diff --git a/bin/minecraft/resources/mekanism/animate/CompressorFront.png b/bin/minecraft/resources/mekanism/animate/CompressorFront.png index 60d9e938f..b99d00592 100644 Binary files a/bin/minecraft/resources/mekanism/animate/CompressorFront.png and b/bin/minecraft/resources/mekanism/animate/CompressorFront.png differ diff --git a/bin/minecraft/resources/mekanism/animate/PurificationChamberFront.png b/bin/minecraft/resources/mekanism/animate/PurificationChamberFront.png new file mode 100644 index 000000000..b6d142a5b Binary files /dev/null and b/bin/minecraft/resources/mekanism/animate/PurificationChamberFront.png differ diff --git a/bin/minecraft/resources/mekanism/gui/GuiPurificationChamber.png b/bin/minecraft/resources/mekanism/gui/GuiPurificationChamber.png new file mode 100755 index 000000000..1d93991a8 Binary files /dev/null and b/bin/minecraft/resources/mekanism/gui/GuiPurificationChamber.png differ diff --git a/bin/minecraft/resources/mekanism/sound/PurificationChamber.ogg b/bin/minecraft/resources/mekanism/sound/PurificationChamber.ogg new file mode 100644 index 000000000..9c2d6b9d0 Binary files /dev/null and b/bin/minecraft/resources/mekanism/sound/PurificationChamber.ogg differ diff --git a/bin/minecraft/resources/mekanism/textures/items.png b/bin/minecraft/resources/mekanism/textures/items.png index 7f53eb50e..abccf18cb 100644 Binary files a/bin/minecraft/resources/mekanism/textures/items.png and b/bin/minecraft/resources/mekanism/textures/items.png differ diff --git a/bin/minecraft/resources/mekanism/textures/terrain.png b/bin/minecraft/resources/mekanism/textures/terrain.png index ed4f1da0d..3e45ba82e 100755 Binary files a/bin/minecraft/resources/mekanism/textures/terrain.png and b/bin/minecraft/resources/mekanism/textures/terrain.png differ diff --git a/src/minecraft/mekanism/api/IElectricMachine.java b/src/minecraft/mekanism/api/IElectricMachine.java index 83c124b3c..9ec67892e 100644 --- a/src/minecraft/mekanism/api/IElectricMachine.java +++ b/src/minecraft/mekanism/api/IElectricMachine.java @@ -1,5 +1,6 @@ package mekanism.api; +import java.util.HashMap; import java.util.Map; /** @@ -24,10 +25,9 @@ public interface IElectricMachine * Runs this machine's operation -- or smelts the item. */ public void operate(); - + /** - * Gets the recipe vector from the machine tile entity. - * @return recipes + * Gets this machine's recipes. */ - public Map getRecipes(); + public HashMap getRecipes(); } diff --git a/src/minecraft/mekanism/client/ClientProxy.java b/src/minecraft/mekanism/client/ClientProxy.java index 3882e9e72..0e217e385 100644 --- a/src/minecraft/mekanism/client/ClientProxy.java +++ b/src/minecraft/mekanism/client/ClientProxy.java @@ -12,6 +12,7 @@ import mekanism.common.TileEntityElectricMachine; import mekanism.common.TileEntityEnergyCube; import mekanism.common.TileEntityGasTank; import mekanism.common.TileEntityMetallurgicInfuser; +import mekanism.common.TileEntityPurificationChamber; import mekanism.common.TileEntitySmeltingFactory; import mekanism.common.TileEntityTeleporter; import mekanism.common.TileEntityTheoreticalElementizer; @@ -77,6 +78,7 @@ public class ClientProxy extends CommonProxy MinecraftForgeClient.preloadTexture("/resources/mekanism/animate/ElementizerSide.png"); MinecraftForgeClient.preloadTexture("/resources/mekanism/animate/HydrogenFront.png"); MinecraftForgeClient.preloadTexture("/resources/mekanism/animate/HydrogenSide.png"); + MinecraftForgeClient.preloadTexture("/resources/mekanism/animate/PurificationChamberFront.png"); //Register animated TextureFX try { @@ -88,6 +90,7 @@ public class ClientProxy extends CommonProxy TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/ElementizerSide.png", Mekanism.ANIMATED_TEXTURE_INDEX+6)); TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/InfuserFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+7)); TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/InfuserSide.png", Mekanism.ANIMATED_TEXTURE_INDEX+8)); + TextureFXManager.instance().addAnimation(new TextureAnimatedFX("/resources/mekanism/animate/PurificationChamberFront.png", Mekanism.ANIMATED_TEXTURE_INDEX+9)); } catch (IOException e) { System.err.println("[Mekanism] Error registering animation with FML: " + e.getMessage()); } @@ -135,13 +138,13 @@ public class ClientProxy extends CommonProxy case 2: return new GuiWeatherOrb(player); case 3: - return new GuiElectricMachine(player.inventory, (TileEntityElectricMachine)tileEntity); + return new GuiEnrichmentChamber(player.inventory, (TileEntityElectricMachine)tileEntity); case 4: - return new GuiAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); + return new GuiPlatinumCompressor(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); case 5: - return new GuiAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); + return new GuiCombiner(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); case 6: - return new GuiElectricMachine(player.inventory, (TileEntityElectricMachine)tileEntity); + return new GuiCrusher(player.inventory, (TileEntityElectricMachine)tileEntity); case 7: return new GuiTheoreticalElementizer(player.inventory, (TileEntityTheoreticalElementizer)tileEntity); case 8: @@ -162,6 +165,8 @@ public class ClientProxy extends CommonProxy { return new GuiPortableTeleporter(player, itemStack); } + case 15: + return new GuiPurificationChamber(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); } return null; } diff --git a/src/minecraft/mekanism/client/GuiCombiner.java b/src/minecraft/mekanism/client/GuiCombiner.java new file mode 100644 index 000000000..e81f286b3 --- /dev/null +++ b/src/minecraft/mekanism/client/GuiCombiner.java @@ -0,0 +1,12 @@ +package mekanism.client; + +import mekanism.common.TileEntityAdvancedElectricMachine; +import net.minecraft.entity.player.InventoryPlayer; + +public class GuiCombiner extends GuiAdvancedElectricMachine +{ + public GuiCombiner(InventoryPlayer inventory, TileEntityAdvancedElectricMachine tentity) + { + super(inventory, tentity); + } +} diff --git a/src/minecraft/mekanism/client/GuiCrusher.java b/src/minecraft/mekanism/client/GuiCrusher.java new file mode 100644 index 000000000..131754499 --- /dev/null +++ b/src/minecraft/mekanism/client/GuiCrusher.java @@ -0,0 +1,12 @@ +package mekanism.client; + +import mekanism.common.TileEntityElectricMachine; +import net.minecraft.entity.player.InventoryPlayer; + +public class GuiCrusher extends GuiElectricMachine +{ + public GuiCrusher(InventoryPlayer inventory, TileEntityElectricMachine tentity) + { + super(inventory, tentity); + } +} diff --git a/src/minecraft/mekanism/client/GuiEnrichmentChamber.java b/src/minecraft/mekanism/client/GuiEnrichmentChamber.java new file mode 100644 index 000000000..9062749e3 --- /dev/null +++ b/src/minecraft/mekanism/client/GuiEnrichmentChamber.java @@ -0,0 +1,12 @@ +package mekanism.client; + +import mekanism.common.TileEntityElectricMachine; +import net.minecraft.entity.player.InventoryPlayer; + +public class GuiEnrichmentChamber extends GuiElectricMachine +{ + public GuiEnrichmentChamber(InventoryPlayer inventory, TileEntityElectricMachine tentity) + { + super(inventory, tentity); + } +} diff --git a/src/minecraft/mekanism/client/GuiPlatinumCompressor.java b/src/minecraft/mekanism/client/GuiPlatinumCompressor.java new file mode 100644 index 000000000..065c313d7 --- /dev/null +++ b/src/minecraft/mekanism/client/GuiPlatinumCompressor.java @@ -0,0 +1,12 @@ +package mekanism.client; + +import mekanism.common.TileEntityAdvancedElectricMachine; +import net.minecraft.entity.player.InventoryPlayer; + +public class GuiPlatinumCompressor extends GuiAdvancedElectricMachine +{ + public GuiPlatinumCompressor(InventoryPlayer inventory, TileEntityAdvancedElectricMachine tentity) + { + super(inventory, tentity); + } +} diff --git a/src/minecraft/mekanism/client/GuiPortableTeleporter.java b/src/minecraft/mekanism/client/GuiPortableTeleporter.java index 9b676548d..c21c804c6 100644 --- a/src/minecraft/mekanism/client/GuiPortableTeleporter.java +++ b/src/minecraft/mekanism/client/GuiPortableTeleporter.java @@ -65,8 +65,11 @@ public class GuiPortableTeleporter extends GuiScreen ItemPortableTeleporter item = (ItemPortableTeleporter)itemStack.getItem(); - fontRenderer.drawString("Portable Teleporter", 160, 43, 0x404040); - fontRenderer.drawString(item.getStatusAsString(item.getStatus(itemStack)), 178, 56, 0x00CD00); + ((GuiButton)controlList.get(0)).xPosition = guiWidth+48; + ((GuiButton)controlList.get(0)).yPosition = guiHeight+68; + + fontRenderer.drawString("Portable Teleporter", guiWidth+39, guiHeight+6, 0x404040); + fontRenderer.drawString(item.getStatusAsString(item.getStatus(itemStack)), guiWidth+53, guiHeight+19, 0x00CD00); super.drawScreen(i, j, f); } diff --git a/src/minecraft/mekanism/client/GuiPurificationChamber.java b/src/minecraft/mekanism/client/GuiPurificationChamber.java new file mode 100644 index 000000000..fc7796e50 --- /dev/null +++ b/src/minecraft/mekanism/client/GuiPurificationChamber.java @@ -0,0 +1,12 @@ +package mekanism.client; + +import mekanism.common.TileEntityAdvancedElectricMachine; +import net.minecraft.entity.player.InventoryPlayer; + +public class GuiPurificationChamber extends GuiAdvancedElectricMachine +{ + public GuiPurificationChamber(InventoryPlayer inventory, TileEntityAdvancedElectricMachine tentity) + { + super(inventory, tentity); + } +} diff --git a/src/minecraft/mekanism/client/GuiSmeltingFactory.java b/src/minecraft/mekanism/client/GuiSmeltingFactory.java index 6a712e035..ea05ef6e0 100644 --- a/src/minecraft/mekanism/client/GuiSmeltingFactory.java +++ b/src/minecraft/mekanism/client/GuiSmeltingFactory.java @@ -50,8 +50,7 @@ public class GuiSmeltingFactory extends GuiContainer drawTexturedModalRect(guiWidth + xAxis, guiHeight + 33, 176, 52, 8, displayInt); } } - - if(tileEntity.tier == SmeltingFactoryTier.ADVANCED) + else if(tileEntity.tier == SmeltingFactoryTier.ADVANCED) { for(int i = 0; i < tileEntity.tier.processes; i++) { @@ -61,8 +60,7 @@ public class GuiSmeltingFactory extends GuiContainer drawTexturedModalRect(guiWidth + xAxis, guiHeight + 33, 176, 52, 8, displayInt); } } - - if(tileEntity.tier == SmeltingFactoryTier.ELITE) + else if(tileEntity.tier == SmeltingFactoryTier.ELITE) { for(int i = 0; i < tileEntity.tier.processes; i++) { diff --git a/src/minecraft/mekanism/common/BlockMachine.java b/src/minecraft/mekanism/common/BlockMachine.java index 4ee829bb2..7d9579621 100644 --- a/src/minecraft/mekanism/common/BlockMachine.java +++ b/src/minecraft/mekanism/common/BlockMachine.java @@ -34,6 +34,7 @@ import cpw.mods.fml.relauncher.SideOnly; * 6: Advanced Smelting Factory * 7: Elite Smelting Factory * 8: Metallurgic Infuser + * 9: Purification Chamber * @author AidanBrady * */ @@ -130,7 +131,7 @@ public class BlockMachine extends BlockContainer return 9; } else { - return 2; + return 26; } } else if(meta == 1) @@ -140,7 +141,7 @@ public class BlockMachine extends BlockContainer return 14; } else { - return 2; + return 26; } } else if(meta == 2) @@ -183,6 +184,10 @@ public class BlockMachine extends BlockContainer { return 41; } + else if(side == 0 || side == 1) + { + return 47; + } else { return 44; } @@ -193,6 +198,10 @@ public class BlockMachine extends BlockContainer { return 42; } + else if(side == 0 || side == 1) + { + return 48; + } else { return 45; } @@ -203,6 +212,10 @@ public class BlockMachine extends BlockContainer { return 43; } + else if(side == 0 || side == 1) + { + return 49; + } else { return 46; } @@ -217,6 +230,16 @@ public class BlockMachine extends BlockContainer return 32; } } + else if(meta == 9) + { + if(side == 3) + { + return 12; + } + else { + return 2; + } + } else { return 0; } @@ -236,7 +259,7 @@ public class BlockMachine extends BlockContainer return MekanismUtils.isActive(world, x, y, z) ? 8 : 9; } else { - return 2; + return 26; } } else if(metadata == 1) @@ -246,7 +269,7 @@ public class BlockMachine extends BlockContainer return MekanismUtils.isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+2 : 14; } else { - return 2; + return 26; } } else if(metadata == 2) @@ -295,6 +318,10 @@ public class BlockMachine extends BlockContainer { return 41; } + else if(side == 0 || side == 1) + { + return 47; + } else { return 44; } @@ -305,6 +332,10 @@ public class BlockMachine extends BlockContainer { return 42; } + else if(side == 0 || side == 1) + { + return 48; + } else { return 45; } @@ -315,6 +346,10 @@ public class BlockMachine extends BlockContainer { return 43; } + else if(side == 0 || side == 1) + { + return 49; + } else { return 46; } @@ -329,6 +364,16 @@ public class BlockMachine extends BlockContainer return MekanismUtils.isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+8 : 32; } } + else if(metadata == 9) + { + if(side == tileEntity.facing) + { + return MekanismUtils.isActive(world, x, y, z) ? Mekanism.ANIMATED_TEXTURE_INDEX+9 : 12; + } + else { + return 2; + } + } else { return 0; } @@ -358,6 +403,7 @@ public class BlockMachine extends BlockContainer list.add(new ItemStack(i, 1, 6)); list.add(new ItemStack(i, 1, 7)); list.add(new ItemStack(i, 1, 8)); + list.add(new ItemStack(i, 1, 9)); } @Override @@ -504,7 +550,8 @@ public class BlockMachine extends BlockContainer BASIC_SMELTING_FACTORY(5, 11, TileEntitySmeltingFactory.class, false), ADVANCED_SMELTING_FACTORY(6, 11, TileEntityAdvancedSmeltingFactory.class, false), ELITE_SMELTING_FACTORY(7, 11, TileEntityEliteSmeltingFactory.class, false), - METALLURGIC_INFUSER(8, 12, TileEntityMetallurgicInfuser.class, false); + METALLURGIC_INFUSER(8, 12, TileEntityMetallurgicInfuser.class, false), + PURIFICATION_CHAMBER(9, 15, TileEntityPurificationChamber.class, false); public int meta; public int guiId; diff --git a/src/minecraft/mekanism/common/CommonProxy.java b/src/minecraft/mekanism/common/CommonProxy.java index dc6c00657..c920ec888 100644 --- a/src/minecraft/mekanism/common/CommonProxy.java +++ b/src/minecraft/mekanism/common/CommonProxy.java @@ -66,8 +66,9 @@ public class CommonProxy Mekanism.gasTankID = Mekanism.configuration.getBlock("GasTank", 3006).getInt(); Mekanism.extrasEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ExtrasEnabled", true).getBoolean(true); Mekanism.platinumGenerationEnabled = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PlatinumGenerationEnabled", true).getBoolean(true); - Mekanism.disableBCSteelCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCSteelCrafting", true).getBoolean(true); - Mekanism.disableBCBronzeCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCBronzeCrafting", true).getBoolean(true); + Mekanism.disableBCSteelCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCSteelCrafting", false).getBoolean(true); + Mekanism.disableBCBronzeCrafting = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisableBCBronzeCrafting", false).getBoolean(true); + Mekanism.notifyNewReleases = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "NotifyNewReleases", false).getBoolean(true); Mekanism.configuration.save(); } @@ -145,6 +146,8 @@ public class CommonProxy return new ContainerMetallurgicInfuser(player.inventory, (TileEntityMetallurgicInfuser)tileEntity); case 13: return new ContainerTeleporter(player.inventory, (TileEntityTeleporter)tileEntity); + case 15: + return new ContainerAdvancedElectricMachine(player.inventory, (TileEntityAdvancedElectricMachine)tileEntity); } return null; } diff --git a/src/minecraft/mekanism/common/ContainerMetallurgicInfuser.java b/src/minecraft/mekanism/common/ContainerMetallurgicInfuser.java index 124dfa044..ab8ac00a8 100644 --- a/src/minecraft/mekanism/common/ContainerMetallurgicInfuser.java +++ b/src/minecraft/mekanism/common/ContainerMetallurgicInfuser.java @@ -4,6 +4,7 @@ import ic2.api.IElectricItem; import mekanism.api.InfusionInput; import mekanism.api.InfusionOutput; import mekanism.api.InfusionType; +import mekanism.common.RecipeHandler.Recipe; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -97,7 +98,7 @@ public class ContainerMetallurgicInfuser extends Container return null; } } - else if(RecipeHandler.getOutput(InfusionInput.getInfusion(tileEntity.type, tileEntity.infuseStored, slotStack), false, TileEntityMetallurgicInfuser.recipes) != null) + else if(RecipeHandler.getOutput(InfusionInput.getInfusion(tileEntity.type, tileEntity.infuseStored, slotStack), false, Recipe.METALLURGIC_INFUSER.get()) != null) { if(!mergeItemStack(slotStack, 2, 3, false)) { diff --git a/src/minecraft/mekanism/common/ContainerSmeltingFactory.java b/src/minecraft/mekanism/common/ContainerSmeltingFactory.java index 6d3013dab..8abf979f3 100644 --- a/src/minecraft/mekanism/common/ContainerSmeltingFactory.java +++ b/src/minecraft/mekanism/common/ContainerSmeltingFactory.java @@ -30,30 +30,46 @@ public class ContainerSmeltingFactory extends Container { int xAxis = 55 + (i*38); - addSlotToContainer(new Slot(tentity, 2+i*2, xAxis, 13)); - addSlotToContainer(new SlotFurnace(inventory.player, tentity, 3+i*2, xAxis, 57)); + addSlotToContainer(new Slot(tentity, 2+i, xAxis, 13)); + } + + for(int i = 0; i < tileEntity.tier.processes; i++) + { + int xAxis = 55 + (i*38); + + addSlotToContainer(new SlotFurnace(inventory.player, tentity, tileEntity.tier.processes+2+i, xAxis, 57)); } } - else if(tileEntity.tier == SmeltingFactoryTier.ADVANCED) { for(int i = 0; i < tileEntity.tier.processes; i++) { int xAxis = 35 + (i*26); - addSlotToContainer(new Slot(tentity, 2+i*2, xAxis, 13)); - addSlotToContainer(new SlotFurnace(inventory.player, tentity, 3+i*2, xAxis, 57)); + addSlotToContainer(new Slot(tentity, 2+i, xAxis, 13)); + } + + for(int i = 0; i < tileEntity.tier.processes; i++) + { + int xAxis = 35 + (i*26); + + addSlotToContainer(new SlotFurnace(inventory.player, tentity, tileEntity.tier.processes+2+i, xAxis, 57)); } } - else if(tileEntity.tier == SmeltingFactoryTier.ELITE) { for(int i = 0; i < tileEntity.tier.processes; i++) { int xAxis = 29 + (i*19); - addSlotToContainer(new Slot(tentity, 2+i*2, xAxis, 13)); - addSlotToContainer(new SlotFurnace(inventory.player, tentity, 3+i*2, xAxis, 57)); + addSlotToContainer(new Slot(tentity, 2+i, xAxis, 13)); + } + + for(int i = 0; i < tileEntity.tier.processes; i++) + { + int xAxis = 29 + (i*19); + + addSlotToContainer(new SlotFurnace(inventory.player, tentity, tileEntity.tier.processes+2+i, xAxis, 57)); } } @@ -127,34 +143,10 @@ public class ContainerSmeltingFactory extends Container { if(!isInputSlot(slotID)) { - if(!mergeItemStack(slotStack, 2, 3, false)) - { - if(!mergeItemStack(slotStack, 4, 5, false)) - { - if(!mergeItemStack(slotStack, 6, 7, false)) - { - if(tileEntity.tier != SmeltingFactoryTier.BASIC) - { - if(!mergeItemStack(slotStack, 8, 9, false)) - { - if(!mergeItemStack(slotStack, 10, 11, false)) - { - if(tileEntity.tier != SmeltingFactoryTier.ADVANCED) - { - if(!mergeItemStack(slotStack, 12, 13, false)) - { - if(!mergeItemStack(slotStack, 14, 15, false)) - { - return null; - } - } - } - } - } - } - } - } - } + if(!mergeItemStack(slotStack, 2, 2+tileEntity.tier.processes, false)) + { + return null; + } } else { if(!mergeItemStack(slotStack, tileEntity.inventory.length, inventorySlots.size(), true)) @@ -227,11 +219,11 @@ public class ContainerSmeltingFactory extends Container public boolean isInputSlot(int slot) { if(tileEntity.tier == Tier.SmeltingFactoryTier.BASIC) - return slot == 2 || slot == 4 || slot == 6; + return slot >= 2 && slot <= 4; if(tileEntity.tier == Tier.SmeltingFactoryTier.ADVANCED) - return slot == 2 || slot == 4 || slot == 6 || slot == 8 || slot == 10; + return slot >= 2 && slot <= 6; if(tileEntity.tier == Tier.SmeltingFactoryTier.ELITE) - return slot == 2 || slot == 4 || slot == 6 || slot == 8 || slot == 12 || slot == 14; + return slot >= 2 && slot <= 8; return false; } @@ -239,11 +231,11 @@ public class ContainerSmeltingFactory extends Container public boolean isOutputSlot(int slot) { if(tileEntity.tier == Tier.SmeltingFactoryTier.BASIC) - return slot == 3 || slot == 5 || slot == 7; + return slot >= 5 && slot <= 7; if(tileEntity.tier == Tier.SmeltingFactoryTier.ADVANCED) - return slot == 3 || slot == 5 || slot == 7 || slot == 9 || slot == 11; + return slot >= 7 && slot <= 11; if(tileEntity.tier == Tier.SmeltingFactoryTier.ELITE) - return slot == 3 || slot == 5 || slot == 7 || slot == 9 || slot == 11 || slot == 13 || slot == 15; + return slot >= 9 && slot <= 15; return false; } diff --git a/src/minecraft/mekanism/common/ItemBlockMachine.java b/src/minecraft/mekanism/common/ItemBlockMachine.java index 02bc1bfc9..52c7391f6 100644 --- a/src/minecraft/mekanism/common/ItemBlockMachine.java +++ b/src/minecraft/mekanism/common/ItemBlockMachine.java @@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack; * 6: Advanced Smelting Factory * 7: Elite Smelting Factory * 8: Metallurgic Infuser + * 9: Purification Chamber * @author AidanBrady * */ @@ -74,6 +75,9 @@ public class ItemBlockMachine extends ItemBlock case 8: name = "MetallurgicInfuser"; break; + case 9: + name = "PurificationChamber"; + break; default: name = "Unknown"; break; diff --git a/src/minecraft/mekanism/common/ItemClump.java b/src/minecraft/mekanism/common/ItemClump.java new file mode 100644 index 000000000..e170339b7 --- /dev/null +++ b/src/minecraft/mekanism/common/ItemClump.java @@ -0,0 +1,48 @@ +package mekanism.common; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; + +public class ItemClump extends ItemMekanism +{ + public static String[] en_USNames = {"Iron", "Gold", "Platinum", + "Copper", "Tin"}; + + public ItemClump(int id) + { + super(id); + setHasSubtypes(true); + setCreativeTab(Mekanism.tabMekanism); + } + + @Override + public int getIconFromDamage(int meta) + { + switch (meta) + { + case 0: return 216; + case 1: return 218; + case 2: return 210; + case 3: return 211; + case 4: return 212; + default: return 0; + } + } + + @Override + public void getSubItems(int id, CreativeTabs tabs, List itemList) + { + for (int counter = 0; counter <= 4; ++counter) + { + itemList.add(new ItemStack(this, 1, counter)); + } + } + + @Override + public String getItemNameIS(ItemStack item) + { + return "item." + en_USNames[item.getItemDamage()].toLowerCase() + "Clump"; + } +} diff --git a/src/minecraft/mekanism/common/ItemDirtyDust.java b/src/minecraft/mekanism/common/ItemDirtyDust.java new file mode 100644 index 000000000..34ccc63b2 --- /dev/null +++ b/src/minecraft/mekanism/common/ItemDirtyDust.java @@ -0,0 +1,48 @@ +package mekanism.common; + +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.ItemStack; + +public class ItemDirtyDust extends ItemMekanism +{ + public static String[] en_USNames = {"Iron", "Gold", "Platinum", + "Copper", "Tin"}; + + public ItemDirtyDust(int id) + { + super(id); + setHasSubtypes(true); + setCreativeTab(Mekanism.tabMekanism); + } + + @Override + public int getIconFromDamage(int meta) + { + switch (meta) + { + case 0: return 200; + case 1: return 202; + case 2: return 194; + case 3: return 195; + case 4: return 196; + default: return 0; + } + } + + @Override + public void getSubItems(int id, CreativeTabs tabs, List itemList) + { + for (int counter = 0; counter <= 4; ++counter) + { + itemList.add(new ItemStack(this, 1, counter)); + } + } + + @Override + public String getItemNameIS(ItemStack item) + { + return "item.dirty" + en_USNames[item.getItemDamage()] + "Dust"; + } +} diff --git a/src/minecraft/mekanism/common/ItemPortableTeleporter.java b/src/minecraft/mekanism/common/ItemPortableTeleporter.java index e5f5fc9ab..91c0b8203 100644 --- a/src/minecraft/mekanism/common/ItemPortableTeleporter.java +++ b/src/minecraft/mekanism/common/ItemPortableTeleporter.java @@ -103,4 +103,10 @@ public class ItemPortableTeleporter extends ItemEnergized itemstack.stackTagCompound.setInteger("digit"+index, digit); } + + @Override + public boolean canProduceElectricity() + { + return false; + } } diff --git a/src/minecraft/mekanism/common/Mekanism.java b/src/minecraft/mekanism/common/Mekanism.java index a0866ec06..719bf99d1 100644 --- a/src/minecraft/mekanism/common/Mekanism.java +++ b/src/minecraft/mekanism/common/Mekanism.java @@ -49,7 +49,7 @@ import cpw.mods.fml.server.FMLServerHandler; * @author AidanBrady * */ -@Mod(modid = "Mekanism", name = "Mekanism", version = "5.1.1") +@Mod(modid = "Mekanism", name = "Mekanism", version = "5.2.0") @NetworkMod(channels = {"Mekanism"}, clientSideRequired = true, serverSideRequired = false, packetHandler = PacketHandler.class) public class Mekanism { @@ -71,7 +71,7 @@ public class Mekanism public static Configuration configuration; /** Mekanism version number */ - public static Version versionNumber = new Version(5, 1, 1); + public static Version versionNumber = new Version(5, 2, 0); /** Map of Teleporter info. */ public static Map> teleporters = new HashMap>(); @@ -138,12 +138,15 @@ public class Mekanism //MultiID Items public static Item Dust; public static Item Ingot; + public static Item Clump; + public static Item DirtyDust; //Boolean Values public static boolean extrasEnabled = true; public static boolean platinumGenerationEnabled = true; public static boolean disableBCBronzeCrafting = true; public static boolean disableBCSteelCrafting = true; + public static boolean notifyNewReleases = true; //Extra data public static float ObsidianTNTBlastRadius = 12.0F; @@ -172,13 +175,13 @@ public class Mekanism "*", Character.valueOf('*'), new ItemStack(BasicBlock, 1, 3) })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BasicBlock, 1, 2), new Object[] { - "***", "***", "***", Character.valueOf('*'), "ingotObsidian" + "***", "***", "***", Character.valueOf('*'), "ingotRefinedObsidian" })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Ingot, 9, 0), new Object[] { "*", Character.valueOf('*'), new ItemStack(BasicBlock, 1, 2) })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(BasicBlock, 1, 4), new Object[] { - "***", "***", "***", Character.valueOf('*'), "ingotGlowstone" + "***", "***", "***", Character.valueOf('*'), "ingotRefinedGlowstone" })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(Ingot, 9, 3), new Object[] { "*", Character.valueOf('*'), new ItemStack(BasicBlock, 1, 4) @@ -234,7 +237,7 @@ public class Mekanism "AOA", "PDP", "AOA", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('O'), "dustObsidian", Character.valueOf('P'), "dustPlatinum", Character.valueOf('D'), Item.diamond })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(AtomicDisassembler.getUnchargedItem(), new Object[] { - "AEA", "ACA", " O ", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('C'), AtomicCore, Character.valueOf('O'), "ingotObsidian" + "AEA", "ACA", " O ", Character.valueOf('A'), EnrichedAlloy, Character.valueOf('E'), EnergyTablet.getUnchargedItem(), Character.valueOf('C'), AtomicCore, Character.valueOf('O'), "ingotRefinedObsidian" })); CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(EnrichedAlloy), new Object[] { " R ", "RIR", " R ", Character.valueOf('R'), Item.redstone, Character.valueOf('I'), Item.ingotIron @@ -317,15 +320,15 @@ public class Mekanism //Platinum Compressor Recipes RecipeHandler.addPlatinumCompressorRecipe(new ItemStack(Item.lightStoneDust), new ItemStack(Ingot, 1, 3)); - //Combiner Recipes - RecipeHandler.addCombinerRecipe(new ItemStack(Item.redstone, 10), new ItemStack(Block.oreRedstone)); - RecipeHandler.addCombinerRecipe(new ItemStack(Item.dyePowder, 8, 4), new ItemStack(Block.oreLapis)); - //Crusher Recipes RecipeHandler.addCrusherRecipe(new ItemStack(Item.diamond), new ItemStack(Dust, 1, 4)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.ingotIron), new ItemStack(Dust, 1, 0)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.ingotGold), new ItemStack(Dust, 1, 1)); + //Purification Chamber Recipes + RecipeHandler.addPurificationChamberRecipe(new ItemStack(Block.oreIron), new ItemStack(Clump, 1, 0)); + RecipeHandler.addPurificationChamberRecipe(new ItemStack(Block.oreGold), new ItemStack(Clump, 1, 1)); + //Metallurgic Infuser Recipes RecipeHandler.addMetallurgicInfuserRecipe(InfusionInput.getInfusion(InfusionType.COAL, 10, new ItemStack(EnrichedIron)), new ItemStack(Dust, 1, 5)); } @@ -383,6 +386,7 @@ public class Mekanism LanguageRegistry.instance().addStringLocalization("tile.MachineBlock.AdvancedSmeltingFactory.name", "Advanced Smelting Factory"); LanguageRegistry.instance().addStringLocalization("tile.MachineBlock.EliteSmeltingFactory.name", "Elite Smelting Factory"); LanguageRegistry.instance().addStringLocalization("tile.MachineBlock.MetallurgicInfuser.name", "Metallurgic Infuser"); + LanguageRegistry.instance().addStringLocalization("tile.MachineBlock.PurificationChamber.name", "Purification Chamber"); //Localization for OreBlock LanguageRegistry.instance().addStringLocalization("tile.OreBlock.PlatinumOre.name", "Platinum Ore"); @@ -402,6 +406,20 @@ public class Mekanism LanguageRegistry.instance().addStringLocalization("item.copperDust.name", "Copper Dust"); LanguageRegistry.instance().addStringLocalization("item.tinDust.name", "Tin Dust"); + //Localization for Clump + LanguageRegistry.instance().addStringLocalization("item.ironClump.name", "Iron Clump"); + LanguageRegistry.instance().addStringLocalization("item.goldClump.name", "Gold Clump"); + LanguageRegistry.instance().addStringLocalization("item.platinumClump.name", "Platinum Clump"); + LanguageRegistry.instance().addStringLocalization("item.copperClump.name", "Copper Clump"); + LanguageRegistry.instance().addStringLocalization("item.tinClump.name", "Tin Clump"); + + //Localization for Dirty Dust + LanguageRegistry.instance().addStringLocalization("item.dirtyIronDust.name", "Dirty Iron Dust"); + LanguageRegistry.instance().addStringLocalization("item.dirtyGoldDust.name", "Dirty Gold Dust"); + LanguageRegistry.instance().addStringLocalization("item.dirtyPlatinumDust.name", "Dirty Platinum Dust"); + LanguageRegistry.instance().addStringLocalization("item.dirtyCopperDust.name", "Dirty Copper Dust"); + LanguageRegistry.instance().addStringLocalization("item.dirtyTinDust.name", "Dirty Tin Dust"); + //Localization for Ingot LanguageRegistry.instance().addStringLocalization("item.obsidianIngot.name", "Obsidian Ingot"); LanguageRegistry.instance().addStringLocalization("item.platinumIngot.name", "Platinum Ingot"); @@ -467,6 +485,8 @@ public class Mekanism CompressedCarbon = new ItemMekanism(configuration.getItem("CompressedCarbon", 11216).getInt()).setItemName("CompressedCarbon"); PortableTeleporter = new ItemPortableTeleporter(configuration.getItem("PortableTeleporter", 11217).getInt()).setItemName("PortableTeleporter"); TeleportationCore = new ItemMekanism(configuration.getItem("TeleportationCore", 11218).getInt()).setItemName("TeleportationCore"); + Clump = new ItemClump(configuration.getItem("Clump", 11219).getInt()-256); + DirtyDust = new ItemDirtyDust(configuration.getItem("DirtyDust", 11220).getInt()-256); configuration.save(); } @@ -511,10 +531,10 @@ public class Mekanism OreDictionary.registerOre("dustCopper", new ItemStack(Dust, 1, 6)); OreDictionary.registerOre("dustTin", new ItemStack(Dust, 1, 7)); - OreDictionary.registerOre("ingotObsidian", new ItemStack(Ingot, 1, 0)); + OreDictionary.registerOre("ingotRefinedObsidian", new ItemStack(Ingot, 1, 0)); OreDictionary.registerOre("ingotPlatinum", new ItemStack(Ingot, 1, 1)); OreDictionary.registerOre("ingotBronze", new ItemStack(Ingot, 1, 2)); - OreDictionary.registerOre("ingotGlowstone", new ItemStack(Ingot, 1, 3)); + OreDictionary.registerOre("ingotRefinedGlowstone", new ItemStack(Ingot, 1, 3)); OreDictionary.registerOre("ingotSteel", new ItemStack(Ingot, 1, 4)); OreDictionary.registerOre("blockPlatinum", new ItemStack(BasicBlock, 1, 0)); @@ -524,6 +544,18 @@ public class Mekanism OreDictionary.registerOre("blockRefinedGlowstone", new ItemStack(BasicBlock, 1, 4)); OreDictionary.registerOre("blockSteel", new ItemStack(BasicBlock, 1, 5)); + OreDictionary.registerOre("dirtyDustIron", new ItemStack(DirtyDust, 1, 0)); + OreDictionary.registerOre("dirtyDustGold", new ItemStack(DirtyDust, 1, 1)); + OreDictionary.registerOre("dirtyDustPlatinum", new ItemStack(DirtyDust, 1, 2)); + OreDictionary.registerOre("dirtyDustCopper", new ItemStack(DirtyDust, 1, 3)); + OreDictionary.registerOre("dirtyDustTin", new ItemStack(DirtyDust, 1, 4)); + + OreDictionary.registerOre("clumpIron", new ItemStack(Clump, 1, 0)); + OreDictionary.registerOre("clumpGold", new ItemStack(Clump, 1, 1)); + OreDictionary.registerOre("clumpPlatinum", new ItemStack(Clump, 1, 2)); + OreDictionary.registerOre("clumpCopper", new ItemStack(Clump, 1, 3)); + OreDictionary.registerOre("clumpTin", new ItemStack(Clump, 1, 4)); + OreDictionary.registerOre("orePlatinum", new ItemStack(OreBlock, 1, 0)); OreDictionary.registerOre("basicCircuit", new ItemStack(ControlCircuit)); @@ -538,25 +570,78 @@ public class Mekanism RecipeHandler.addCrusherRecipe(new ItemStack(Item.coal), hooks.IC2CoalDust); } + for(ItemStack ore : OreDictionary.getOres("clumpIron")) + { + RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 0)); + } + + for(ItemStack ore : OreDictionary.getOres("clumpGold")) + { + RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 1)); + } + + for(ItemStack ore : OreDictionary.getOres("clumpPlatinum")) + { + RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 2)); + } + + for(ItemStack ore : OreDictionary.getOres("clumpCopper")) + { + RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 3)); + } + + for(ItemStack ore : OreDictionary.getOres("clumpTin")) + { + RecipeHandler.addCrusherRecipe(ore, new ItemStack(DirtyDust, 1, 4)); + } + + for(ItemStack ore : OreDictionary.getOres("dirtyDustIron")) + { + RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 1, 0)); + } + + for(ItemStack ore : OreDictionary.getOres("dirtyDustGold")) + { + RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 1, 1)); + } + + for(ItemStack ore : OreDictionary.getOres("dirtyDustPlatinum")) + { + RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 1, 2)); + } + + for(ItemStack ore : OreDictionary.getOres("dirtyDustCopper")) + { + RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 1, 6)); + } + + for(ItemStack ore : OreDictionary.getOres("dirtyDustTin")) + { + RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 1, 7)); + } + for(ItemStack ore : OreDictionary.getOres("oreCopper")) { RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 2, 6)); + RecipeHandler.addPurificationChamberRecipe(ore, new ItemStack(Clump, 3, 3)); } for(ItemStack ore : OreDictionary.getOres("oreTin")) { RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 2, 7)); + RecipeHandler.addPurificationChamberRecipe(ore, new ItemStack(Clump, 3, 4)); } for(ItemStack ore : OreDictionary.getOres("orePlatinum")) { RecipeHandler.addEnrichmentChamberRecipe(ore, new ItemStack(Dust, 2, 2)); + RecipeHandler.addPurificationChamberRecipe(ore, new ItemStack(Clump, 3, 2)); } try { for(ItemStack ore : OreDictionary.getOres("oreLead")) { - RecipeHandler.addEnrichmentChamberRecipe(ore, OreDictionary.getOres("dustLead").get(0)); + RecipeHandler.addEnrichmentChamberRecipe(ore, MekanismUtils.getStackWithSize(OreDictionary.getOres("dustLead").get(0), 2)); } for(ItemStack ore : OreDictionary.getOres("ingotLead")) @@ -568,7 +653,7 @@ public class Mekanism try { for(ItemStack ore : OreDictionary.getOres("oreSilver")) { - RecipeHandler.addEnrichmentChamberRecipe(ore, OreDictionary.getOres("dustSilver").get(0)); + RecipeHandler.addEnrichmentChamberRecipe(ore, MekanismUtils.getStackWithSize(OreDictionary.getOres("dustSilver").get(0), 2)); } for(ItemStack ore : OreDictionary.getOres("ingotSilver")) @@ -577,7 +662,7 @@ public class Mekanism } } catch(Exception e) {} - for(ItemStack ore : OreDictionary.getOres("ingotObsidian")) + for(ItemStack ore : OreDictionary.getOres("ingotRefinedObsidian")) { RecipeHandler.addCrusherRecipe(ore, new ItemStack(Dust, 1, 3)); } @@ -592,7 +677,7 @@ public class Mekanism RecipeHandler.addCrusherRecipe(ore, new ItemStack(Item.redstone)); } - for(ItemStack ore : OreDictionary.getOres("ingotGlowstone")) + for(ItemStack ore : OreDictionary.getOres("ingotRefinedGlowstone")) { RecipeHandler.addCrusherRecipe(ore, new ItemStack(Item.lightStoneDust)); } @@ -621,12 +706,12 @@ public class Mekanism for(ItemStack ore : OreDictionary.getOres("dustIron")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), new ItemStack(Block.oreIron)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), new ItemStack(Block.oreIron)); } for(ItemStack ore : OreDictionary.getOres("dustGold")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), new ItemStack(Block.oreGold)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), new ItemStack(Block.oreGold)); } for(ItemStack ore : OreDictionary.getOres("dustObsidian")) @@ -637,13 +722,13 @@ public class Mekanism for(ItemStack ore : OreDictionary.getOres("dustPlatinum")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), new ItemStack(OreBlock, 1, 0)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), new ItemStack(OreBlock, 1, 0)); } try { for(ItemStack ore : OreDictionary.getOres("dustCopper")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), OreDictionary.getOres("oreCopper").get(0)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), OreDictionary.getOres("oreCopper").get(0)); } } catch(Exception e) {} @@ -657,21 +742,21 @@ public class Mekanism try { for(ItemStack ore : OreDictionary.getOres("dustTin")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), OreDictionary.getOres("oreTin").get(0)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), OreDictionary.getOres("oreTin").get(0)); } } catch(Exception e) {} try { for(ItemStack ore : OreDictionary.getOres("dustLead")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), OreDictionary.getOres("oreLead").get(0)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), OreDictionary.getOres("oreLead").get(0)); } } catch(Exception e) {} try { for(ItemStack ore : OreDictionary.getOres("dustSilver")) { - RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 2), OreDictionary.getOres("oreSilver").get(0)); + RecipeHandler.addCombinerRecipe(MekanismUtils.getStackWithSize(ore, 8), OreDictionary.getOres("oreSilver").get(0)); } } catch(Exception e) {} } @@ -701,6 +786,7 @@ public class Mekanism GameRegistry.registerTileEntity(TileEntityEliteSmeltingFactory.class, "UltimateSmeltingFactory"); GameRegistry.registerTileEntity(TileEntityMetallurgicInfuser.class, "MetallurgicInfuser"); GameRegistry.registerTileEntity(TileEntityTeleporter.class, "MekanismTeleporter"); + GameRegistry.registerTileEntity(TileEntityPurificationChamber.class, "PurificationChamber"); //Load tile entities that have special renderers. proxy.registerSpecialTileEntities(); diff --git a/src/minecraft/mekanism/common/MekanismUtils.java b/src/minecraft/mekanism/common/MekanismUtils.java index 09060d75f..5d1eb05ef 100644 --- a/src/minecraft/mekanism/common/MekanismUtils.java +++ b/src/minecraft/mekanism/common/MekanismUtils.java @@ -36,22 +36,25 @@ public final class MekanismUtils */ public static void checkForUpdates(EntityPlayer entityplayer) { - if(!Mekanism.latestVersionNumber.equals("Error retrieving data.")) + if(Mekanism.notifyNewReleases) { - if(!Mekanism.latestVersionNumber.contains(Mekanism.versionNumber.toString())) + if(!Mekanism.latestVersionNumber.equals("Error retrieving data.")) { - entityplayer.addChatMessage(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"); - entityplayer.addChatMessage(EnumColor.GREY + " Using outdated version " + EnumColor.DARK_GREY + Mekanism.versionNumber + EnumColor.GREY + " for Minecraft 1.4.6/7."); - entityplayer.addChatMessage(EnumColor.GREY + " Consider updating to version " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber); - entityplayer.addChatMessage(EnumColor.GREY + " New features: " + EnumColor.INDIGO + Mekanism.recentNews); - entityplayer.addChatMessage(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"); + if(!Mekanism.latestVersionNumber.contains(Mekanism.versionNumber.toString())) + { + entityplayer.addChatMessage(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[Mekanism]" + EnumColor.GREY + " -------------"); + entityplayer.addChatMessage(EnumColor.GREY + " Using outdated version " + EnumColor.DARK_GREY + Mekanism.versionNumber + EnumColor.GREY + " for Minecraft 1.4.6/7."); + entityplayer.addChatMessage(EnumColor.GREY + " Consider updating to version " + EnumColor.DARK_GREY + Mekanism.latestVersionNumber); + entityplayer.addChatMessage(EnumColor.GREY + " New features: " + EnumColor.INDIGO + Mekanism.recentNews); + entityplayer.addChatMessage(EnumColor.GREY + "------------- " + EnumColor.DARK_BLUE + "[=======]" + EnumColor.GREY + " -------------"); + return; + } + } + else { + System.out.println("[Mekanism] Minecraft is in offline mode, could not check for updates."); return; } } - else { - System.out.println("[Mekanism] Minecraft is in offline mode, could not check for updates."); - return; - } } /** diff --git a/src/minecraft/mekanism/common/PacketHandler.java b/src/minecraft/mekanism/common/PacketHandler.java index 13bedf088..303c4db9a 100644 --- a/src/minecraft/mekanism/common/PacketHandler.java +++ b/src/minecraft/mekanism/common/PacketHandler.java @@ -193,14 +193,17 @@ public class PacketHandler implements IPacketHandler { Teleporter.Coords coords = Mekanism.teleporters.get(new Teleporter.Code(item.getDigit(itemstack, 0), item.getDigit(itemstack, 1), item.getDigit(itemstack, 2), item.getDigit(itemstack, 3))).get(0); + item.onUse(item.calculateEnergyCost(entityPlayerMP, coords), itemstack); + if(entityPlayerMP.worldObj.provider.dimensionId != coords.dimensionId) { entityPlayerMP.travelToDimension(coords.dimensionId); } - entityPlayerMP.playerNetServerHandler.setPlayerLocation(coords.xCoord, coords.yCoord, coords.zCoord, entityPlayerMP.rotationYaw, entityPlayerMP.rotationPitch); + entityPlayerMP.playerNetServerHandler.setPlayerLocation(coords.xCoord+0.5, coords.yCoord, coords.zCoord+0.5, entityPlayerMP.rotationYaw, entityPlayerMP.rotationPitch); - item.onUse(item.calculateEnergyCost(entityPlayerMP, coords), itemstack); + entityplayer.worldObj.playSound(coords.xCoord, coords.yCoord, coords.zCoord, "mob.endermen.portal", 1.0F, 1.0F, true); + PacketHandler.sendPortalFX(coords.xCoord, coords.yCoord, coords.zCoord, coords.dimensionId); } } } @@ -479,6 +482,6 @@ public class PacketHandler implements IPacketHandler packet.data = bytes.toByteArray(); packet.length = packet.data.length; PacketDispatcher.sendPacketToServer(packet); - System.out.println("[Mekanism] Sent data int packet '" + i + "' to server"); + System.out.println("[Mekanism] Sent data int packet '" + type.id + ":" + i + "' to server"); } } diff --git a/src/minecraft/mekanism/common/RecipeHandler.java b/src/minecraft/mekanism/common/RecipeHandler.java index fd130df27..114de5957 100644 --- a/src/minecraft/mekanism/common/RecipeHandler.java +++ b/src/minecraft/mekanism/common/RecipeHandler.java @@ -1,5 +1,6 @@ package mekanism.common; +import java.util.HashMap; import java.util.Map; import mekanism.api.InfusionInput; @@ -13,6 +14,11 @@ import net.minecraft.item.ItemStack; */ public final class RecipeHandler { + public static void addRecipe(Recipe recipe, Object input, Object output) + { + recipe.put(input, output); + } + /** * Add an Enrichment Chamber recipe. * @param input - input ItemStack @@ -20,7 +26,7 @@ public final class RecipeHandler */ public static void addEnrichmentChamberRecipe(ItemStack input, ItemStack output) { - TileEntityEnrichmentChamber.recipes.put(input, output); + Recipe.ENRICHMENT_CHAMBER.put(input, output); } /** @@ -30,7 +36,7 @@ public final class RecipeHandler */ public static void addPlatinumCompressorRecipe(ItemStack input, ItemStack output) { - TileEntityPlatinumCompressor.recipes.put(input, output); + Recipe.PLATINUM_COMPRESSOR.put(input, output); } /** @@ -40,7 +46,7 @@ public final class RecipeHandler */ public static void addCombinerRecipe(ItemStack input, ItemStack output) { - TileEntityCombiner.recipes.put(input, output); + Recipe.COMBINER.put(input, output); } /** @@ -50,7 +56,17 @@ public final class RecipeHandler */ public static void addCrusherRecipe(ItemStack input, ItemStack output) { - TileEntityCrusher.recipes.put(input, output); + Recipe.CRUSHER.put(input, output); + } + + /** + * Add a Purification Chamber recipe. + * @param input - input ItemStack + * @param output - output ItemStack + */ + public static void addPurificationChamberRecipe(ItemStack input, ItemStack output) + { + Recipe.PURIFICATION_CHAMBER.put(input, output); } /** @@ -60,7 +76,7 @@ public final class RecipeHandler */ public static void addMetallurgicInfuserRecipe(InfusionInput input, ItemStack output) { - TileEntityMetallurgicInfuser.recipes.put(input, InfusionOutput.getInfusion(input, output)); + Recipe.METALLURGIC_INFUSER.put(input, InfusionOutput.getInfusion(input, output)); } /** @@ -115,4 +131,31 @@ public final class RecipeHandler return null; } + + public static enum Recipe + { + ENRICHMENT_CHAMBER(new HashMap()), + PLATINUM_COMPRESSOR(new HashMap()), + COMBINER(new HashMap()), + CRUSHER(new HashMap()), + PURIFICATION_CHAMBER(new HashMap()), + METALLURGIC_INFUSER(new HashMap()); + + private HashMap recipes; + + private Recipe(HashMap map) + { + recipes = map; + } + + public void put(Object input, Object output) + { + recipes.put(input, output); + } + + public HashMap get() + { + return recipes; + } + } } diff --git a/src/minecraft/mekanism/common/TileEntityAdvancedElectricMachine.java b/src/minecraft/mekanism/common/TileEntityAdvancedElectricMachine.java index 6a828b548..2c5fe2076 100644 --- a/src/minecraft/mekanism/common/TileEntityAdvancedElectricMachine.java +++ b/src/minecraft/mekanism/common/TileEntityAdvancedElectricMachine.java @@ -110,12 +110,12 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM } } - if(inventory[1] != null && secondaryEnergyStored == 0) + if(inventory[1] != null) { int fuelTicks = getFuelTicks(inventory[1]); - if(fuelTicks > 0) + int energyNeeded = MAX_SECONDARY_ENERGY - secondaryEnergyStored; + if(fuelTicks > 0 && fuelTicks <= energyNeeded) { - int energyNeeded = MAX_SECONDARY_ENERGY - secondaryEnergyStored; if(fuelTicks <= energyNeeded) { setSecondaryEnergy(secondaryEnergyStored + fuelTicks); @@ -157,41 +157,24 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM currentMaxElectricity = MAX_ELECTRICITY; } - if(canOperate() && (operatingTicks+1) < currentTicksRequired && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK) + if(electricityStored >= ENERGY_PER_TICK && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK) { - ++operatingTicks; - secondaryEnergyStored -= SECONDARY_ENERGY_PER_TICK; - electricityStored -= ENERGY_PER_TICK; - } - else if((operatingTicks+1) >= currentTicksRequired) - { - if(!worldObj.isRemote) + if(canOperate() && (operatingTicks+1) < currentTicksRequired && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK) { - operate(); + ++operatingTicks; + secondaryEnergyStored -= SECONDARY_ENERGY_PER_TICK; + electricityStored -= ENERGY_PER_TICK; + } + else if((operatingTicks+1) >= currentTicksRequired) + { + if(!worldObj.isRemote) + { + operate(); + } + operatingTicks = 0; + secondaryEnergyStored -= SECONDARY_ENERGY_PER_TICK; + electricityStored -= ENERGY_PER_TICK; } - operatingTicks = 0; - secondaryEnergyStored -= SECONDARY_ENERGY_PER_TICK; - electricityStored -= ENERGY_PER_TICK; - } - - if(electricityStored < 0) - { - electricityStored = 0; - } - - if(secondaryEnergyStored < 0) - { - secondaryEnergyStored = 0; - } - - if(electricityStored > currentMaxElectricity) - { - electricityStored = currentMaxElectricity; - } - - if(secondaryEnergyStored > MAX_SECONDARY_ENERGY) - { - secondaryEnergyStored = MAX_SECONDARY_ENERGY; } if(!canOperate()) @@ -201,16 +184,12 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM if(!worldObj.isRemote) { - if(testActive != operatingTicks > 0) + if(canOperate() && electricityStored >= ENERGY_PER_TICK && secondaryEnergyStored >= SECONDARY_ENERGY_PER_TICK) { - if(operatingTicks > 0) - { - setActive(true); - } - else if(!canOperate()) - { - setActive(false); - } + setActive(true); + } + else { + setActive(false); } } } @@ -218,11 +197,6 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM @Override public void operate() { - if (!canOperate()) - { - return; - } - ItemStack itemstack = RecipeHandler.getOutput(inventory[0], true, getRecipes()); if (inventory[0].stackSize <= 0) @@ -247,16 +221,6 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM { return false; } - - if(electricityStored < ENERGY_PER_TICK) - { - return false; - } - - if(secondaryEnergyStored < SECONDARY_ENERGY_PER_TICK) - { - return false; - } ItemStack itemstack = RecipeHandler.getOutput(inventory[0], false, getRecipes()); @@ -363,7 +327,7 @@ public abstract class TileEntityAdvancedElectricMachine extends TileEntityBasicM */ public void setSecondaryEnergy(int energy) { - secondaryEnergyStored = Math.max(Math.min(energy, getFuelTicks(inventory[1])), 0); + secondaryEnergyStored = Math.max(Math.min(energy, MAX_SECONDARY_ENERGY), 0); } /** diff --git a/src/minecraft/mekanism/common/TileEntityCombiner.java b/src/minecraft/mekanism/common/TileEntityCombiner.java index 14014a673..e09847672 100644 --- a/src/minecraft/mekanism/common/TileEntityCombiner.java +++ b/src/minecraft/mekanism/common/TileEntityCombiner.java @@ -3,23 +3,22 @@ package mekanism.common; import java.util.HashMap; import java.util.Map; +import mekanism.common.RecipeHandler.Recipe; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class TileEntityCombiner extends TileEntityAdvancedElectricMachine { - public static Map recipes = new HashMap(); - public TileEntityCombiner() { super("Combiner.ogg", "Combiner", "/resources/mekanism/gui/GuiCombiner.png", 5, 1, 200, 1000, 200); } @Override - public Map getRecipes() + public HashMap getRecipes() { - return recipes; + return Recipe.COMBINER.get(); } @Override diff --git a/src/minecraft/mekanism/common/TileEntityCrusher.java b/src/minecraft/mekanism/common/TileEntityCrusher.java index 5b4aaf9fc..b44fffec6 100644 --- a/src/minecraft/mekanism/common/TileEntityCrusher.java +++ b/src/minecraft/mekanism/common/TileEntityCrusher.java @@ -3,20 +3,19 @@ package mekanism.common; import java.util.HashMap; import java.util.Map; +import mekanism.common.RecipeHandler.Recipe; import net.minecraft.item.ItemStack; public class TileEntityCrusher extends TileEntityElectricMachine { - public static Map recipes = new HashMap(); - public TileEntityCrusher() { super("Crusher.ogg", "Crusher", "/resources/mekanism/gui/GuiCrusher.png", 5, 200, 1000); } @Override - public Map getRecipes() + public HashMap getRecipes() { - return recipes; + return Recipe.CRUSHER.get(); } } diff --git a/src/minecraft/mekanism/common/TileEntityElectricMachine.java b/src/minecraft/mekanism/common/TileEntityElectricMachine.java index 83d454dde..3ea2fac31 100644 --- a/src/minecraft/mekanism/common/TileEntityElectricMachine.java +++ b/src/minecraft/mekanism/common/TileEntityElectricMachine.java @@ -40,8 +40,6 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine { super.onUpdate(); - boolean testActive = operatingTicks > 0; - if(inventory[1] != null) { if(electricityStored < currentMaxElectricity) @@ -113,29 +111,22 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine currentMaxElectricity = MAX_ELECTRICITY; } - if(canOperate() && (operatingTicks+1) < currentTicksRequired) + if(electricityStored >= ENERGY_PER_TICK) { - ++operatingTicks; - electricityStored -= ENERGY_PER_TICK; - } - else if(canOperate() && (operatingTicks+1) >= currentTicksRequired) - { - if(!worldObj.isRemote) + if(canOperate() && (operatingTicks+1) < currentTicksRequired) { - operate(); + operatingTicks++; + electricityStored -= ENERGY_PER_TICK; + } + else if(canOperate() && (operatingTicks+1) >= currentTicksRequired) + { + if(!worldObj.isRemote) + { + operate(); + } + operatingTicks = 0; + electricityStored -= ENERGY_PER_TICK; } - operatingTicks = 0; - electricityStored -= ENERGY_PER_TICK; - } - - if(electricityStored < 0) - { - electricityStored = 0; - } - - if(electricityStored > currentMaxElectricity) - { - electricityStored = currentMaxElectricity; } if(!canOperate()) @@ -145,16 +136,12 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine if(!worldObj.isRemote) { - if(testActive != operatingTicks > 0) + if(canOperate() && electricityStored >= ENERGY_PER_TICK) { - if(operatingTicks > 0) - { - setActive(true); - } - else if(!canOperate()) - { - setActive(false); - } + setActive(true); + } + else { + setActive(false); } } } @@ -162,11 +149,6 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine @Override public void operate() { - if (!canOperate()) - { - return; - } - ItemStack itemstack = RecipeHandler.getOutput(inventory[0], true, getRecipes()); if (inventory[0].stackSize <= 0) @@ -191,11 +173,6 @@ public abstract class TileEntityElectricMachine extends TileEntityBasicMachine { return false; } - - if(electricityStored < ENERGY_PER_TICK) - { - return false; - } ItemStack itemstack = RecipeHandler.getOutput(inventory[0], false, getRecipes()); diff --git a/src/minecraft/mekanism/common/TileEntityEnergyCube.java b/src/minecraft/mekanism/common/TileEntityEnergyCube.java index e74e8ddc9..5db993f50 100644 --- a/src/minecraft/mekanism/common/TileEntityEnergyCube.java +++ b/src/minecraft/mekanism/common/TileEntityEnergyCube.java @@ -63,7 +63,12 @@ public class TileEntityEnergyCube extends TileEntityElectricBlock implements IEn public TileEntityEnergyCube(String name, int maxEnergy, int i) { super(name, maxEnergy); - powerProvider.configure(5, 2, 10, 1, maxEnergy/10); + + if(powerProvider != null) + { + powerProvider.configure(5, 2, 10, 1, maxEnergy/10); + } + ElectricityConnections.registerConnector(this, EnumSet.allOf(ForgeDirection.class)); inventory = new ItemStack[2]; output = i; diff --git a/src/minecraft/mekanism/common/TileEntityEnrichmentChamber.java b/src/minecraft/mekanism/common/TileEntityEnrichmentChamber.java index 604d99fae..541dab541 100644 --- a/src/minecraft/mekanism/common/TileEntityEnrichmentChamber.java +++ b/src/minecraft/mekanism/common/TileEntityEnrichmentChamber.java @@ -3,20 +3,19 @@ package mekanism.common; import java.util.HashMap; import java.util.Map; +import mekanism.common.RecipeHandler.Recipe; import net.minecraft.item.ItemStack; public class TileEntityEnrichmentChamber extends TileEntityElectricMachine { - public static Map recipes = new HashMap(); - public TileEntityEnrichmentChamber() { super("Chamber.ogg", "Enrichment Chamber", "/resources/mekanism/gui/GuiChamber.png", 5, 200, 1000); } @Override - public Map getRecipes() + public HashMap getRecipes() { - return recipes; + return Recipe.ENRICHMENT_CHAMBER.get(); } } diff --git a/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java b/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java index 0fe88f341..2dd34a541 100644 --- a/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java +++ b/src/minecraft/mekanism/common/TileEntityMetallurgicInfuser.java @@ -15,6 +15,7 @@ import mekanism.api.InfusionInput; import mekanism.api.InfusionOutput; import mekanism.api.InfusionType; import mekanism.client.Sound; +import mekanism.common.RecipeHandler.Recipe; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -42,8 +43,6 @@ import dan200.computer.api.IPeripheral; public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implements IEnergySink, IJouleStorage, IVoltage, IPeripheral, IActiveState { - public static Map recipes = new HashMap(); - /** The Sound instance for this machine. */ @SideOnly(Side.CLIENT) public Sound audio; @@ -316,7 +315,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem return; } - InfusionOutput output = RecipeHandler.getOutput(InfusionInput.getInfusion(type, infuseStored, inventory[2]), true, recipes); + InfusionOutput output = RecipeHandler.getOutput(InfusionInput.getInfusion(type, infuseStored, inventory[2]), true, Recipe.METALLURGIC_INFUSER.get()); infuseStored -= output.getInfuseRequired(); @@ -346,7 +345,7 @@ public class TileEntityMetallurgicInfuser extends TileEntityElectricBlock implem return false; } - InfusionOutput output = RecipeHandler.getOutput(InfusionInput.getInfusion(type, infuseStored, inventory[2]), false, recipes); + InfusionOutput output = RecipeHandler.getOutput(InfusionInput.getInfusion(type, infuseStored, inventory[2]), false, Recipe.METALLURGIC_INFUSER.get()); if (output == null) { diff --git a/src/minecraft/mekanism/common/TileEntityPlatinumCompressor.java b/src/minecraft/mekanism/common/TileEntityPlatinumCompressor.java index d863f22e4..94f8f0ca8 100644 --- a/src/minecraft/mekanism/common/TileEntityPlatinumCompressor.java +++ b/src/minecraft/mekanism/common/TileEntityPlatinumCompressor.java @@ -3,22 +3,21 @@ package mekanism.common; import java.util.HashMap; import java.util.Map; +import mekanism.common.RecipeHandler.Recipe; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class TileEntityPlatinumCompressor extends TileEntityAdvancedElectricMachine { - public static Map recipes = new HashMap(); - public TileEntityPlatinumCompressor() { super("Compressor.ogg", "Platinum Compressor", "/resources/mekanism/gui/GuiCompressor.png", 5, 1, 200, 1000, 200); } - + @Override - public Map getRecipes() + public HashMap getRecipes() { - return recipes; + return Recipe.PLATINUM_COMPRESSOR.get(); } @Override diff --git a/src/minecraft/mekanism/common/TileEntityPurificationChamber.java b/src/minecraft/mekanism/common/TileEntityPurificationChamber.java new file mode 100644 index 000000000..3592cd8c2 --- /dev/null +++ b/src/minecraft/mekanism/common/TileEntityPurificationChamber.java @@ -0,0 +1,31 @@ +package mekanism.common; + +import java.util.HashMap; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +import mekanism.common.RecipeHandler.Recipe; + +public class TileEntityPurificationChamber extends TileEntityAdvancedElectricMachine +{ + public TileEntityPurificationChamber() + { + super("PurificationChamber.ogg", "Purification Chamber", "/resources/mekanism/gui/GuiPurificationChamber.png", 20, 1, 200, 12000, 1200); + } + + @Override + public HashMap getRecipes() + { + return Recipe.PURIFICATION_CHAMBER.get(); + } + + @Override + public int getFuelTicks(ItemStack itemstack) + { + if(itemstack.isItemEqual(new ItemStack(Block.sand))) return 10; + if(itemstack.isItemEqual(new ItemStack(Item.flint))) return 300; + return 0; + } +} diff --git a/src/minecraft/mekanism/common/TileEntitySmeltingFactory.java b/src/minecraft/mekanism/common/TileEntitySmeltingFactory.java index cf9848414..5b72edf57 100644 --- a/src/minecraft/mekanism/common/TileEntitySmeltingFactory.java +++ b/src/minecraft/mekanism/common/TileEntitySmeltingFactory.java @@ -390,6 +390,52 @@ public class TileEntitySmeltingFactory extends TileEntityElectricBlock implement inventory[outputSlot].stackSize += itemstack.stackSize; } } + + @Override + public int getStartInventorySide(ForgeDirection side) + { + if(side == ForgeDirection.getOrientation(1) || side == MekanismUtils.getLeft(facing)) + { + return 2; + } + else if(side == ForgeDirection.getOrientation(0) || side == MekanismUtils.getRight(facing)) + { + return 2+tier.processes; + } + else if(side == ForgeDirection.getOrientation(facing)) + { + return 0; + } + else if(side == ForgeDirection.getOrientation(facing).getOpposite()) + { + return 1; + } + + return 0; + } + + @Override + public int getSizeInventorySide(ForgeDirection side) + { + if(side == ForgeDirection.getOrientation(1) || side == MekanismUtils.getLeft(facing)) + { + return tier.processes; + } + else if(side == ForgeDirection.getOrientation(0) || side == MekanismUtils.getRight(facing)) + { + return tier.processes; + } + else if(side == ForgeDirection.getOrientation(facing)) + { + return 1; + } + else if(side == ForgeDirection.getOrientation(facing).getOpposite()) + { + return 1; + } + + return 0; + } @Override public void handlePacketData(INetworkManager network, Packet250CustomPayload packet, EntityPlayer player, ByteArrayDataInput dataStream) @@ -465,12 +511,12 @@ public class TileEntitySmeltingFactory extends TileEntityElectricBlock implement public int getInputSlot(int operation) { - return (operation+operation)+2; + return operation+2; } public int getOutputSlot(int operation) { - return (operation+operation)+3; + return tier.processes+2+operation; } @Override diff --git a/src/minecraft/mekanism/common/TileEntityTeleporter.java b/src/minecraft/mekanism/common/TileEntityTeleporter.java index 7bad18775..6a7657621 100644 --- a/src/minecraft/mekanism/common/TileEntityTeleporter.java +++ b/src/minecraft/mekanism/common/TileEntityTeleporter.java @@ -264,15 +264,14 @@ public class TileEntityTeleporter extends TileEntityElectricBlock implements IEn { setJoules(electricityStored - calculateEnergyCost(entity, closestCoords)); - entity.worldObj.playSoundAtEntity((EntityPlayerMP)entity, "mob.enderman.portal", 1.0F, 1.0F); + worldObj.playSoundAtEntity((EntityPlayerMP)entity, "mob.endermen.portal", 1.0F, 1.0F); if(entity.worldObj.provider.dimensionId != closestCoords.dimensionId) { entity.travelToDimension(closestCoords.dimensionId); } - ((EntityPlayerMP)entity).setLocationAndAngles(closestCoords.xCoord, closestCoords.yCoord, closestCoords.zCoord, entity.rotationYaw, entity.rotationPitch); - ((EntityPlayerMP)entity).playerNetServerHandler.setPlayerLocation(closestCoords.xCoord, closestCoords.yCoord, closestCoords.zCoord, entity.rotationYaw, entity.rotationPitch); + ((EntityPlayerMP)entity).playerNetServerHandler.setPlayerLocation(closestCoords.xCoord+0.5, closestCoords.yCoord, closestCoords.zCoord+0.5, entity.rotationYaw, entity.rotationPitch); for(Teleporter.Coords coords : Mekanism.teleporters.get(code)) { diff --git a/src/minecraft/mekanism/common/TileEntityTheoreticalElementizer.java b/src/minecraft/mekanism/common/TileEntityTheoreticalElementizer.java index d49bc431b..727bd2f81 100644 --- a/src/minecraft/mekanism/common/TileEntityTheoreticalElementizer.java +++ b/src/minecraft/mekanism/common/TileEntityTheoreticalElementizer.java @@ -16,9 +16,9 @@ public class TileEntityTheoreticalElementizer extends TileEntityAdvancedElectric } @Override - public Map getRecipes() + public HashMap getRecipes() { - return Collections.synchronizedMap(new HashMap()); + return (HashMap)Collections.synchronizedMap(new HashMap()); } @Override diff --git a/src/minecraft/mekanism/generators/common/MekanismGenerators.java b/src/minecraft/mekanism/generators/common/MekanismGenerators.java index 68420614e..61f8be619 100644 --- a/src/minecraft/mekanism/generators/common/MekanismGenerators.java +++ b/src/minecraft/mekanism/generators/common/MekanismGenerators.java @@ -19,7 +19,7 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; -@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.1.1", dependencies = "required-after:Mekanism") +@Mod(modid = "MekanismGenerators", name = "MekanismGenerators", version = "5.2.0", dependencies = "required-after:Mekanism") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MekanismGenerators { @@ -93,13 +93,15 @@ public class MekanismGenerators //BioFuel Crusher Recipes RecipeHandler.addCrusherRecipe(new ItemStack(Block.sapling), new ItemStack(BioFuel, 2)); RecipeHandler.addCrusherRecipe(new ItemStack(Block.tallGrass), new ItemStack(BioFuel, 2)); + RecipeHandler.addCrusherRecipe(new ItemStack(Item.reed), new ItemStack(BioFuel, 1)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.seeds), new ItemStack(BioFuel, 1)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.wheat), new ItemStack(BioFuel, 2)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.pumpkinSeeds), new ItemStack(BioFuel, 1)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.melonSeeds), new ItemStack(BioFuel, 1)); - RecipeHandler.addCrusherRecipe(new ItemStack(Item.appleRed), new ItemStack(BioFuel, 3)); - RecipeHandler.addCrusherRecipe(new ItemStack(Item.bread), new ItemStack(BioFuel, 3)); + RecipeHandler.addCrusherRecipe(new ItemStack(Item.appleRed), new ItemStack(BioFuel, 2)); + RecipeHandler.addCrusherRecipe(new ItemStack(Item.bread), new ItemStack(BioFuel, 2)); RecipeHandler.addCrusherRecipe(new ItemStack(Item.potato), new ItemStack(BioFuel, 2)); + RecipeHandler.addCrusherRecipe(new ItemStack(Item.carrot), new ItemStack(BioFuel, 2)); for(int i = 0; i < BlockLeaves.LEAF_TYPES.length; i++) { diff --git a/src/minecraft/mekanism/generators/common/TileEntityBioGenerator.java b/src/minecraft/mekanism/generators/common/TileEntityBioGenerator.java index 38ae594df..935cf35f5 100644 --- a/src/minecraft/mekanism/generators/common/TileEntityBioGenerator.java +++ b/src/minecraft/mekanism/generators/common/TileEntityBioGenerator.java @@ -34,6 +34,9 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank @SideOnly(Side.CLIENT) public Sound audio; + /** The amount of electricity this machine can produce with a unit of fuel. */ + public final int GENERATION = 560; + /** The LiquidSlot biofuel instance for this generator. */ public LiquidSlot bioFuelSlot = new LiquidSlot(24000, Mekanism.hooks.ForestryBiofuelID); @@ -93,22 +96,19 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank } } - if(electricityStored < MAX_ELECTRICITY) - { - if(canOperate()) - { - if(!worldObj.isRemote) - { - setActive(true); - } - bioFuelSlot.setLiquid(bioFuelSlot.liquidStored - 10); - setJoules(electricityStored + 560); + if(canOperate()) + { + if(!worldObj.isRemote) + { + setActive(true); } - else { - if(!worldObj.isRemote) - { - setActive(false); - } + bioFuelSlot.setLiquid(bioFuelSlot.liquidStored - 10); + setJoules(electricityStored + GENERATION); + } + else { + if(!worldObj.isRemote) + { + setActive(false); } } } @@ -189,7 +189,6 @@ public class TileEntityBioGenerator extends TileEntityGenerator implements ITank bioFuelSlot.liquidStored = dataStream.readInt(); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.updateAllLightTypes(xCoord, yCoord, zCoord); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, MekanismGenerators.generatorID); } catch (Exception e) { System.out.println("[Mekanism] Error while handling tile entity packet."); diff --git a/src/minecraft/mekanism/generators/common/TileEntityElectrolyticSeparator.java b/src/minecraft/mekanism/generators/common/TileEntityElectrolyticSeparator.java index 463354eec..7fdb96919 100644 --- a/src/minecraft/mekanism/generators/common/TileEntityElectrolyticSeparator.java +++ b/src/minecraft/mekanism/generators/common/TileEntityElectrolyticSeparator.java @@ -228,7 +228,7 @@ public class TileEntityElectrolyticSeparator extends TileEntityElectricBlock imp waterSlot.setLiquid(waterSlot.liquidStored - 10); setJoules(electricityStored - 4); setGas(EnumGas.OXYGEN, oxygenStored + 1); - setGas(EnumGas.HYDROGEN, hydrogenStored + 1); + setGas(EnumGas.HYDROGEN, hydrogenStored + 2); } if(outputType != EnumGas.NONE && getGas(outputType) > 0 && !worldObj.isRemote) diff --git a/src/minecraft/mekanism/generators/common/TileEntityHeatGenerator.java b/src/minecraft/mekanism/generators/common/TileEntityHeatGenerator.java index 503f4b6db..a0dbf341f 100644 --- a/src/minecraft/mekanism/generators/common/TileEntityHeatGenerator.java +++ b/src/minecraft/mekanism/generators/common/TileEntityHeatGenerator.java @@ -35,6 +35,9 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan /** The LiquidSlot fuel instance for this generator. */ public LiquidSlot fuelSlot = new LiquidSlot(24000, Mekanism.hooks.BuildCraftFuelID); + /** The amount of electricity this machine can produce with a unit of fuel. */ + public final int GENERATION = 100; + public TileEntityHeatGenerator() { super("Heat Generator", 160000, 480); @@ -88,27 +91,29 @@ public class TileEntityHeatGenerator extends TileEntityGenerator implements ITan { inventory[0] = null; } + + if(prevStack.isItemEqual(new ItemStack(Item.bucketLava))) + { + inventory[0] = new ItemStack(Item.bucketEmpty); + } } } - if(electricityStored < MAX_ELECTRICITY) - { - setJoules(electricityStored + getEnvironmentBoost()); - - if(canOperate()) - { - if(!worldObj.isRemote) - { - setActive(true); - } - fuelSlot.setLiquid(fuelSlot.liquidStored - 10); - setJoules(electricityStored + 100); + setJoules(electricityStored + getEnvironmentBoost()); + + if(canOperate()) + { + if(!worldObj.isRemote) + { + setActive(true); } - else { - if(!worldObj.isRemote) - { - setActive(false); - } + fuelSlot.setLiquid(fuelSlot.liquidStored - 10); + setJoules(electricityStored + GENERATION); + } + else { + if(!worldObj.isRemote) + { + setActive(false); } } } diff --git a/src/minecraft/mekanism/generators/common/TileEntityHydrogenGenerator.java b/src/minecraft/mekanism/generators/common/TileEntityHydrogenGenerator.java index d2afcad06..6d65b8150 100644 --- a/src/minecraft/mekanism/generators/common/TileEntityHydrogenGenerator.java +++ b/src/minecraft/mekanism/generators/common/TileEntityHydrogenGenerator.java @@ -195,7 +195,6 @@ public class TileEntityHydrogenGenerator extends TileEntityGenerator implements isActive = dataStream.readBoolean(); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); worldObj.updateAllLightTypes(xCoord, yCoord, zCoord); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, MekanismGenerators.generatorID); } catch (Exception e) { System.out.println("[Mekanism] Error while handling tile entity packet."); diff --git a/src/minecraft/mekanism/generators/common/TileEntitySolarGenerator.java b/src/minecraft/mekanism/generators/common/TileEntitySolarGenerator.java index cad20e9c6..bea4acdbb 100644 --- a/src/minecraft/mekanism/generators/common/TileEntitySolarGenerator.java +++ b/src/minecraft/mekanism/generators/common/TileEntitySolarGenerator.java @@ -148,7 +148,6 @@ public class TileEntitySolarGenerator extends TileEntityGenerator isActive = dataStream.readBoolean(); seesSun = dataStream.readBoolean(); worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); - worldObj.notifyBlocksOfNeighborChange(xCoord, yCoord, zCoord, MekanismGenerators.generatorID); } catch (Exception e) { System.out.println("[Mekanism] Error while handling tile entity packet."); diff --git a/src/minecraft/mekanism/nei/AdvancedMachineRecipeHandler.java b/src/minecraft/mekanism/nei/AdvancedMachineRecipeHandler.java new file mode 100644 index 000000000..aba4076b1 --- /dev/null +++ b/src/minecraft/mekanism/nei/AdvancedMachineRecipeHandler.java @@ -0,0 +1,139 @@ +package mekanism.nei; + +import java.awt.Rectangle; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.forge.GuiContainerManager; +import codechicken.nei.recipe.TemplateRecipeHandler; + +public abstract class AdvancedMachineRecipeHandler extends TemplateRecipeHandler +{ + int ticksPassed; + + public abstract String getRecipeId(); + + public abstract ItemStack getFuelStack(); + + public abstract Set> getRecipes(); + + @Override + public void drawBackground(GuiContainerManager guimanager, int i) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + guimanager.bindTextureByName(getGuiTexture()); + guimanager.drawTexturedModalRect(12, 0, 28, 5, 144, 68); + } + + @Override + public void drawExtras(GuiContainerManager guimanager, int i) + { + float f = ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F; + drawProgressBar(guimanager, 63, 34, 176, 0, 24, 7, f, 0); + + f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F; + if(ticksPassed < 20) f = 0.0F; + drawProgressBar(guimanager, 45, 32, 176, 7, 5, 12, f, 3); + + f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + drawProgressBar(guimanager, 149, 12, 176, 19, 4, 52, f, 3); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + ticksPassed++; + } + + @Override + public void loadTransferRects() + { + transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(63, 34, 24, 7), getRecipeId(), new Object[0])); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if(outputId.equals(getRecipeId())) + { + for(Map.Entry irecipe : getRecipes()) + { + arecipes.add(new CachedIORecipe(irecipe, getFuelStack())); + } + } + else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + for(Map.Entry irecipe : getRecipes()) + { + if(NEIServerUtils.areStacksSameTypeCrafting((ItemStack)irecipe.getValue(), result)) + { + arecipes.add(new CachedIORecipe(irecipe, getFuelStack())); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + for(Map.Entry irecipe : getRecipes()) + { + if(NEIServerUtils.areStacksSameTypeCrafting((ItemStack)irecipe.getKey(), ingredient)) + { + arecipes.add(new CachedIORecipe(irecipe, getFuelStack())); + } + } + } + + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe + { + public PositionedStack inputStack; + public PositionedStack outputStack; + public PositionedStack fuelStack; + + @Override + public PositionedStack getIngredient() + { + return inputStack; + } + + @Override + public PositionedStack getResult() + { + return outputStack; + } + + @Override + public PositionedStack getOtherStack() + { + return fuelStack; + } + + public CachedIORecipe(ItemStack input, ItemStack output, ItemStack fuel) + { + super(); + inputStack = new PositionedStack(input, 40, 12); + outputStack = new PositionedStack(output, 100, 30); + fuelStack = new PositionedStack(fuel, 40, 48); + } + + public CachedIORecipe(Map.Entry recipe, ItemStack fuel) + { + this((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue(), fuel); + } + } +} diff --git a/src/minecraft/mekanism/nei/CombinerRecipeHandler.java b/src/minecraft/mekanism/nei/CombinerRecipeHandler.java new file mode 100644 index 000000000..def3e00a1 --- /dev/null +++ b/src/minecraft/mekanism/nei/CombinerRecipeHandler.java @@ -0,0 +1,57 @@ +package mekanism.nei; + +import java.util.List; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + +import mekanism.client.GuiAdvancedElectricMachine; +import mekanism.client.GuiCombiner; +import mekanism.common.TileEntityCombiner; +import mekanism.common.RecipeHandler.Recipe; + +public class CombinerRecipeHandler extends AdvancedMachineRecipeHandler +{ + @Override + public String getRecipeName() + { + return "Combiner"; + } + + @Override + public String getRecipeId() + { + return "mekanism.combiner"; + } + + @Override + public String getOverlayIdentifier() + { + return "combiner"; + } + + @Override + public Set getRecipes() + { + return Recipe.COMBINER.get().entrySet(); + } + + @Override + public String getGuiTexture() + { + return "/resources/mekanism/gui/GuiCombiner.png"; + } + + @Override + public ItemStack getFuelStack() + { + return new ItemStack(Block.cobblestone); + } + + @Override + public Class getGuiClass() + { + return GuiCombiner.class; + } +} diff --git a/src/minecraft/mekanism/nei/CrusherRecipeHandler.java b/src/minecraft/mekanism/nei/CrusherRecipeHandler.java new file mode 100644 index 000000000..2df964ded --- /dev/null +++ b/src/minecraft/mekanism/nei/CrusherRecipeHandler.java @@ -0,0 +1,47 @@ +package mekanism.nei; + +import java.util.Set; + +import mekanism.client.GuiCrusher; +import mekanism.client.GuiElectricMachine; +import mekanism.common.TileEntityCrusher; +import mekanism.common.RecipeHandler.Recipe; + +public class CrusherRecipeHandler extends MachineRecipeHandler +{ + @Override + public String getRecipeName() + { + return "Crusher"; + } + + @Override + public String getRecipeId() + { + return "mekanism.crusher"; + } + + @Override + public String getOverlayIdentifier() + { + return "crusher"; + } + + @Override + public Set getRecipes() + { + return Recipe.CRUSHER.get().entrySet(); + } + + @Override + public String getGuiTexture() + { + return "/resources/mekanism/gui/GuiCrusher.png"; + } + + @Override + public Class getGuiClass() + { + return GuiCrusher.class; + } +} diff --git a/src/minecraft/mekanism/nei/EnrichmentChamberRecipeHandler.java b/src/minecraft/mekanism/nei/EnrichmentChamberRecipeHandler.java new file mode 100644 index 000000000..a7c7d8a69 --- /dev/null +++ b/src/minecraft/mekanism/nei/EnrichmentChamberRecipeHandler.java @@ -0,0 +1,47 @@ +package mekanism.nei; + +import java.util.Set; + +import mekanism.client.GuiElectricMachine; +import mekanism.client.GuiEnrichmentChamber; +import mekanism.common.TileEntityEnrichmentChamber; +import mekanism.common.RecipeHandler.Recipe; + +public class EnrichmentChamberRecipeHandler extends MachineRecipeHandler +{ + @Override + public String getRecipeName() + { + return "Enrichment Chamber"; + } + + @Override + public String getRecipeId() + { + return "mekanism.chamber"; + } + + @Override + public String getOverlayIdentifier() + { + return "chamber"; + } + + @Override + public Set getRecipes() + { + return Recipe.ENRICHMENT_CHAMBER.get().entrySet(); + } + + @Override + public String getGuiTexture() + { + return "/resources/mekanism/gui/GuiChamber.png"; + } + + @Override + public Class getGuiClass() + { + return GuiEnrichmentChamber.class; + } +} diff --git a/src/minecraft/mekanism/nei/MachineRecipeHandler.java b/src/minecraft/mekanism/nei/MachineRecipeHandler.java new file mode 100644 index 000000000..3632d39e3 --- /dev/null +++ b/src/minecraft/mekanism/nei/MachineRecipeHandler.java @@ -0,0 +1,124 @@ +package mekanism.nei; + +import java.awt.Rectangle; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.forge.GuiContainerManager; +import codechicken.nei.recipe.TemplateRecipeHandler; + +public abstract class MachineRecipeHandler extends TemplateRecipeHandler +{ + int ticksPassed; + + public abstract String getRecipeId(); + + public abstract Set> getRecipes(); + + @Override + public void drawBackground(GuiContainerManager guimanager, int i) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + guimanager.bindTextureByName(getGuiTexture()); + guimanager.drawTexturedModalRect(12, 0, 28, 5, 144, 68); + } + + @Override + public void drawExtras(GuiContainerManager guimanager, int i) + { + float f = ticksPassed >= 20 ? (ticksPassed - 20) % 20 / 20.0F : 0.0F; + drawProgressBar(guimanager, 63, 34, 176, 0, 24, 7, f, 0); + f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + drawProgressBar(guimanager, 149, 12, 176, 7, 4, 52, f, 3); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + ticksPassed++; + } + + @Override + public void loadTransferRects() + { + transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(63, 34, 24, 7), getRecipeId(), new Object[0])); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if(outputId.equals(getRecipeId())) + { + for(Map.Entry irecipe : getRecipes()) + { + arecipes.add(new CachedIORecipe(irecipe)); + } + } + else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + for(Map.Entry irecipe : getRecipes()) + { + if(NEIServerUtils.areStacksSameTypeCrafting((ItemStack)irecipe.getValue(), result)) + { + arecipes.add(new CachedIORecipe(irecipe)); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + for(Map.Entry irecipe : getRecipes()) + { + if(NEIServerUtils.areStacksSameTypeCrafting((ItemStack)irecipe.getKey(), ingredient)) + { + arecipes.add(new CachedIORecipe(irecipe)); + } + } + } + + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe + { + public PositionedStack input; + public PositionedStack output; + + @Override + public PositionedStack getIngredient() + { + return input; + } + + @Override + public PositionedStack getResult() + { + return output; + } + + public CachedIORecipe(ItemStack itemstack, ItemStack itemstack1) + { + super(); + input = new PositionedStack(itemstack, 40, 12); + output = new PositionedStack(itemstack1, 100, 30); + } + + public CachedIORecipe(Map.Entry recipe) + { + this((ItemStack)recipe.getKey(), (ItemStack)recipe.getValue()); + } + } +} diff --git a/src/minecraft/mekanism/nei/MetallurgicInfuserRecipeHandler.java b/src/minecraft/mekanism/nei/MetallurgicInfuserRecipeHandler.java new file mode 100644 index 000000000..4a1514ac8 --- /dev/null +++ b/src/minecraft/mekanism/nei/MetallurgicInfuserRecipeHandler.java @@ -0,0 +1,188 @@ +package mekanism.nei; + +import java.awt.Rectangle; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +import mekanism.api.InfusionInput; +import mekanism.api.InfusionOutput; +import mekanism.api.InfusionType; +import mekanism.client.GuiMetallurgicInfuser; +import mekanism.common.Mekanism; +import mekanism.common.TileEntityMetallurgicInfuser; +import mekanism.common.RecipeHandler.Recipe; +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + +import codechicken.nei.NEIServerUtils; +import codechicken.nei.PositionedStack; +import codechicken.nei.forge.GuiContainerManager; +import codechicken.nei.recipe.TemplateRecipeHandler; + +public class MetallurgicInfuserRecipeHandler extends TemplateRecipeHandler +{ + int ticksPassed; + + @Override + public String getRecipeName() + { + return "Metallurgic Infuser"; + } + + @Override + public String getOverlayIdentifier() + { + return "infuser"; + } + + @Override + public String getGuiTexture() + { + return "/resources/mekanism/gui/GuiMetallurgicInfuser.png"; + } + + @Override + public Class getGuiClass() + { + return GuiMetallurgicInfuser.class; + } + + public String getRecipeId() + { + return "mekanism.infuser"; + } + + public ItemStack getInfuseStack(InfusionType type) + { + return type == InfusionType.COAL ? new ItemStack(Mekanism.CompressedCarbon) : new ItemStack(Mekanism.Dust, 1, 7); + } + + public Set> getRecipes() + { + return Recipe.METALLURGIC_INFUSER.get().entrySet(); + } + + @Override + public void drawBackground(GuiContainerManager guimanager, int i) + { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + guimanager.bindTextureByName(getGuiTexture()); + guimanager.drawTexturedModalRect(0, 0, 5, 5, 166, 78); + } + + @Override + public void drawExtras(GuiContainerManager guimanager, int i) + { + float f = ticksPassed >= 40 ? (ticksPassed - 40) % 20 / 20.0F : 0.0F; + drawProgressBar(guimanager, 67, 42, 176, 104, 32, 8, f, 0); + + f = ticksPassed >= 20 && ticksPassed < 40 ? (ticksPassed - 20) % 20 / 20.0F : 1.0F; + if(ticksPassed < 20) f = 0.0F; + int infuseX = 176 + (getOtherStacks(i).get(0).item.isItemEqual(new ItemStack(Mekanism.CompressedCarbon)) ? 4 : 0); + int infuseY = getOtherStacks(i).get(0).item.isItemEqual(new ItemStack(Mekanism.CompressedCarbon)) ? 0 : 52; + + drawProgressBar(guimanager, 2, 22, infuseX, infuseY, 4, 52, f, 3); + + f = ticksPassed <= 20 ? ticksPassed / 20.0F : 1.0F; + drawProgressBar(guimanager, 160, 12, 176, 0, 4, 52, f, 3); + } + + @Override + public void onUpdate() + { + super.onUpdate(); + ticksPassed++; + } + + @Override + public void loadTransferRects() + { + transferRects.add(new TemplateRecipeHandler.RecipeTransferRect(new Rectangle(67, 42, 32, 8), getRecipeId(), new Object[0])); + } + + @Override + public void loadCraftingRecipes(String outputId, Object... results) + { + if(outputId.equals(getRecipeId())) + { + for(Map.Entry irecipe : getRecipes()) + { + arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType))); + } + } + else { + super.loadCraftingRecipes(outputId, results); + } + } + + @Override + public int recipiesPerPage() + { + return 1; + } + + @Override + public void loadCraftingRecipes(ItemStack result) + { + for(Map.Entry irecipe : getRecipes()) + { + if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionOutput)irecipe.getValue()).resource, result)) + { + arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType))); + } + } + } + + @Override + public void loadUsageRecipes(ItemStack ingredient) + { + for(Map.Entry irecipe : getRecipes()) + { + if(NEIServerUtils.areStacksSameTypeCrafting(((InfusionInput)irecipe.getKey()).inputSlot, ingredient)) + { + arecipes.add(new CachedIORecipe(irecipe, getInfuseStack(((InfusionInput)irecipe.getKey()).infusionType))); + } + } + } + + public class CachedIORecipe extends TemplateRecipeHandler.CachedRecipe + { + public PositionedStack inputStack; + public PositionedStack outputStack; + public PositionedStack infuseStack; + + @Override + public PositionedStack getIngredient() + { + return inputStack; + } + + @Override + public PositionedStack getResult() + { + return outputStack; + } + + @Override + public PositionedStack getOtherStack() + { + return infuseStack; + } + + public CachedIORecipe(ItemStack input, ItemStack output, ItemStack infuse) + { + super(); + inputStack = new PositionedStack(input, 46, 38); + outputStack = new PositionedStack(output, 104, 38); + infuseStack = new PositionedStack(infuse, 12, 30); + } + + public CachedIORecipe(Map.Entry recipe, ItemStack infuse) + { + this(((InfusionInput)recipe.getKey()).inputSlot, ((InfusionOutput)recipe.getValue()).resource, infuse); + } + } +} diff --git a/src/minecraft/mekanism/nei/NEIMekanismConfig.java b/src/minecraft/mekanism/nei/NEIMekanismConfig.java new file mode 100644 index 000000000..627cff21a --- /dev/null +++ b/src/minecraft/mekanism/nei/NEIMekanismConfig.java @@ -0,0 +1,36 @@ +package mekanism.nei; + +import codechicken.nei.api.API; +import codechicken.nei.api.IConfigureNEI; + +public class NEIMekanismConfig implements IConfigureNEI +{ + @Override + public void loadConfig() + { + API.registerRecipeHandler(new EnrichmentChamberRecipeHandler()); + API.registerUsageHandler(new EnrichmentChamberRecipeHandler()); + API.registerRecipeHandler(new PlatinumCompressorRecipeHandler()); + API.registerUsageHandler(new PlatinumCompressorRecipeHandler()); + API.registerRecipeHandler(new CrusherRecipeHandler()); + API.registerUsageHandler(new CrusherRecipeHandler()); + API.registerRecipeHandler(new CombinerRecipeHandler()); + API.registerUsageHandler(new CombinerRecipeHandler()); + API.registerRecipeHandler(new MetallurgicInfuserRecipeHandler()); + API.registerUsageHandler(new MetallurgicInfuserRecipeHandler()); + API.registerRecipeHandler(new PurificationChamberRecipeHandler()); + API.registerUsageHandler(new PurificationChamberRecipeHandler()); + } + + @Override + public String getName() + { + return "Mekanism NEI Plugin"; + } + + @Override + public String getVersion() + { + return "1.0.1"; + } +} diff --git a/src/minecraft/mekanism/nei/PlatinumCompressorRecipeHandler.java b/src/minecraft/mekanism/nei/PlatinumCompressorRecipeHandler.java new file mode 100644 index 000000000..abba4bd7e --- /dev/null +++ b/src/minecraft/mekanism/nei/PlatinumCompressorRecipeHandler.java @@ -0,0 +1,56 @@ +package mekanism.nei; + +import java.util.Set; + +import net.minecraft.item.ItemStack; + +import mekanism.client.GuiAdvancedElectricMachine; +import mekanism.client.GuiPlatinumCompressor; +import mekanism.common.Mekanism; +import mekanism.common.TileEntityPlatinumCompressor; +import mekanism.common.RecipeHandler.Recipe; + +public class PlatinumCompressorRecipeHandler extends AdvancedMachineRecipeHandler +{ + @Override + public String getRecipeName() + { + return "Platinum Compressor"; + } + + @Override + public String getRecipeId() + { + return "mekanism.compressor"; + } + + @Override + public String getOverlayIdentifier() + { + return "compressor"; + } + + @Override + public Set getRecipes() + { + return Recipe.PLATINUM_COMPRESSOR.get().entrySet(); + } + + @Override + public String getGuiTexture() + { + return "/resources/mekanism/gui/GuiCompressor.png"; + } + + @Override + public ItemStack getFuelStack() + { + return new ItemStack(Mekanism.Ingot, 1, 1); + } + + @Override + public Class getGuiClass() + { + return GuiPlatinumCompressor.class; + } +} diff --git a/src/minecraft/mekanism/nei/PurificationChamberRecipeHandler.java b/src/minecraft/mekanism/nei/PurificationChamberRecipeHandler.java new file mode 100644 index 000000000..c26731b2c --- /dev/null +++ b/src/minecraft/mekanism/nei/PurificationChamberRecipeHandler.java @@ -0,0 +1,55 @@ +package mekanism.nei; + +import java.util.Set; + +import mekanism.client.GuiAdvancedElectricMachine; +import mekanism.client.GuiPurificationChamber; +import mekanism.common.Mekanism; +import mekanism.common.RecipeHandler.Recipe; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + +public class PurificationChamberRecipeHandler extends AdvancedMachineRecipeHandler +{ + @Override + public String getRecipeName() + { + return "Purification Chamber"; + } + + @Override + public String getRecipeId() + { + return "mekanism.purificationchamber"; + } + + @Override + public String getOverlayIdentifier() + { + return "purificationchamber"; + } + + @Override + public Set getRecipes() + { + return Recipe.PURIFICATION_CHAMBER.get().entrySet(); + } + + @Override + public String getGuiTexture() + { + return "/resources/mekanism/gui/GuiPurificationChamber.png"; + } + + @Override + public ItemStack getFuelStack() + { + return new ItemStack(Item.flint); + } + + @Override + public Class getGuiClass() + { + return GuiPurificationChamber.class; + } +} diff --git a/src/minecraft/mekanism/tools/common/MekanismTools.java b/src/minecraft/mekanism/tools/common/MekanismTools.java index 9f1f2c138..d1b95cf2a 100644 --- a/src/minecraft/mekanism/tools/common/MekanismTools.java +++ b/src/minecraft/mekanism/tools/common/MekanismTools.java @@ -26,7 +26,7 @@ import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.EntityRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; -@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.1.1", dependencies = "required-after:Mekanism") +@Mod(modid = "MekanismTools", name = "MekanismTools", version = "5.2.0", dependencies = "required-after:Mekanism") @NetworkMod(clientSideRequired = true, serverSideRequired = false) public class MekanismTools {