From f07e52a5ee5289b35bdc009b944580d0cd09ef19 Mon Sep 17 00:00:00 2001 From: pahimar Date: Fri, 6 Sep 2013 22:47:12 -0400 Subject: [PATCH] Code formatting and import organizing --- .../com/pahimar/ee3/EquivalentExchange3.java | 163 +++++++++--------- .../ee3/block/BlockAlchemicalChest.java | 8 +- .../pahimar/ee3/block/BlockAlchemyTable.java | 66 +++---- .../pahimar/ee3/block/BlockAludelBase.java | 8 +- .../pahimar/ee3/block/BlockCalcinator.java | 8 +- common/com/pahimar/ee3/block/BlockEE.java | 6 +- .../com/pahimar/ee3/block/BlockGlassBell.java | 8 +- .../ee3/block/BlockRedWaterFlowing.java | 8 +- .../pahimar/ee3/block/BlockRedWaterStill.java | 8 +- .../pahimar/ee3/block/BlockRenderingTank.java | 36 ++-- .../gui/inventory/GuiAlchemicalBag.java | 70 ++++---- .../gui/inventory/GuiAlchemicalChest.java | 4 +- .../client/gui/inventory/GuiAlchemyTable.java | 25 +-- .../client/gui/inventory/GuiCalcinator.java | 4 +- .../inventory/GuiPortableTransmutation.java | 1 + .../ee3/client/model/ModelAlchemyTable.java | 2 +- .../ee3/client/model/ModelRenderingTank.java | 18 +- .../item/ItemRenderingTankRenderer.java | 80 ++++----- .../TileEntityCalcinatorRenderer.java | 1 + .../TileEntityRenderingTankRenderer.java | 20 +-- common/com/pahimar/ee3/command/CommandEE.java | 11 +- .../pahimar/ee3/command/CommandOverlay.java | 10 +- .../com/pahimar/ee3/core/util/ItemUtil.java | 142 +++++++-------- .../pahimar/ee3/core/util/RecipeHelper.java | 44 ++--- .../ee3/core/util/ResourceLocationHelper.java | 20 +-- .../pahimar/ee3/core/util/VersionHelper.java | 16 +- .../ee3/creativetab/CreativeTabEE3.java | 22 +-- common/com/pahimar/ee3/emc/DynEMC.java | 81 ++++----- common/com/pahimar/ee3/emc/EmcBlackList.java | 16 +- common/com/pahimar/ee3/emc/EmcComponent.java | 28 +-- common/com/pahimar/ee3/emc/EmcRegistry.java | 34 ++-- common/com/pahimar/ee3/emc/EmcType.java | 8 +- common/com/pahimar/ee3/emc/EmcValue.java | 112 ++++++------ .../ee3/emc/graph/WeightedDirectedGraph.java | 2 +- .../ee3/inventory/ContainerAlchemyTable.java | 25 +-- .../pahimar/ee3/item/ItemAlchemicalChalk.java | 8 +- .../pahimar/ee3/item/ItemAlchemicalDust.java | 6 +- common/com/pahimar/ee3/item/ModItems.java | 2 +- .../ee3/item/crafting/RecipeRegistry.java | 72 ++++---- .../ee3/item/crafting/RecipesVanilla.java | 2 +- common/com/pahimar/ee3/lib/InterModComms.java | 4 +- common/com/pahimar/ee3/lib/Models.java | 2 +- common/com/pahimar/ee3/lib/RenderIds.java | 2 +- common/com/pahimar/ee3/lib/Strings.java | 2 +- common/com/pahimar/ee3/nbt/NBTHelper.java | 64 +++---- .../ee3/tileentity/TileAlchemyTable.java | 129 +++++++------- .../ee3/tileentity/TileRenderingTank.java | 6 +- 47 files changed, 708 insertions(+), 706 deletions(-) diff --git a/common/com/pahimar/ee3/EquivalentExchange3.java b/common/com/pahimar/ee3/EquivalentExchange3.java index 0b5b6b57..adfc9e0b 100644 --- a/common/com/pahimar/ee3/EquivalentExchange3.java +++ b/common/com/pahimar/ee3/EquivalentExchange3.java @@ -65,122 +65,121 @@ import cpw.mods.fml.relauncher.Side; @NetworkMod(channels = { Reference.CHANNEL_NAME }, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class EquivalentExchange3 { - @Instance(Reference.MOD_ID) - public static EquivalentExchange3 instance; + @Instance(Reference.MOD_ID) + public static EquivalentExchange3 instance; - @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) - public static CommonProxy proxy; + @SidedProxy(clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS) + public static CommonProxy proxy; - public static CreativeTabs tabsEE3 = new CreativeTabEE3(CreativeTabs.getNextID(), Reference.MOD_ID); + public static CreativeTabs tabsEE3 = new CreativeTabEE3(CreativeTabs.getNextID(), Reference.MOD_ID); - @EventHandler - public void invalidFingerprint(FMLFingerprintViolationEvent event) { + @EventHandler + public void invalidFingerprint(FMLFingerprintViolationEvent event) { - // Report (log) to the user that the version of Equivalent Exchange 3 - // they are using has been changed/tampered with - if (Reference.FINGERPRINT.equals("@FINGERPRINT@")) { - LogHelper.warning(Strings.NO_FINGERPRINT_MESSAGE); - } - else { - LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE); - } - } + // Report (log) to the user that the version of Equivalent Exchange 3 + // they are using has been changed/tampered with + if (Reference.FINGERPRINT.equals("@FINGERPRINT@")) { + LogHelper.warning(Strings.NO_FINGERPRINT_MESSAGE); + } + else { + LogHelper.severe(Strings.INVALID_FINGERPRINT_MESSAGE); + } + } - @EventHandler - public void serverStarting(FMLServerStartingEvent event) { + @EventHandler + public void serverStarting(FMLServerStartingEvent event) { - // Initialize the custom commands - CommandHandler.initCommands(event); - } + // Initialize the custom commands + CommandHandler.initCommands(event); + } - @EventHandler - public void preInit(FMLPreInitializationEvent event) { + @EventHandler + public void preInit(FMLPreInitializationEvent event) { - // Initialize the log helper - LogHelper.init(); + // Initialize the log helper + LogHelper.init(); - // Initialize the configuration - ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg")); + // Initialize the configuration + ConfigurationHandler.init(new File(event.getModConfigurationDirectory().getAbsolutePath() + File.separator + Reference.CHANNEL_NAME + File.separator + Reference.MOD_ID + ".cfg")); - // Conduct the version check and log the result - VersionHelper.execute(); + // Conduct the version check and log the result + VersionHelper.execute(); - // Initialize the Version Check Tick Handler (Client only) - TickRegistry.registerTickHandler(new VersionCheckTickHandler(), - Side.CLIENT); + // Initialize the Version Check Tick Handler (Client only) + TickRegistry.registerTickHandler(new VersionCheckTickHandler(), Side.CLIENT); - // Initialize the Render Tick Handler (Client only) - proxy.registerRenderTickHandler(); + // Initialize the Render Tick Handler (Client only) + proxy.registerRenderTickHandler(); - // Register the KeyBinding Handler (Client only) - proxy.registerKeyBindingHandler(); + // Register the KeyBinding Handler (Client only) + proxy.registerKeyBindingHandler(); - // Register the Sound Handler (Client only) - proxy.registerSoundHandler(); + // Register the Sound Handler (Client only) + proxy.registerSoundHandler(); - // Initialize mod blocks - ModBlocks.init(); + // Initialize mod blocks + ModBlocks.init(); - // Initialize mod items - ModItems.init(); - } + // Initialize mod items + ModItems.init(); + } - @EventHandler - @SuppressWarnings("unchecked") - public void load(FMLInitializationEvent event) { + @EventHandler + @SuppressWarnings("unchecked") + public void load(FMLInitializationEvent event) { - // Register the GUI Handler - NetworkRegistry.instance().registerGuiHandler(instance, proxy); + // Register the GUI Handler + NetworkRegistry.instance().registerGuiHandler(instance, proxy); - // Register the PlayerDestroyItem Handler - MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler()); + // Register the PlayerDestroyItem Handler + MinecraftForge.EVENT_BUS.register(new PlayerDestroyItemHandler()); - // Register the Item Pickup Handler - MinecraftForge.EVENT_BUS.register(new ItemEventHandler()); + // Register the Item Pickup Handler + MinecraftForge.EVENT_BUS.register(new ItemEventHandler()); - // Register the EntityLiving Handler - MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); + // Register the EntityLiving Handler + MinecraftForge.EVENT_BUS.register(new EntityLivingHandler()); - MinecraftForge.EVENT_BUS.register(new ActionRequestHandler()); + MinecraftForge.EVENT_BUS.register(new ActionRequestHandler()); - MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler()); + MinecraftForge.EVENT_BUS.register(new WorldTransmutationHandler()); - GameRegistry.registerCraftingHandler(new CraftingHandler()); + GameRegistry.registerCraftingHandler(new CraftingHandler()); - // Register the DrawBlockHighlight Handler - proxy.registerDrawBlockHighlightHandler(); + // Register the DrawBlockHighlight Handler + proxy.registerDrawBlockHighlightHandler(); - // Initialize mod tile entities - proxy.registerTileEntities(); + // Initialize mod tile entities + proxy.registerTileEntities(); - // Initialize custom rendering and pre-load textures (Client only) - proxy.initRenderingAndTextures(); + // Initialize custom rendering and pre-load textures (Client only) + proxy.initRenderingAndTextures(); - // Add in the ability to dye Alchemical Bags - CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes()); + // Add in the ability to dye Alchemical Bags + CraftingManager.getInstance().getRecipeList().add(new RecipesAlchemicalBagDyes()); - // Register the Fuel Handler - GameRegistry.registerFuelHandler(new FuelHandler()); + // Register the Fuel Handler + GameRegistry.registerFuelHandler(new FuelHandler()); - // Quick test to see that sending an encoded recipe to be added to the - // recipe registry works - FMLInterModComms.sendMessage(Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT(Item.bucketWater, Arrays.asList(Item.bucketEmpty, Block.waterStill))); - FMLInterModComms.sendMessage(Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT(Item.bucketLava, Arrays.asList(Item.bucketEmpty, Block.lavaStill))); - } + // Quick test to see that sending an encoded recipe to be added to the + // recipe registry works + FMLInterModComms.sendMessage(Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT(Item.bucketWater, Arrays.asList(Item.bucketEmpty, Block.waterStill))); + FMLInterModComms.sendMessage(Reference.MOD_ID, InterModComms.ADD_RECIPE, NBTHelper.encodeRecipeAsNBT(Item.bucketLava, Arrays.asList(Item.bucketEmpty, Block.lavaStill))); + } - @EventHandler - public void modsLoaded(FMLPostInitializationEvent event) { + @EventHandler + public void modsLoaded(FMLPostInitializationEvent event) { - // Initialize the Addon Handler - AddonHandler.init(); + // Initialize the Addon Handler + AddonHandler.init(); - // Initialize the DynEMC system + // Initialize the DynEMC system DynEMC dynEMC = DynEMC.getInstance(); - } + } - @EventHandler - public void handleIMCMessages(IMCEvent event) { + @EventHandler + public void handleIMCMessages(IMCEvent event) { - InterModCommsHandler.processIMCMessages(event); - } + InterModCommsHandler.processIMCMessages(event); + } } diff --git a/common/com/pahimar/ee3/block/BlockAlchemicalChest.java b/common/com/pahimar/ee3/block/BlockAlchemicalChest.java index 0182b6cf..ade874b5 100644 --- a/common/com/pahimar/ee3/block/BlockAlchemicalChest.java +++ b/common/com/pahimar/ee3/block/BlockAlchemicalChest.java @@ -42,16 +42,16 @@ public class BlockAlchemicalChest extends BlockEE { this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); this.setCreativeTab(EquivalentExchange3.tabsEE3); } - + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.ALCHEMICAL_CHEST_NAME); - + return unlocalizedName.toString(); } diff --git a/common/com/pahimar/ee3/block/BlockAlchemyTable.java b/common/com/pahimar/ee3/block/BlockAlchemyTable.java index 07301827..2f652822 100644 --- a/common/com/pahimar/ee3/block/BlockAlchemyTable.java +++ b/common/com/pahimar/ee3/block/BlockAlchemyTable.java @@ -10,47 +10,47 @@ import com.pahimar.ee3.tileentity.TileAlchemyTable; public class BlockAlchemyTable extends BlockEE { - public BlockAlchemyTable(int id) { - - super(id, Material.iron); - this.setUnlocalizedName(Strings.ALCHEMY_TABLE_NAME); + public BlockAlchemyTable(int id) { + + super(id, Material.iron); + this.setUnlocalizedName(Strings.ALCHEMY_TABLE_NAME); this.setCreativeTab(EquivalentExchange3.tabsEE3); - } - - @Override + } + + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.ALCHEMY_TABLE_NAME); - + return unlocalizedName.toString(); } - - // TODO Finish getting the rendering nice looking -// @Override -// public boolean renderAsNormalBlock() { -// -// return false; -// } -// -// @Override -// public boolean isOpaqueCube() { -// -// return false; -// } -// -// @Override -// public int getRenderType() { -// -// return RenderIds.alchemyTable; -// } - @Override - public TileEntity createNewTileEntity(World world) { + // TODO Finish getting the rendering nice looking + // @Override + // public boolean renderAsNormalBlock() { + // + // return false; + // } + // + // @Override + // public boolean isOpaqueCube() { + // + // return false; + // } + // + // @Override + // public int getRenderType() { + // + // return RenderIds.alchemyTable; + // } - return new TileAlchemyTable(); - } + @Override + public TileEntity createNewTileEntity(World world) { + + return new TileAlchemyTable(); + } } diff --git a/common/com/pahimar/ee3/block/BlockAludelBase.java b/common/com/pahimar/ee3/block/BlockAludelBase.java index 2d8d02da..5c5c1106 100644 --- a/common/com/pahimar/ee3/block/BlockAludelBase.java +++ b/common/com/pahimar/ee3/block/BlockAludelBase.java @@ -46,16 +46,16 @@ public class BlockAludelBase extends BlockEE { this.setBlockBounds(0.0625F, 0.0F, 0.0625F, 0.9375F, 1.0F, 0.9375F); this.setHardness(5F); } - + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.ALUDEL_NAME); - + return unlocalizedName.toString(); } diff --git a/common/com/pahimar/ee3/block/BlockCalcinator.java b/common/com/pahimar/ee3/block/BlockCalcinator.java index fb158424..89cc1a8d 100644 --- a/common/com/pahimar/ee3/block/BlockCalcinator.java +++ b/common/com/pahimar/ee3/block/BlockCalcinator.java @@ -42,16 +42,16 @@ public class BlockCalcinator extends BlockEE { this.setHardness(5F); this.setBlockBounds(0.1F, 0.0F, 0.1F, 0.9F, 1.0F, 0.9F); } - + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.CALCINATOR_NAME); - + return unlocalizedName.toString(); } diff --git a/common/com/pahimar/ee3/block/BlockEE.java b/common/com/pahimar/ee3/block/BlockEE.java index 1e54bc01..b9526c0f 100644 --- a/common/com/pahimar/ee3/block/BlockEE.java +++ b/common/com/pahimar/ee3/block/BlockEE.java @@ -37,10 +37,10 @@ public abstract class BlockEE extends BlockContainer { blockIcon = iconRegister.registerIcon(String.format("%s:%s", Reference.MOD_ID.toLowerCase(), getUnwrappedUnlocalizedName(this.getUnlocalizedName()))); } - + protected String getUnwrappedUnlocalizedName(String unlocalizedName) { - - return unlocalizedName.substring(unlocalizedName.indexOf(":") + 1); + + return unlocalizedName.substring(unlocalizedName.indexOf(":") + 1); } /** diff --git a/common/com/pahimar/ee3/block/BlockGlassBell.java b/common/com/pahimar/ee3/block/BlockGlassBell.java index 879806bf..98a86f34 100644 --- a/common/com/pahimar/ee3/block/BlockGlassBell.java +++ b/common/com/pahimar/ee3/block/BlockGlassBell.java @@ -40,16 +40,16 @@ public class BlockGlassBell extends BlockEE { this.setCreativeTab(EquivalentExchange3.tabsEE3); this.setHardness(1.0F); } - + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.GLASS_BELL_NAME); - + return unlocalizedName.toString(); } diff --git a/common/com/pahimar/ee3/block/BlockRedWaterFlowing.java b/common/com/pahimar/ee3/block/BlockRedWaterFlowing.java index 88ba0b53..4e25c812 100644 --- a/common/com/pahimar/ee3/block/BlockRedWaterFlowing.java +++ b/common/com/pahimar/ee3/block/BlockRedWaterFlowing.java @@ -25,16 +25,16 @@ public class BlockRedWaterFlowing extends BlockFlowing { this.setCreativeTab(EquivalentExchange3.tabsEE3); this.setUnlocalizedName(Strings.RED_WATER_FLOWING_NAME); } - + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.RED_WATER_FLOWING_NAME); - + return unlocalizedName.toString(); } } diff --git a/common/com/pahimar/ee3/block/BlockRedWaterStill.java b/common/com/pahimar/ee3/block/BlockRedWaterStill.java index 2524a195..6e691bac 100644 --- a/common/com/pahimar/ee3/block/BlockRedWaterStill.java +++ b/common/com/pahimar/ee3/block/BlockRedWaterStill.java @@ -26,16 +26,16 @@ public class BlockRedWaterStill extends BlockStationary { this.setCreativeTab(EquivalentExchange3.tabsEE3); this.disableStats(); } - + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.RED_WATER_STILL_NAME); - + return unlocalizedName.toString(); } } diff --git a/common/com/pahimar/ee3/block/BlockRenderingTank.java b/common/com/pahimar/ee3/block/BlockRenderingTank.java index 2b1dd1e5..e8361945 100644 --- a/common/com/pahimar/ee3/block/BlockRenderingTank.java +++ b/common/com/pahimar/ee3/block/BlockRenderingTank.java @@ -11,27 +11,27 @@ import com.pahimar.ee3.tileentity.TileRenderingTank; public class BlockRenderingTank extends BlockEE { - public BlockRenderingTank(int id) { - - super(id, Material.anvil); - this.setUnlocalizedName(Strings.RENDERING_TANK_NAME); - this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 3.0F, 1.0F); + public BlockRenderingTank(int id) { + + super(id, Material.anvil); + this.setUnlocalizedName(Strings.RENDERING_TANK_NAME); + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 3.0F, 1.0F); this.setCreativeTab(EquivalentExchange3.tabsEE3); - } - - @Override + } + + @Override public String getUnlocalizedName() { - + StringBuilder unlocalizedName = new StringBuilder(); - + unlocalizedName.append("tile."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.RENDERING_TANK_NAME); - + return unlocalizedName.toString(); } - - @Override + + @Override public boolean renderAsNormalBlock() { return false; @@ -49,10 +49,10 @@ public class BlockRenderingTank extends BlockEE { return RenderIds.renderingTank; } - @Override - public TileEntity createNewTileEntity(World world) { - - return new TileRenderingTank(); - } + @Override + public TileEntity createNewTileEntity(World world) { + + return new TileRenderingTank(); + } } diff --git a/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java b/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java index 15674a1f..8d04c567 100644 --- a/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java +++ b/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalBag.java @@ -27,52 +27,46 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiAlchemicalBag extends GuiContainer { - public GuiAlchemicalBag(InventoryPlayer inventoryPlayer) { + public GuiAlchemicalBag(InventoryPlayer inventoryPlayer) { - super(new ContainerAlchemicalBag(inventoryPlayer)); - xSize = 248; - ySize = 186; - } + super(new ContainerAlchemicalBag(inventoryPlayer)); + xSize = 248; + ySize = 186; + } - @Override - protected void drawGuiContainerForegroundLayer(int x, int y) { + @Override + protected void drawGuiContainerForegroundLayer(int x, int y) { - fontRenderer.drawString(StatCollector - .translateToLocal(Strings.CONTAINER_ALCHEMICAL_BAG_NAME), 8, 6, - 4210752); - fontRenderer.drawString( - StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), - 44, ySize - 96 + 2, 4210752); - } + fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_ALCHEMICAL_BAG_NAME), 8, 6, 4210752); + fontRenderer.drawString(StatCollector.translateToLocal(Strings.CONTAINER_INVENTORY), 44, ySize - 96 + 2, 4210752); + } - @Override - protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { + @Override + protected void drawGuiContainerBackgroundLayer(float opacity, int x, int y) { - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - // this.mc.getTextureManager().bindTexture(...) - this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE); + // this.mc.getTextureManager().bindTexture(...) + this.mc.getTextureManager().bindTexture(Textures.GUI_ALCHEMICAL_STORAGE); - int xStart = (width - xSize) / 2; - int yStart = (height - ySize) / 2; - this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); - } + int xStart = (width - xSize) / 2; + int yStart = (height - ySize) / 2; + this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); + } - @Override - public void onGuiClosed() { + @Override + public void onGuiClosed() { - super.onGuiClosed(); + super.onGuiClosed(); - if (mc.thePlayer != null) { - for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) { - if (itemStack != null) { - if (NBTHelper.hasTag(itemStack, - Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { - NBTHelper.removeTag(itemStack, - Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); - } - } - } - } - } + if (mc.thePlayer != null) { + for (ItemStack itemStack : mc.thePlayer.inventory.mainInventory) { + if (itemStack != null) { + if (NBTHelper.hasTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN)) { + NBTHelper.removeTag(itemStack, Strings.NBT_ITEM_ALCHEMICAL_BAG_GUI_OPEN); + } + } + } + } + } } diff --git a/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java b/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java index fd10dd52..02e26963 100644 --- a/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java +++ b/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemicalChest.java @@ -47,9 +47,9 @@ public class GuiAlchemicalChest extends GuiContainer { 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_ALCHEMICAL_STORAGE); - + int xStart = (width - xSize) / 2; int yStart = (height - ySize) / 2; this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); diff --git a/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemyTable.java b/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemyTable.java index c6fb8b0f..228a5946 100644 --- a/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemyTable.java +++ b/common/com/pahimar/ee3/client/gui/inventory/GuiAlchemyTable.java @@ -12,18 +12,19 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class GuiAlchemyTable extends GuiContainer { - private TileAlchemyTable tileAlchemyTable; - - public GuiAlchemyTable(InventoryPlayer inventoryPlayer, TileAlchemyTable tileAlchemyTable) { - - super(new ContainerAlchemyTable(inventoryPlayer, tileAlchemyTable)); - this.tileAlchemyTable = tileAlchemyTable; - } + private TileAlchemyTable tileAlchemyTable; - @Override - protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { - // TODO Auto-generated method stub - - } + public GuiAlchemyTable(InventoryPlayer inventoryPlayer, TileAlchemyTable tileAlchemyTable) { + + super(new ContainerAlchemyTable(inventoryPlayer, tileAlchemyTable)); + this.tileAlchemyTable = tileAlchemyTable; + } + + @Override + protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { + + // TODO Auto-generated method stub + + } } diff --git a/common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java b/common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java index 4ae8bd58..c231fe59 100644 --- a/common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java +++ b/common/com/pahimar/ee3/client/gui/inventory/GuiCalcinator.java @@ -47,9 +47,9 @@ public class GuiCalcinator extends GuiContainer { 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_CALCINATOR); - + int xStart = (width - xSize) / 2; int yStart = (height - ySize) / 2; this.drawTexturedModalRect(xStart, yStart, 0, 0, xSize, ySize); diff --git a/common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java b/common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java index 6c068c1b..3529b9d0 100644 --- a/common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java +++ b/common/com/pahimar/ee3/client/gui/inventory/GuiPortableTransmutation.java @@ -3,6 +3,7 @@ package com.pahimar.ee3.client.gui.inventory; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.inventory.Container; import net.minecraft.item.ItemStack; + import org.lwjgl.opengl.GL11; import com.pahimar.ee3.lib.Strings; diff --git a/common/com/pahimar/ee3/client/model/ModelAlchemyTable.java b/common/com/pahimar/ee3/client/model/ModelAlchemyTable.java index b813cc33..52bbb7dd 100644 --- a/common/com/pahimar/ee3/client/model/ModelAlchemyTable.java +++ b/common/com/pahimar/ee3/client/model/ModelAlchemyTable.java @@ -1,8 +1,8 @@ package com.pahimar.ee3.client.model; +import net.minecraft.client.model.ModelBase; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.model.ModelBase; @SideOnly(Side.CLIENT) public class ModelAlchemyTable extends ModelBase { diff --git a/common/com/pahimar/ee3/client/model/ModelRenderingTank.java b/common/com/pahimar/ee3/client/model/ModelRenderingTank.java index f1c7f52d..7bab65dc 100644 --- a/common/com/pahimar/ee3/client/model/ModelRenderingTank.java +++ b/common/com/pahimar/ee3/client/model/ModelRenderingTank.java @@ -1,26 +1,26 @@ package com.pahimar.ee3.client.model; -import com.pahimar.ee3.lib.Models; - import net.minecraftforge.client.model.AdvancedModelLoader; import net.minecraftforge.client.model.IModelCustom; +import com.pahimar.ee3.lib.Models; + public class ModelRenderingTank { - private IModelCustom modelRenderingTank; - - public ModelRenderingTank() { + private IModelCustom modelRenderingTank; - modelRenderingTank = AdvancedModelLoader.loadModel(Models.RENDERING_TANK); + public ModelRenderingTank() { + + modelRenderingTank = AdvancedModelLoader.loadModel(Models.RENDERING_TANK); } public void render() { - modelRenderingTank.renderAll(); + modelRenderingTank.renderAll(); } - + public void renderPart(String partName) { - modelRenderingTank.renderPart(partName); + modelRenderingTank.renderPart(partName); } } diff --git a/common/com/pahimar/ee3/client/renderer/item/ItemRenderingTankRenderer.java b/common/com/pahimar/ee3/client/renderer/item/ItemRenderingTankRenderer.java index a53efe9f..ce15ca6c 100644 --- a/common/com/pahimar/ee3/client/renderer/item/ItemRenderingTankRenderer.java +++ b/common/com/pahimar/ee3/client/renderer/item/ItemRenderingTankRenderer.java @@ -1,10 +1,10 @@ package com.pahimar.ee3.client.renderer.item; -import org.lwjgl.opengl.GL11; - import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; +import org.lwjgl.opengl.GL11; + import com.pahimar.ee3.client.model.ModelRenderingTank; import com.pahimar.ee3.lib.Textures; @@ -12,51 +12,51 @@ import cpw.mods.fml.client.FMLClientHandler; public class ItemRenderingTankRenderer implements IItemRenderer { - private ModelRenderingTank modelRenderingTank; - - public ItemRenderingTankRenderer() { + private ModelRenderingTank modelRenderingTank; - modelRenderingTank = new ModelRenderingTank(); + public ItemRenderingTankRenderer() { + + modelRenderingTank = new ModelRenderingTank(); } - - @Override - public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return true; - } + @Override + public boolean handleRenderType(ItemStack item, ItemRenderType type) { - @Override - public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { + return true; + } - return true; - } + @Override + public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { - @Override - public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + return true; + } - switch (type) { - case ENTITY: { - renderRenderingTank(-0.5F, -1.2F, 0.5F, 0.75F); - return; - } - case EQUIPPED: { - renderRenderingTank(-0.2F, -0.85F, 0.8F, 0.75F); - return; - } - case EQUIPPED_FIRST_PERSON: { - renderRenderingTank(-0.2F, -0.50F, 0.8F, 0.75F); - return; - } - case INVENTORY: { - renderRenderingTank(-1.0F, -2.05F, 0.0F, 0.5F); - return; - } - default: - return; - } - } - - private void renderRenderingTank(float x, float y, float z, float scale) { + @Override + public void renderItem(ItemRenderType type, ItemStack item, Object... data) { + + switch (type) { + case ENTITY: { + renderRenderingTank(-0.5F, -1.2F, 0.5F, 0.75F); + return; + } + case EQUIPPED: { + renderRenderingTank(-0.2F, -0.85F, 0.8F, 0.75F); + return; + } + case EQUIPPED_FIRST_PERSON: { + renderRenderingTank(-0.2F, -0.50F, 0.8F, 0.75F); + return; + } + case INVENTORY: { + renderRenderingTank(-1.0F, -2.05F, 0.0F, 0.5F); + return; + } + default: + return; + } + } + + private void renderRenderingTank(float x, float y, float z, float scale) { GL11.glPushMatrix(); GL11.glDisable(GL11.GL_LIGHTING); diff --git a/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java b/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java index 5cf253b4..6963c83d 100644 --- a/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java +++ b/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityCalcinatorRenderer.java @@ -2,6 +2,7 @@ package com.pahimar.ee3.client.renderer.tileentity; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; + import org.lwjgl.opengl.GL11; import com.pahimar.ee3.client.model.ModelCalcinator; diff --git a/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityRenderingTankRenderer.java b/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityRenderingTankRenderer.java index d93ce65e..9e627700 100644 --- a/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityRenderingTankRenderer.java +++ b/common/com/pahimar/ee3/client/renderer/tileentity/TileEntityRenderingTankRenderer.java @@ -16,16 +16,16 @@ import cpw.mods.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class TileEntityRenderingTankRenderer extends TileEntitySpecialRenderer { - private ModelRenderingTank modelRenderingTank = new ModelRenderingTank(); - - @Override - public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { + private ModelRenderingTank modelRenderingTank = new ModelRenderingTank(); - if (tileEntity instanceof TileRenderingTank) { + @Override + public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float tick) { - GL11.glDisable(GL11.GL_LIGHTING); + if (tileEntity instanceof TileRenderingTank) { + + GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_CULL_FACE); - + GL11.glPushMatrix(); // Scale, Translate, Rotate @@ -38,12 +38,12 @@ public class TileEntityRenderingTankRenderer extends TileEntitySpecialRenderer { // Render modelRenderingTank.render(); - + GL11.glPopMatrix(); - + GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); } - } + } } diff --git a/common/com/pahimar/ee3/command/CommandEE.java b/common/com/pahimar/ee3/command/CommandEE.java index da68bbb2..256c2390 100644 --- a/common/com/pahimar/ee3/command/CommandEE.java +++ b/common/com/pahimar/ee3/command/CommandEE.java @@ -95,9 +95,10 @@ public class CommandEE extends CommandBase { throw new WrongUsageException(Commands.COMMAND_EE3_USAGE, new Object[0]); } - @Override - public String getCommandUsage(ICommandSender icommandsender) { - // TODO Auto-generated method stub - return null; - } + @Override + public String getCommandUsage(ICommandSender icommandsender) { + + // TODO Auto-generated method stub + return null; + } } diff --git a/common/com/pahimar/ee3/command/CommandOverlay.java b/common/com/pahimar/ee3/command/CommandOverlay.java index 4d42372c..ef08698d 100644 --- a/common/com/pahimar/ee3/command/CommandOverlay.java +++ b/common/com/pahimar/ee3/command/CommandOverlay.java @@ -68,7 +68,7 @@ public class CommandOverlay { float scale = Float.parseFloat(args[1]); if (scale <= 0F) { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE }); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE }); } else { ConfigurationSettings.TARGET_BLOCK_OVERLAY_SCALE = scale; @@ -77,11 +77,11 @@ public class CommandOverlay { } } catch (Exception e) { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE }); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE }); } } else { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE }); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_SCALE_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_SCALE_USAGE }); } } @@ -101,11 +101,11 @@ public class CommandOverlay { } } catch (Exception e) { - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); } } else - throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); + throw new WrongUsageException(Commands.COMMAND_OVERLAY_OPACITY_USAGE_ADDITIONAL_TEXT, new Object[] { Commands.COMMAND_OVERLAY_OPACITY_USAGE }); } private static void processPositionCommand(ICommandSender commandSender, String[] args) { diff --git a/common/com/pahimar/ee3/core/util/ItemUtil.java b/common/com/pahimar/ee3/core/util/ItemUtil.java index 2891fa30..e6edf57f 100644 --- a/common/com/pahimar/ee3/core/util/ItemUtil.java +++ b/common/com/pahimar/ee3/core/util/ItemUtil.java @@ -31,11 +31,11 @@ public class ItemUtil { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append("ItemStack("); - + if (itemStack != null) { - + stringBuilder.append(String.format("%s", encodeItemStackAsString(itemStack))); - + if (itemStack.hasTagCompound()) { stringBuilder.append(String.format("%s%s", Strings.TOKEN_DELIMITER, NBTHelper.encodeNBTAsString((itemStack.getTagCompound())))); } @@ -43,7 +43,7 @@ public class ItemUtil { else { stringBuilder.append("null"); } - + stringBuilder.append(")"); return stringBuilder.toString(); @@ -52,54 +52,56 @@ public class ItemUtil { public static String encodeItemStackAsString(ItemStack itemStack) { StringBuilder stringBuilder = new StringBuilder(); - + stringBuilder.append(String.format("%s%s%s", itemStack.itemID, Strings.TOKEN_DELIMITER, itemStack.getItemDamage())); - + return stringBuilder.toString(); } - + public static ItemStack decodeItemStackFromString(String encodedItemStack) { - + ItemStack decodedItemStack = null; - + final int UNDEFINED = -1; final int ERROR = -2; - + int itemId = UNDEFINED; int meta = UNDEFINED; - + String[] splitString = encodedItemStack.split(Strings.TOKEN_DELIMITER); - + // Grab itemId if (splitString.length >= 1) { - + try { itemId = Integer.parseInt(splitString[0]); - } catch (NumberFormatException e) { + } + catch (NumberFormatException e) { itemId = ERROR; } } - + // Grab meta if (splitString.length >= 2) { - + try { meta = Integer.parseInt(splitString[1]); - } catch (NumberFormatException e) { + } + catch (NumberFormatException e) { meta = ERROR; } } - + if (meta == UNDEFINED) { meta = OreDictionary.WILDCARD_VALUE; } - + if (itemId != UNDEFINED && itemId != ERROR) { if (meta != ERROR) { decodedItemStack = new ItemStack(itemId, 1, meta); } } - + return decodedItemStack; } @@ -168,58 +170,58 @@ public class ItemUtil { } } } - + public static Comparator ItemStackComparator = new Comparator() { - - public int compare(ItemStack itemStack1, ItemStack itemStack2) { - - if (itemStack1 != null && itemStack2 != null) { - // Sort on itemID - if (itemStack1.itemID == itemStack2.itemID) { - - // Then sort on meta - if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) { - - // Then sort on NBT - if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) { - - // Then sort on stack size - if (itemStack1.getTagCompound().equals(itemStack2.getTagCompound())) { - return (itemStack1.stackSize - itemStack2.stackSize); - } - else { - return (itemStack1.getTagCompound().hashCode() - itemStack2.getTagCompound().hashCode()); - } - } - else if (!(itemStack1.hasTagCompound()) && itemStack2.hasTagCompound()) { - return -1; - } - else if (itemStack1.hasTagCompound() && !(itemStack2.hasTagCompound())) { - return 1; - } - else { - return (itemStack1.stackSize - itemStack2.stackSize); - } - } - else { - return (itemStack1.getItemDamage() - itemStack2.getItemDamage()); - } - } - else { - return (itemStack1.itemID - itemStack2.itemID); - } - } - else if (itemStack1 != null && itemStack2 == null) { - return -1; - } - else if (itemStack1 == null && itemStack2 != null) { + + public int compare(ItemStack itemStack1, ItemStack itemStack2) { + + if (itemStack1 != null && itemStack2 != null) { + // Sort on itemID + if (itemStack1.itemID == itemStack2.itemID) { + + // Then sort on meta + if (itemStack1.getItemDamage() == itemStack2.getItemDamage()) { + + // Then sort on NBT + if (itemStack1.hasTagCompound() && itemStack2.hasTagCompound()) { + + // Then sort on stack size + if (itemStack1.getTagCompound().equals(itemStack2.getTagCompound())) { + return (itemStack1.stackSize - itemStack2.stackSize); + } + else { + return (itemStack1.getTagCompound().hashCode() - itemStack2.getTagCompound().hashCode()); + } + } + else if (!(itemStack1.hasTagCompound()) && itemStack2.hasTagCompound()) { + return -1; + } + else if (itemStack1.hasTagCompound() && !(itemStack2.hasTagCompound())) { + return 1; + } + else { + return (itemStack1.stackSize - itemStack2.stackSize); + } + } + else { + return (itemStack1.getItemDamage() - itemStack2.getItemDamage()); + } + } + else { + return (itemStack1.itemID - itemStack2.itemID); + } + } + else if (itemStack1 != null && itemStack2 == null) { + return -1; + } + else if (itemStack1 == null && itemStack2 != null) { return 1; } - else { - return 0; - } - - } - + else { + return 0; + } + + } + }; } diff --git a/common/com/pahimar/ee3/core/util/RecipeHelper.java b/common/com/pahimar/ee3/core/util/RecipeHelper.java index 8e616bf9..0a883cd7 100644 --- a/common/com/pahimar/ee3/core/util/RecipeHelper.java +++ b/common/com/pahimar/ee3/core/util/RecipeHelper.java @@ -89,15 +89,15 @@ public class RecipeHelper { ShapedRecipes shapedRecipe = (ShapedRecipes) recipe; for (int i = 0; i < shapedRecipe.recipeItems.length; i++) { - + if (shapedRecipe.recipeItems[i] instanceof ItemStack) { - + ItemStack itemStack = shapedRecipe.recipeItems[i].copy(); - + if (itemStack.stackSize > 1) { itemStack.stackSize = 1; } - + recipeInputs.add(new CustomWrappedStack(itemStack)); } } @@ -107,15 +107,15 @@ public class RecipeHelper { ShapelessRecipes shapelessRecipe = (ShapelessRecipes) recipe; for (Object object : shapelessRecipe.recipeItems) { - + if (object instanceof ItemStack) { - + ItemStack itemStack = ((ItemStack) object).copy(); - + if (itemStack.stackSize > 1) { itemStack.stackSize = 1; } - + recipeInputs.add(new CustomWrappedStack(itemStack)); } } @@ -125,25 +125,25 @@ public class RecipeHelper { ShapedOreRecipe shapedOreRecipe = (ShapedOreRecipe) recipe; for (int i = 0; i < shapedOreRecipe.getInput().length; i++) { - + /* * If the element is a list, then it is an OreStack */ if (shapedOreRecipe.getInput()[i] instanceof ArrayList) { - CustomWrappedStack oreStack = new CustomWrappedStack(shapedOreRecipe.getInput()[i]); - - if (oreStack.getWrappedStack() instanceof OreStack) { - recipeInputs.add(new CustomWrappedStack(shapedOreRecipe.getInput()[i])); - } + CustomWrappedStack oreStack = new CustomWrappedStack(shapedOreRecipe.getInput()[i]); + + if (oreStack.getWrappedStack() instanceof OreStack) { + recipeInputs.add(new CustomWrappedStack(shapedOreRecipe.getInput()[i])); + } } else if (shapedOreRecipe.getInput()[i] instanceof ItemStack) { - + ItemStack itemStack = ((ItemStack) shapedOreRecipe.getInput()[i]).copy(); - + if (itemStack.stackSize > 1) { itemStack.stackSize = 1; } - + recipeInputs.add(new CustomWrappedStack(itemStack)); } } @@ -153,18 +153,18 @@ public class RecipeHelper { ShapelessOreRecipe shapelessOreRecipe = (ShapelessOreRecipe) recipe; for (Object object : shapelessOreRecipe.getInput()) { - - if (object instanceof ArrayList) { + + if (object instanceof ArrayList) { recipeInputs.add(new CustomWrappedStack(object)); } else if (object instanceof ItemStack) { - + ItemStack itemStack = ((ItemStack) object).copy(); - + if (itemStack.stackSize > 1) { itemStack.stackSize = 1; } - + recipeInputs.add(new CustomWrappedStack(itemStack)); } } diff --git a/common/com/pahimar/ee3/core/util/ResourceLocationHelper.java b/common/com/pahimar/ee3/core/util/ResourceLocationHelper.java index 2febda74..2a2ff4d2 100644 --- a/common/com/pahimar/ee3/core/util/ResourceLocationHelper.java +++ b/common/com/pahimar/ee3/core/util/ResourceLocationHelper.java @@ -1,18 +1,18 @@ package com.pahimar.ee3.core.util; -import com.pahimar.ee3.lib.Reference; - import net.minecraft.util.ResourceLocation; +import com.pahimar.ee3.lib.Reference; + public class ResourceLocationHelper { - public static ResourceLocation getResourceLocation(String modId, String path) { - - return new ResourceLocation(modId, path); - } - - public static ResourceLocation getResourceLocation(String path) { + public static ResourceLocation getResourceLocation(String modId, String path) { - return getResourceLocation(Reference.MOD_ID.toLowerCase(), path); - } + return new ResourceLocation(modId, path); + } + + public static ResourceLocation getResourceLocation(String path) { + + return getResourceLocation(Reference.MOD_ID.toLowerCase(), path); + } } diff --git a/common/com/pahimar/ee3/core/util/VersionHelper.java b/common/com/pahimar/ee3/core/util/VersionHelper.java index c684607e..3416b31d 100644 --- a/common/com/pahimar/ee3/core/util/VersionHelper.java +++ b/common/com/pahimar/ee3/core/util/VersionHelper.java @@ -132,7 +132,7 @@ public class VersionHelper implements Runnable { public static String getResultMessage() { if (result == UNINITIALIZED) { - return StatCollector.translateToLocal(Strings.UNINITIALIZED_MESSAGE); + return StatCollector.translateToLocal(Strings.UNINITIALIZED_MESSAGE); } else if (result == CURRENT) { return StatCollector.translateToLocalFormatted(Strings.CURRENT_MESSAGE, Reference.MOD_NAME, Loader.instance().getMCVersionString()); @@ -141,16 +141,16 @@ public class VersionHelper implements Runnable { return StatCollector.translateToLocalFormatted(Strings.OUTDATED_MESSAGE, Reference.MOD_NAME, remoteVersion, Loader.instance().getMCVersionString(), remoteUpdateLocation); } else if (result == OUTDATED && remoteVersion != null && remoteUpdateLocation != null) { - return StatCollector.translateToLocalFormatted(Strings.OUTDATED_MESSAGE, Reference.MOD_NAME, remoteVersion, Loader.instance().getMCVersionString(), remoteUpdateLocation); + return StatCollector.translateToLocalFormatted(Strings.OUTDATED_MESSAGE, Reference.MOD_NAME, remoteVersion, Loader.instance().getMCVersionString(), remoteUpdateLocation); } else if (result == ERROR) { - return StatCollector.translateToLocal(Strings.GENERAL_ERROR_MESSAGE); + return StatCollector.translateToLocal(Strings.GENERAL_ERROR_MESSAGE); } else if (result == FINAL_ERROR) { - return StatCollector.translateToLocal(Strings.FINAL_ERROR_MESSAGE); + return StatCollector.translateToLocal(Strings.FINAL_ERROR_MESSAGE); } else if (result == MC_VERSION_NOT_FOUND) { - return StatCollector.translateToLocalFormatted(Strings.MC_VERSION_NOT_FOUND, Reference.MOD_NAME, Loader.instance().getMCVersionString()); + return StatCollector.translateToLocalFormatted(Strings.MC_VERSION_NOT_FOUND, Reference.MOD_NAME, Loader.instance().getMCVersionString()); } else { result = ERROR; @@ -160,11 +160,7 @@ public class VersionHelper implements Runnable { public static String getResultMessageForClient() { - return StatCollector.translateToLocalFormatted(Strings.OUTDATED_MESSAGE, - Colours.TEXT_COLOUR_PREFIX_YELLOW + Reference.MOD_NAME + Colours.TEXT_COLOUR_PREFIX_WHITE, - Colours.TEXT_COLOUR_PREFIX_YELLOW + VersionHelper.remoteVersion + Colours.TEXT_COLOUR_PREFIX_WHITE, - Colours.TEXT_COLOUR_PREFIX_YELLOW + Loader.instance().getMCVersionString() + Colours.TEXT_COLOUR_PREFIX_WHITE, - Colours.TEXT_COLOUR_PREFIX_YELLOW + VersionHelper.remoteUpdateLocation + Colours.TEXT_COLOUR_PREFIX_WHITE); + return StatCollector.translateToLocalFormatted(Strings.OUTDATED_MESSAGE, Colours.TEXT_COLOUR_PREFIX_YELLOW + Reference.MOD_NAME + Colours.TEXT_COLOUR_PREFIX_WHITE, Colours.TEXT_COLOUR_PREFIX_YELLOW + VersionHelper.remoteVersion + Colours.TEXT_COLOUR_PREFIX_WHITE, Colours.TEXT_COLOUR_PREFIX_YELLOW + Loader.instance().getMCVersionString() + Colours.TEXT_COLOUR_PREFIX_WHITE, Colours.TEXT_COLOUR_PREFIX_YELLOW + VersionHelper.remoteUpdateLocation + Colours.TEXT_COLOUR_PREFIX_WHITE); } public static byte getResult() { diff --git a/common/com/pahimar/ee3/creativetab/CreativeTabEE3.java b/common/com/pahimar/ee3/creativetab/CreativeTabEE3.java index 56d54292..69976bd1 100644 --- a/common/com/pahimar/ee3/creativetab/CreativeTabEE3.java +++ b/common/com/pahimar/ee3/creativetab/CreativeTabEE3.java @@ -18,19 +18,19 @@ import cpw.mods.fml.relauncher.SideOnly; */ public class CreativeTabEE3 extends CreativeTabs { - public CreativeTabEE3(int tabID, String tabLabel) { + public CreativeTabEE3(int tabID, String tabLabel) { - super(tabID, tabLabel); - } + super(tabID, tabLabel); + } - @Override - @SideOnly(Side.CLIENT) - /** - * the itemID for the item to be displayed on the tab - */ - public int getTabIconItemIndex() { + @Override + @SideOnly(Side.CLIENT) + /** + * the itemID for the item to be displayed on the tab + */ + public int getTabIconItemIndex() { - return ItemIds.MINIUM_SHARD; - } + return ItemIds.MINIUM_SHARD; + } } diff --git a/common/com/pahimar/ee3/emc/DynEMC.java b/common/com/pahimar/ee3/emc/DynEMC.java index f5891f8d..5f534974 100644 --- a/common/com/pahimar/ee3/emc/DynEMC.java +++ b/common/com/pahimar/ee3/emc/DynEMC.java @@ -15,7 +15,7 @@ import com.pahimar.ee3.item.crafting.RecipeRegistry; public class DynEMC { private static DynEMC dynEMC = null; - + private RecipeRegistry recipeRegistry; private WeightedDirectedGraph graph; @@ -37,60 +37,61 @@ public class DynEMC { } private void init() { - + populateGraph(); } private void populateGraph() { - + for (CustomWrappedStack discoveredStack : recipeRegistry.getDiscoveredStacks()) { graph.addNode(discoveredStack); } - + Multimap> recipeMappings = recipeRegistry.getRecipeMappings(); - + Set recipeKeySet = recipeMappings.keySet(); Iterator recipeKeySetIterator = recipeKeySet.iterator(); CustomWrappedStack recipeOutput = null; - + while (recipeKeySetIterator.hasNext()) { recipeOutput = recipeKeySetIterator.next(); - + for (List recipeInputs : recipeMappings.get(recipeOutput)) { - - CustomWrappedStack unWrappedRecipeOutput = new CustomWrappedStack(recipeOutput.getWrappedStack()); - - if (graph.nodeExists(unWrappedRecipeOutput)) { - for (CustomWrappedStack recipeInput : recipeInputs) { - - // Unwrapped the wrapped stacks so that we actually find them in the graph - - CustomWrappedStack unWrappedRecipeInput = new CustomWrappedStack(recipeInput.getWrappedStack()); - - if (graph.nodeExists(unWrappedRecipeInput)) { - if (recipeOutput.getStackSize() != 0) { - try { - graph.addEdge(unWrappedRecipeOutput, unWrappedRecipeInput, (recipeInput.getStackSize() * 1.0f) / recipeOutput.getStackSize()); - } catch (NoSuchElementException e) { - LogHelper.severe(e.getLocalizedMessage()); - } - } - } - else { - LogHelper.debug("Recipe output '" + unWrappedRecipeOutput.toString() + "' exists in the crafting relationship graph"); - LogHelper.debug("Recipe input '" + unWrappedRecipeInput.toString() + "' does not exist in the crafting relationship graph"); - } - } - } - else { - LogHelper.debug("Recipe output '" + unWrappedRecipeOutput.toString() + "' does not exist in the crafting relationship graph"); - } + + CustomWrappedStack unWrappedRecipeOutput = new CustomWrappedStack(recipeOutput.getWrappedStack()); + + if (graph.nodeExists(unWrappedRecipeOutput)) { + for (CustomWrappedStack recipeInput : recipeInputs) { + + // Unwrapped the wrapped stacks so that we actually find them in the graph + + CustomWrappedStack unWrappedRecipeInput = new CustomWrappedStack(recipeInput.getWrappedStack()); + + if (graph.nodeExists(unWrappedRecipeInput)) { + if (recipeOutput.getStackSize() != 0) { + try { + graph.addEdge(unWrappedRecipeOutput, unWrappedRecipeInput, (recipeInput.getStackSize() * 1.0f) / recipeOutput.getStackSize()); + } + catch (NoSuchElementException e) { + LogHelper.severe(e.getLocalizedMessage()); + } + } + } + else { + LogHelper.debug("Recipe output '" + unWrappedRecipeOutput.toString() + "' exists in the crafting relationship graph"); + LogHelper.debug("Recipe input '" + unWrappedRecipeInput.toString() + "' does not exist in the crafting relationship graph"); + } + } + } + else { + LogHelper.debug("Recipe output '" + unWrappedRecipeOutput.toString() + "' does not exist in the crafting relationship graph"); + } } } } - + public List getCriticalNodes() { - + return graph.getCriticalNodes(); } @@ -104,12 +105,12 @@ public class DynEMC { LogHelper.debug("Total node count: " + graph.getAllNodes().size()); LogHelper.debug("Critical node count: " + graph.getCriticalNodes().size()); LogHelper.debug("Orphan node count: " + graph.getOrphanNodes().size()); - + List critsMinusOrphans = graph.getCriticalNodes(); critsMinusOrphans.removeAll(graph.getOrphanNodes()); - + LogHelper.debug("[Critical - Orphans] node count: " + critsMinusOrphans.size()); - + LogHelper.debug("***** START NODES *****"); Iterator nodeIter = graph.iterator(); while (nodeIter.hasNext()) { diff --git a/common/com/pahimar/ee3/emc/EmcBlackList.java b/common/com/pahimar/ee3/emc/EmcBlackList.java index 9384f515..fbb88d00 100644 --- a/common/com/pahimar/ee3/emc/EmcBlackList.java +++ b/common/com/pahimar/ee3/emc/EmcBlackList.java @@ -35,12 +35,12 @@ public class EmcBlackList { public boolean add(Object object) { boolean wasAdded = false; - + if (CustomWrappedStack.canBeWrapped(object)) { - + CustomWrappedStack wrappedStack = new CustomWrappedStack(object); wrappedStack.setStackSize(1); - + if (!stackBlackList.contains(wrappedStack)) { stackBlackList.add(wrappedStack); wasAdded = true; @@ -53,10 +53,10 @@ public class EmcBlackList { public boolean contains(Object object) { if (CustomWrappedStack.canBeWrapped(object)) { - + CustomWrappedStack wrappedStack = new CustomWrappedStack(object); wrappedStack.setStackSize(1); - + return stackBlackList.contains(wrappedStack); } @@ -66,12 +66,12 @@ public class EmcBlackList { public boolean remove(Object object) { boolean wasRemoved = false; - + if (CustomWrappedStack.canBeWrapped(object)) { - + CustomWrappedStack wrappedStack = new CustomWrappedStack(object); wrappedStack.setStackSize(1); - + if (stackBlackList.contains(wrappedStack)) { stackBlackList.remove(wrappedStack); wasRemoved = true; diff --git a/common/com/pahimar/ee3/emc/EmcComponent.java b/common/com/pahimar/ee3/emc/EmcComponent.java index 34601270..e7474bef 100644 --- a/common/com/pahimar/ee3/emc/EmcComponent.java +++ b/common/com/pahimar/ee3/emc/EmcComponent.java @@ -43,19 +43,19 @@ public class EmcComponent implements Comparable { return stringBuilder.toString(); } - @Override - public int compareTo(EmcComponent emcComponent) { + @Override + public int compareTo(EmcComponent emcComponent) { - if (emcComponent != null) { - if (this.type == emcComponent.type) { - return (this.ratioWeight - emcComponent.ratioWeight); - } - else { - return this.type.compareTo(emcComponent.type); - } - } - else { - return 1; - } - } + if (emcComponent != null) { + if (this.type == emcComponent.type) { + return (this.ratioWeight - emcComponent.ratioWeight); + } + else { + return this.type.compareTo(emcComponent.type); + } + } + else { + return 1; + } + } } diff --git a/common/com/pahimar/ee3/emc/EmcRegistry.java b/common/com/pahimar/ee3/emc/EmcRegistry.java index e6e80d04..14184334 100644 --- a/common/com/pahimar/ee3/emc/EmcRegistry.java +++ b/common/com/pahimar/ee3/emc/EmcRegistry.java @@ -9,29 +9,29 @@ import com.pahimar.ee3.item.CustomWrappedStack; public class EmcRegistry { - private static EmcRegistry emcRegistry = null; - - private Map stackMappings; - private TreeMap> valueMappings; + private static EmcRegistry emcRegistry = null; - private EmcRegistry() { + private Map stackMappings; + private TreeMap> valueMappings; - stackMappings = new HashMap(); - valueMappings = new TreeMap>(); - } + private EmcRegistry() { - public static EmcRegistry getInstance() { + stackMappings = new HashMap(); + valueMappings = new TreeMap>(); + } - if (emcRegistry == null) { - emcRegistry = new EmcRegistry(); - emcRegistry.init(); - } + public static EmcRegistry getInstance() { - return emcRegistry; - } + if (emcRegistry == null) { + emcRegistry = new EmcRegistry(); + emcRegistry.init(); + } - private void init() { + return emcRegistry; + } - } + private void init() { + + } } diff --git a/common/com/pahimar/ee3/emc/EmcType.java b/common/com/pahimar/ee3/emc/EmcType.java index 158391ab..de482e73 100644 --- a/common/com/pahimar/ee3/emc/EmcType.java +++ b/common/com/pahimar/ee3/emc/EmcType.java @@ -1,11 +1,5 @@ package com.pahimar.ee3.emc; public enum EmcType { - OMNI, - CORPOREAL, - KINETIC, - TEMPORAL, - ESSENTIA, - AMORPHOUS, - VOID; + OMNI, CORPOREAL, KINETIC, TEMPORAL, ESSENTIA, AMORPHOUS, VOID; } diff --git a/common/com/pahimar/ee3/emc/EmcValue.java b/common/com/pahimar/ee3/emc/EmcValue.java index 7fcdf653..68928b1c 100644 --- a/common/com/pahimar/ee3/emc/EmcValue.java +++ b/common/com/pahimar/ee3/emc/EmcValue.java @@ -18,7 +18,7 @@ import com.pahimar.ee3.lib.Strings; */ public class EmcValue implements Comparable { - public final float value; + public final float value; public final float recoveryPercent; private final List components; @@ -33,10 +33,10 @@ public class EmcValue implements Comparable { } public EmcValue(float value, float recoveryPercent) { - + this(value, recoveryPercent, new ArrayList()); } - + public EmcValue(float value, List components) { this(value, 1F, collateComponents(components)); @@ -50,10 +50,10 @@ public class EmcValue implements Comparable { } public List getComponents() { - - return components; + + return components; } - + public EmcComponent getComponentByType(EmcType type) { EmcComponent[] componentArray = (EmcComponent[]) components.toArray(); @@ -77,25 +77,25 @@ public class EmcValue implements Comparable { public String toString() { StringBuilder stringBuilder = new StringBuilder(); - + stringBuilder.append(String.format("V:%s%sRP:%s%s[", value, Strings.TOKEN_DELIMITER, recoveryPercent, Strings.TOKEN_DELIMITER)); - + List componentArray = this.components; Collections.sort(componentArray); - + int i = 0; - + for (EmcComponent component : componentArray) { - - stringBuilder.append(String.format("%s:%s", component.getType(), component.getRatioWeight())); - - i++; - - if (i < componentArray.size()) { - stringBuilder.append(String.format("%s", Strings.TOKEN_DELIMITER)); + + stringBuilder.append(String.format("%s:%s", component.getType(), component.getRatioWeight())); + + i++; + + if (i < componentArray.size()) { + stringBuilder.append(String.format("%s", Strings.TOKEN_DELIMITER)); } } - + stringBuilder.append("]"); return stringBuilder.toString(); @@ -113,42 +113,42 @@ public class EmcValue implements Comparable { return hashCode; } - @Override - public int compareTo(EmcValue emcValue) { - - if (Float.compare(this.value, emcValue.value) == 0) { - if (Float.compare(this.recoveryPercent, emcValue.recoveryPercent) == 0) { - return (this.components.hashCode() - emcValue.components.hashCode()); - } - else { - return Float.compare(this.recoveryPercent, emcValue.recoveryPercent); - } - } - else { - return Float.compare(this.value, emcValue.value); - } - } - - private static List collateComponents(List uncollatedComponents) { - - Integer[] componentCount = new Integer[7]; - - for (EmcComponent emcComponent : uncollatedComponents) { - if (componentCount[emcComponent.getType().ordinal()] == null) { - componentCount[emcComponent.getType().ordinal()] = new Integer(0); - } - - componentCount[emcComponent.getType().ordinal()] = new Integer(componentCount[emcComponent.getType().ordinal()].intValue() + emcComponent.getRatioWeight()); - } - - List collatedComponents = new ArrayList(); - - for (int i = 0; i < 7; i++) { - if (componentCount[i] != null) { - collatedComponents.add(new EmcComponent(EmcType.values()[i], componentCount[i].intValue())); - } - } - - return collatedComponents; - } + @Override + public int compareTo(EmcValue emcValue) { + + if (Float.compare(this.value, emcValue.value) == 0) { + if (Float.compare(this.recoveryPercent, emcValue.recoveryPercent) == 0) { + return (this.components.hashCode() - emcValue.components.hashCode()); + } + else { + return Float.compare(this.recoveryPercent, emcValue.recoveryPercent); + } + } + else { + return Float.compare(this.value, emcValue.value); + } + } + + private static List collateComponents(List uncollatedComponents) { + + Integer[] componentCount = new Integer[7]; + + for (EmcComponent emcComponent : uncollatedComponents) { + if (componentCount[emcComponent.getType().ordinal()] == null) { + componentCount[emcComponent.getType().ordinal()] = new Integer(0); + } + + componentCount[emcComponent.getType().ordinal()] = new Integer(componentCount[emcComponent.getType().ordinal()].intValue() + emcComponent.getRatioWeight()); + } + + List collatedComponents = new ArrayList(); + + for (int i = 0; i < 7; i++) { + if (componentCount[i] != null) { + collatedComponents.add(new EmcComponent(EmcType.values()[i], componentCount[i].intValue())); + } + } + + return collatedComponents; + } } diff --git a/common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java b/common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java index 59e39bce..9b59c2ba 100644 --- a/common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java +++ b/common/com/pahimar/ee3/emc/graph/WeightedDirectedGraph.java @@ -52,7 +52,7 @@ public class WeightedDirectedGraph implements Iterable { LogHelper.severe("To node: " + to.toString()); } if (!graph.containsKey(to)) { - LogHelper.severe("From node: " + from.toString()); + LogHelper.severe("From node: " + from.toString()); LogHelper.severe("To node doesn't exist: " + to.toString()); } throw new NoSuchElementException("Missing nodes from graph"); diff --git a/common/com/pahimar/ee3/inventory/ContainerAlchemyTable.java b/common/com/pahimar/ee3/inventory/ContainerAlchemyTable.java index e73d4661..50d6be5e 100644 --- a/common/com/pahimar/ee3/inventory/ContainerAlchemyTable.java +++ b/common/com/pahimar/ee3/inventory/ContainerAlchemyTable.java @@ -8,17 +8,18 @@ import com.pahimar.ee3.tileentity.TileAlchemyTable; public class ContainerAlchemyTable extends Container { - private TileAlchemyTable tileAlchemyTable; - - public ContainerAlchemyTable(InventoryPlayer inventoryPlayer, TileAlchemyTable tileAlchemyTable) { - - this.tileAlchemyTable = tileAlchemyTable; - } - - @Override - public boolean canInteractWith(EntityPlayer entityplayer) { - // TODO Auto-generated method stub - return false; - } + private TileAlchemyTable tileAlchemyTable; + + public ContainerAlchemyTable(InventoryPlayer inventoryPlayer, TileAlchemyTable tileAlchemyTable) { + + this.tileAlchemyTable = tileAlchemyTable; + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + + // TODO Auto-generated method stub + return false; + } } diff --git a/common/com/pahimar/ee3/item/ItemAlchemicalChalk.java b/common/com/pahimar/ee3/item/ItemAlchemicalChalk.java index c8e7e2ce..553997ad 100644 --- a/common/com/pahimar/ee3/item/ItemAlchemicalChalk.java +++ b/common/com/pahimar/ee3/item/ItemAlchemicalChalk.java @@ -5,11 +5,11 @@ import com.pahimar.ee3.lib.Strings; public class ItemAlchemicalChalk extends ItemEE { - public ItemAlchemicalChalk(int id) { - - super(id); + public ItemAlchemicalChalk(int id) { + + super(id); this.setUnlocalizedName(Strings.RESOURCE_PREFIX + Strings.ALCHEMICAL_CHALK_NAME); this.setCreativeTab(EquivalentExchange3.tabsEE3); - } + } } diff --git a/common/com/pahimar/ee3/item/ItemAlchemicalDust.java b/common/com/pahimar/ee3/item/ItemAlchemicalDust.java index b8e91bed..180cd21d 100644 --- a/common/com/pahimar/ee3/item/ItemAlchemicalDust.java +++ b/common/com/pahimar/ee3/item/ItemAlchemicalDust.java @@ -42,14 +42,14 @@ public class ItemAlchemicalDust extends ItemEE { @Override public String getUnlocalizedName(ItemStack itemStack) { - StringBuilder unlocalizedName = new StringBuilder(); + StringBuilder unlocalizedName = new StringBuilder(); int meta = MathHelper.clamp_int(itemStack.getItemDamage(), 0, 5); - + unlocalizedName.append("item."); unlocalizedName.append(Strings.RESOURCE_PREFIX); unlocalizedName.append(Strings.ALCHEMICAL_DUST_NAME); unlocalizedName.append(ALCHEMICAL_DUST_NAMES[meta]); - + return unlocalizedName.toString(); } diff --git a/common/com/pahimar/ee3/item/ModItems.java b/common/com/pahimar/ee3/item/ModItems.java index ae796c65..89d80583 100644 --- a/common/com/pahimar/ee3/item/ModItems.java +++ b/common/com/pahimar/ee3/item/ModItems.java @@ -43,7 +43,7 @@ public class ModItems { philStone.setContainerItem(philStone); // TODO Register items with the GameRegistry - + GameRegistry.addRecipe(new ItemStack(inertStone), new Object[] { "sis", "igi", "sis", Character.valueOf('s'), Block.stone, Character.valueOf('i'), Item.ingotIron, Character.valueOf('g'), Item.ingotGold }); GameRegistry.addRecipe(new ItemStack(miniumStone), new Object[] { "sss", "sis", "sss", Character.valueOf('s'), miniumShard, Character.valueOf('i'), inertStone }); diff --git a/common/com/pahimar/ee3/item/crafting/RecipeRegistry.java b/common/com/pahimar/ee3/item/crafting/RecipeRegistry.java index 2aedd50e..0ae6f1a7 100644 --- a/common/com/pahimar/ee3/item/crafting/RecipeRegistry.java +++ b/common/com/pahimar/ee3/item/crafting/RecipeRegistry.java @@ -43,9 +43,9 @@ public class RecipeRegistry { return recipeRegistry; } - + private void init() { - + Multimap> recipes = HashMultimap.create(); // Add potion recipes @@ -62,7 +62,7 @@ public class RecipeRegistry { // Populate the discovered stacks list with all stacks that we are involved in a recipe we are aware of discoverStacks(recipes); - + // Add items that have no recipe, using the list of discovered stacks to determine if it's in a recipe or not for (CustomWrappedStack stack : recipelessStacks) { recipes.put(stack, new ArrayList()); @@ -75,32 +75,32 @@ public class RecipeRegistry { while (recipeKeySetIterator.hasNext()) { recipeOutput = recipeKeySetIterator.next(); - + for (List recipeInputs : recipes.get(recipeOutput)) { addRecipe(recipeOutput, recipeInputs); } } } - + private void discoverStacks(Multimap> recipes) { - + Set recipeKeySet = recipes.keySet(); Iterator recipeKeySetIterator = recipeKeySet.iterator(); CustomWrappedStack recipeOutput = null; - + // Discover all stacks involved in the recipes we know about while (recipeKeySetIterator.hasNext()) { recipeOutput = recipeKeySetIterator.next(); - + if (!discoveredStacks.contains(new CustomWrappedStack(recipeOutput.getWrappedStack())) && recipeOutput.getWrappedStack() != null) { discoveredStacks.add(new CustomWrappedStack(recipeOutput.getWrappedStack())); } - + for (List recipeInputs : recipes.get(recipeOutput)) { for (CustomWrappedStack recipeInput : recipeInputs) { - + CustomWrappedStack unwrappedRecipeInput = new CustomWrappedStack(recipeInput.getWrappedStack()); - + if (!discoveredStacks.contains(unwrappedRecipeInput) && recipeInput.getWrappedStack() != null) { discoveredStacks.add(unwrappedRecipeInput); } @@ -109,41 +109,41 @@ public class RecipeRegistry { } CustomWrappedStack customWrappedStack; - + // Discover all stacks from the vanilla Items array for (int i = 0; i < Item.itemsList.length; i++) { - + if (Item.itemsList[i] != null) { - + if (Item.itemsList[i].getHasSubtypes()) { - - for (int meta = 0; meta < 16; meta++) { - - customWrappedStack = new CustomWrappedStack(new ItemStack(Item.itemsList[i].itemID, 1, meta)); - - if (!discoveredStacks.contains(customWrappedStack)) { + + for (int meta = 0; meta < 16; meta++) { + + customWrappedStack = new CustomWrappedStack(new ItemStack(Item.itemsList[i].itemID, 1, meta)); + + if (!discoveredStacks.contains(customWrappedStack)) { discoveredStacks.add(customWrappedStack); } - } + } } else { - + customWrappedStack = new CustomWrappedStack(new ItemStack(Item.itemsList[i])); - + if (!discoveredStacks.contains(customWrappedStack)) { discoveredStacks.add(customWrappedStack); } } } } - + /* - * For every stack we have discovered, check to see if we know a recipe for it. If we don't - * and we haven't already added it to the recipeless stack list, add it to the recipeless stack - * list + * For every stack we have discovered, check to see if we know a recipe + * for it. If we don't and we haven't already added it to the recipeless + * stack list, add it to the recipeless stack list */ for (CustomWrappedStack discoveredStack : discoveredStacks) { - + if (recipes.get(discoveredStack).size() == 0 && !recipelessStacks.contains(discoveredStack)) { recipelessStacks.add(discoveredStack); } @@ -278,24 +278,24 @@ public class RecipeRegistry { return stringBuilder.toString(); } - + public Multimap> getRecipeMappings() { - + return recipeMap; } - + public List getDiscoveredStacks() { - + return discoveredStacks; } - + public List getRecipelessStacks() { - + return recipelessStacks; } - + public List getWildCardStacks() { - + return wildCardStacks; } } diff --git a/common/com/pahimar/ee3/item/crafting/RecipesVanilla.java b/common/com/pahimar/ee3/item/crafting/RecipesVanilla.java index 5b504acb..980aa228 100644 --- a/common/com/pahimar/ee3/item/crafting/RecipesVanilla.java +++ b/common/com/pahimar/ee3/item/crafting/RecipesVanilla.java @@ -39,7 +39,7 @@ public class RecipesVanilla { ItemStack recipeOutput = recipe.getRecipeOutput(); if (recipeOutput != null) { - + ArrayList recipeInputs = RecipeHelper.getRecipeInputs(recipe); vanillaRecipes.put(new CustomWrappedStack(recipeOutput), recipeInputs); } diff --git a/common/com/pahimar/ee3/lib/InterModComms.java b/common/com/pahimar/ee3/lib/InterModComms.java index c4133e50..43022e5b 100644 --- a/common/com/pahimar/ee3/lib/InterModComms.java +++ b/common/com/pahimar/ee3/lib/InterModComms.java @@ -4,11 +4,11 @@ public class InterModComms { // Interacting with the Recipe Registry public static final String ADD_RECIPE = "add-recipe"; - + // Interacting with the EMC BlackList public static final String ADD_BLACKLIST_ENTRY = "add-blacklist-entry"; public static final String REMOVE_BLACKLIST_ENTRY = "remove-blacklist-entry"; - + // Interacting with the EMC value mappings public static final String SET_EMC_VALUE = "set-emc-value"; } diff --git a/common/com/pahimar/ee3/lib/Models.java b/common/com/pahimar/ee3/lib/Models.java index 430f6aea..61ccb432 100644 --- a/common/com/pahimar/ee3/lib/Models.java +++ b/common/com/pahimar/ee3/lib/Models.java @@ -10,5 +10,5 @@ public class Models { public static final String GLASS_BELL = MODEL_LOCATION + "aludel.obj"; public static final String ALCHEMY_TABLE = MODEL_LOCATION + "alchemyTable.obj"; public static final String RENDERING_TANK = MODEL_LOCATION + "renderingTank.obj"; - + } diff --git a/common/com/pahimar/ee3/lib/RenderIds.java b/common/com/pahimar/ee3/lib/RenderIds.java index 5ba47ea2..348c4311 100644 --- a/common/com/pahimar/ee3/lib/RenderIds.java +++ b/common/com/pahimar/ee3/lib/RenderIds.java @@ -17,5 +17,5 @@ public class RenderIds { public static int glassBell; public static int alchemyTable; public static int renderingTank; - + } diff --git a/common/com/pahimar/ee3/lib/Strings.java b/common/com/pahimar/ee3/lib/Strings.java index 5979839e..15af9d91 100644 --- a/common/com/pahimar/ee3/lib/Strings.java +++ b/common/com/pahimar/ee3/lib/Strings.java @@ -15,7 +15,7 @@ public class Strings { public static final String TRUE = "true"; public static final String FALSE = "false"; public static final String TOKEN_DELIMITER = ","; - + /* Localization Prefixes */ public static final String RESOURCE_PREFIX = Reference.MOD_ID.toLowerCase() + ":"; diff --git a/common/com/pahimar/ee3/nbt/NBTHelper.java b/common/com/pahimar/ee3/nbt/NBTHelper.java index 06e87be5..e04fefaa 100644 --- a/common/com/pahimar/ee3/nbt/NBTHelper.java +++ b/common/com/pahimar/ee3/nbt/NBTHelper.java @@ -39,20 +39,20 @@ public class NBTHelper { /** * Encodes the given NBT object as a String - * @param nbtBase + * + * @param nbtBase * @return String encoding of the given NBT object */ public static String encodeNBTAsString(NBTBase nbtBase) { - + StringBuilder stringBuilder = new StringBuilder(); if (nbtBase != null) { // Encode the name of the tag, and the type of the tag stringBuilder.append(String.format("'%s':%s:", nbtBase.getName(), NBTBase.getTagName(nbtBase.getId()))); - + // Encode the value of the tag, depending on the type of the tag - switch (nbtBase.getId()) - { + switch (nbtBase.getId()) { case 0: { stringBuilder.append(((NBTTagEnd) nbtBase).toString()); break; @@ -83,19 +83,19 @@ public class NBTHelper { } case 7: { NBTTagByteArray byteArray = (NBTTagByteArray) nbtBase; - + stringBuilder.append("["); - + for (int i = 0; i < byteArray.byteArray.length; i++) { stringBuilder.append(byteArray.byteArray[i]); - + if (i < byteArray.byteArray.length - 1) { stringBuilder.append("|"); } } - + stringBuilder.append("]"); - + break; } case 8: { @@ -104,63 +104,63 @@ public class NBTHelper { } case 9: { NBTTagList tagList = (NBTTagList) nbtBase; - + stringBuilder.append("["); - + for (int i = 0; i < tagList.tagCount(); i++) { Object tagObject = tagList.tagAt(i); - + if (tagObject instanceof NBTBase) { stringBuilder.append(encodeNBTAsString((NBTBase) tagObject)); } - + if (i < tagList.tagCount() - 1) { stringBuilder.append("|"); } } - + stringBuilder.append("]"); - + break; } case 10: { NBTTagCompound tagCompound = (NBTTagCompound) nbtBase; - + stringBuilder.append("["); - + Iterator tagIterator = tagCompound.getTags().iterator(); - + while (tagIterator.hasNext()) { Object tagObject = tagIterator.next(); - + if (tagObject instanceof NBTBase) { stringBuilder.append(encodeNBTAsString((NBTBase) tagObject)); } - + if (tagIterator.hasNext()) { stringBuilder.append("|"); } } - + stringBuilder.append("]"); - + break; } case 11: { NBTTagIntArray intArray = (NBTTagIntArray) nbtBase; - + stringBuilder.append("["); - + for (int i = 0; i < intArray.intArray.length; i++) { stringBuilder.append(intArray.intArray[i]); - + if (i < intArray.intArray.length - 1) { stringBuilder.append("|"); } } - + stringBuilder.append("]"); - + break; } default: { @@ -169,10 +169,10 @@ public class NBTHelper { } } } - + return stringBuilder.toString(); } - + // TODO Link this method to some API stuffs public static NBTTagCompound encodeStackAsNBT(Object stackObject) { @@ -184,9 +184,9 @@ public class NBTHelper { NBTTagCompound encodedStack = new NBTTagCompound(name); if (CustomWrappedStack.canBeWrapped(object)) { - + CustomWrappedStack wrappedStack = new CustomWrappedStack(object); - + if (wrappedStack.getWrappedStack() instanceof ItemStack) { ItemStack itemStack = (ItemStack) wrappedStack.getWrappedStack(); diff --git a/common/com/pahimar/ee3/tileentity/TileAlchemyTable.java b/common/com/pahimar/ee3/tileentity/TileAlchemyTable.java index 80796982..d2d24f00 100644 --- a/common/com/pahimar/ee3/tileentity/TileAlchemyTable.java +++ b/common/com/pahimar/ee3/tileentity/TileAlchemyTable.java @@ -5,74 +5,85 @@ import net.minecraft.item.ItemStack; public class TileAlchemyTable extends TileEE implements IInventory { - public TileAlchemyTable() { - - } - - @Override - public int getSizeInventory() { - // TODO Auto-generated method stub - return 0; - } + public TileAlchemyTable() { - @Override - public ItemStack getStackInSlot(int slotIndex) { - // TODO Auto-generated method stub - return null; - } + } - @Override - public ItemStack decrStackSize(int slotIndex, int decrementAmount) { - // TODO Auto-generated method stub - return null; - } + @Override + public int getSizeInventory() { - @Override - public ItemStack getStackInSlotOnClosing(int slotIndex) { - // TODO Auto-generated method stub - return null; - } + // TODO Auto-generated method stub + return 0; + } - @Override - public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { - // TODO Auto-generated method stub - - } + @Override + public ItemStack getStackInSlot(int slotIndex) { - @Override - public String getInvName() { - // TODO Auto-generated method stub - return null; - } + // TODO Auto-generated method stub + return null; + } - @Override - public boolean isInvNameLocalized() { - // TODO Auto-generated method stub - return false; - } + @Override + public ItemStack decrStackSize(int slotIndex, int decrementAmount) { - @Override - public int getInventoryStackLimit() { - // TODO Auto-generated method stub - return 0; - } + // TODO Auto-generated method stub + return null; + } - @Override - public void openChest() { - // TODO Auto-generated method stub - - } + @Override + public ItemStack getStackInSlotOnClosing(int slotIndex) { - @Override - public void closeChest() { - // TODO Auto-generated method stub - - } + // TODO Auto-generated method stub + return null; + } - @Override - public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { - // TODO Auto-generated method stub - return false; - } + @Override + public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { + + // TODO Auto-generated method stub + + } + + @Override + public String getInvName() { + + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean isInvNameLocalized() { + + // TODO Auto-generated method stub + return false; + } + + @Override + public int getInventoryStackLimit() { + + // TODO Auto-generated method stub + return 0; + } + + @Override + public void openChest() { + + // TODO Auto-generated method stub + + } + + @Override + public void closeChest() { + + // TODO Auto-generated method stub + + } + + @Override + public boolean isItemValidForSlot(int slotIndex, ItemStack itemstack) { + + // TODO Auto-generated method stub + return false; + } } diff --git a/common/com/pahimar/ee3/tileentity/TileRenderingTank.java b/common/com/pahimar/ee3/tileentity/TileRenderingTank.java index e1db3580..6449008f 100644 --- a/common/com/pahimar/ee3/tileentity/TileRenderingTank.java +++ b/common/com/pahimar/ee3/tileentity/TileRenderingTank.java @@ -2,7 +2,7 @@ package com.pahimar.ee3.tileentity; public class TileRenderingTank extends TileEE { - public TileRenderingTank() { - - } + public TileRenderingTank() { + + } }