- * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest; - -import java.util.Properties; - -import cpw.mods.ironchest.common.CommonProxy; -import cpw.mods.ironchest.common.lib.BlockLists; -import cpw.mods.ironchest.common.network.MessageCrystalChestSync; -import cpw.mods.ironchest.common.network.MessageCrystalShulkerSync; -import cpw.mods.ironchest.common.util.MissingMappingsHandler; -import cpw.mods.ironchest.common.util.OcelotsSitOnChestsHandler; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.common.Mod; -import net.minecraftforge.fml.common.Mod.EventHandler; -import net.minecraftforge.fml.common.Mod.Instance; -import net.minecraftforge.fml.common.SidedProxy; -import net.minecraftforge.fml.common.event.FMLInitializationEvent; -import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; -import net.minecraftforge.fml.common.network.NetworkRegistry; -import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import net.minecraftforge.fml.relauncher.Side; - -@Mod(modid = IronChest.MOD_ID, name = "Iron Chests", dependencies = "required-after:forge@[14.21.0.2359,)", acceptedMinecraftVersions = "[1.12, 1.13)") -public class IronChest -{ - public static final String MOD_ID = "ironchest"; - - @Instance(IronChest.MOD_ID) - public static IronChest instance; - - @SidedProxy(clientSide = "cpw.mods.ironchest.client.ClientProxy", serverSide = "cpw.mods.ironchest.common.CommonProxy") - public static CommonProxy proxy; - - public static final SimpleNetworkWrapper packetHandler = NetworkRegistry.INSTANCE.newSimpleChannel(MOD_ID); - - @EventHandler - public void preInit(FMLPreInitializationEvent event) - { - Properties properties = event.getVersionProperties(); - - if (properties != null) - { - String major = properties.getProperty("IronChest.build.major.number"); - String minor = properties.getProperty("IronChest.build.minor.number"); - String rev = properties.getProperty("IronChest.build.revision.number"); - String build = properties.getProperty("IronChest.build.number"); - - event.getModMetadata().version = String.format("%s.%s.%s build %s", major, minor, rev, build); - } - - proxy.preInit(); - - NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); - - MinecraftForge.EVENT_BUS.register(new OcelotsSitOnChestsHandler()); - - MinecraftForge.EVENT_BUS.register(new MissingMappingsHandler()); - } - - @EventHandler - public void init(FMLInitializationEvent event) - { - int messageId = 0; - packetHandler.registerMessage(MessageCrystalChestSync.Handler.class, MessageCrystalChestSync.class, messageId++, Side.CLIENT); - packetHandler.registerMessage(MessageCrystalShulkerSync.Handler.class, MessageCrystalShulkerSync.class, messageId++, Side.CLIENT); - - BlockLists.createShulkerItemList(); - } - -} diff --git a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java b/src/main/java/cpw/mods/ironchest/client/ClientProxy.java deleted file mode 100755 index 881d277b..00000000 --- a/src/main/java/cpw/mods/ironchest/client/ClientProxy.java +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 cpw. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/gpl.html - *
- * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest.client; - -import cpw.mods.ironchest.client.gui.chest.GUIChest; -import cpw.mods.ironchest.client.gui.shulker.GUIShulkerChest; -import cpw.mods.ironchest.client.renderer.chest.TileEntityIronChestRenderer; -import cpw.mods.ironchest.client.renderer.shulker.TileEntityIronShulkerBoxRenderer; -import cpw.mods.ironchest.common.CommonProxy; -import cpw.mods.ironchest.common.blocks.chest.IronChestType; -import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; -import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; -import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.client.registry.ClientRegistry; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -@SideOnly(Side.CLIENT) -public class ClientProxy extends CommonProxy -{ - @Override - public void preInit() - { - for (IronChestType type : IronChestType.values()) - { - ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronChestRenderer()); - } - - for (IronShulkerBoxType type : IronShulkerBoxType.values()) - { - ClientRegistry.bindTileEntitySpecialRenderer(type.clazz, new TileEntityIronShulkerBoxRenderer()); - } - } - - @Override - public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) - { - TileEntity te = world.getTileEntity(new BlockPos(x, y, z)); - - if (te != null && te instanceof TileEntityIronChest) - { - return GUIChest.GUI.buildGUI(IronChestType.values()[ID], player.inventory, (TileEntityIronChest) te); - } - else if (te != null && te instanceof TileEntityIronShulkerBox) - { - return GUIShulkerChest.GUI.buildGUI(IronShulkerBoxType.values()[ID], player.inventory, (TileEntityIronShulkerBox) te); - } - else - { - return null; - } - } - - @Override - public World getClientWorld() - { - return Minecraft.getMinecraft().world; - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/gui/chest/GUIChest.java b/src/main/java/cpw/mods/ironchest/client/gui/chest/GUIChest.java deleted file mode 100755 index 91e44845..00000000 --- a/src/main/java/cpw/mods/ironchest/client/gui/chest/GUIChest.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 cpw. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/gpl.html - *
- * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest.client.gui.chest; - -import cpw.mods.ironchest.common.blocks.chest.IronChestType; -import cpw.mods.ironchest.common.gui.chest.ContainerIronChest; -import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.util.ResourceLocation; - -public class GUIChest extends GuiContainer -{ - public enum ResourceList - { - //@formatter:off - IRON(new ResourceLocation("ironchest", "textures/gui/iron_container.png")), - COPPER(new ResourceLocation("ironchest", "textures/gui/copper_container.png")), - SILVER(new ResourceLocation("ironchest", "textures/gui/silver_container.png")), - GOLD(new ResourceLocation("ironchest", "textures/gui/gold_container.png")), - DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamond_container.png")), - DIRT(new ResourceLocation("ironchest", "textures/gui/dirt_container.png")); - //@formatter:on - public final ResourceLocation location; - - ResourceList(ResourceLocation loc) - { - this.location = loc; - } - } - - public enum GUI - { - //@formatter:off - IRON(184, 202, ResourceList.IRON, IronChestType.IRON), - GOLD(184, 256, ResourceList.GOLD, IronChestType.GOLD), - DIAMOND(238, 256, ResourceList.DIAMOND, IronChestType.DIAMOND), - COPPER(184, 184, ResourceList.COPPER, IronChestType.COPPER), - SILVER(184, 238, ResourceList.SILVER, IronChestType.SILVER), - CRYSTAL(238, 256, ResourceList.DIAMOND, IronChestType.CRYSTAL), - OBSIDIAN(238, 256, ResourceList.DIAMOND,IronChestType.OBSIDIAN), - DIRTCHEST9000(184, 184, ResourceList.DIRT, IronChestType.DIRTCHEST9000); - //@formatter:on - - private int xSize; - - private int ySize; - - private ResourceList guiResourceList; - - private IronChestType mainType; - - GUI(int xSize, int ySize, ResourceList guiResourceList, IronChestType mainType) - { - this.xSize = xSize; - this.ySize = ySize; - this.guiResourceList = guiResourceList; - this.mainType = mainType; - } - - protected Container makeContainer(IInventory player, IInventory chest) - { - return new ContainerIronChest(player, chest, this.mainType, this.xSize, this.ySize); - } - - public static GUIChest buildGUI(IronChestType type, IInventory playerInventory, TileEntityIronChest chestInventory) - { - return new GUIChest(values()[chestInventory.getType().ordinal()], playerInventory, chestInventory); - } - } - - private GUI type; - - private GUIChest(GUI type, IInventory player, IInventory chest) - { - super(type.makeContainer(player, chest)); - this.type = type; - this.xSize = type.xSize; - this.ySize = type.ySize; - this.allowUserInput = false; - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) - { - this.drawDefaultBackground(); - super.drawScreen(mouseX, mouseY, partialTicks); - this.renderHoveredToolTip(mouseX, mouseY); - } - - /** - * Draws the background layer of this container (behind the items). - */ - @Override - protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) - { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - - this.mc.getTextureManager().bindTexture(this.type.guiResourceList.location); - - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java b/src/main/java/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java deleted file mode 100644 index 041afe8b..00000000 --- a/src/main/java/cpw/mods/ironchest/client/gui/shulker/GUIShulkerChest.java +++ /dev/null @@ -1,119 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 cpw. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/gpl.html - *
- * Contributors: - * cpw - initial API and implementation - ******************************************************************************/ -package cpw.mods.ironchest.client.gui.shulker; - -import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType; -import cpw.mods.ironchest.common.gui.shulker.ContainerIronShulkerBox; -import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.util.ResourceLocation; - -public class GUIShulkerChest extends GuiContainer -{ - public enum ResourceList - { - //@formatter:off - IRON(new ResourceLocation("ironchest", "textures/gui/iron_container.png")), - COPPER(new ResourceLocation("ironchest", "textures/gui/copper_container.png")), - SILVER(new ResourceLocation("ironchest", "textures/gui/silver_container.png")), - GOLD(new ResourceLocation("ironchest", "textures/gui/gold_container.png")), - DIAMOND(new ResourceLocation("ironchest", "textures/gui/diamond_container.png")); - //@formatter:on - - public final ResourceLocation location; - - ResourceList(ResourceLocation loc) - { - this.location = loc; - } - } - - public enum GUI - { - //@formatter:off - IRON(184, 202, ResourceList.IRON, IronShulkerBoxType.IRON), - GOLD(184, 256, ResourceList.GOLD, IronShulkerBoxType.GOLD), - DIAMOND(238, 256, ResourceList.DIAMOND, IronShulkerBoxType.DIAMOND), - COPPER(184, 184, ResourceList.COPPER, IronShulkerBoxType.COPPER), - SILVER(184, 238, ResourceList.SILVER, IronShulkerBoxType.SILVER), - CRYSTAL(238, 256, ResourceList.DIAMOND, IronShulkerBoxType.CRYSTAL), - OBSIDIAN(238, 256, ResourceList.DIAMOND,IronShulkerBoxType.OBSIDIAN); - //@formatter:on - - private int xSize; - - private int ySize; - - private ResourceList guiResourceList; - - private IronShulkerBoxType mainType; - - GUI(int xSize, int ySize, ResourceList guiResourceList, IronShulkerBoxType mainType) - { - this.xSize = xSize; - this.ySize = ySize; - this.guiResourceList = guiResourceList; - this.mainType = mainType; - } - - protected Container makeContainer(IInventory player, IInventory shulker) - { - return new ContainerIronShulkerBox(player, shulker, this.mainType, this.xSize, this.ySize); - } - - public static GUIShulkerChest buildGUI(IronShulkerBoxType type, IInventory playerInventory, TileEntityIronShulkerBox shulkerInventory) - { - return new GUIShulkerChest(values()[shulkerInventory.getType().ordinal()], playerInventory, shulkerInventory); - } - } - - private GUI type; - - private GUIShulkerChest(GUI type, IInventory player, IInventory shulker) - { - super(type.makeContainer(player, shulker)); - - this.type = type; - this.xSize = type.xSize; - this.ySize = type.ySize; - this.allowUserInput = false; - } - - /** - * Draws the screen and all the components in it. - */ - @Override - public void drawScreen(int mouseX, int mouseY, float partialTicks) - { - this.drawDefaultBackground(); - super.drawScreen(mouseX, mouseY, partialTicks); - this.renderHoveredToolTip(mouseX, mouseY); - } - - /** - * Draws the background layer of this container (behind the items). - */ - @Override - protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) - { - GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); - - this.mc.getTextureManager().bindTexture(this.type.guiResourceList.location); - - int x = (this.width - this.xSize) / 2; - int y = (this.height - this.ySize) / 2; - - this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize); - } -} diff --git a/src/main/java/cpw/mods/ironchest/client/renderer/chest/TileEntityIronChestRenderer.java b/src/main/java/cpw/mods/ironchest/client/renderer/chest/TileEntityIronChestRenderer.java deleted file mode 100755 index c466cabd..00000000 --- a/src/main/java/cpw/mods/ironchest/client/renderer/chest/TileEntityIronChestRenderer.java +++ /dev/null @@ -1,238 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012 cpw. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the GNU Public License v3.0 - * which accompanies this distribution, and is available at - * http://www.gnu.org/licenses/gpl.html - *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.client.renderer.chest;
-
-import java.util.Random;
-
-import com.google.common.primitives.SignedBytes;
-
-import cpw.mods.ironchest.common.blocks.chest.BlockIronChest;
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import cpw.mods.ironchest.common.core.IronChestBlocks;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.model.ModelChest;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.entity.RenderEntityItem;
-import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-
-public class TileEntityIronChestRenderer extends TileEntitySpecialRenderer
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.client.renderer.shulker;
-
-import java.util.Random;
-
-import com.google.common.primitives.SignedBytes;
-
-import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox;
-import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.model.ModelShulker;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.client.renderer.entity.RenderEntityItem;
-import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.ResourceLocation;
-
-public class TileEntityIronShulkerBoxRenderer extends TileEntitySpecialRenderer
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common;
-
-import cpw.mods.ironchest.common.gui.chest.ContainerIronChest;
-import cpw.mods.ironchest.common.gui.shulker.ContainerIronShulkerBox;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.common.network.IGuiHandler;
-
-public class CommonProxy implements IGuiHandler
-{
- public void preInit()
- {
-
- }
-
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- return null;
- }
-
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- TileEntity te = world.getTileEntity(new BlockPos(x, y, z));
-
- if (te != null && te instanceof TileEntityIronChest)
- {
- TileEntityIronChest icte = (TileEntityIronChest) te;
-
- return new ContainerIronChest(player.inventory, icte, icte.getType(), 0, 0);
- }
- else if (te != null && te instanceof TileEntityIronShulkerBox)
- {
- TileEntityIronShulkerBox icte = (TileEntityIronShulkerBox) te;
-
- return new ContainerIronShulkerBox(player.inventory, icte, icte.getType(), 0, 0);
- }
- else
- {
- return null;
- }
- }
-
- public World getClientWorld()
- {
- return null;
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/ai/IronChestAIOcelotSit.java b/src/main/java/cpw/mods/ironchest/common/ai/IronChestAIOcelotSit.java
deleted file mode 100755
index ee379100..00000000
--- a/src/main/java/cpw/mods/ironchest/common/ai/IronChestAIOcelotSit.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.ai;
-
-import cpw.mods.ironchest.common.core.IronChestBlocks;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import net.minecraft.block.Block;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.ai.EntityAIOcelotSit;
-import net.minecraft.entity.passive.EntityOcelot;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class IronChestAIOcelotSit extends EntityAIOcelotSit
-{
- public IronChestAIOcelotSit(EntityOcelot ocelotIn, float speedIn)
- {
- super(ocelotIn, speedIn);
- }
-
- /**
- * Return true to set given position as destination
- */
- @Override
- protected boolean shouldMoveTo(World worldIn, BlockPos pos)
- {
- if (!worldIn.isAirBlock(pos.up()))
- {
- return false;
- }
- else
- {
- IBlockState iblockstate = worldIn.getBlockState(pos);
- Block block = iblockstate.getBlock();
-
- if (block == IronChestBlocks.ironChestBlock)
- {
- TileEntity tileentity = worldIn.getTileEntity(pos);
-
- if (tileentity instanceof TileEntityIronChest && ((TileEntityIronChest) tileentity).numPlayersUsing < 1)
- {
- return true;
- }
- }
-
- return super.shouldMoveTo(worldIn, pos);
- }
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/blocks/chest/BlockIronChest.java b/src/main/java/cpw/mods/ironchest/common/blocks/chest/BlockIronChest.java
deleted file mode 100755
index dde7a1da..00000000
--- a/src/main/java/cpw/mods/ironchest/common/blocks/chest/BlockIronChest.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.blocks.chest;
-
-import javax.annotation.Nullable;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.core.IronChestCreativeTabs;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import cpw.mods.ironchest.common.util.BlockNames;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyEnum;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.InventoryHelper;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.ILockableContainer;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-public class BlockIronChest extends Block
-{
- public static final PropertyEnum
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.blocks.chest;
-
-import cpw.mods.ironchest.common.gui.chest.slot.ValidatingChestSlot;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityCopperChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityCrystalChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityDiamondChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityDirtChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityGoldChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityObsidianChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntitySilverChest;
-import net.minecraft.init.Blocks;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagByte;
-import net.minecraft.util.IStringSerializable;
-import net.minecraft.util.ResourceLocation;
-
-public enum IronChestType implements IStringSerializable
-{
- //@formatter:off
- IRON(54, 9, true, "iron_chest.png", TileEntityIronChest.class, 184, 202),
- GOLD(81, 9, true, "gold_chest.png", TileEntityGoldChest.class, 184, 256),
- DIAMOND(108, 12, true, "diamond_chest.png", TileEntityDiamondChest.class, 184, 256),
- COPPER(45, 9, false, "copper_chest.png", TileEntityCopperChest.class, 184, 184),
- SILVER(72, 9, false, "silver_chest.png", TileEntitySilverChest.class, 184, 238),
- CRYSTAL(108, 12, true, "crystal_chest.png", TileEntityCrystalChest.class, 238, 256),
- OBSIDIAN(108, 12, false, "obsidian_chest.png", TileEntityObsidianChest.class, 238, 256),
- DIRTCHEST9000(1, 1, false, "dirt_chest.png", TileEntityDirtChest.class, 184, 184),
- WOOD(0, 0, false, "", null, 0, 0);
- //@formatter:on
-
- public static final IronChestType VALUES[] = values();
-
- public final String name;
-
- public final int size;
-
- public final int rowLength;
-
- public final boolean tieredChest;
-
- public final ResourceLocation modelTexture;
-
- private String breakTexture;
-
- public final Class extends TileEntityIronChest> clazz;
-
- public final int xSize;
-
- public final int ySize;
-
- //@formatter:off
- IronChestType(int size, int rowLength, boolean tieredChest, String modelTexture, Class extends TileEntityIronChest> clazz, int xSize, int ySize)
- //@formatter:on
- {
- this.name = this.name().toLowerCase();
- this.size = size;
- this.rowLength = rowLength;
- this.tieredChest = tieredChest;
- this.modelTexture = new ResourceLocation("ironchest", "textures/model/chest/" + modelTexture);
- this.clazz = clazz;
- this.xSize = xSize;
- this.ySize = ySize;
- }
-
- public String getBreakTexture()
- {
- if (this.breakTexture == null)
- {
- switch (this)
- {
- case DIRTCHEST9000:
- {
- this.breakTexture = "minecraft:blocks/dirt";
- break;
- }
- case OBSIDIAN:
- {
- this.breakTexture = "minecraft:blocks/obsidian";
- break;
- }
- case WOOD:
- {
- this.breakTexture = "minecraft:blocks/planks_oak";
- break;
- }
- default:
- {
- this.breakTexture = "ironchest:blocks/" + this.getName() + "break";
- }
- }
- }
-
- return this.breakTexture;
- }
-
- @Override
- public String getName()
- {
- return this.name;
- }
-
- public int getRowCount()
- {
- return this.size / this.rowLength;
- }
-
- public boolean isTransparent()
- {
- return this == CRYSTAL;
- }
-
- public boolean isValidForCreativeMode()
- {
- return this != WOOD;
- }
-
- public boolean isExplosionResistant()
- {
- return this == OBSIDIAN;
- }
-
- public Slot makeSlot(IInventory chestInventory, int index, int x, int y)
- {
- return new ValidatingChestSlot(chestInventory, index, x, y, this);
- }
-
- private static final Item DIRT_ITEM = Item.getItemFromBlock(Blocks.DIRT);
-
- public boolean acceptsStack(ItemStack itemstack)
- {
- if (this == DIRTCHEST9000)
- {
- return itemstack.isEmpty() || itemstack.getItem() == DIRT_ITEM;
- }
-
- return true;
- }
-
- public void adornItemDrop(ItemStack item)
- {
- if (this == DIRTCHEST9000)
- {
- item.setTagInfo("dirtchest", new NBTTagByte((byte) 1));
- }
- }
-
- public TileEntityIronChest makeEntity()
- {
- switch (this)
- {
- case IRON:
- return new TileEntityIronChest();
- case GOLD:
- return new TileEntityGoldChest();
- case DIAMOND:
- return new TileEntityDiamondChest();
- case COPPER:
- return new TileEntityCopperChest();
- case SILVER:
- return new TileEntitySilverChest();
- case CRYSTAL:
- return new TileEntityCrystalChest();
- case OBSIDIAN:
- return new TileEntityObsidianChest();
- case DIRTCHEST9000:
- return new TileEntityDirtChest();
- default:
- return null;
- }
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java
deleted file mode 100644
index 62bbd436..00000000
--- a/src/main/java/cpw/mods/ironchest/common/blocks/shulker/BlockIronShulkerBox.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.blocks.shulker;
-
-import java.util.List;
-
-import javax.annotation.Nullable;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.core.IronChestBlocks;
-import cpw.mods.ironchest.common.core.IronChestCreativeTabs;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
-import net.minecraft.block.Block;
-import net.minecraft.block.material.EnumPushReaction;
-import net.minecraft.block.material.Material;
-import net.minecraft.block.properties.PropertyEnum;
-import net.minecraft.block.state.BlockStateContainer;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.client.util.ITooltipFlag;
-import net.minecraft.creativetab.CreativeTabs;
-import net.minecraft.entity.Entity;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.ItemStackHelper;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.Item;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.EnumBlockRenderType;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.util.text.TextFormatting;
-import net.minecraft.util.text.translation.I18n;
-import net.minecraft.world.Explosion;
-import net.minecraft.world.IBlockAccess;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.relauncher.Side;
-import net.minecraftforge.fml.relauncher.SideOnly;
-
-@SuppressWarnings("deprecation")
-public class BlockIronShulkerBox extends Block
-{
- public static final PropertyEnum
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.blocks.shulker;
-
-import cpw.mods.ironchest.common.gui.shulker.slot.ValidatingShulkerBoxSlot;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityCopperShulkerBox;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityCrystalShulkerBox;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityDiamondShulkerBox;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityGoldShulkerBox;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityObsidianShulkerBox;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntitySilverShulkerBox;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.util.IStringSerializable;
-
-public enum IronShulkerBoxType implements IStringSerializable
-{
- //@formatter:off
- IRON(54, 9, true, "_iron.png", TileEntityIronShulkerBox.class, 184, 202),
- GOLD(81, 9, true, "_gold.png", TileEntityGoldShulkerBox.class, 184, 256),
- DIAMOND(108, 12, true, "_diamond.png", TileEntityDiamondShulkerBox.class, 184, 256),
- COPPER(45, 9, false, "_copper.png", TileEntityCopperShulkerBox.class, 184, 184),
- SILVER(72, 9, false, "_silver.png", TileEntitySilverShulkerBox.class, 184, 238),
- CRYSTAL(108, 12, true, "_crystal.png", TileEntityCrystalShulkerBox.class, 238, 256),
- OBSIDIAN(108, 12, false, "_obsidian.png", TileEntityObsidianShulkerBox.class, 238, 256),
- VANILLA(0, 0, false, "", null, 0, 0);
- //@formatter:on
-
- public static final IronShulkerBoxType VALUES[] = values();
-
- public final String name;
-
- public final int size;
-
- public final int rowLength;
-
- public final boolean tieredShulkerBox;
-
- public final String modelTexture;
-
- public final Class extends TileEntityIronShulkerBox> clazz;
-
- public final int xSize;
-
- public final int ySize;
-
- private String breakTexture;
-
- //@formatter:off
- IronShulkerBoxType(int size, int rowLength, boolean tieredShulkerBox, String modelTexture, Class extends TileEntityIronShulkerBox> clazz, int xSize, int ySize)
- //@formatter:on
- {
- this.name = this.name().toLowerCase();
- this.size = size;
- this.rowLength = rowLength;
- this.tieredShulkerBox = tieredShulkerBox;
- this.modelTexture = modelTexture;
- this.clazz = clazz;
- this.xSize = xSize;
- this.ySize = ySize;
- }
-
- @Override
- public String getName()
- {
- return this.name;
- }
-
- public String getBreakTexture()
- {
- if (this.breakTexture == null)
- {
- switch (this)
- {
- case OBSIDIAN:
- {
- this.breakTexture = "minecraft:blocks/obsidian";
- break;
- }
- case VANILLA:
- {
- this.breakTexture = "minecraft:blocks/planks_oak";
- break;
- }
- default:
- {
- this.breakTexture = "ironchest:blocks/" + this.getName() + "break";
- }
- }
- }
-
- return this.breakTexture;
- }
-
- public int getRowCount()
- {
- return this.size / this.rowLength;
- }
-
- public boolean isTransparent()
- {
- return this == CRYSTAL;
- }
-
- public boolean isValidForCreativeMode()
- {
- return this != VANILLA;
- }
-
- public boolean isExplosionResistant()
- {
- return this == OBSIDIAN;
- }
-
- public Slot makeSlot(IInventory chestInventory, int index, int x, int y)
- {
- return new ValidatingShulkerBoxSlot(chestInventory, index, x, y);
- }
-
- public TileEntityIronShulkerBox makeEntity(EnumDyeColor colorIn)
- {
- switch (this)
- {
- case IRON:
- return new TileEntityIronShulkerBox(colorIn);
- case GOLD:
- return new TileEntityGoldShulkerBox(colorIn);
- case DIAMOND:
- return new TileEntityDiamondShulkerBox(colorIn);
- case COPPER:
- return new TileEntityCopperShulkerBox(colorIn);
- case SILVER:
- return new TileEntitySilverShulkerBox(colorIn);
- case CRYSTAL:
- return new TileEntityCrystalShulkerBox(colorIn);
- case OBSIDIAN:
- return new TileEntityObsidianShulkerBox(colorIn);
- default:
- return null;
- }
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/core/IronChestBlocks.java b/src/main/java/cpw/mods/ironchest/common/core/IronChestBlocks.java
deleted file mode 100644
index 7a4d7aac..00000000
--- a/src/main/java/cpw/mods/ironchest/common/core/IronChestBlocks.java
+++ /dev/null
@@ -1,187 +0,0 @@
-package cpw.mods.ironchest.common.core;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.blocks.chest.BlockIronChest;
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox;
-import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
-import cpw.mods.ironchest.common.items.chest.ItemIronChest;
-import cpw.mods.ironchest.common.items.shulker.ItemIronShulkerBox;
-import cpw.mods.ironchest.common.lib.BlockLists;
-import cpw.mods.ironchest.common.util.BlockNames;
-import net.minecraft.block.Block;
-import net.minecraft.client.renderer.block.model.ModelResourceLocation;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.Item;
-import net.minecraftforge.client.event.ModelRegistryEvent;
-import net.minecraftforge.client.model.ModelLoader;
-import net.minecraftforge.event.RegistryEvent.Register;
-import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
-import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
-import net.minecraftforge.fml.common.registry.GameRegistry;
-import net.minecraftforge.fml.common.registry.GameRegistry.ObjectHolder;
-import net.minecraftforge.registries.IForgeRegistry;
-
-public class IronChestBlocks
-{
- @ObjectHolder(BlockNames.IRON_CHEST)
- public static BlockIronChest ironChestBlock;
-
- @ObjectHolder(BlockNames.IRON_CHEST)
- public static Item ironChestItemBlock;
-
- //@formatter:off
- @ObjectHolder(BlockNames.WHITE_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxWhiteBlock;
- @ObjectHolder(BlockNames.ORANGE_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxOrangeBlock;
- @ObjectHolder(BlockNames.MAGENTA_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxMagentaBlock;
- @ObjectHolder(BlockNames.LIGHT_BLUE_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxLightBlueBlock;
- @ObjectHolder(BlockNames.YELLOW_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxYellowBlock;
- @ObjectHolder(BlockNames.LIME_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxLimeBlock;
- @ObjectHolder(BlockNames.PINK_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxPinkBlock;
- @ObjectHolder(BlockNames.GRAY_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxGrayBlock;
- @ObjectHolder(BlockNames.SILVER_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxSilverBlock;
- @ObjectHolder(BlockNames.CYAN_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxCyanBlock;
- @ObjectHolder(BlockNames.PURPLE_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxPurpleBlock;
- @ObjectHolder(BlockNames.BLUE_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxBlueBlock;
- @ObjectHolder(BlockNames.BROWN_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxBrownBlock;
- @ObjectHolder(BlockNames.GREEN_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxGreenBlock;
- @ObjectHolder(BlockNames.RED_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxRedBlock;
- @ObjectHolder(BlockNames.BLACK_SHULKER)
- public static BlockIronShulkerBox ironShulkerBoxBlackBlock;
-
- @ObjectHolder(BlockNames.WHITE_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxWhiteItemBlock;
- @ObjectHolder(BlockNames.ORANGE_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxOrangeItemBlock;
- @ObjectHolder(BlockNames.MAGENTA_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxMagentaItemBlock;
- @ObjectHolder(BlockNames.LIGHT_BLUE_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxLightBlueItemBlock;
- @ObjectHolder(BlockNames.YELLOW_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxYellowItemBlock;
- @ObjectHolder(BlockNames.LIME_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxLimeItemBlock;
- @ObjectHolder(BlockNames.PINK_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxPinkItemBlock;
- @ObjectHolder(BlockNames.GRAY_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxGrayItemBlock;
- @ObjectHolder(BlockNames.SILVER_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxSilverItemBlock;
- @ObjectHolder(BlockNames.CYAN_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxCyanItemBlock;
- @ObjectHolder(BlockNames.PURPLE_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxPurpleItemBlock;
- @ObjectHolder(BlockNames.BLUE_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxBlueItemBlock;
- @ObjectHolder(BlockNames.BROWN_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxBrownItemBlock;
- @ObjectHolder(BlockNames.GREEN_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxGreenItemBlock;
- @ObjectHolder(BlockNames.RED_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxRedItemBlock;
- @ObjectHolder(BlockNames.BLACK_SHULKER)
- public static ItemIronShulkerBox ironShulkerBoxBlackItemBlock;
- //@formatter:on
-
- @EventBusSubscriber(modid = IronChest.MOD_ID)
- public static class Registration
- {
- @SubscribeEvent
- public static void registerBlocks(Register
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.crafting.condition;
-
-import java.util.function.BooleanSupplier;
-
-import com.google.gson.JsonObject;
-
-import net.minecraft.util.JsonUtils;
-import net.minecraftforge.common.crafting.IConditionFactory;
-import net.minecraftforge.common.crafting.JsonContext;
-import net.minecraftforge.oredict.OreDictionary;
-
-public class OreDictEntryExistsConditionFactory implements IConditionFactory
-{
- @Override
- public BooleanSupplier parse(JsonContext context, JsonObject json)
- {
- String orename = JsonUtils.getString(json, "ore");
-
- if (OreDictionary.getOres(orename).isEmpty())
- {
- return () -> false;
- }
- else
- {
- return () -> true;
- }
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/crafting/recipe/ShulkerBoxColorRecipeFactory.java b/src/main/java/cpw/mods/ironchest/common/crafting/recipe/ShulkerBoxColorRecipeFactory.java
deleted file mode 100644
index 10a6b5a5..00000000
--- a/src/main/java/cpw/mods/ironchest/common/crafting/recipe/ShulkerBoxColorRecipeFactory.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.crafting.recipe;
-
-import com.google.gson.JsonObject;
-
-import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox;
-import net.minecraft.block.Block;
-import net.minecraft.init.Items;
-import net.minecraft.inventory.InventoryCrafting;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.IRecipe;
-import net.minecraft.util.NonNullList;
-import net.minecraft.world.World;
-import net.minecraftforge.common.crafting.IRecipeFactory;
-import net.minecraftforge.common.crafting.JsonContext;
-import net.minecraftforge.registries.IForgeRegistryEntry.Impl;
-
-public class ShulkerBoxColorRecipeFactory implements IRecipeFactory
-{
- @Override
- public IRecipe parse(JsonContext context, JsonObject json)
- {
- return new ShulkerBoxColorRecipe();
- }
-
- public static class ShulkerBoxColorRecipe extends Impl
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.crafting.recipe;
-
-import javax.annotation.Nonnull;
-
-import com.google.gson.JsonObject;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockShulkerBox;
-import net.minecraft.inventory.InventoryCrafting;
-import net.minecraft.item.ItemStack;
-import net.minecraft.item.crafting.IRecipe;
-import net.minecraft.util.JsonUtils;
-import net.minecraft.util.ResourceLocation;
-import net.minecraftforge.common.crafting.CraftingHelper.ShapedPrimer;
-import net.minecraftforge.common.crafting.IRecipeFactory;
-import net.minecraftforge.common.crafting.JsonContext;
-import net.minecraftforge.oredict.ShapedOreRecipe;
-
-public class ShulkerBoxRecipeFactory implements IRecipeFactory
-{
- @Override
- public IRecipe parse(JsonContext context, JsonObject json)
- {
- ShapedOreRecipe recipe = ShapedOreRecipe.factory(context, json);
-
- ShapedPrimer primer = new ShapedPrimer();
- primer.width = recipe.getRecipeWidth();
- primer.height = recipe.getRecipeHeight();
- primer.mirrored = JsonUtils.getBoolean(json, "mirrored", true);
- primer.input = recipe.getIngredients();
-
- return new ShulkerBoxRecipe(new ResourceLocation(IronChest.MOD_ID, "shulker_box_crafting"), recipe.getRecipeOutput(), primer);
- }
-
- public static class ShulkerBoxRecipe extends ShapedOreRecipe
- {
- public ShulkerBoxRecipe(ResourceLocation group, ItemStack result, ShapedPrimer primer)
- {
- super(group, result, primer);
- }
-
- @Override
- @Nonnull
- public ItemStack getCraftingResult(@Nonnull InventoryCrafting var1)
- {
- ItemStack newOutput = this.output.copy();
-
- ItemStack itemstack = ItemStack.EMPTY;
-
- for (int i = 0; i < var1.getSizeInventory(); ++i)
- {
- ItemStack stack = var1.getStackInSlot(i);
-
- if (!stack.isEmpty())
- {
- if (Block.getBlockFromItem(stack.getItem()) instanceof BlockIronShulkerBox || Block.getBlockFromItem(stack.getItem()) instanceof BlockShulkerBox)
- {
- itemstack = stack;
- }
- }
- }
-
- if (itemstack.hasTagCompound())
- {
- newOutput.setTagCompound(itemstack.getTagCompound().copy());
- }
-
- return newOutput;
- }
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/gui/chest/ContainerIronChest.java b/src/main/java/cpw/mods/ironchest/common/gui/chest/ContainerIronChest.java
deleted file mode 100755
index 019045fe..00000000
--- a/src/main/java/cpw/mods/ironchest/common/gui/chest/ContainerIronChest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.gui.chest;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import invtweaks.api.container.ChestContainer;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-@ChestContainer(isLargeChest = true)
-public class ContainerIronChest extends Container
-{
- private IronChestType type;
-
- private EntityPlayer player;
-
- private IInventory chest;
-
- public ContainerIronChest(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize)
- {
- this.chest = chestInventory;
- this.player = ((InventoryPlayer) playerInventory).player;
- this.type = type;
- chestInventory.openInventory(this.player);
- this.layoutContainer(playerInventory, chestInventory, type, xSize, ySize);
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer playerIn)
- {
- return this.chest.isUsableByPlayer(playerIn);
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
- {
- ItemStack itemstack = ItemStack.EMPTY;
- Slot slot = this.inventorySlots.get(index);
-
- if (slot != null && slot.getHasStack())
- {
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- if (index < this.type.size)
- {
- if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true))
- {
- return ItemStack.EMPTY;
- }
- }
- else if (!this.type.acceptsStack(itemstack1))
- {
- return ItemStack.EMPTY;
- }
- else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false))
- {
- return ItemStack.EMPTY;
- }
-
- if (itemstack1.isEmpty())
- {
- slot.putStack(ItemStack.EMPTY);
- }
- else
- {
- slot.onSlotChanged();
- }
- }
-
- return itemstack;
- }
-
- @Override
- public void onContainerClosed(EntityPlayer playerIn)
- {
- super.onContainerClosed(playerIn);
-
- this.chest.closeInventory(playerIn);
- }
-
- protected void layoutContainer(IInventory playerInventory, IInventory chestInventory, IronChestType type, int xSize, int ySize)
- {
- if (type == IronChestType.DIRTCHEST9000)
- {
- this.addSlotToContainer(type.makeSlot(chestInventory, 0, 12 + 4 * 18, 8 + 2 * 18));
- }
- else
- {
- for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++)
- {
- for (int chestCol = 0; chestCol < type.rowLength; chestCol++)
- {
- this.addSlotToContainer(type.makeSlot(chestInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18));
- }
- }
- }
-
- int leftCol = (xSize - 162) / 2 + 1;
-
- for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++)
- {
- for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++)
- {
- this.addSlotToContainer(
- new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10));
- }
-
- }
-
- for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++)
- {
- this.addSlotToContainer(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
- }
- }
-
- public EntityPlayer getPlayer()
- {
- return this.player;
- }
-
- @ChestContainer.RowSizeCallback
- public int getNumColumns()
- {
- return this.type.rowLength;
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java b/src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java
deleted file mode 100755
index 1985faa5..00000000
--- a/src/main/java/cpw/mods/ironchest/common/gui/chest/slot/ValidatingChestSlot.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.gui.chest.slot;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class ValidatingChestSlot extends Slot
-{
- private IronChestType type;
-
- public ValidatingChestSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition, IronChestType type)
- {
- super(inventoryIn, slotIndex, xPosition, yPosition);
- this.type = type;
- }
-
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return this.type.acceptsStack(stack);
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java
deleted file mode 100644
index 2d657e63..00000000
--- a/src/main/java/cpw/mods/ironchest/common/gui/shulker/ContainerIronShulkerBox.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.gui.shulker;
-
-import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
-import invtweaks.api.container.ChestContainer;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-@ChestContainer(isLargeChest = true)
-public class ContainerIronShulkerBox extends Container
-{
- private IronShulkerBoxType type;
-
- private EntityPlayer player;
-
- private IInventory inventory;
-
- public ContainerIronShulkerBox(IInventory playerInventory, IInventory shulkerBoxInventory, IronShulkerBoxType type, int xSize, int ySize)
- {
- this.inventory = shulkerBoxInventory;
- this.player = ((InventoryPlayer) playerInventory).player;
- this.type = type;
- shulkerBoxInventory.openInventory(this.player);
- this.layoutContainer(playerInventory, shulkerBoxInventory, type, xSize, ySize);
- }
-
- protected void layoutContainer(IInventory playerInventory, IInventory shulkerBoxInventory, IronShulkerBoxType type, int xSize, int ySize)
- {
- for (int chestRow = 0; chestRow < type.getRowCount(); chestRow++)
- {
- for (int chestCol = 0; chestCol < type.rowLength; chestCol++)
- {
- this.addSlotToContainer(type.makeSlot(shulkerBoxInventory, chestCol + chestRow * type.rowLength, 12 + chestCol * 18, 8 + chestRow * 18));
- }
- }
-
- int leftCol = (xSize - 162) / 2 + 1;
-
- for (int playerInvRow = 0; playerInvRow < 3; playerInvRow++)
- {
- for (int playerInvCol = 0; playerInvCol < 9; playerInvCol++)
- {
- //@formatter:off
- this.addSlotToContainer(new Slot(playerInventory, playerInvCol + playerInvRow * 9 + 9, leftCol + playerInvCol * 18, ySize - (4 - playerInvRow) * 18 - 10));
- //@formatter:on
- }
-
- }
-
- for (int hotbarSlot = 0; hotbarSlot < 9; hotbarSlot++)
- {
- this.addSlotToContainer(new Slot(playerInventory, hotbarSlot, leftCol + hotbarSlot * 18, ySize - 24));
- }
- }
-
- public EntityPlayer getPlayer()
- {
- return this.player;
- }
-
- /**
- * Determines whether supplied player can use this container
- */
- @Override
- public boolean canInteractWith(EntityPlayer playerIn)
- {
- return this.inventory.isUsableByPlayer(playerIn);
- }
-
- /**
- * Take a stack from the specified inventory slot.
- */
- @Override
- public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
- {
- ItemStack itemstack = ItemStack.EMPTY;
- Slot slot = this.inventorySlots.get(index);
-
- if (slot != null && slot.getHasStack())
- {
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
-
- if (index < this.type.size)
- {
- if (!this.mergeItemStack(itemstack1, this.type.size, this.inventorySlots.size(), true))
- {
- return ItemStack.EMPTY;
- }
- }
- else if (!this.mergeItemStack(itemstack1, 0, this.type.size, false))
- {
- return ItemStack.EMPTY;
- }
-
- if (itemstack1.isEmpty())
- {
- slot.putStack(ItemStack.EMPTY);
- }
- else
- {
- slot.onSlotChanged();
- }
- }
-
- return itemstack;
- }
-
- /**
- * Called when the container is closed.
- */
- @Override
- public void onContainerClosed(EntityPlayer playerIn)
- {
- super.onContainerClosed(playerIn);
-
- this.inventory.closeInventory(playerIn);
- }
-
- @ChestContainer.RowSizeCallback
- public int getNumColumns()
- {
- return this.type.rowLength;
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java b/src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java
deleted file mode 100644
index 9ce22118..00000000
--- a/src/main/java/cpw/mods/ironchest/common/gui/shulker/slot/ValidatingShulkerBoxSlot.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.gui.shulker.slot;
-
-import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockShulkerBox;
-import net.minecraft.inventory.IInventory;
-import net.minecraft.inventory.Slot;
-import net.minecraft.item.ItemStack;
-
-public class ValidatingShulkerBoxSlot extends Slot
-{
- public ValidatingShulkerBoxSlot(IInventory inventoryIn, int slotIndex, int xPosition, int yPosition)
- {
- super(inventoryIn, slotIndex, xPosition, yPosition);
- }
-
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- //@formatter:off
- return !(Block.getBlockFromItem(stack.getItem()) instanceof BlockIronShulkerBox) && !(Block.getBlockFromItem(stack.getItem()) instanceof BlockShulkerBox);
- //@formatter:on
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/items/ChestChangerType.java b/src/main/java/cpw/mods/ironchest/common/items/ChestChangerType.java
deleted file mode 100755
index de0fa602..00000000
--- a/src/main/java/cpw/mods/ironchest/common/items/ChestChangerType.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw. All rights reserved. This program and the accompanying materials are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at http://www.gnu.org/licenses/gpl.html
- *
- * Contributors: cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.items;
-
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.COPPER;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.CRYSTAL;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.DIAMOND;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.GOLD;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.IRON;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.OBSIDIAN;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.SILVER;
-import static cpw.mods.ironchest.common.blocks.chest.IronChestType.WOOD;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import cpw.mods.ironchest.common.items.chest.ItemChestChanger;
-import net.minecraft.item.Item;
-import net.minecraftforge.registries.IForgeRegistry;
-
-public enum ChestChangerType
-{
- //@formatter:off
- IRON_GOLD(IRON, GOLD, "iron_gold_chest_upgrade"),
- GOLD_DIAMOND(GOLD, DIAMOND, "gold_diamond_chest_upgrade"),
- COPPER_SILVER(COPPER, SILVER, "copper_silver_chest_upgrade"),
- SILVER_GOLD(SILVER, GOLD, "silver_gold_chest_upgrade"),
- COPPER_IRON(COPPER, IRON, "copper_iron_chest_upgrade"),
- DIAMOND_CRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_chest_upgrade"),
- WOOD_IRON(WOOD, IRON, "wood_iron_chest_upgrade"),
- WOOD_COPPER(WOOD, COPPER, "wood_copper_chest_upgrade"),
- DIAMOND_OBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_chest_upgrade");
- //@formatter:on
-
- public static final ChestChangerType[] VALUES = values();
-
- public final IronChestType source;
-
- public final IronChestType target;
-
- public final String itemName;
-
- public ItemChestChanger item;
-
- ChestChangerType(IronChestType source, IronChestType target, String itemName)
- {
- this.source = source;
- this.target = target;
- this.itemName = itemName;
- }
-
- public boolean canUpgrade(IronChestType from)
- {
- return from == this.source;
- }
-
- public ItemChestChanger buildItem(IForgeRegistry
- * Contributors: cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.items;
-
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.COPPER;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.CRYSTAL;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.DIAMOND;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.GOLD;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.IRON;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.OBSIDIAN;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.SILVER;
-import static cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType.VANILLA;
-
-import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
-import cpw.mods.ironchest.common.items.shulker.ItemShulkerBoxChanger;
-import net.minecraft.item.Item;
-import net.minecraftforge.registries.IForgeRegistry;
-
-public enum ShulkerBoxChangerType
-{
- //@formatter:off
- IRON_GOLD(IRON, GOLD, "iron_gold_shulker_upgrade"),
- GOLD_DIAMOND(GOLD, DIAMOND, "gold_diamond_shulker_upgrade"),
- COPPER_SILVER(COPPER, SILVER, "copper_silver_shulker_upgrade"),
- SILVER_GOLD(SILVER, GOLD, "silver_gold_shulker_upgrade"),
- COPPER_IRON(COPPER, IRON, "copper_iron_shulker_upgrade"),
- DIAMOND_CRYSTAL(DIAMOND, CRYSTAL, "diamond_crystal_shulker_upgrade"),
- VANILLA_IRON(VANILLA, IRON, "vanilla_iron_shulker_upgrade"),
- VANILLA_COPPER(VANILLA, COPPER, "vanilla_copper_shulker_upgrade"),
- DIAMOND_OBSIDIAN(DIAMOND, OBSIDIAN, "diamond_obsidian_shulker_upgrade");
- //@formatter:on
-
- public static final ShulkerBoxChangerType[] VALUES = values();
-
- public final IronShulkerBoxType source;
-
- public final IronShulkerBoxType target;
-
- public final String itemName;
-
- public ItemShulkerBoxChanger item;
-
- ShulkerBoxChangerType(IronShulkerBoxType source, IronShulkerBoxType target, String itemName)
- {
- this.source = source;
- this.target = target;
- this.itemName = itemName;
- }
-
- public boolean canUpgrade(IronShulkerBoxType from)
- {
- return from == this.source;
- }
-
- public ItemShulkerBoxChanger buildItem(IForgeRegistry
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.items.chest;
-
-import java.util.Locale;
-
-import cpw.mods.ironchest.common.blocks.chest.BlockIronChest;
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import cpw.mods.ironchest.common.core.IronChestBlocks;
-import cpw.mods.ironchest.common.core.IronChestCreativeTabs;
-import cpw.mods.ironchest.common.items.ChestChangerType;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import cpw.mods.ironchest.common.util.ItemTooltip;
-import net.minecraft.block.BlockChest;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.tileentity.TileEntityChest;
-import net.minecraft.util.EnumActionResult;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class ItemChestChanger extends ItemTooltip
-{
- public final ChestChangerType type;
-
- public ItemChestChanger(ChestChangerType type)
- {
- this.type = type;
- this.setMaxStackSize(1);
- this.setUnlocalizedName("ironchest.chest." + type.name().toLowerCase(Locale.US));
- this.setCreativeTab(IronChestCreativeTabs.tabIronChests);
- }
-
- /**
- * Called when a Block is right-clicked with this Item
- */
- @Override
- //@formatter:off
- public EnumActionResult onItemUseFirst(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand)
- //@formatter:on
- {
- ItemStack itemstack = playerIn.getHeldItem(hand);
-
- if (worldIn.isRemote)
- {
- return EnumActionResult.PASS;
- }
-
- if (this.type.canUpgrade(IronChestType.WOOD))
- {
- if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockChest))
- {
- return EnumActionResult.PASS;
- }
- }
- else
- {
- //@formatter:off
- if (worldIn.getBlockState(pos) != IronChestBlocks.ironChestBlock.getStateFromMeta(IronChestType.valueOf(this.type.source.getName().toUpperCase()).ordinal()))
- //@formatter:on
- {
- return EnumActionResult.PASS;
- }
- }
-
- TileEntity te = worldIn.getTileEntity(pos);
- TileEntityIronChest newchest = new TileEntityIronChest();
-
- NonNullList
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.items.chest;
-
-import java.util.Locale;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import net.minecraft.block.Block;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-
-public class ItemIronChest extends ItemBlock
-{
- public ItemIronChest(Block block)
- {
- super(block);
-
- this.setRegistryName(block.getRegistryName());
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- }
-
- @Override
- public int getMetadata(int meta)
- {
- return meta;
- }
-
- @Override
- public String getUnlocalizedName(ItemStack itemstack)
- {
- return "tile.ironchest.chest." + IronChestType.VALUES[itemstack.getMetadata()].name().toLowerCase(Locale.US);
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java b/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java
deleted file mode 100644
index c5a5351a..00000000
--- a/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemIronShulkerBox.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.items.shulker;
-
-import java.util.Locale;
-
-import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
-import net.minecraft.block.Block;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.ItemBlock;
-import net.minecraft.item.ItemStack;
-
-public class ItemIronShulkerBox extends ItemBlock
-{
- private final String colorName;
-
- public ItemIronShulkerBox(Block block, EnumDyeColor colorIn)
- {
- super(block);
-
- this.setRegistryName(block.getRegistryName());
- this.setMaxDamage(0);
- this.setHasSubtypes(true);
- this.setMaxStackSize(1);
- this.colorName = colorIn.getName();
- }
-
- @Override
- public int getMetadata(int meta)
- {
- return meta;
- }
-
- @Override
- public String getUnlocalizedName(ItemStack itemstack)
- {
- return "tile.ironchest.shulker_box." + IronShulkerBoxType.VALUES[itemstack.getMetadata()].name().toLowerCase(Locale.US) + "." + this.colorName;
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java b/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java
deleted file mode 100644
index ce22c4ad..00000000
--- a/src/main/java/cpw/mods/ironchest/common/items/shulker/ItemShulkerBoxChanger.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.items.shulker;
-
-import java.util.Locale;
-
-import cpw.mods.ironchest.common.blocks.shulker.BlockIronShulkerBox;
-import cpw.mods.ironchest.common.blocks.shulker.IronShulkerBoxType;
-import cpw.mods.ironchest.common.core.IronChestCreativeTabs;
-import cpw.mods.ironchest.common.items.ShulkerBoxChangerType;
-import cpw.mods.ironchest.common.lib.BlockLists;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
-import cpw.mods.ironchest.common.util.ItemTooltip;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockShulkerBox;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.item.EnumDyeColor;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.tileentity.TileEntityShulkerBox;
-import net.minecraft.util.EnumActionResult;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.EnumHand;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-
-public class ItemShulkerBoxChanger extends ItemTooltip
-{
- public final ShulkerBoxChangerType type;
-
- public ItemShulkerBoxChanger(ShulkerBoxChangerType type)
- {
- this.type = type;
-
- this.setMaxStackSize(1);
- this.setUnlocalizedName("ironchest.shulker_box." + type.name().toLowerCase(Locale.US));
- this.setCreativeTab(IronChestCreativeTabs.tabIronChests);
- }
-
- public EnumDyeColor getColorFromTileEntity(TileEntity te, World worldIn)
- {
- if (te != null)
- {
- if (te instanceof TileEntityIronShulkerBox)
- {
- TileEntityIronShulkerBox ironShulkerBox = (TileEntityIronShulkerBox) te;
-
- Block ironShulkerBoxBlock = worldIn.getBlockState(ironShulkerBox.getPos()).getBlock();
-
- for (int i = 0; i < BlockLists.SHULKER_BLOCKS.size(); i++)
- {
- if (BlockLists.SHULKER_BLOCKS.get(i) == ironShulkerBoxBlock)
- {
- return BlockLists.VANILLA_SHULKER_COLORS.get(i);
- }
- }
- }
- else if (te instanceof TileEntityShulkerBox)
- {
- TileEntityShulkerBox shulkerBox = (TileEntityShulkerBox) te;
-
- Block shulkerBoxBlock = worldIn.getBlockState(shulkerBox.getPos()).getBlock();
-
- for (int i = 0; i < BlockLists.VANILLA_SHULKER_BLOCKS.size(); i++)
- {
- if (BlockLists.VANILLA_SHULKER_BLOCKS.get(i) == shulkerBoxBlock)
- {
- return BlockLists.VANILLA_SHULKER_COLORS.get(i);
- }
- }
- }
- }
-
- return EnumDyeColor.PURPLE;
- }
-
- /**
- * Called when a Block is right-clicked with this Item
- */
- @Override
- //@formatter:off
- public EnumActionResult onItemUseFirst(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ, EnumHand hand)
- //@formatter:on
- {
- ItemStack itemstack = playerIn.getHeldItem(hand);
-
- if (worldIn.isRemote)
- {
- return EnumActionResult.PASS;
- }
-
- if (this.type.canUpgrade(IronShulkerBoxType.VANILLA))
- {
- if (!(worldIn.getBlockState(pos).getBlock() instanceof BlockShulkerBox))
- {
- return EnumActionResult.PASS;
- }
- }
- else
- {
- if ((worldIn.getBlockState(pos).getBlock() instanceof BlockIronShulkerBox))
- {
- //@formatter:off
- if (worldIn.getBlockState(pos) != ((BlockIronShulkerBox) worldIn.getBlockState(pos).getBlock()).getStateFromMeta(IronShulkerBoxType.valueOf(this.type.source.getName().toUpperCase()).ordinal()))
- //@formatter:on
- {
- return EnumActionResult.PASS;
- }
- }
- else
- {
- return EnumActionResult.PASS;
- }
- }
-
- TileEntity te = worldIn.getTileEntity(pos);
-
- TileEntityIronShulkerBox newShulkerBox = new TileEntityIronShulkerBox();
-
- NonNullList
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.network;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.tileentity.chest.TileEntityIronChest;
-import io.netty.buffer.ByteBuf;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.common.network.ByteBufUtils;
-import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
-import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
-import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
-
-public class MessageCrystalChestSync implements IMessage
-{
- int dimension;
- BlockPos pos;
- private NonNullList
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.network;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.tileentity.shulker.TileEntityIronShulkerBox;
-import io.netty.buffer.ByteBuf;
-import net.minecraft.item.ItemStack;
-import net.minecraft.tileentity.TileEntity;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.math.BlockPos;
-import net.minecraft.world.World;
-import net.minecraftforge.fml.common.network.ByteBufUtils;
-import net.minecraftforge.fml.common.network.simpleimpl.IMessage;
-import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler;
-import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
-
-public class MessageCrystalShulkerSync implements IMessage
-{
- int dimension;
- BlockPos pos;
- private NonNullList
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.tileentity.chest;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-
-public class TileEntityCopperChest extends TileEntityIronChest
-{
- public TileEntityCopperChest()
- {
- super(IronChestType.COPPER);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCrystalChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCrystalChest.java
deleted file mode 100755
index e0f333c4..00000000
--- a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityCrystalChest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.tileentity.chest;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-
-public class TileEntityCrystalChest extends TileEntityIronChest
-{
- public TileEntityCrystalChest()
- {
- super(IronChestType.CRYSTAL);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDiamondChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDiamondChest.java
deleted file mode 100755
index 3adf7edd..00000000
--- a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDiamondChest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.tileentity.chest;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-
-public class TileEntityDiamondChest extends TileEntityIronChest
-{
- public TileEntityDiamondChest()
- {
- super(IronChestType.DIAMOND);
- }
-}
\ No newline at end of file
diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDirtChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDirtChest.java
deleted file mode 100755
index dd802c0d..00000000
--- a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityDirtChest.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package cpw.mods.ironchest.common.tileentity.chest;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagList;
-import net.minecraft.nbt.NBTTagString;
-import net.minecraft.util.text.translation.I18n;
-
-@SuppressWarnings("deprecation")
-public class TileEntityDirtChest extends TileEntityIronChest
-{
- private static ItemStack dirtChest9000GuideBook = new ItemStack(Items.WRITTEN_BOOK);
-
- static
- {
- dirtChest9000GuideBook.setTagInfo("author", new NBTTagString("cpw"));
- dirtChest9000GuideBook.setTagInfo("title", new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.title")));
- NBTTagList pages = new NBTTagList();
- pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page1")));
- pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page2")));
- pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page3")));
- pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page4")));
- pages.appendTag(new NBTTagString(I18n.translateToLocal("book.ironchest.dirtchest9000.page5")));
- dirtChest9000GuideBook.setTagInfo("pages", pages);
- }
-
- public TileEntityDirtChest()
- {
- super(IronChestType.DIRTCHEST9000);
- }
-
- @Override
- public void wasPlaced(EntityLivingBase entityliving, ItemStack itemStack)
- {
- if (!(itemStack.hasTagCompound() && itemStack.getTagCompound().getBoolean("dirtchest")))
- {
- this.setInventorySlotContents(0, dirtChest9000GuideBook.copy());
- }
- }
-
- @Override
- public void removeAdornments()
- {
- if (!this.getItems().get(0).isEmpty() && this.getItems().get(0).isItemEqual(dirtChest9000GuideBook))
- {
- this.getItems().set(0, ItemStack.EMPTY);
- }
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityGoldChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityGoldChest.java
deleted file mode 100755
index d6f0e792..00000000
--- a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityGoldChest.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.tileentity.chest;
-
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-
-public class TileEntityGoldChest extends TileEntityIronChest
-{
- public TileEntityGoldChest()
- {
- super(IronChestType.GOLD);
- }
-}
diff --git a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityIronChest.java b/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityIronChest.java
deleted file mode 100755
index 82484179..00000000
--- a/src/main/java/cpw/mods/ironchest/common/tileentity/chest/TileEntityIronChest.java
+++ /dev/null
@@ -1,633 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 cpw.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the GNU Public License v3.0
- * which accompanies this distribution, and is available at
- * http://www.gnu.org/licenses/gpl.html
- *
- * Contributors:
- * cpw - initial API and implementation
- ******************************************************************************/
-package cpw.mods.ironchest.common.tileentity.chest;
-
-import java.util.Collections;
-import java.util.Comparator;
-
-import cpw.mods.ironchest.IronChest;
-import cpw.mods.ironchest.common.blocks.chest.BlockIronChest;
-import cpw.mods.ironchest.common.blocks.chest.IronChestType;
-import cpw.mods.ironchest.common.core.IronChestBlocks;
-import cpw.mods.ironchest.common.gui.chest.ContainerIronChest;
-import cpw.mods.ironchest.common.network.MessageCrystalChestSync;
-import net.minecraft.block.state.IBlockState;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.entity.player.InventoryPlayer;
-import net.minecraft.init.SoundEvents;
-import net.minecraft.inventory.Container;
-import net.minecraft.inventory.ItemStackHelper;
-import net.minecraft.item.ItemStack;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.network.NetworkManager;
-import net.minecraft.network.play.server.SPacketUpdateTileEntity;
-import net.minecraft.tileentity.TileEntityLockableLoot;
-import net.minecraft.util.EnumFacing;
-import net.minecraft.util.ITickable;
-import net.minecraft.util.NonNullList;
-import net.minecraft.util.SoundCategory;
-import net.minecraft.util.math.AxisAlignedBB;
-import net.minecraftforge.common.util.Constants;
-import net.minecraftforge.fml.common.network.NetworkRegistry.TargetPoint;
-
-public class TileEntityIronChest extends TileEntityLockableLoot implements ITickable
-{
- /** Chest Contents */
- public NonNullList