From fc300745cd1ca023a46a404a7f847ad2f234bd31 Mon Sep 17 00:00:00 2001 From: Sebastian Hartte Date: Tue, 2 Jun 2020 02:33:05 +0200 Subject: [PATCH] Container-Stuff --- .../appeng/container/AEBaseContainer.java | 65 ++++++++++--------- .../appeng/container/guisync/SyncData.java | 13 ++-- .../ContainerCellWorkbench.java | 13 ++-- .../implementations/ContainerChest.java | 2 +- .../implementations/ContainerCondenser.java | 6 +- .../implementations/ContainerCraftAmount.java | 2 +- .../ContainerCraftConfirm.java | 8 +-- .../implementations/ContainerCraftingCPU.java | 10 +-- .../ContainerCraftingTerm.java | 4 +- .../implementations/ContainerDrive.java | 2 +- .../ContainerFormationPlane.java | 14 ++-- .../implementations/ContainerGrinder.java | 14 ++-- .../implementations/ContainerIOPort.java | 10 +-- .../implementations/ContainerInscriber.java | 9 ++- .../implementations/ContainerInterface.java | 6 +- .../ContainerInterfaceTerminal.java | 6 +- .../ContainerLevelEmitter.java | 10 +-- .../implementations/ContainerMAC.java | 16 ++--- .../ContainerMEMonitorable.java | 15 ++--- .../ContainerNetworkStatus.java | 4 +- .../implementations/ContainerNetworkTool.java | 2 +- .../implementations/ContainerPatternTerm.java | 25 ++++--- .../implementations/ContainerQNB.java | 2 +- .../implementations/ContainerQuartzKnife.java | 5 +- .../ContainerSecurityStation.java | 7 +- .../implementations/ContainerSkyChest.java | 2 +- .../ContainerSpatialIOPort.java | 4 +- .../implementations/ContainerStorageBus.java | 15 ++--- .../implementations/ContainerUpgradeable.java | 28 ++++---- .../ContainerVibrationChamber.java | 2 +- .../implementations/ContainerWireless.java | 2 +- .../sync/packets/PacketInventoryAction.java | 4 +- .../core/sync/packets/PacketJEIRecipe.java | 4 +- .../sync/packets/PacketPartPlacement.java | 4 +- .../core/sync/packets/PacketPatternSlot.java | 4 +- .../java/appeng/debug/TileChunkLoader.java | 6 +- .../ContainerFluidFormationPlane.java | 10 +-- .../container/ContainerFluidStorageBus.java | 11 ++-- .../container/ContainerFluidTerminal.java | 14 ++-- .../appeng/fluids/helper/FluidSyncHelper.java | 6 +- .../java/appeng/me/cache/PathGridCache.java | 6 +- .../java/appeng/spatial/StorageHelper.java | 6 +- .../resources/META-INF/accesstransformer.cfg | 1 + 43 files changed, 197 insertions(+), 202 deletions(-) diff --git a/src/main/java/appeng/container/AEBaseContainer.java b/src/main/java/appeng/container/AEBaseContainer.java index 66a50828d..f530d7757 100644 --- a/src/main/java/appeng/container/AEBaseContainer.java +++ b/src/main/java/appeng/container/AEBaseContainer.java @@ -26,11 +26,13 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; +import appeng.core.Api; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.container.Container; +import net.minecraft.inventory.container.ContainerType; import net.minecraft.inventory.container.IContainerListener; import net.minecraft.inventory.container.Slot; import net.minecraft.item.ItemStack; @@ -38,7 +40,6 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.PlayerInvWrapper; -import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.SecurityPermissions; import appeng.api.implementations.guiobjects.IGuiItemObject; @@ -97,13 +98,14 @@ public abstract class AEBaseContainer extends Container private int ticksSinceCheck = 900; private IAEItemStack clientRequestedTargetItem = null; - public AEBaseContainer( final PlayerInventory ip, final TileEntity myTile, final IPart myPart ) + public AEBaseContainer( ContainerType containerType, int id, final PlayerInventory ip, final TileEntity myTile, final IPart myPart ) { - this( ip, myTile, myPart, null ); + this( containerType, id, ip, myTile, myPart, null ); } - public AEBaseContainer( final PlayerInventory ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio ) + public AEBaseContainer(ContainerType containerType, int id, final PlayerInventory ip, final TileEntity myTile, final IPart myPart, final IGuiItemObject gio ) { + super(containerType, id); this.invPlayer = ip; this.tileEntity = myTile; this.part = myPart; @@ -112,6 +114,24 @@ public abstract class AEBaseContainer extends Container this.prepareSync(); } + public AEBaseContainer(ContainerType containerType, int id, final PlayerInventory ip, final Object anchor ) + { + super(containerType, id); + this.invPlayer = ip; + this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null; + this.part = anchor instanceof IPart ? (IPart) anchor : null; + this.obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null; + + if( this.tileEntity == null && this.part == null && this.obj == null ) + { + throw new IllegalArgumentException( "Must have a valid anchor, instead " + anchor + " in " + ip ); + } + + this.mySrc = new PlayerSource( ip.player, this.getActionHost() ); + + this.prepareSync(); + } + protected IActionHost getActionHost() { if( this.obj instanceof IActionHost ) @@ -151,23 +171,6 @@ public abstract class AEBaseContainer extends Container } } - public AEBaseContainer( final PlayerInventory ip, final Object anchor ) - { - this.invPlayer = ip; - this.tileEntity = anchor instanceof TileEntity ? (TileEntity) anchor : null; - this.part = anchor instanceof IPart ? (IPart) anchor : null; - this.obj = anchor instanceof IGuiItemObject ? (IGuiItemObject) anchor : null; - - if( this.tileEntity == null && this.part == null && this.obj == null ) - { - throw new IllegalArgumentException( "Must have a valid anchor, instead " + anchor + " in " + ip ); - } - - this.mySrc = new PlayerSource( ip.player, this.getActionHost() ); - - this.prepareSync(); - } - public IAEItemStack getTargetStack() { return this.clientRequestedTargetItem; @@ -310,11 +313,11 @@ public abstract class AEBaseContainer extends Container { if( this.locked.contains( j + i * 9 + 9 ) ) { - this.addSlotToContainer( new SlotDisabled( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) ); + this.addSlot( new SlotDisabled( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) ); } else { - this.addSlotToContainer( new SlotPlayerInv( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) ); + this.addSlot( new SlotPlayerInv( ih, j + i * 9 + 9, 8 + j * 18 + offsetX, offsetY + i * 18 ) ); } } } @@ -324,23 +327,23 @@ public abstract class AEBaseContainer extends Container { if( this.locked.contains( i ) ) { - this.addSlotToContainer( new SlotDisabled( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) ); + this.addSlot( new SlotDisabled( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) ); } else { - this.addSlotToContainer( new SlotPlayerHotBar( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) ); + this.addSlot( new SlotPlayerHotBar( ih, i, 8 + i * 18 + offsetX, 58 + offsetY ) ); } } } @Override - protected Slot addSlotToContainer( final Slot newSlot ) + protected Slot addSlot(final Slot newSlot ) { if( newSlot instanceof AppEngSlot ) { final AppEngSlot s = (AppEngSlot) newSlot; s.setContainer( this ); - return super.addSlotToContainer( newSlot ); + return super.addSlot( newSlot ); } else { @@ -654,7 +657,7 @@ public abstract class AEBaseContainer extends Container return ( (AppEngSlot) s ).isDraggable(); } - public void doAction( final PlayerEntityMP player, final InventoryAction action, final int slot, final long id ) + public void doAction( final ServerPlayerEntity player, final InventoryAction action, final int slot, final long id ) { if( slot >= 0 && slot < this.inventorySlots.size() ) { @@ -1012,7 +1015,7 @@ public abstract class AEBaseContainer extends Container } } - protected void updateHeld( final PlayerEntityMP p ) + protected void updateHeld( final ServerPlayerEntity p ) { if( Platform.isServer() ) { @@ -1099,7 +1102,7 @@ public abstract class AEBaseContainer extends Container { NetworkHandler.instance() .sendTo( new PacketValueConfig( "CustomName", this.getCustomName() ), - (PlayerEntityMP) this.getPlayerInventory().player ); + (ServerPlayerEntity) this.getPlayerInventory().player ); } catch( final IOException e ) { diff --git a/src/main/java/appeng/container/guisync/SyncData.java b/src/main/java/appeng/container/guisync/SyncData.java index f0457381a..d47f6617c 100644 --- a/src/main/java/appeng/container/guisync/SyncData.java +++ b/src/main/java/appeng/container/guisync/SyncData.java @@ -23,14 +23,13 @@ import java.io.IOException; import java.lang.reflect.Field; import java.util.EnumSet; -import net.minecraft.entity.player.PlayerEntityMP; -import net.minecraft.inventory.IContainerListener; - import appeng.container.AEBaseContainer; import appeng.core.AELog; import appeng.core.sync.network.NetworkHandler; import appeng.core.sync.packets.PacketProgressBar; import appeng.core.sync.packets.PacketValueConfig; +import net.minecraft.entity.player.ServerPlayerEntity; +import net.minecraft.inventory.container.IContainerListener; public class SyncData @@ -86,9 +85,9 @@ public class SyncData { if( val instanceof String ) { - if( o instanceof PlayerEntityMP ) + if( o instanceof ServerPlayerEntity) { - NetworkHandler.instance().sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (PlayerEntityMP) o ); + NetworkHandler.instance().sendTo( new PacketValueConfig( "SyncDat." + this.channel, (String) val ), (ServerPlayerEntity) o ); } } else if( this.field.getType().isEnum() ) @@ -97,9 +96,9 @@ public class SyncData } else if( val instanceof Long || val.getClass() == long.class ) { - if( o instanceof PlayerEntityMP ) + if( o instanceof ServerPlayerEntity ) { - NetworkHandler.instance().sendTo( new PacketProgressBar( this.channel, (Long) val ), (PlayerEntityMP) o ); + NetworkHandler.instance().sendTo( new PacketProgressBar( this.channel, (Long) val ), (ServerPlayerEntity) o ); } } else if( val instanceof Boolean || val.getClass() == boolean.class ) diff --git a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java index 9e412bdd7..2e1ce7219 100644 --- a/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java +++ b/src/main/java/appeng/container/implementations/ContainerCellWorkbench.java @@ -21,7 +21,7 @@ package appeng.container.implementations; import java.util.Iterator; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IContainerListener; import net.minecraft.inventory.Slot; @@ -29,7 +29,6 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.EmptyHandler; -import appeng.api.AEApi; import appeng.api.config.CopyMode; import appeng.api.config.FuzzyMode; import appeng.api.config.Settings; @@ -94,7 +93,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable protected void setupConfig() { final IItemHandler cell = this.getUpgradeable().getInventoryByName( "cell" ); - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getPlayerInv() ) ); + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.WORKBENCH_CELL, cell, 0, 152, 8, this.getPlayerInv() ) ); final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" ); final WrapperSupplierItemHandler upgradeInventory = new WrapperSupplierItemHandler( this::getCellUpgradeInventory ); @@ -107,7 +106,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable { for( int z = 0; z < 9; z++ ) { - this.addSlotToContainer( new SlotFakeTypeOnly( inv, offset, x + z * 18, y + w * 18 ) ); + this.addSlot( new SlotFakeTypeOnly( inv, offset, x + z * 18, y + w * 18 ) ); offset++; } } @@ -117,7 +116,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable for( int z = 0; z < 8; z++ ) { final int iSLot = zz * 8 + z; - this.addSlotToContainer( + this.addSlot( new OptionalSlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgradeInventory, this, iSLot, 187 + zz * 18, 8 + 18 * z, iSLot, this .getPlayerInventory() ) ); } @@ -164,9 +163,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable } } - if( listener instanceof PlayerEntityMP ) + if( listener instanceof ServerPlayerEntity ) { - ( (PlayerEntityMP) listener ).isChangingQuantityOnly = false; + ( (ServerPlayerEntity) listener ).isChangingQuantityOnly = false; } } } diff --git a/src/main/java/appeng/container/implementations/ContainerChest.java b/src/main/java/appeng/container/implementations/ContainerChest.java index 5cfe180e8..44d212880 100644 --- a/src/main/java/appeng/container/implementations/ContainerChest.java +++ b/src/main/java/appeng/container/implementations/ContainerChest.java @@ -36,7 +36,7 @@ public class ContainerChest extends AEBaseContainer super( ip, chest, null ); this.chest = chest; - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest.getInternalInventory(), 1, 80, 37, this + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, this.chest.getInternalInventory(), 1, 80, 37, this .getPlayerInventory() ) ); this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); diff --git a/src/main/java/appeng/container/implementations/ContainerCondenser.java b/src/main/java/appeng/container/implementations/ContainerCondenser.java index c268d02c8..9d3ec9de3 100644 --- a/src/main/java/appeng/container/implementations/ContainerCondenser.java +++ b/src/main/java/appeng/container/implementations/ContainerCondenser.java @@ -51,9 +51,9 @@ public class ContainerCondenser extends AEBaseContainer implements IProgressProv IItemHandler inv = condenser.getInternalInventory(); - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, inv, 0, 51, 52, ip ) ); - this.addSlotToContainer( new SlotOutput( inv, 1, 105, 52, -1 ) ); - this.addSlotToContainer( + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.TRASH, inv, 0, 51, 52, ip ) ); + this.addSlot( new SlotOutput( inv, 1, 105, 52, -1 ) ); + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_COMPONENT, inv, 2, 101, 26, ip ) ).setStackLimit( 1 ) ); this.bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); diff --git a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java index 51d02d8b6..a0aaf168c 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftAmount.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftAmount.java @@ -48,7 +48,7 @@ public class ContainerCraftAmount extends AEBaseContainer super( ip, te ); this.craftingItem = new SlotInaccessible( new AppEngInternalInventory( null, 1 ), 0, 34, 53 ); - this.addSlotToContainer( this.getCraftingItem() ); + this.addSlot( this.getCraftingItem() ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java index d84f64f00..ed9444078 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftConfirm.java @@ -29,7 +29,7 @@ import javax.annotation.Nonnull; import com.google.common.collect.ImmutableSet; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IContainerListener; import net.minecraft.tileentity.TileEntity; @@ -263,11 +263,11 @@ public class ContainerCraftConfirm extends AEBaseContainer { if( g instanceof PlayerEntity ) { - NetworkHandler.instance().sendTo( a, (PlayerEntityMP) g ); - NetworkHandler.instance().sendTo( b, (PlayerEntityMP) g ); + NetworkHandler.instance().sendTo( a, (ServerPlayerEntity) g ); + NetworkHandler.instance().sendTo( b, (ServerPlayerEntity) g ); if( c != null ) { - NetworkHandler.instance().sendTo( c, (PlayerEntityMP) g ); + NetworkHandler.instance().sendTo( c, (ServerPlayerEntity) g ); } } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java index 3fea1ec39..5b1d72944 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingCPU.java @@ -22,7 +22,7 @@ package appeng.container.implementations; import java.io.IOException; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IContainerListener; @@ -100,7 +100,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH { try { - NetworkHandler.instance().sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (PlayerEntityMP) g ); + NetworkHandler.instance().sendTo( new PacketValueConfig( "CraftingStatus", "Clear" ), (ServerPlayerEntity) g ); } catch( final IOException e ) { @@ -191,17 +191,17 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH { if( !a.isEmpty() ) { - NetworkHandler.instance().sendTo( a, (PlayerEntityMP) g ); + NetworkHandler.instance().sendTo( a, (ServerPlayerEntity) g ); } if( !b.isEmpty() ) { - NetworkHandler.instance().sendTo( b, (PlayerEntityMP) g ); + NetworkHandler.instance().sendTo( b, (ServerPlayerEntity) g ); } if( !c.isEmpty() ) { - NetworkHandler.instance().sendTo( c, (PlayerEntityMP) g ); + NetworkHandler.instance().sendTo( c, (ServerPlayerEntity) g ); } } } diff --git a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java index 3857e29be..caa6c1b87 100644 --- a/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerCraftingTerm.java @@ -60,11 +60,11 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE { for( int x = 0; x < 3; x++ ) { - this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) ); + this.addSlot( this.craftingSlots[x + y * 3] = new SlotCraftingMatrix( this, crafting, x + y * 3, 37 + x * 18, -72 + y * 18 ) ); } } - this.addSlotToContainer( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.getActionSource(), this + this.addSlot( this.outputSlot = new SlotCraftingTerm( this.getPlayerInv().player, this.getActionSource(), this .getPowerSource(), monitorable, crafting, crafting, this.output, 131, -72 + 18, this ) ); this.bindPlayerInventory( ip, 0, 0 ); diff --git a/src/main/java/appeng/container/implementations/ContainerDrive.java b/src/main/java/appeng/container/implementations/ContainerDrive.java index 854fc1bc7..0003b47a6 100644 --- a/src/main/java/appeng/container/implementations/ContainerDrive.java +++ b/src/main/java/appeng/container/implementations/ContainerDrive.java @@ -37,7 +37,7 @@ public class ContainerDrive extends AEBaseContainer { for( int x = 0; x < 2; x++ ) { - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, drive .getInternalInventory(), x + y * 2, 71 + x * 18, 14 + y * 18, this.getPlayerInventory() ) ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java index a10cd6364..de55577a0 100644 --- a/src/main/java/appeng/container/implementations/ContainerFormationPlane.java +++ b/src/main/java/appeng/container/implementations/ContainerFormationPlane.java @@ -65,28 +65,28 @@ public class ContainerFormationPlane extends ContainerUpgradeable { if( y < 2 ) { - this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); + this.addSlot( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); } else { - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); } } } final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerGrinder.java b/src/main/java/appeng/container/implementations/ContainerGrinder.java index 8d5589d20..9418aae5a 100644 --- a/src/main/java/appeng/container/implementations/ContainerGrinder.java +++ b/src/main/java/appeng/container/implementations/ContainerGrinder.java @@ -38,15 +38,15 @@ public class ContainerGrinder extends AEBaseContainer IItemHandler inv = grinder.getInternalInventory(); - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 0, 12, 17, this.getPlayerInventory() ) ); - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 1, 12 + 18, 17, this.getPlayerInventory() ) ); - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 2, 12 + 36, 17, this.getPlayerInventory() ) ); + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 0, 12, 17, this.getPlayerInventory() ) ); + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 1, 12 + 18, 17, this.getPlayerInventory() ) ); + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ORE, inv, 2, 12 + 36, 17, this.getPlayerInventory() ) ); - this.addSlotToContainer( new SlotInaccessible( inv, 6, 80, 40 ) ); + this.addSlot( new SlotInaccessible( inv, 6, 80, 40 ) ); - this.addSlotToContainer( new SlotOutput( inv, 3, 112, 63, 2 * 16 + 15 ) ); - this.addSlotToContainer( new SlotOutput( inv, 4, 112 + 18, 63, 2 * 16 + 15 ) ); - this.addSlotToContainer( new SlotOutput( inv, 5, 112 + 36, 63, 2 * 16 + 15 ) ); + this.addSlot( new SlotOutput( inv, 3, 112, 63, 2 * 16 + 15 ) ); + this.addSlot( new SlotOutput( inv, 4, 112 + 18, 63, 2 * 16 + 15 ) ); + this.addSlot( new SlotOutput( inv, 5, 112 + 36, 63, 2 * 16 + 15 ) ); this.bindPlayerInventory( ip, 0, 176 - /* height of player inventory */82 ); } diff --git a/src/main/java/appeng/container/implementations/ContainerIOPort.java b/src/main/java/appeng/container/implementations/ContainerIOPort.java index dc7c91454..530406dfb 100644 --- a/src/main/java/appeng/container/implementations/ContainerIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerIOPort.java @@ -65,7 +65,7 @@ public class ContainerIOPort extends ContainerUpgradeable { for( int x = 0; x < 2; x++ ) { - this.addSlotToContainer( + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.STORAGE_CELLS, cells, x + y * 2, offX + x * 18, offY + y * 18, this .getPlayerInventory() ) ); } @@ -77,18 +77,18 @@ public class ContainerIOPort extends ContainerUpgradeable { for( int x = 0; x < 2; x++ ) { - this.addSlotToContainer( + this.addSlot( new SlotOutput( cells, 6 + x + y * 2, offX + x * 18, offY + y * 18, SlotRestrictedInput.PlacableItemType.STORAGE_CELLS.IIcon ) ); } } final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerInscriber.java b/src/main/java/appeng/container/implementations/ContainerInscriber.java index 5a3898a7e..d06300fc8 100644 --- a/src/main/java/appeng/container/implementations/ContainerInscriber.java +++ b/src/main/java/appeng/container/implementations/ContainerInscriber.java @@ -24,7 +24,6 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; -import appeng.api.AEApi; import appeng.api.definitions.IItemDefinition; import appeng.api.features.IInscriberRecipe; import appeng.container.guisync.GuiSync; @@ -63,14 +62,14 @@ public class ContainerInscriber extends ContainerUpgradeable implements IProgres IItemHandler inv = te.getInternalInventory(); - this.addSlotToContainer( + this.addSlot( this.top = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, inv, 0, 45, 16, this.getPlayerInventory() ) ); - this.addSlotToContainer( + this.addSlot( this.bottom = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_PLATE, inv, 1, 45, 62, this.getPlayerInventory() ) ); - this.addSlotToContainer( + this.addSlot( this.middle = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.INSCRIBER_INPUT, inv, 2, 63, 39, this.getPlayerInventory() ) ); - this.addSlotToContainer( new SlotOutput( inv, 3, 113, 40, -1 ) ); + this.addSlot( new SlotOutput( inv, 3, 113, 40, -1 ) ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerInterface.java b/src/main/java/appeng/container/implementations/ContainerInterface.java index 5c32a44f7..955f6e3a1 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterface.java +++ b/src/main/java/appeng/container/implementations/ContainerInterface.java @@ -52,18 +52,18 @@ public class ContainerInterface extends ContainerUpgradeable for( int x = 0; x < DualityInterface.NUMBER_OF_PATTERN_SLOTS; x++ ) { - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, this.myDuality .getPatterns(), x, 8 + 18 * x, 90 + 7, this.getPlayerInventory() ) ); } for( int x = 0; x < DualityInterface.NUMBER_OF_CONFIG_SLOTS; x++ ) { - this.addSlotToContainer( new SlotFake( this.myDuality.getConfig(), x, 8 + 18 * x, 35 ) ); + this.addSlot( new SlotFake( this.myDuality.getConfig(), x, 8 + 18 * x, 35 ) ); } for( int x = 0; x < DualityInterface.NUMBER_OF_STORAGE_SLOTS; x++ ) { - this.addSlotToContainer( new SlotNormal( this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18 ) ); + this.addSlot( new SlotNormal( this.myDuality.getStorage(), x, 8 + 18 * x, 35 + 18 ) ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java index 722d173db..1fdea18a5 100644 --- a/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java +++ b/src/main/java/appeng/container/implementations/ContainerInterfaceTerminal.java @@ -24,7 +24,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; @@ -188,7 +188,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer { try { - NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (PlayerEntityMP) this.getPlayerInv().player ); + NetworkHandler.instance().sendTo( new PacketCompressedNBT( this.data ), (ServerPlayerEntity) this.getPlayerInv().player ); } catch( final IOException e ) { @@ -200,7 +200,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer } @Override - public void doAction( final PlayerEntityMP player, final InventoryAction action, final int slot, final long id ) + public void doAction( final ServerPlayerEntity player, final InventoryAction action, final int slot, final long id ) { final InvTracker inv = this.byId.get( id ); if( inv != null ) diff --git a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java index 4ba28463f..331017c5d 100644 --- a/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java +++ b/src/main/java/appeng/container/implementations/ContainerLevelEmitter.java @@ -78,25 +78,25 @@ public class ContainerLevelEmitter extends ContainerUpgradeable final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); if( this.availableUpgrades() > 0 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); } if( this.availableUpgrades() > 1 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); } if( this.availableUpgrades() > 2 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); } if( this.availableUpgrades() > 3 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); } @@ -104,7 +104,7 @@ public class ContainerLevelEmitter extends ContainerUpgradeable final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" ); final int y = 40; final int x = 80 + 44; - this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); + this.addSlot( new SlotFakeTypeOnly( inv, 0, x, y ) ); } @Override diff --git a/src/main/java/appeng/container/implementations/ContainerMAC.java b/src/main/java/appeng/container/implementations/ContainerMAC.java index 1a558456e..59ab476a9 100644 --- a/src/main/java/appeng/container/implementations/ContainerMAC.java +++ b/src/main/java/appeng/container/implementations/ContainerMAC.java @@ -95,33 +95,33 @@ public class ContainerMAC extends ContainerUpgradeable implements IProgressProvi for( int x = 0; x < 3; x++ ) { final SlotMACPattern s = new SlotMACPattern( this, mac, x + y * 3, offX + x * 18, offY + y * 18 ); - this.addSlotToContainer( s ); + this.addSlot( s ); } } offX = 126; offY = 16; - this.addSlotToContainer( + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_CRAFTING_PATTERN, mac, 10, offX, offY, this.getPlayerInventory() ) ); - this.addSlotToContainer( new SlotOutput( mac, 9, offX, offY + 32, -1 ) ); + this.addSlot( new SlotOutput( mac, 9, offX, offY + 32, -1 ) ); offX = 122; offY = 17; final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java index 60b73f53d..2efd137cb 100644 --- a/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java +++ b/src/main/java/appeng/container/implementations/ContainerMEMonitorable.java @@ -25,13 +25,12 @@ import java.nio.BufferOverflowException; import javax.annotation.Nonnull; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IContainerListener; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.config.PowerMultiplier; import appeng.api.config.SecurityPermissions; @@ -169,7 +168,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.cellView[y] = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.VIEW_CELL, ( (IViewCellStorage) monitorable ) .getViewCellStorage(), y, 206, y * 18 + 8, this.getPlayerInventory() ); this.cellView[y].setAllowEdit( this.canAccessViewCells ); - this.addSlotToContainer( this.cellView[y] ); + this.addSlot( this.cellView[y] ); } } @@ -204,11 +203,11 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa this.clientCM.putSetting( set, sideLocal ); for( final IContainerListener crafter : this.listeners ) { - if( crafter instanceof PlayerEntityMP ) + if( crafter instanceof ServerPlayerEntity ) { try { - NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (PlayerEntityMP) crafter ); + NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (ServerPlayerEntity) crafter ); } catch( final IOException e ) { @@ -249,7 +248,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa { if( c instanceof PlayerEntity ) { - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); } } } @@ -345,14 +344,14 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa } catch( final BufferOverflowException boe ) { - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); piu = new PacketMEInventoryUpdate(); piu.appendItem( send ); } } - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); } catch( final IOException e ) { diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java index 78909a198..de9f2b993 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkStatus.java @@ -22,7 +22,7 @@ package appeng.container.implementations; import java.io.IOException; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; @@ -138,7 +138,7 @@ public class ContainerNetworkStatus extends AEBaseContainer { if( c instanceof PlayerEntity ) { - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); } } } diff --git a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java index 4af1df221..c2c080ac3 100644 --- a/src/main/java/appeng/container/implementations/ContainerNetworkTool.java +++ b/src/main/java/appeng/container/implementations/ContainerNetworkTool.java @@ -48,7 +48,7 @@ public class ContainerNetworkTool extends AEBaseContainer { for( int x = 0; x < 3; x++ ) { - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, te .getInventory(), y * 3 + x, 80 - 18 + x * 18, 37 - 18 + y * 18, this.getPlayerInventory() ) ) ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java index 8583645ef..16f35e452 100644 --- a/src/main/java/appeng/container/implementations/ContainerPatternTerm.java +++ b/src/main/java/appeng/container/implementations/ContainerPatternTerm.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Optional; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IContainerListener; import net.minecraft.inventory.InventoryCraftResult; @@ -41,7 +41,6 @@ import net.minecraft.world.World; import net.minecraftforge.items.IItemHandler; import net.minecraftforge.items.wrapper.PlayerInvWrapper; -import appeng.api.AEApi; import appeng.api.config.Actionable; import appeng.api.definitions.IDefinitions; import appeng.api.storage.IMEMonitor; @@ -104,25 +103,25 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA { for( int x = 0; x < 3; x++ ) { - this.addSlotToContainer( this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18 ) ); + this.addSlot( this.craftingSlots[x + y * 3] = new SlotFakeCraftingMatrix( this.crafting, x + y * 3, 18 + x * 18, -76 + y * 18 ) ); } } - this.addSlotToContainer( this.craftSlot = new SlotPatternTerm( ip.player, this.getActionSource(), this + this.addSlot( this.craftSlot = new SlotPatternTerm( ip.player, this.getActionSource(), this .getPowerSource(), monitorable, this.crafting, patternInv, this.cOut, 110, -76 + 18, this, 2, this ) ); this.craftSlot.setIIcon( -1 ); for( int y = 0; y < 3; y++ ) { - this.addSlotToContainer( this.outputSlots[y] = new SlotPatternOutputs( output, this, y, 110, -76 + y * 18, 0, 0, 1 ) ); + this.addSlot( this.outputSlots[y] = new SlotPatternOutputs( output, this, y, 110, -76 + y * 18, 0, 0, 1 ) ); this.outputSlots[y].setRenderDisabled( false ); this.outputSlots[y].setIIcon( -1 ); } - this.addSlotToContainer( + this.addSlot( this.patternSlotIN = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BLANK_PATTERN, patternInv, 0, 147, -72 - 9, this .getPlayerInventory() ) ); - this.addSlotToContainer( + this.addSlot( this.patternSlotOUT = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODED_PATTERN, patternInv, 1, 147, -72 + 34, this .getPlayerInventory() ) ); @@ -395,9 +394,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA if( extracted != null ) { inv.addItems( extracted.createItemStack() ); - if( p instanceof PlayerEntityMP ) + if( p instanceof ServerPlayerEntity ) { - this.updateHeld( (PlayerEntityMP) p ); + this.updateHeld( (ServerPlayerEntity) p ); } this.detectAndSendChanges(); return; @@ -455,9 +454,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA } inv.addItems( is ); - if( p instanceof PlayerEntityMP ) + if( p instanceof ServerPlayerEntity ) { - this.updateHeld( (PlayerEntityMP) p ); + this.updateHeld( (ServerPlayerEntity) p ); } this.detectAndSendChanges(); } @@ -519,9 +518,9 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA listener.sendSlotContents( this, slot.slotNumber, slot.getStack() ); } } - if( listener instanceof PlayerEntityMP ) + if( listener instanceof ServerPlayerEntity ) { - ( (PlayerEntityMP) listener ).isChangingQuantityOnly = false; + ( (ServerPlayerEntity) listener ).isChangingQuantityOnly = false; } } this.detectAndSendChanges(); diff --git a/src/main/java/appeng/container/implementations/ContainerQNB.java b/src/main/java/appeng/container/implementations/ContainerQNB.java index 5baa95601..665fceb66 100644 --- a/src/main/java/appeng/container/implementations/ContainerQNB.java +++ b/src/main/java/appeng/container/implementations/ContainerQNB.java @@ -33,7 +33,7 @@ public class ContainerQNB extends AEBaseContainer { super( ip, quantumBridge, null ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.QE_SINGULARITY, quantumBridge .getInternalInventory(), 0, 80, 37, this.getPlayerInventory() ) ).setStackLimit( 1 ) ); this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); diff --git a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java index ec8bd5eaf..65189cebe 100644 --- a/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java +++ b/src/main/java/appeng/container/implementations/ContainerQuartzKnife.java @@ -29,7 +29,6 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; import net.minecraftforge.items.IItemHandler; -import appeng.api.AEApi; import appeng.container.AEBaseContainer; import appeng.container.slot.SlotOutput; import appeng.container.slot.SlotRestrictedInput; @@ -51,8 +50,8 @@ public class ContainerQuartzKnife extends AEBaseContainer super( ip, null, null ); this.toolInv = te; - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip ) ); - this.addSlotToContainer( new QuartzKniveSlot( this.inSlot, 0, 134, 44, -1 ) ); + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.METAL_INGOTS, this.inSlot, 0, 94, 44, ip ) ); + this.addSlot( new QuartzKniveSlot( this.inSlot, 0, 134, 44, -1 ) ); this.lockPlayerInventorySlot( ip.currentItem ); diff --git a/src/main/java/appeng/container/implementations/ContainerSecurityStation.java b/src/main/java/appeng/container/implementations/ContainerSecurityStation.java index b976c864a..bd1f76303 100644 --- a/src/main/java/appeng/container/implementations/ContainerSecurityStation.java +++ b/src/main/java/appeng/container/implementations/ContainerSecurityStation.java @@ -25,7 +25,6 @@ import net.minecraft.inventory.IContainerListener; import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; -import appeng.api.AEApi; import appeng.api.config.SecurityPermissions; import appeng.api.features.INetworkEncodable; import appeng.api.features.IWirelessTermHandler; @@ -60,12 +59,12 @@ public class ContainerSecurityStation extends ContainerMEMonitorable implements this.securityBox = (TileSecurityStation) monitorable; - this.addSlotToContainer( this.configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, this.securityBox + this.addSlot( this.configSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.BIOMETRIC_CARD, this.securityBox .getConfigSlot(), 0, 37, -33, ip ) ); - this.addSlotToContainer( + this.addSlot( this.wirelessIn = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.ENCODABLE_ITEM, this.wirelessEncoder, 0, 212, 10, ip ) ); - this.addSlotToContainer( this.wirelessOut = new SlotOutput( this.wirelessEncoder, 1, 212, 68, -1 ) ); + this.addSlot( this.wirelessOut = new SlotOutput( this.wirelessEncoder, 1, 212, 68, -1 ) ); this.bindPlayerInventory( ip, 0, 0 ); } diff --git a/src/main/java/appeng/container/implementations/ContainerSkyChest.java b/src/main/java/appeng/container/implementations/ContainerSkyChest.java index 411a3acd4..3a6afc059 100644 --- a/src/main/java/appeng/container/implementations/ContainerSkyChest.java +++ b/src/main/java/appeng/container/implementations/ContainerSkyChest.java @@ -41,7 +41,7 @@ public class ContainerSkyChest extends AEBaseContainer { for( int x = 0; x < 9; x++ ) { - this.addSlotToContainer( new SlotNormal( this.chest.getInternalInventory(), y * 9 + x, 8 + 18 * x, 24 + 18 * y ) ); + this.addSlot( new SlotNormal( this.chest.getInternalInventory(), y * 9 + x, 8 + 18 * x, 24 + 18 * y ) ); } } diff --git a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java index 70a268195..2e3ce9bb7 100644 --- a/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java +++ b/src/main/java/appeng/container/implementations/ContainerSpatialIOPort.java @@ -65,9 +65,9 @@ public class ContainerSpatialIOPort extends AEBaseContainer this.network = spatialIOPort.getGridNode( AEPartLocation.INTERNAL ).getGrid(); } - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS, spatialIOPort .getInternalInventory(), 0, 52, 48, this.getPlayerInventory() ) ); - this.addSlotToContainer( + this.addSlot( new SlotOutput( spatialIOPort.getInternalInventory(), 1, 113, 48, SlotRestrictedInput.PlacableItemType.SPATIAL_STORAGE_CELLS.IIcon ) ); this.bindPlayerInventory( ip, 0, 197 - /* height of player inventory */82 ); diff --git a/src/main/java/appeng/container/implementations/ContainerStorageBus.java b/src/main/java/appeng/container/implementations/ContainerStorageBus.java index a12f9f93d..5f62bf12f 100644 --- a/src/main/java/appeng/container/implementations/ContainerStorageBus.java +++ b/src/main/java/appeng/container/implementations/ContainerStorageBus.java @@ -25,7 +25,6 @@ import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraftforge.items.IItemHandler; -import appeng.api.AEApi; import appeng.api.config.AccessRestriction; import appeng.api.config.FuzzyMode; import appeng.api.config.SecurityPermissions; @@ -82,28 +81,28 @@ public class ContainerStorageBus extends ContainerUpgradeable { if( y < 2 ) { - this.addSlotToContainer( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); + this.addSlot( new SlotFakeTypeOnly( config, y * 9 + x, xo + x * 18, yo + y * 18 ) ); } else { - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( config, this, y * 9 + x, xo, yo, x, y, y - 2 ) ); } } } final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java index 4dd63b566..c6b5a7698 100644 --- a/src/main/java/appeng/container/implementations/ContainerUpgradeable.java +++ b/src/main/java/appeng/container/implementations/ContainerUpgradeable.java @@ -113,7 +113,7 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl { for( int u = 0; u < 3; u++ ) { - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.tbInventory + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, this.tbInventory .getInternalInventory(), u + v * 3, 186 + u * 18, this.getHeight() - 82 + v * 18, this.getPlayerInventory() ) ).setPlayerSide() ); } } @@ -141,19 +141,19 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl final IItemHandler inv = this.getUpgradeable().getInventoryByName( "config" ); final int y = 40; final int x = 80; - this.addSlotToContainer( new SlotFakeTypeOnly( inv, 0, x, y ) ); + this.addSlot( new SlotFakeTypeOnly( inv, 0, x, y ) ); if( this.supportCapacity() ) { - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 1, x, y, -1, 0, 1 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 2, x, y, 1, 0, 1 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 3, x, y, 0, -1, 1 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 4, x, y, 0, 1, 1 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 1, x, y, -1, 0, 1 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 2, x, y, 1, 0, 1 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 3, x, y, 0, -1, 1 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 4, x, y, 0, 1, 1 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 5, x, y, -1, -1, 2 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 6, x, y, 1, -1, 2 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 7, x, y, -1, 1, 2 ) ); - this.addSlotToContainer( new OptionalSlotFakeTypeOnly( inv, this, 8, x, y, 1, 1, 2 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 5, x, y, -1, -1, 2 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 6, x, y, 1, -1, 2 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 7, x, y, -1, 1, 2 ) ); + this.addSlot( new OptionalSlotFakeTypeOnly( inv, this, 8, x, y, 1, 1, 2 ) ); } } @@ -162,25 +162,25 @@ public class ContainerUpgradeable extends AEBaseContainer implements IOptionalSl final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); if( this.availableUpgrades() > 0 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); } if( this.availableUpgrades() > 1 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); } if( this.availableUpgrades() > 2 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); } if( this.availableUpgrades() > 3 ) { - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java index 13427691d..eb67b2390 100644 --- a/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java +++ b/src/main/java/appeng/container/implementations/ContainerVibrationChamber.java @@ -42,7 +42,7 @@ public class ContainerVibrationChamber extends AEBaseContainer implements IProgr super( ip, vibrationChamber, null ); this.vibrationChamber = vibrationChamber; - this.addSlotToContainer( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber.getInternalInventory(), 0, 80, 37, this + this.addSlot( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.FUEL, vibrationChamber.getInternalInventory(), 0, 80, 37, this .getPlayerInventory() ) ); this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); diff --git a/src/main/java/appeng/container/implementations/ContainerWireless.java b/src/main/java/appeng/container/implementations/ContainerWireless.java index 06297654f..ce36fec65 100644 --- a/src/main/java/appeng/container/implementations/ContainerWireless.java +++ b/src/main/java/appeng/container/implementations/ContainerWireless.java @@ -43,7 +43,7 @@ public class ContainerWireless extends AEBaseContainer super( ip, te, null ); this.wirelessTerminal = te; - this.addSlotToContainer( this.boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, this.wirelessTerminal + this.addSlot( this.boosterSlot = new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.RANGE_BOOSTER, this.wirelessTerminal .getInternalInventory(), 0, 80, 47, this.getPlayerInventory() ) ); this.bindPlayerInventory( ip, 0, 166 - /* height of player inventory */82 ); diff --git a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java index f14c059ae..4e3222430 100644 --- a/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java +++ b/src/main/java/appeng/core/sync/packets/PacketInventoryAction.java @@ -25,7 +25,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; @@ -123,7 +123,7 @@ public class PacketInventoryAction extends AppEngPacket @Override public void serverPacketData( final INetworkInfo manager, final PlayerEntity player ) { - final PlayerEntityMP sender = (PlayerEntityMP) player; + final ServerPlayerEntity sender = (ServerPlayerEntity) player; if( sender.openContainer instanceof AEBaseContainer ) { final AEBaseContainer baseContainer = (AEBaseContainer) sender.openContainer; diff --git a/src/main/java/appeng/core/sync/packets/PacketJEIRecipe.java b/src/main/java/appeng/core/sync/packets/PacketJEIRecipe.java index 20de7903d..ac4e5c91f 100644 --- a/src/main/java/appeng/core/sync/packets/PacketJEIRecipe.java +++ b/src/main/java/appeng/core/sync/packets/PacketJEIRecipe.java @@ -28,7 +28,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; @@ -101,7 +101,7 @@ public class PacketJEIRecipe extends AppEngPacket @Override public void serverPacketData( final INetworkInfo manager, final PlayerEntity player ) { - final PlayerEntityMP pmp = (PlayerEntityMP) player; + final ServerPlayerEntity pmp = (ServerPlayerEntity) player; final Container con = pmp.openContainer; if( !( con instanceof IContainerCraftingPacket ) ) diff --git a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java index 335c78480..5e09cd109 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java +++ b/src/main/java/appeng/core/sync/packets/PacketPartPlacement.java @@ -23,7 +23,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.network.PacketBuffer; import net.minecraft.util.Direction; import net.minecraft.util.Hand; @@ -74,7 +74,7 @@ public class PacketPartPlacement extends AppEngPacket @Override public void serverPacketData( final INetworkInfo manager, final PlayerEntity player ) { - final PlayerEntityMP sender = (PlayerEntityMP) player; + final ServerPlayerEntity sender = (ServerPlayerEntity) player; AppEng.proxy.updateRenderMode( sender ); PartPlacement.setEyeHeight( this.eyeHeight ); PartPlacement.place( sender.getHeldItem( this.hand ), new BlockPos( this.x, this.y, this.z ), Direction.values()[this.face], sender, this.hand, diff --git a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java index 037128f8b..1aadbf046 100644 --- a/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java +++ b/src/main/java/appeng/core/sync/packets/PacketPatternSlot.java @@ -25,7 +25,7 @@ import io.netty.buffer.ByteBuf; import io.netty.buffer.Unpooled; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.network.PacketBuffer; import net.minecraftforge.items.IItemHandler; @@ -110,7 +110,7 @@ public class PacketPatternSlot extends AppEngPacket @Override public void serverPacketData( final INetworkInfo manager, final PlayerEntity player ) { - final PlayerEntityMP sender = (PlayerEntityMP) player; + final ServerPlayerEntity sender = (ServerPlayerEntity) player; if( sender.openContainer instanceof ContainerPatternTerm ) { final ContainerPatternTerm patternTerminal = (ContainerPatternTerm) sender.openContainer; diff --git a/src/main/java/appeng/debug/TileChunkLoader.java b/src/main/java/appeng/debug/TileChunkLoader.java index 131a95413..c90a221bc 100644 --- a/src/main/java/appeng/debug/TileChunkLoader.java +++ b/src/main/java/appeng/debug/TileChunkLoader.java @@ -21,7 +21,7 @@ package appeng.debug; import java.util.List; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.ITickableTileEntity; import net.minecraft.util.math.ChunkPos; @@ -67,8 +67,8 @@ public class TileChunkLoader extends AEBaseTile implements ITickableTileEntity final MinecraftServer server = ServerLifecycleHooks.getCurrentServer(); if( server != null ) { - final List pl = server.getPlayerList().getPlayers(); - for( final PlayerEntityMP p : pl ) + final List pl = server.getPlayerList().getPlayers(); + for( final ServerPlayerEntity p : pl ) { p.sendMessage( new TextComponentString( "Can't chunk load.." ) ); } diff --git a/src/main/java/appeng/fluids/container/ContainerFluidFormationPlane.java b/src/main/java/appeng/fluids/container/ContainerFluidFormationPlane.java index 5a077a9b7..821ba5187 100644 --- a/src/main/java/appeng/fluids/container/ContainerFluidFormationPlane.java +++ b/src/main/java/appeng/fluids/container/ContainerFluidFormationPlane.java @@ -39,18 +39,18 @@ public class ContainerFluidFormationPlane extends ContainerFluidConfigurable protected void setupConfig() { final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/fluids/container/ContainerFluidStorageBus.java b/src/main/java/appeng/fluids/container/ContainerFluidStorageBus.java index c93048c31..81f2fb1f9 100644 --- a/src/main/java/appeng/fluids/container/ContainerFluidStorageBus.java +++ b/src/main/java/appeng/fluids/container/ContainerFluidStorageBus.java @@ -24,7 +24,6 @@ import java.util.Iterator; import net.minecraft.entity.player.PlayerInventory; import net.minecraftforge.items.IItemHandler; -import appeng.api.AEApi; import appeng.api.config.AccessRestriction; import appeng.api.config.FuzzyMode; import appeng.api.config.SecurityPermissions; @@ -75,18 +74,18 @@ public class ContainerFluidStorageBus extends ContainerFluidConfigurable protected void setupConfig() { final IItemHandler upgrades = this.getUpgradeable().getInventoryByName( "upgrades" ); - this.addSlotToContainer( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 0, 187, 8, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 1, 187, 8 + 18, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 2, 187, 8 + 18 * 2, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 3, 187, 8 + 18 * 3, this.getPlayerInventory() ) ) .setNotDraggable() ); - this.addSlotToContainer( + this.addSlot( ( new SlotRestrictedInput( SlotRestrictedInput.PlacableItemType.UPGRADES, upgrades, 4, 187, 8 + 18 * 4, this.getPlayerInventory() ) ) .setNotDraggable() ); } diff --git a/src/main/java/appeng/fluids/container/ContainerFluidTerminal.java b/src/main/java/appeng/fluids/container/ContainerFluidTerminal.java index a207c03a0..0b8c2a599 100644 --- a/src/main/java/appeng/fluids/container/ContainerFluidTerminal.java +++ b/src/main/java/appeng/fluids/container/ContainerFluidTerminal.java @@ -25,7 +25,7 @@ import java.nio.BufferOverflowException; import javax.annotation.Nonnull; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.IContainerListener; import net.minecraft.item.ItemStack; @@ -207,14 +207,14 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa } catch( final BufferOverflowException boe ) { - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); piu = new PacketMEFluidInventoryUpdate(); piu.appendFluid( send ); } } - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); } catch( final IOException e ) { @@ -281,11 +281,11 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa this.clientCM.putSetting( set, sideLocal ); for( final IContainerListener crafter : this.listeners ) { - if( crafter instanceof PlayerEntityMP ) + if( crafter instanceof ServerPlayerEntity ) { try { - NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (PlayerEntityMP) crafter ); + NetworkHandler.instance().sendTo( new PacketValueConfig( set.name(), sideLocal.name() ), (ServerPlayerEntity) crafter ); } catch( final IOException e ) { @@ -326,7 +326,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa { if( c instanceof PlayerEntity ) { - NetworkHandler.instance().sendTo( piu, (PlayerEntityMP) c ); + NetworkHandler.instance().sendTo( piu, (ServerPlayerEntity) c ); } } } @@ -343,7 +343,7 @@ public class ContainerFluidTerminal extends AEBaseContainer implements IConfigMa } @Override - public void doAction( PlayerEntityMP player, InventoryAction action, int slot, long id ) + public void doAction( ServerPlayerEntity player, InventoryAction action, int slot, long id ) { if( action != InventoryAction.FILL_ITEM && action != InventoryAction.EMPTY_ITEM ) { diff --git a/src/main/java/appeng/fluids/helper/FluidSyncHelper.java b/src/main/java/appeng/fluids/helper/FluidSyncHelper.java index 8bd64f102..52dd93118 100644 --- a/src/main/java/appeng/fluids/helper/FluidSyncHelper.java +++ b/src/main/java/appeng/fluids/helper/FluidSyncHelper.java @@ -6,7 +6,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Objects; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.inventory.IContainerListener; import appeng.api.storage.data.IAEFluidStack; @@ -59,9 +59,9 @@ public class FluidSyncHelper for( final IContainerListener l : listeners ) { - if( l instanceof PlayerEntityMP ) + if( l instanceof ServerPlayerEntity ) { - NetworkHandler.instance().sendTo( new PacketFluidSlot( data ), (PlayerEntityMP) l ); + NetworkHandler.instance().sendTo( new PacketFluidSlot( data ), (ServerPlayerEntity) l ); } } } diff --git a/src/main/java/appeng/me/cache/PathGridCache.java b/src/main/java/appeng/me/cache/PathGridCache.java index 32653be99..6ac981ec3 100644 --- a/src/main/java/appeng/me/cache/PathGridCache.java +++ b/src/main/java/appeng/me/cache/PathGridCache.java @@ -27,7 +27,7 @@ import java.util.List; import java.util.Set; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import appeng.api.AEApi; import appeng.api.networking.GridFlags; @@ -352,9 +352,9 @@ public class PathGridCache implements IPathingGrid for( final IGridNode n : this.requireChannels ) { PlayerEntity player = Api.INSTANCE.registries().players().findPlayer( n.getPlayerID() ); - if( player instanceof PlayerEntityMP ) + if( player instanceof ServerPlayerEntity ) { - currentBracket.trigger( (PlayerEntityMP) player ); + currentBracket.trigger( (ServerPlayerEntity) player ); } } } diff --git a/src/main/java/appeng/spatial/StorageHelper.java b/src/main/java/appeng/spatial/StorageHelper.java index d6cc364ff..a1b8d99af 100644 --- a/src/main/java/appeng/spatial/StorageHelper.java +++ b/src/main/java/appeng/spatial/StorageHelper.java @@ -25,7 +25,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; -import net.minecraft.entity.player.PlayerEntityMP; +import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; @@ -111,9 +111,9 @@ public class StorageHelper // load the chunk! newWorld.getChunkProvider().provideChunk( MathHelper.floor( link.x ) >> 4, MathHelper.floor( link.z ) >> 4 ); - if( entity instanceof PlayerEntityMP && link.dim.provider instanceof StorageWorldProvider ) + if( entity instanceof ServerPlayerEntity && link.dim.provider instanceof StorageWorldProvider ) { - AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger( (PlayerEntityMP) entity ); + AppEng.instance().getAdvancementTriggers().getSpatialExplorer().trigger( (ServerPlayerEntity) entity ); } entity.changeDimension( link.dim.provider.getDimension(), new METeleporter( link ) ); diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index e4a2ff08e..70fe86474 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,6 +1,7 @@ # GUI rendering protected net.minecraft.client.gui.screen.inventory.ContainerScreen func_146977_a(Lnet/minecraft/inventory/container/Slot;)V # drawSlot #public net.minecraft.client.gui.GuiTextField func_146188_c(IIII)V # drawSelectionBox +protected net.minecraft.inventory.container.Container field_75149_d # listeners # Reusing RedstoneParticle for ChargedOreFX protected net.minecraft.client.particle.RedstoneParticle (Lnet/minecraft/world/World;DDDDDDLnet/minecraft/particles/RedstoneParticleData;Lnet/minecraft/client/particle/IAnimatedSprite;)V