diff --git a/build.gradle b/build.gradle index d4f59dd..02cbb77 100755 --- a/build.gradle +++ b/build.gradle @@ -33,7 +33,7 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.11:4.0.1.191" + deobfCompile "mezz.jei:jei_1.11:4.0.1.193" } // This is our group. I'm cpw.mods @@ -43,8 +43,8 @@ archivesBaseName = "ironchest" // Setup the forge minecraft plugin data. Specify the preferred forge/minecraft version here minecraft { - version = "1.11-13.19.0.2148" - mappings = "snapshot_20161111" + version = "1.11-13.19.0.2153" + mappings = "snapshot_20161118" runDir = "run" } diff --git a/src/main/java/cpw/mods/ironchest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/BlockIronChest.java index 3d3a071..5bd0b33 100755 --- a/src/main/java/cpw/mods/ironchest/BlockIronChest.java +++ b/src/main/java/cpw/mods/ironchest/BlockIronChest.java @@ -150,22 +150,22 @@ public class BlockIronChest extends Block } @Override - public void onBlockAdded(World world, BlockPos pos, IBlockState blockState) + public void onBlockAdded(World world, BlockPos pos, IBlockState state) { - super.onBlockAdded(world, pos, blockState); - world.notifyBlockUpdate(pos, blockState, blockState, 3); + super.onBlockAdded(world, pos, state); + world.notifyBlockUpdate(pos, state, state, 3); } @Override - public void onBlockPlacedBy(World world, BlockPos pos, IBlockState blockState, EntityLivingBase entityliving, ItemStack itemStack) + public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { - TileEntity te = world.getTileEntity(pos); + TileEntity te = worldIn.getTileEntity(pos); if (te != null && te instanceof TileEntityIronChest) { TileEntityIronChest teic = (TileEntityIronChest) te; - teic.wasPlaced(entityliving, itemStack); - teic.setFacing(entityliving.getHorizontalFacing().getOpposite()); - world.notifyBlockUpdate(pos, blockState, blockState, 3); + teic.wasPlaced(placer, stack); + teic.setFacing(placer.getHorizontalFacing().getOpposite()); + worldIn.notifyBlockUpdate(pos, state, state, 3); } } diff --git a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java index 5ef4f55..443f876 100755 --- a/src/main/java/cpw/mods/ironchest/ContainerIronChest.java +++ b/src/main/java/cpw/mods/ironchest/ContainerIronChest.java @@ -39,42 +39,46 @@ public class ContainerIronChest extends Container @Override public boolean canInteractWith(EntityPlayer player) { - return this.chest.isUseableByPlayer(player); + return this.chest.isUsableByPlayer(player); } @Override - public ItemStack transferStackInSlot(EntityPlayer p, int i) + public ItemStack transferStackInSlot(EntityPlayer playerIn, int index) { - ItemStack itemstack = ItemStack.field_190927_a; - Slot slot = this.inventorySlots.get(i); + ItemStack itemstack = ItemStack.EMPTY; + Slot slot = this.inventorySlots.get(index); + if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); - if (i < this.type.size) + + if (index < this.type.size) { if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true)) { - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } } else if (!this.type.acceptsStack(itemstack1)) { - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false)) { - return ItemStack.field_190927_a; + return ItemStack.EMPTY; } - if (itemstack1.func_190916_E() == 0) + + if (itemstack1.isEmpty()) { - slot.putStack(ItemStack.field_190927_a); + slot.putStack(ItemStack.EMPTY); } else { slot.onSlotChanged(); } } + return itemstack; } diff --git a/src/main/java/cpw/mods/ironchest/IronChestType.java b/src/main/java/cpw/mods/ironchest/IronChestType.java index db0d4c2..793ad53 100755 --- a/src/main/java/cpw/mods/ironchest/IronChestType.java +++ b/src/main/java/cpw/mods/ironchest/IronChestType.java @@ -202,7 +202,7 @@ public enum IronChestType implements IStringSerializable { if (this == DIRTCHEST9000) { - return itemstack == ItemStack.field_190927_a || itemstack.getItem() == DIRT_ITEM; + return itemstack == ItemStack.EMPTY || itemstack.getItem() == DIRT_ITEM; } return true; diff --git a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java index 369cbf6..b5b8d9f 100755 --- a/src/main/java/cpw/mods/ironchest/ItemChestChanger.java +++ b/src/main/java/cpw/mods/ironchest/ItemChestChanger.java @@ -66,14 +66,14 @@ public class ItemChestChanger extends Item TileEntity te = world.getTileEntity(pos); TileEntityIronChest newchest = new TileEntityIronChest(); - NonNullList chestContents = NonNullList. func_191197_a(27, ItemStack.field_190927_a); + NonNullList chestContents = NonNullList. withSize(27, ItemStack.EMPTY); EnumFacing chestFacing = EnumFacing.DOWN; if (te != null) { if (te instanceof TileEntityIronChest) { - chestContents = ((TileEntityIronChest) te).func_190576_q(); + chestContents = ((TileEntityIronChest) te).getItems(); chestFacing = ((TileEntityIronChest) te).getFacing(); newchest = this.type.target.makeEntity(); if (newchest == null) @@ -95,7 +95,7 @@ public class ItemChestChanger extends Item { return EnumActionResult.PASS; } - chestContents = NonNullList. func_191197_a(chest.getSizeInventory(), ItemStack.field_190927_a); + chestContents = NonNullList. withSize(chest.getSizeInventory(), ItemStack.EMPTY); for (int i = 0; i < chestContents.size(); i++) { chestContents.set(i, chest.getStackInSlot(i)); @@ -131,7 +131,7 @@ public class ItemChestChanger extends Item ItemStack stack = player.getHeldItem(hand); - stack.func_190920_e(player.capabilities.isCreativeMode ? stack.func_190916_E() : stack.func_190916_E() - 1); + stack.setCount(player.capabilities.isCreativeMode ? stack.getCount() : stack.getCount() - 1); return EnumActionResult.SUCCESS; } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java index 0b04bb2..fa77246 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityDirtChest.java @@ -42,9 +42,9 @@ public class TileEntityDirtChest extends TileEntityIronChest @Override public void removeAdornments() { - if (this.func_190576_q().get(0) != ItemStack.field_190927_a && this.func_190576_q().get(0).isItemEqual(dirtChest9000GuideBook)) + if (this.getItems().get(0) != ItemStack.EMPTY && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook)) { - this.func_190576_q().set(0, ItemStack.field_190927_a); + this.getItems().set(0, ItemStack.EMPTY); } } } diff --git a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java index ef8e205..353ad46 100755 --- a/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java +++ b/src/main/java/cpw/mods/ironchest/TileEntityIronChest.java @@ -68,14 +68,14 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { super(); this.chestType = type; - this.chestContents = NonNullList. func_191197_a(type.size, ItemStack.field_190927_a); - this.topStacks = NonNullList. func_191197_a(8, ItemStack.field_190927_a); + this.chestContents = NonNullList. withSize(type.size, ItemStack.EMPTY); + this.topStacks = NonNullList. withSize(8, ItemStack.EMPTY); this.facing = EnumFacing.NORTH; } public void setContents(NonNullList contents) { - this.chestContents = NonNullList. func_191197_a(this.getType().size, ItemStack.field_190927_a); + this.chestContents = NonNullList. withSize(this.getType().size, ItemStack.EMPTY); for (int i = 0; i < contents.size(); i++) { @@ -108,9 +108,9 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { IronChestType type = IronChestType.IRON; - if (this.hasWorldObj()) + if (this.hasWorld()) { - IBlockState state = this.worldObj.getBlockState(this.pos); + IBlockState state = this.world.getBlockState(this.pos); if (state.getBlock() == IronChest.ironChestBlock) { @@ -128,7 +128,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick this.inventoryTouched = true; - return this.func_190576_q().get(index); + return this.getItems().get(index); } @Override @@ -141,12 +141,12 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick protected void sortTopStacks() { - if (!this.getType().isTransparent() || (this.worldObj != null && this.worldObj.isRemote)) + if (!this.getType().isTransparent() || (this.world != null && this.world.isRemote)) { return; } - NonNullList tempCopy = NonNullList. func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a); + NonNullList tempCopy = NonNullList. withSize(this.getSizeInventory(), ItemStack.EMPTY); boolean hasStuff = false; @@ -154,13 +154,13 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick mainLoop: for (int i = 0; i < this.getSizeInventory(); i++) { - if (this.chestContents.get(i) != ItemStack.field_190927_a) + if (this.chestContents.get(i) != ItemStack.EMPTY) { for (int j = 0; j < compressedIdx; j++) { if (tempCopy.get(j).isItemEqual(this.chestContents.get(i))) { - tempCopy.get(j).func_190920_e(tempCopy.get(j).func_190916_E() + this.chestContents.get(i).func_190916_E()); + tempCopy.get(j).setCount(tempCopy.get(j).getCount() + this.chestContents.get(i).getCount()); continue mainLoop; } } @@ -175,13 +175,13 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick for (int i = 0; i < this.topStacks.size(); i++) { - this.topStacks.set(i, ItemStack.field_190927_a); + this.topStacks.set(i, ItemStack.EMPTY); } - if (this.worldObj != null) + if (this.world != null) { - IBlockState iblockstate = this.worldObj.getBlockState(this.pos); - this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); + IBlockState iblockstate = this.world.getBlockState(this.pos); + this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } return; @@ -203,7 +203,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick } else { - return stack2.func_190916_E() - stack1.func_190916_E(); + return stack2.getCount() - stack1.getCount(); } } }); @@ -213,7 +213,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick for (int i = 0; i < tempCopy.size(); i++) { ItemStack element = tempCopy.get(i); - if (element != ItemStack.field_190927_a && element.func_190916_E() > 0) + if (element != ItemStack.EMPTY && element.getCount() > 0) { this.topStacks.set(p++, element); @@ -226,14 +226,14 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick for (int i = p; i < this.topStacks.size(); i++) { - this.topStacks.set(i, ItemStack.field_190927_a); + this.topStacks.set(i, ItemStack.EMPTY); } - if (this.worldObj != null) + if (this.world != null) { - IBlockState iblockstate = this.worldObj.getBlockState(this.pos); + IBlockState iblockstate = this.world.getBlockState(this.pos); - this.worldObj.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); + this.world.notifyBlockUpdate(this.pos, iblockstate, iblockstate, 3); } } @@ -249,6 +249,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick return this.customName != null && this.customName.length() > 0; } + @Override public void setCustomName(String name) { this.customName = name; @@ -259,7 +260,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { super.readFromNBT(compound); - this.chestContents = NonNullList. func_191197_a(this.getSizeInventory(), ItemStack.field_190927_a); + this.chestContents = NonNullList. withSize(this.getSizeInventory(), ItemStack.EMPTY); if (compound.hasKey("CustomName", Constants.NBT.TAG_STRING)) { @@ -268,7 +269,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick if (!this.checkLootAndRead(compound)) { - ItemStackHelper.func_191283_b(compound, this.chestContents); + ItemStackHelper.loadAllItems(compound, this.chestContents); } this.facing = EnumFacing.VALUES[compound.getByte("facing")]; @@ -283,7 +284,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick if (!this.checkLootAndWrite(compound)) { - ItemStackHelper.func_191282_a(compound, this.chestContents); + ItemStackHelper.saveAllItems(compound, this.chestContents); } compound.setByte("facing", (byte) this.facing.ordinal()); @@ -303,14 +304,14 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick } @Override - public boolean isUseableByPlayer(EntityPlayer player) + public boolean isUsableByPlayer(EntityPlayer player) { - if (this.worldObj == null) + if (this.world == null) { return true; } - if (this.worldObj.getTileEntity(this.pos) != this) + if (this.world.getTileEntity(this.pos) != this) { return false; } @@ -323,7 +324,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { // Resynchronizes clients with the server state //@formatter:off - if (this.worldObj != null && !this.worldObj.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) + if (this.world != null && !this.world.isRemote && this.numPlayersUsing != 0 && (this.ticksSinceSync + this.pos.getX() + this.pos.getY() + this.pos.getZ()) % 200 == 0) //@formatter:on { this.numPlayersUsing = 0; @@ -331,7 +332,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick float f = 5.0F; //@formatter:off - for (EntityPlayer player : this.worldObj.getEntitiesWithinAABB(EntityPlayer.class, + for (EntityPlayer player : this.world.getEntitiesWithinAABB(EntityPlayer.class, new AxisAlignedBB(this.pos.getX() - f, this.pos.getY() - f, this.pos.getZ() - f, this.pos.getX() + 1 + f, this.pos.getY() + 1 + f, this.pos.getZ() + 1 + f))) //@formatter:on { @@ -342,12 +343,12 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick } } - if (this.worldObj != null && !this.worldObj.isRemote && this.ticksSinceSync < 0) + if (this.world != null && !this.world.isRemote && this.ticksSinceSync < 0) { - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 3, ((this.numPlayersUsing << 3) & 0xF8) | (this.facing.ordinal() & 0x7)); } - if (!this.worldObj.isRemote && this.inventoryTouched) + if (!this.world.isRemote && this.inventoryTouched) { this.inventoryTouched = false; @@ -367,7 +368,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick double z = this.pos.getZ() + 0.5D; //@formatter:off - this.worldObj.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.world.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_OPEN, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } @@ -398,7 +399,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick double z = this.pos.getZ() + 0.5D; //@formatter:off - this.worldObj.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.worldObj.rand.nextFloat() * 0.1F + 0.9F); + this.world.playSound(null, x, y, z, SoundEvents.BLOCK_CHEST_CLOSE, SoundCategory.BLOCKS, 0.5F, this.world.rand.nextFloat() * 0.1F + 0.9F); //@formatter:on } @@ -434,7 +435,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { if (!player.isSpectator()) { - if (this.worldObj == null) + if (this.world == null) { return; } @@ -446,9 +447,9 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick ++this.numPlayersUsing; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); - this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.world.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); + this.world.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); } } @@ -457,16 +458,16 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { if (!player.isSpectator()) { - if (this.worldObj == null) + if (this.world == null) { return; } --this.numPlayersUsing; - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); - this.worldObj.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); - this.worldObj.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 1, this.numPlayersUsing); + this.world.notifyNeighborsOfStateChange(this.pos, IronChest.ironChestBlock, false); + this.world.notifyNeighborsOfStateChange(this.pos.down(), IronChest.ironChestBlock, false); } } @@ -490,7 +491,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick for (int slot = 0; slot < stacks.size(); slot++) { - if (stacks.get(slot) != ItemStack.field_190927_a) + if (stacks.get(slot) != ItemStack.EMPTY) { NBTTagCompound item = new NBTTagCompound(); @@ -545,7 +546,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick } else { - this.topStacks.set(i, ItemStack.field_190927_a); + this.topStacks.set(i, ItemStack.EMPTY); } pos++; @@ -558,7 +559,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { if (this.getType().isTransparent()) { - NonNullList sortList = NonNullList. func_191197_a(this.topStacks.size(), ItemStack.field_190927_a); + NonNullList sortList = NonNullList. withSize(this.topStacks.size(), ItemStack.EMPTY); int pos = 0; @@ -571,7 +572,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick } else { - sortList.set(pos++, ItemStack.field_190927_a); + sortList.set(pos++, ItemStack.EMPTY); } } @@ -591,7 +592,7 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick { this.setFacing(this.facing.rotateY()); - this.worldObj.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); + this.world.addBlockEvent(this.pos, IronChest.ironChestBlock, 2, this.facing.ordinal()); } public void wasPlaced(EntityLivingBase entityliving, ItemStack stack) @@ -629,17 +630,17 @@ public class TileEntityIronChest extends TileEntityLockableLoot implements ITick } @Override - protected NonNullList func_190576_q() + protected NonNullList getItems() { return this.chestContents; } @Override - public boolean func_191420_l() + public boolean isEmpty() { for (ItemStack itemstack : this.chestContents) { - if (!itemstack.func_190926_b()) + if (!itemstack.isEmpty()) { return false; } diff --git a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java index 24e661a..5391f7f 100755 --- a/src/main/java/cpw/mods/ironchest/ValidatingSlot.java +++ b/src/main/java/cpw/mods/ironchest/ValidatingSlot.java @@ -15,8 +15,8 @@ public class ValidatingSlot extends Slot } @Override - public boolean isItemValid(ItemStack par1ItemStack) + public boolean isItemValid(ItemStack stack) { - return this.type.acceptsStack(par1ItemStack); + return this.type.acceptsStack(stack); } } diff --git a/src/main/java/cpw/mods/ironchest/client/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/GUIChest.java index 9b404f8..2de0f54 100755 --- a/src/main/java/cpw/mods/ironchest/client/GUIChest.java +++ b/src/main/java/cpw/mods/ironchest/client/GUIChest.java @@ -88,7 +88,7 @@ public class GUIChest extends GuiContainer } @Override - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); // new "bind tex" diff --git a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java index de76f8c..fc769db 100755 --- a/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java +++ b/src/main/java/cpw/mods/ironchest/client/TileEntityIronChestRenderer.java @@ -51,26 +51,26 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer= 0) + if (destroyStage >= 0) { - this.bindTexture(DESTROY_STAGES[breakStage]); + this.bindTexture(DESTROY_STAGES[destroyStage]); GlStateManager.matrixMode(5890); GlStateManager.pushMatrix(); GlStateManager.scale(4F, 4F, 1F); @@ -121,7 +121,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer= 0) + if (destroyStage >= 0) { GlStateManager.matrixMode(5890); GlStateManager.popMatrix(); @@ -146,8 +146,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer stacks = tile.getTopItemStacks(); + NonNullList stacks = te.getTopItemStacks(); for (int i = 0; i < stacks.size(); i++) { ItemStack item = stacks.get(i); @@ -177,7 +176,7 @@ public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer