Added Feature: #0134 - Need info on wireless terminal GUI
This commit is contained in:
@@ -2,8 +2,10 @@ package appeng.container.implementations;
|
||||
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import appeng.container.AEBaseContainer;
|
||||
import appeng.container.guisync.GuiSync;
|
||||
import appeng.container.slot.SlotRestrictedInput;
|
||||
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
|
||||
import appeng.core.AEConfig;
|
||||
import appeng.tile.networking.TileWireless;
|
||||
|
||||
public class ContainerWireless extends AEBaseContainer
|
||||
@@ -11,13 +13,32 @@ public class ContainerWireless extends AEBaseContainer
|
||||
|
||||
TileWireless myte;
|
||||
|
||||
@GuiSync(1)
|
||||
public long range = 0;
|
||||
|
||||
@GuiSync(2)
|
||||
public long drain = 0;
|
||||
|
||||
SlotRestrictedInput boosterSlot;
|
||||
|
||||
public ContainerWireless(InventoryPlayer ip, TileWireless te) {
|
||||
super( ip, te, null );
|
||||
myte = te;
|
||||
|
||||
addSlotToContainer( new SlotRestrictedInput( PlaceableItemType.RANGE_BOOSTER, myte, 0, 80, 37, invPlayer ) );
|
||||
addSlotToContainer( boosterSlot = new SlotRestrictedInput( PlaceableItemType.RANGE_BOOSTER, myte, 0, 80, 47, invPlayer ) );
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user