From 6ba900d5e371bf7afa4ad71f35c990fc6d022300 Mon Sep 17 00:00:00 2001 From: Tinytimrob Date: Wed, 29 Aug 2012 23:26:57 +0000 Subject: [PATCH 1/3] Added configuration properties for wires, gates and facade --- common/buildcraft/BuildCraftTransport.java | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 1df4938d..d86f1634 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -314,39 +314,48 @@ public class BuildCraftTransport { diamondTextures[j] = 1 * 16 + 6 + j; } - redPipeWire = new ItemBuildCraft(DefaultProps.RED_PIPE_WIRE).setIconIndex(4 * 16 + 0); + Property redPipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("redPipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.RED_PIPE_WIRE); + redPipeWire = new ItemBuildCraft(Integer.parseInt(redPipeWireId.value)).setIconIndex(4 * 16 + 0); redPipeWire.setItemName("redPipeWire"); LanguageRegistry.addName(redPipeWire, "Red Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8))); - bluePipeWire = new ItemBuildCraft(DefaultProps.BLUE_PIPE_WIRE).setIconIndex(4 * 16 + 1); + Property bluePipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bluePipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.BLUE_PIPE_WIRE); + bluePipeWire = new ItemBuildCraft(Integer.parseInt(bluePipeWireId.value)).setIconIndex(4 * 16 + 1); bluePipeWire.setItemName("bluePipeWire"); LanguageRegistry.addName(bluePipeWire, "Blue Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8))); - greenPipeWire = new ItemBuildCraft(DefaultProps.GREEN_PIPE_WIRE).setIconIndex(4 * 16 + 2); + Property greenPipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("greenPipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.GREEN_PIPE_WIRE); + greenPipeWire = new ItemBuildCraft(Integer.parseInt(greenPipeWireId.value)).setIconIndex(4 * 16 + 2); greenPipeWire.setItemName("greenPipeWire"); LanguageRegistry.addName(greenPipeWire, "Green Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8))); - yellowPipeWire = new ItemBuildCraft(DefaultProps.YELLOW_PIPE_WIRE).setIconIndex(4 * 16 + 3); + Property yellowPipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("yellowPipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.YELLOW_PIPE_WIRE); + yellowPipeWire = new ItemBuildCraft(Integer.parseInt(yellowPipeWireId.value)).setIconIndex(4 * 16 + 3); yellowPipeWire.setItemName("yellowPipeWire"); LanguageRegistry.addName(yellowPipeWire, "Yellow Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8))); - pipeGate = new ItemGate(DefaultProps.GATE_ID, 0).setIconIndex(2 * 16 + 3); + Property pipeGateId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipeGate.id", Configuration.CATEGORY_ITEM, DefaultProps.GATE_ID); + pipeGate = new ItemGate(Integer.parseInt(pipeGateId.value), 0).setIconIndex(2 * 16 + 3); pipeGate.setItemName("pipeGate"); - pipeGateAutarchic = new ItemGate(DefaultProps.GATE_AUTARCHIC_ID, 1).setIconIndex(2 * 16 + 3); + Property pipeGateAutarchicId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipeGateAutarchic.id", Configuration.CATEGORY_ITEM, DefaultProps.GATE_AUTARCHIC_ID); + pipeGateAutarchic = new ItemGate(Integer.parseInt(pipeGateAutarchicId.value), 1).setIconIndex(2 * 16 + 3); pipeGateAutarchic.setItemName("pipeGateAutarchic"); - facadeItem = new ItemFacade(DefaultProps.PIPE_FACADE_ID); + Property pipeFacadeId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("pipeFacade.id", Configuration.CATEGORY_ITEM, DefaultProps.PIPE_FACADE_ID); + facadeItem = new ItemFacade(Integer.parseInt(pipeFacadeId.value)); facadeItem.setItemName("pipeFacade"); ItemFacade.initialize(); + + BuildCraftCore.mainConfiguration.save(); new BptBlockPipe(genericPipeBlock.blockID); From f2a9fc5d12fcc913f181528d8490eb06d6e9fa2d Mon Sep 17 00:00:00 2001 From: Tinytimrob Date: Wed, 29 Aug 2012 23:30:35 +0000 Subject: [PATCH 2/3] Prevent gates with damage value 0 from being shown in creative inventory twice --- common/buildcraft/transport/ItemGate.java | 1 - 1 file changed, 1 deletion(-) diff --git a/common/buildcraft/transport/ItemGate.java b/common/buildcraft/transport/ItemGate.java index c30fc545..21387756 100644 --- a/common/buildcraft/transport/ItemGate.java +++ b/common/buildcraft/transport/ItemGate.java @@ -64,7 +64,6 @@ public class ItemGate extends ItemBuildCraft { @Override @SideOnly(Side.CLIENT) public void getSubItems(int par1, CreativeTabs par2CreativeTabs, List itemList) { - super.getSubItems(par1, par2CreativeTabs, itemList); itemList.add(new ItemStack(this, 1, 0)); itemList.add(new ItemStack(this, 1, 1)); itemList.add(new ItemStack(this, 1, 2)); From 322f305c46af8890d7e9eb9fe430636699e9637e Mon Sep 17 00:00:00 2001 From: Tinytimrob Date: Wed, 29 Aug 2012 23:48:49 +0000 Subject: [PATCH 3/3] Adding blueprint library and pipe wires to creative inventory --- common/buildcraft/BuildCraftTransport.java | 4 ++++ common/buildcraft/builders/BlockBlueprintLibrary.java | 2 ++ 2 files changed, 6 insertions(+) diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index d86f1634..5cfeafc8 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -317,6 +317,7 @@ public class BuildCraftTransport { Property redPipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("redPipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.RED_PIPE_WIRE); redPipeWire = new ItemBuildCraft(Integer.parseInt(redPipeWireId.value)).setIconIndex(4 * 16 + 0); redPipeWire.setItemName("redPipeWire"); + redPipeWire.setTabToDisplayOn(CreativeTabs.tabMisc); LanguageRegistry.addName(redPipeWire, "Red Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 1), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(redPipeWire, 8))); @@ -324,6 +325,7 @@ public class BuildCraftTransport { Property bluePipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("bluePipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.BLUE_PIPE_WIRE); bluePipeWire = new ItemBuildCraft(Integer.parseInt(bluePipeWireId.value)).setIconIndex(4 * 16 + 1); bluePipeWire.setItemName("bluePipeWire"); + bluePipeWire.setTabToDisplayOn(CreativeTabs.tabMisc); LanguageRegistry.addName(bluePipeWire, "Blue Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 4), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(bluePipeWire, 8))); @@ -331,6 +333,7 @@ public class BuildCraftTransport { Property greenPipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("greenPipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.GREEN_PIPE_WIRE); greenPipeWire = new ItemBuildCraft(Integer.parseInt(greenPipeWireId.value)).setIconIndex(4 * 16 + 2); greenPipeWire.setItemName("greenPipeWire"); + greenPipeWire.setTabToDisplayOn(CreativeTabs.tabMisc); LanguageRegistry.addName(greenPipeWire, "Green Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 2), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(greenPipeWire, 8))); @@ -338,6 +341,7 @@ public class BuildCraftTransport { Property yellowPipeWireId = BuildCraftCore.mainConfiguration.getOrCreateIntProperty("yellowPipeWire.id", Configuration.CATEGORY_ITEM, DefaultProps.YELLOW_PIPE_WIRE); yellowPipeWire = new ItemBuildCraft(Integer.parseInt(yellowPipeWireId.value)).setIconIndex(4 * 16 + 3); yellowPipeWire.setItemName("yellowPipeWire"); + yellowPipeWire.setTabToDisplayOn(CreativeTabs.tabMisc); LanguageRegistry.addName(yellowPipeWire, "Yellow Pipe Wire"); AssemblyRecipe.assemblyRecipes.add(new AssemblyRecipe(new ItemStack[] { new ItemStack(Item.dyePowder, 1, 11), new ItemStack(Item.redstone, 1), new ItemStack(Item.ingotIron, 1) }, 500, new ItemStack(yellowPipeWire, 8))); diff --git a/common/buildcraft/builders/BlockBlueprintLibrary.java b/common/buildcraft/builders/BlockBlueprintLibrary.java index 49e7e184..c9ec9c93 100644 --- a/common/buildcraft/builders/BlockBlueprintLibrary.java +++ b/common/buildcraft/builders/BlockBlueprintLibrary.java @@ -12,6 +12,7 @@ package buildcraft.builders; import java.util.ArrayList; import net.minecraft.src.BlockContainer; +import net.minecraft.src.CreativeTabs; import net.minecraft.src.EntityLiving; import net.minecraft.src.EntityPlayer; import net.minecraft.src.ItemStack; @@ -28,6 +29,7 @@ public class BlockBlueprintLibrary extends BlockContainer { public BlockBlueprintLibrary(int i) { super(i, Material.wood); + setCreativeTab(CreativeTabs.tabRedstone); setHardness(0.7F); }