Applied-Energistics-2-tiler.../container/implementations/ContainerWireless.java

45 lines
1.2 KiB
Java
Raw Normal View History

2014-02-04 05:27:49 +01:00
package appeng.container.implementations;
import net.minecraft.entity.player.InventoryPlayer;
import appeng.container.AEBaseContainer;
import appeng.container.guisync.GuiSync;
2014-02-04 05:27:49 +01:00
import appeng.container.slot.SlotRestrictedInput;
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
import appeng.core.AEConfig;
2014-02-04 05:27:49 +01:00
import appeng.tile.networking.TileWireless;
public class ContainerWireless extends AEBaseContainer
{
TileWireless myte;
@GuiSync(1)
public long range = 0;
@GuiSync(2)
public long drain = 0;
SlotRestrictedInput boosterSlot;
2014-02-04 05:27:49 +01:00
public ContainerWireless(InventoryPlayer ip, TileWireless te) {
super( ip, te, null );
myte = te;
addSlotToContainer( boosterSlot = new SlotRestrictedInput( PlaceableItemType.RANGE_BOOSTER, myte, 0, 80, 47, invPlayer ) );
2014-02-04 05:27:49 +01:00
bindPlayerInventory( ip, 0, 166 - /* height of playerinventory */82 );
}
@Override
public void detectAndSendChanges()
{
int boosters = boosterSlot.getStack() == null ? 0 : boosterSlot.getStack().stackSize;
range = (long) (10 * AEConfig.instance.wireless_getMaxRange( boosters ));
drain = (long) (100 * AEConfig.instance.wireless_getPowerDrain( boosters ));
super.detectAndSendChanges();
}
2014-02-04 05:27:49 +01:00
}