From 07fd93608111a20dd5eb3b92a1352ed3fa1cd32f Mon Sep 17 00:00:00 2001 From: Pahimar Date: Tue, 16 Sep 2014 22:58:54 -0400 Subject: [PATCH] Getting ready for transmutation and alchemy squares --- .../ee3/api/EnergyValueRegistryProxy.java | 13 -- .../pahimar/ee3/block/BlockAlchemySquare.java | 20 -- .../pahimar/ee3/block/BlockAlchemySymbol.java | 49 ++++ .../ee3/block/BlockTransmutationSquare.java | 54 ----- .../gui/inventory/GuiTransmutationSquare.java | 43 ---- .../handler/ItemTooltipEventHandler.java | 14 -- .../ee3/exchange/EnergyValueRegistry.java | 23 -- .../ee3/handler/ConfigurationHandler.java | 1 - .../com/pahimar/ee3/handler/GuiHandler.java | 10 - .../java/com/pahimar/ee3/init/ModBlocks.java | 4 +- .../ContainerTransmutationSquare.java | 14 -- .../com/pahimar/ee3/proxy/ClientProxy.java | 1 + .../com/pahimar/ee3/proxy/CommonProxy.java | 2 +- .../com/pahimar/ee3/reference/Messages.java | 6 - .../java/com/pahimar/ee3/reference/Names.java | 1 + .../com/pahimar/ee3/reference/RenderIds.java | 1 + .../com/pahimar/ee3/reference/Settings.java | 5 - ...uare.java => TileEntityAlchemySymbol.java} | 2 +- .../TileEntityTransmutationSquare.java | 215 ------------------ src/main/resources/assets/ee3/lang/en_US.lang | 4 - 20 files changed, 56 insertions(+), 426 deletions(-) delete mode 100644 src/main/java/com/pahimar/ee3/block/BlockAlchemySquare.java create mode 100644 src/main/java/com/pahimar/ee3/block/BlockAlchemySymbol.java delete mode 100644 src/main/java/com/pahimar/ee3/block/BlockTransmutationSquare.java delete mode 100644 src/main/java/com/pahimar/ee3/client/gui/inventory/GuiTransmutationSquare.java delete mode 100644 src/main/java/com/pahimar/ee3/inventory/ContainerTransmutationSquare.java rename src/main/java/com/pahimar/ee3/tileentity/{TileEntityAlchemySquare.java => TileEntityAlchemySymbol.java} (89%) delete mode 100644 src/main/java/com/pahimar/ee3/tileentity/TileEntityTransmutationSquare.java diff --git a/src/main/java/com/pahimar/ee3/api/EnergyValueRegistryProxy.java b/src/main/java/com/pahimar/ee3/api/EnergyValueRegistryProxy.java index 6d810f69..994b665b 100644 --- a/src/main/java/com/pahimar/ee3/api/EnergyValueRegistryProxy.java +++ b/src/main/java/com/pahimar/ee3/api/EnergyValueRegistryProxy.java @@ -115,19 +115,6 @@ public final class EnergyValueRegistryProxy return EE3Wrapper.ee3mod.getEnergyValueRegistry().getStacksInRange(start, finish); } - public static String getStageValueWasAssigned(Object object) - { - init(); - - // NOOP if EquivalentExchange3 is not present - if (ee3Mod == null) - { - return ""; - } - - return EE3Wrapper.ee3mod.getEnergyValueRegistry().getStageValueWasAssigned(object); - } - private static class EE3Wrapper { private static EquivalentExchange3 ee3mod; diff --git a/src/main/java/com/pahimar/ee3/block/BlockAlchemySquare.java b/src/main/java/com/pahimar/ee3/block/BlockAlchemySquare.java deleted file mode 100644 index cc235031..00000000 --- a/src/main/java/com/pahimar/ee3/block/BlockAlchemySquare.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.pahimar.ee3.block; - -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockAlchemySquare extends BlockEE implements ITileEntityProvider -{ - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - * - * @param p_149915_1_ - * @param p_149915_2_ - */ - @Override - public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) - { - return null; - } -} diff --git a/src/main/java/com/pahimar/ee3/block/BlockAlchemySymbol.java b/src/main/java/com/pahimar/ee3/block/BlockAlchemySymbol.java new file mode 100644 index 00000000..63890031 --- /dev/null +++ b/src/main/java/com/pahimar/ee3/block/BlockAlchemySymbol.java @@ -0,0 +1,49 @@ +package com.pahimar.ee3.block; + +import com.pahimar.ee3.reference.Names; +import com.pahimar.ee3.reference.RenderIds; +import com.pahimar.ee3.tileentity.TileEntityAlchemySymbol; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BlockAlchemySymbol extends BlockEE implements ITileEntityProvider +{ + public BlockAlchemySymbol() + { + super(Material.circuits); + this.setCreativeTab(null); + this.setBlockName(Names.Blocks.ALCHEMY_SYMBOL); + } + + @Override + public boolean renderAsNormalBlock() + { + return false; + } + + @Override + public boolean isOpaqueCube() + { + return false; + } + + @Override + public int getRenderType() + { + return RenderIds.alchemySymbol; + } + + /** + * Returns a new instance of a block's tile entity class. Called on placing the block. + * + * @param world + * @param metaData + */ + @Override + public TileEntity createNewTileEntity(World world, int metaData) + { + return new TileEntityAlchemySymbol(); + } +} diff --git a/src/main/java/com/pahimar/ee3/block/BlockTransmutationSquare.java b/src/main/java/com/pahimar/ee3/block/BlockTransmutationSquare.java deleted file mode 100644 index f59f6f57..00000000 --- a/src/main/java/com/pahimar/ee3/block/BlockTransmutationSquare.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.pahimar.ee3.block; - -import com.pahimar.ee3.EquivalentExchange3; -import com.pahimar.ee3.reference.GuiId; -import com.pahimar.ee3.reference.Names; -import com.pahimar.ee3.tileentity.TileEntityTransmutationSquare; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.block.material.Material; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class BlockTransmutationSquare extends BlockEE implements ITileEntityProvider -{ - public BlockTransmutationSquare() - { - super(Material.circuits); - this.setCreativeTab(null); - this.setBlockName(Names.Blocks.TRANSMUTATION_SQUARE); - } - - /** - * Returns a new instance of a block's tile entity class. Called on placing the block. - * - * @param world - * @param metaData - */ - @Override - public TileEntity createNewTileEntity(World world, int metaData) - { - return new TileEntityTransmutationSquare(); - } - - @Override - public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) - { - if (player.isSneaking()) - { - return false; - } - else - { - if (!world.isRemote) - { - if (world.getTileEntity(x, y, z) instanceof TileEntityTransmutationSquare) - { - player.openGui(EquivalentExchange3.instance, GuiId.TRANSMUTATION_SQUARE.ordinal(), world, x, y, z); - } - } - - return true; - } - } -} diff --git a/src/main/java/com/pahimar/ee3/client/gui/inventory/GuiTransmutationSquare.java b/src/main/java/com/pahimar/ee3/client/gui/inventory/GuiTransmutationSquare.java deleted file mode 100644 index 738e040c..00000000 --- a/src/main/java/com/pahimar/ee3/client/gui/inventory/GuiTransmutationSquare.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.pahimar.ee3.client.gui.inventory; - -import com.pahimar.ee3.inventory.ContainerTransmutationSquare; -import com.pahimar.ee3.reference.Names; -import com.pahimar.ee3.reference.Textures; -import com.pahimar.ee3.tileentity.TileEntityTransmutationSquare; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; -import org.lwjgl.opengl.GL11; - -public class GuiTransmutationSquare extends GuiContainer -{ - private TileEntityTransmutationSquare tileEntityTransmutationSquare; - - public GuiTransmutationSquare(InventoryPlayer inventoryPlayer, TileEntityTransmutationSquare tileEntityTransmutationSquare) - { - super(new ContainerTransmutationSquare(inventoryPlayer, tileEntityTransmutationSquare)); - this.tileEntityTransmutationSquare = tileEntityTransmutationSquare; - xSize = 246; - ySize = 223; - } - - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) - { - String containerName = StatCollector.translateToLocal(Names.Containers.TRANSMUTATION_SQUARE); - fontRendererObj.drawString(containerName, xSize / 2 - fontRendererObj.getStringWidth(containerName) / 2, 6, 4210752); - fontRendererObj.drawString(StatCollector.translateToLocal(Names.Containers.VANILLA_INVENTORY), 8, ySize - 96 + 2, 4210752); - } - - @Override - protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) - { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - - this.mc.getTextureManager().bindTexture(Textures.Gui.TRANSMUTATION_SQUARE); - - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } -} diff --git a/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java b/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java index 01e68603..1771d0af 100644 --- a/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java +++ b/src/main/java/com/pahimar/ee3/client/handler/ItemTooltipEventHandler.java @@ -1,11 +1,8 @@ package com.pahimar.ee3.client.handler; import com.pahimar.ee3.api.EnergyValue; -import com.pahimar.ee3.api.EnergyValueRegistryProxy; import com.pahimar.ee3.exchange.EnergyValueRegistry; import com.pahimar.ee3.exchange.WrappedStack; -import com.pahimar.ee3.reference.Settings; -import com.pahimar.ee3.skill.SkillRegistry; import com.pahimar.ee3.util.IOwnable; import com.pahimar.ee3.util.ItemHelper; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -52,17 +49,6 @@ public class ItemTooltipEventHandler { event.toolTip.add("No Exchange Energy value"); } - - if (Settings.Debug.debugMode) - { - event.toolTip.add(""); - event.toolTip.add("[DEBUG INFORMATION]"); - if (EnergyValueRegistry.getInstance().hasEnergyValue(stack)) - { - event.toolTip.add(String.format("Value was: %s", EnergyValueRegistryProxy.getStageValueWasAssigned(event.itemStack))); - } - event.toolTip.add(String.format("Can Learn: %s", SkillRegistry.canLearnItemStack(event.itemStack))); - } } if (event.itemStack.getItem() instanceof IOwnable) diff --git a/src/main/java/com/pahimar/ee3/exchange/EnergyValueRegistry.java b/src/main/java/com/pahimar/ee3/exchange/EnergyValueRegistry.java index 2b08fb28..ef83cb67 100644 --- a/src/main/java/com/pahimar/ee3/exchange/EnergyValueRegistry.java +++ b/src/main/java/com/pahimar/ee3/exchange/EnergyValueRegistry.java @@ -591,29 +591,6 @@ public class EnergyValueRegistry implements INBTTaggable return stacksInRange; } - public String getStageValueWasAssigned(Object object) - { - if (WrappedStack.canBeWrapped(object)) - { - WrappedStack wrappedStack = new WrappedStack(object); - - if (preAssignedMappings.keySet().contains(wrappedStack)) - { - return "Pre Assigned"; - } - else if (postAssignedMappings.keySet().contains(wrappedStack)) - { - return "Post Assigned"; - } - else if (hasEnergyValue(object)) - { - return "Computed"; - } - } - - return "No Value Assigned"; - } - @Override public void readFromNBT(NBTTagCompound nbtTagCompound) { diff --git a/src/main/java/com/pahimar/ee3/handler/ConfigurationHandler.java b/src/main/java/com/pahimar/ee3/handler/ConfigurationHandler.java index 8bd43db1..bcf30ebb 100644 --- a/src/main/java/com/pahimar/ee3/handler/ConfigurationHandler.java +++ b/src/main/java/com/pahimar/ee3/handler/ConfigurationHandler.java @@ -32,7 +32,6 @@ public class ConfigurationHandler Settings.Transmutation.maxKnowledgeTier = configuration.getInt(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_MAX_TIER, Messages.Configuration.CATEGORY_TRANSMUTATION, 0, 0, Short.MAX_VALUE, StatCollector.translateToLocal(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_MAX_TIER_COMMENT), Messages.Configuration.TRANSMUTATION_KNOWLEDGE_MAX_TIER_LABEL); Settings.Transmutation.useTemplateFile = configuration.getBoolean(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_TEMPLATE, Messages.Configuration.CATEGORY_TRANSMUTATION, true, StatCollector.translateToLocal(Messages.Configuration.TRANSMUTATION_KNOWLEDGE_TEMPLATE_COMMENT), Messages.Configuration.TRANSMUTATION_KNOWLEDGE_TEMPLATE_LABEL); Settings.Sounds.soundMode = ConfigurationHelper.getString(configuration, Messages.Configuration.SOUND_MODE, Configuration.CATEGORY_GENERAL, "All", StatCollector.translateToLocal(Messages.Configuration.SOUND_MODE_COMMENT), new String[]{"All", "Self", "None"}, Messages.Configuration.SOUND_MODE_LABEL); - Settings.Debug.debugMode = configuration.getBoolean(Messages.Configuration.DEBUG_MODE, Messages.Configuration.CATEGORY_DEBUG, false, StatCollector.translateToLocal(Messages.Configuration.DEBUG_MODE_COMMENT), Messages.Configuration.DEBUG_MODE_LABEL); if (configuration.hasChanged()) { diff --git a/src/main/java/com/pahimar/ee3/handler/GuiHandler.java b/src/main/java/com/pahimar/ee3/handler/GuiHandler.java index 151bc903..2867941d 100644 --- a/src/main/java/com/pahimar/ee3/handler/GuiHandler.java +++ b/src/main/java/com/pahimar/ee3/handler/GuiHandler.java @@ -52,11 +52,6 @@ public class GuiHandler implements IGuiHandler TileEntityAugmentationTable tileEntityAugmentationTable = (TileEntityAugmentationTable) world.getTileEntity(x, y, z); return new ContainerAugmentationTable(entityPlayer.inventory, tileEntityAugmentationTable); } - else if (id == GuiId.TRANSMUTATION_SQUARE.ordinal()) - { - TileEntityTransmutationSquare tileEntityTransmutationSquare = (TileEntityTransmutationSquare) world.getTileEntity(x, y, z); - return new ContainerTransmutationSquare(entityPlayer.inventory, tileEntityTransmutationSquare); - } return null; } @@ -103,11 +98,6 @@ public class GuiHandler implements IGuiHandler TileEntityAugmentationTable tileEntityAugmentationTable = (TileEntityAugmentationTable) world.getTileEntity(x, y, z); return new GuiAugmentationTable(entityPlayer.inventory, tileEntityAugmentationTable); } - else if (id == GuiId.TRANSMUTATION_SQUARE.ordinal()) - { - TileEntityTransmutationSquare tileEntityTransmutationSquare = (TileEntityTransmutationSquare) world.getTileEntity(x, y, z); - return new GuiTransmutationSquare(entityPlayer.inventory, tileEntityTransmutationSquare); - } return null; } diff --git a/src/main/java/com/pahimar/ee3/init/ModBlocks.java b/src/main/java/com/pahimar/ee3/init/ModBlocks.java index 0cf5ccf0..8e147163 100644 --- a/src/main/java/com/pahimar/ee3/init/ModBlocks.java +++ b/src/main/java/com/pahimar/ee3/init/ModBlocks.java @@ -18,7 +18,7 @@ public class ModBlocks public static final BlockEE glassBell = new BlockGlassBell(); public static final BlockEE researchStation = new BlockResearchStation(); public static final BlockEE augmentationTable = new BlockAugmentationTable(); - public static final BlockEE transmutationSquare = new BlockTransmutationSquare(); + public static final BlockEE alchemySymbol = new BlockAlchemySymbol(); public static void init() { @@ -30,6 +30,6 @@ public class ModBlocks GameRegistry.registerBlock(alchemicalChest, ItemBlockAlchemicalChest.class, Names.Blocks.ALCHEMICAL_CHEST); GameRegistry.registerBlock(chalkBlock, Names.Blocks.CHALK); GameRegistry.registerBlock(alchemicalFuelBlock, ItemBlockAlchemicalFuel.class, Names.Blocks.ALCHEMICAL_FUEL); - GameRegistry.registerBlock(transmutationSquare, Names.Blocks.TRANSMUTATION_SQUARE); + GameRegistry.registerBlock(alchemySymbol, Names.Blocks.ALCHEMY_SYMBOL); } } diff --git a/src/main/java/com/pahimar/ee3/inventory/ContainerTransmutationSquare.java b/src/main/java/com/pahimar/ee3/inventory/ContainerTransmutationSquare.java deleted file mode 100644 index 5ce1f673..00000000 --- a/src/main/java/com/pahimar/ee3/inventory/ContainerTransmutationSquare.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.pahimar.ee3.inventory; - -import com.pahimar.ee3.tileentity.TileEntityTransmutationSquare; -import net.minecraft.entity.player.InventoryPlayer; - -public class ContainerTransmutationSquare extends ContainerEE -{ - private TileEntityTransmutationSquare tileEntityTransmutationSquare; - - public ContainerTransmutationSquare(InventoryPlayer inventoryPlayer, TileEntityTransmutationSquare tileEntityTransmutationSquare) - { - this.tileEntityTransmutationSquare = tileEntityTransmutationSquare; - } -} diff --git a/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java b/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java index 466188bc..5e0f54a0 100644 --- a/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java +++ b/src/main/java/com/pahimar/ee3/proxy/ClientProxy.java @@ -52,6 +52,7 @@ public class ClientProxy extends CommonProxy RenderIds.glassBell = RenderingRegistry.getNextAvailableRenderId(); RenderIds.researchStation = RenderingRegistry.getNextAvailableRenderId(); RenderIds.augmentationTable = RenderingRegistry.getNextAvailableRenderId(); + RenderIds.alchemySymbol = RenderingRegistry.getNextAvailableRenderId(); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.alchemicalChest), new ItemRendererAlchemicalChest()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(ModBlocks.aludel), new ItemRendererAludel()); diff --git a/src/main/java/com/pahimar/ee3/proxy/CommonProxy.java b/src/main/java/com/pahimar/ee3/proxy/CommonProxy.java index da5331a0..ef50dbcc 100644 --- a/src/main/java/com/pahimar/ee3/proxy/CommonProxy.java +++ b/src/main/java/com/pahimar/ee3/proxy/CommonProxy.java @@ -36,6 +36,6 @@ public abstract class CommonProxy implements IProxy GameRegistry.registerTileEntityWithAlternatives(TileEntityGlassBell.class, Names.Blocks.GLASS_BELL, "tile." + Names.Blocks.GLASS_BELL); GameRegistry.registerTileEntity(TileEntityResearchStation.class, Names.Blocks.RESEARCH_STATION); GameRegistry.registerTileEntity(TileEntityAugmentationTable.class, Names.Blocks.AUGMENTATION_TABLE); - GameRegistry.registerTileEntity(TileEntityTransmutationSquare.class, Names.Blocks.TRANSMUTATION_SQUARE); + GameRegistry.registerTileEntity(TileEntityAlchemySymbol.class, Names.Blocks.ALCHEMY_SYMBOL); } } diff --git a/src/main/java/com/pahimar/ee3/reference/Messages.java b/src/main/java/com/pahimar/ee3/reference/Messages.java index 19493374..4a05e82a 100644 --- a/src/main/java/com/pahimar/ee3/reference/Messages.java +++ b/src/main/java/com/pahimar/ee3/reference/Messages.java @@ -11,12 +11,6 @@ public final class Messages public static final class Configuration { - public static final String CATEGORY_DEBUG = "general.debug"; - - public static final String DEBUG_MODE = "debugMode"; - public static final String DEBUG_MODE_LABEL = "general.debug.mode.label"; - public static final String DEBUG_MODE_COMMENT = "general.debug.mode.comment"; - public static final String GENERAL_SYNC_THRESHOLD = "sync.threshold"; public static final String GENERAL_SYNC_THRESHOLD_LABEL = "general.sync.threshold.label"; public static final String GENERAL_SYNC_THRESHOLD_COMMENT = "general.sync.threshold.comment"; diff --git a/src/main/java/com/pahimar/ee3/reference/Names.java b/src/main/java/com/pahimar/ee3/reference/Names.java index f133a079..16aaa3c6 100644 --- a/src/main/java/com/pahimar/ee3/reference/Names.java +++ b/src/main/java/com/pahimar/ee3/reference/Names.java @@ -13,6 +13,7 @@ public class Names public static final String RESEARCH_STATION = "researchStation"; public static final String AUGMENTATION_TABLE = "augmentationTable"; public static final String TRANSMUTATION_SQUARE = "transmutationSquare"; + public static final String ALCHEMY_SYMBOL = "alchemySymbol"; } public static final class Items diff --git a/src/main/java/com/pahimar/ee3/reference/RenderIds.java b/src/main/java/com/pahimar/ee3/reference/RenderIds.java index 3b45dbf4..ccba3f7b 100644 --- a/src/main/java/com/pahimar/ee3/reference/RenderIds.java +++ b/src/main/java/com/pahimar/ee3/reference/RenderIds.java @@ -8,4 +8,5 @@ public class RenderIds public static int glassBell; public static int researchStation; public static int augmentationTable; + public static int alchemySymbol; } diff --git a/src/main/java/com/pahimar/ee3/reference/Settings.java b/src/main/java/com/pahimar/ee3/reference/Settings.java index c2fd659c..9920f529 100644 --- a/src/main/java/com/pahimar/ee3/reference/Settings.java +++ b/src/main/java/com/pahimar/ee3/reference/Settings.java @@ -2,11 +2,6 @@ package com.pahimar.ee3.reference; public class Settings { - public static class Debug - { - public static boolean debugMode; - } - public static class General { public static int syncThreshold; diff --git a/src/main/java/com/pahimar/ee3/tileentity/TileEntityAlchemySquare.java b/src/main/java/com/pahimar/ee3/tileentity/TileEntityAlchemySymbol.java similarity index 89% rename from src/main/java/com/pahimar/ee3/tileentity/TileEntityAlchemySquare.java rename to src/main/java/com/pahimar/ee3/tileentity/TileEntityAlchemySymbol.java index e57895b8..ef7081de 100644 --- a/src/main/java/com/pahimar/ee3/tileentity/TileEntityAlchemySquare.java +++ b/src/main/java/com/pahimar/ee3/tileentity/TileEntityAlchemySymbol.java @@ -1,6 +1,6 @@ package com.pahimar.ee3.tileentity; -public class TileEntityAlchemySquare extends TileEntityEE +public class TileEntityAlchemySymbol extends TileEntityEE { /** * Shape (3 bits): diff --git a/src/main/java/com/pahimar/ee3/tileentity/TileEntityTransmutationSquare.java b/src/main/java/com/pahimar/ee3/tileentity/TileEntityTransmutationSquare.java deleted file mode 100644 index ede5b8d0..00000000 --- a/src/main/java/com/pahimar/ee3/tileentity/TileEntityTransmutationSquare.java +++ /dev/null @@ -1,215 +0,0 @@ -package com.pahimar.ee3.tileentity; - -import com.pahimar.ee3.api.EnergyValue; -import com.pahimar.ee3.reference.Names; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -public class TileEntityTransmutationSquare extends TileEntityEE implements IInventory -{ - public static final int INVENTORY_SIZE = 9; - - private ItemStack[] inventory; - private EnergyValue currentEnergyValue; - private int tier; - - public TileEntityTransmutationSquare() - { - inventory = new ItemStack[INVENTORY_SIZE]; - } - - /** - * Returns the number of slots in the inventory. - */ - @Override - public int getSizeInventory() - { - return inventory.length; - } - - /** - * Returns the stack in slot i - * - * @param slotIndex - */ - @Override - public ItemStack getStackInSlot(int slotIndex) - { - return inventory[slotIndex]; - } - - /** - * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a - * new stack. - * - * @param slotIndex - * @param decrementAmount - */ - @Override - public ItemStack decrStackSize(int slotIndex, int decrementAmount) - { - ItemStack itemStack = getStackInSlot(slotIndex); - if (itemStack != null) - { - if (itemStack.stackSize <= decrementAmount) - { - setInventorySlotContents(slotIndex, null); - } - else - { - itemStack = itemStack.splitStack(decrementAmount); - if (itemStack.stackSize == 0) - { - setInventorySlotContents(slotIndex, null); - } - } - } - - return itemStack; - } - - /** - * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - - * like when you close a workbench GUI. - * - * @param slotIndex - */ - @Override - public ItemStack getStackInSlotOnClosing(int slotIndex) - { - ItemStack itemStack = getStackInSlot(slotIndex); - if (itemStack != null) - { - setInventorySlotContents(slotIndex, null); - } - return itemStack; - } - - /** - * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). - * - * @param slotIndex - * @param itemStack - */ - @Override - public void setInventorySlotContents(int slotIndex, ItemStack itemStack) - { - inventory[slotIndex] = itemStack; - if (itemStack != null && itemStack.stackSize > getInventoryStackLimit()) - { - itemStack.stackSize = getInventoryStackLimit(); - } - } - - /** - * Returns the name of the inventory - */ - @Override - public String getInventoryName() - { - return this.hasCustomName() ? this.getCustomName() : Names.Containers.TRANSMUTATION_SQUARE; - } - - /** - * Returns if the inventory is named - */ - @Override - public boolean hasCustomInventoryName() - { - return this.hasCustomName(); - } - - /** - * Returns the maximum stack size for a inventory slot. - */ - @Override - public int getInventoryStackLimit() - { - return 64; - } - - /** - * Do not make give this method the name canInteractWith because it clashes with Container - * - * @param entityPlayer - */ - @Override - public boolean isUseableByPlayer(EntityPlayer entityPlayer) - { - return true; - } - - @Override - public void openInventory() - { - // NOOP - } - - @Override - public void closeInventory() - { - // NOOP - } - - /** - * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. - * - * @param slotIndex - * @param itemStack - */ - @Override - public boolean isItemValidForSlot(int slotIndex, ItemStack itemStack) - { - return false; - } - - @Override - public void writeToNBT(NBTTagCompound nbtTagCompound) - { - super.writeToNBT(nbtTagCompound); - - // Write the ItemStacks in the inventory to NBT - NBTTagList tagList = new NBTTagList(); - for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) - { - if (inventory[currentIndex] != null) - { - NBTTagCompound tagCompound = new NBTTagCompound(); - tagCompound.setByte("Slot", (byte) currentIndex); - inventory[currentIndex].writeToNBT(tagCompound); - tagList.appendTag(tagCompound); - } - } - nbtTagCompound.setTag(Names.NBT.ITEMS, tagList); - nbtTagCompound.setInteger("tier", tier); - } - - @Override - public void readFromNBT(NBTTagCompound nbtTagCompound) - { - super.readFromNBT(nbtTagCompound); - - // Read in the ItemStacks in the inventory from NBT - NBTTagList tagList = nbtTagCompound.getTagList(Names.NBT.ITEMS, 10); - inventory = new ItemStack[this.getSizeInventory()]; - for (int i = 0; i < tagList.tagCount(); ++i) - { - NBTTagCompound tagCompound = tagList.getCompoundTagAt(i); - byte slotIndex = tagCompound.getByte("Slot"); - if (slotIndex >= 0 && slotIndex < inventory.length) - { - inventory[slotIndex] = ItemStack.loadItemStackFromNBT(tagCompound); - } - } - tier = nbtTagCompound.getInteger("tier"); - } - - @Override - public void updateEntity() - { - - } -} diff --git a/src/main/resources/assets/ee3/lang/en_US.lang b/src/main/resources/assets/ee3/lang/en_US.lang index 43184a8e..efd0d34e 100644 --- a/src/main/resources/assets/ee3/lang/en_US.lang +++ b/src/main/resources/assets/ee3/lang/en_US.lang @@ -15,10 +15,6 @@ general.transmutation.knowledge.template.comment=If true, new player's will have general.sound.soundMode.label=Sounds general.sound.soundMode.comment='All' plays mod sounds from all players, 'Self' only plays mod sounds from you, and 'None' plays no mod sounds -general.debug=Debug Settings -general.debug.mode.label=Debug Mode Enabled -general.debug.mode.comment=Toggles whether or not debug mode is enabled (Note: This is primarily for modders testing mod interaction with Equivalent Exchange 3) - # Keys key.categories.ee3=Equivalent Exchange 3 key.charge=Charge