2014-02-04 05:27:49 +01:00
|
|
|
package appeng.container.implementations;
|
|
|
|
|
|
|
|
import net.minecraft.entity.player.InventoryPlayer;
|
|
|
|
import appeng.container.AEBaseContainer;
|
2014-08-02 08:12:36 +02:00
|
|
|
import appeng.container.guisync.GuiSync;
|
2014-02-04 05:27:49 +01:00
|
|
|
import appeng.container.slot.SlotRestrictedInput;
|
|
|
|
import appeng.container.slot.SlotRestrictedInput.PlaceableItemType;
|
2014-08-02 08:12:36 +02:00
|
|
|
import appeng.core.AEConfig;
|
2014-02-04 05:27:49 +01:00
|
|
|
import appeng.tile.networking.TileWireless;
|
|
|
|
|
|
|
|
public class ContainerWireless extends AEBaseContainer
|
|
|
|
{
|
|
|
|
|
|
|
|
TileWireless myte;
|
|
|
|
|
2014-08-02 08:12:36 +02:00
|
|
|
@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;
|
|
|
|
|
2014-08-02 08:12:36 +02:00
|
|
|
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 );
|
|
|
|
}
|
|
|
|
|
2014-08-02 08:12:36 +02:00
|
|
|
@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
|
|
|
}
|