diff --git a/common/buildcraft/BuildCraftTransport.java b/common/buildcraft/BuildCraftTransport.java index 6d3edfe7..b5d9ef8d 100644 --- a/common/buildcraft/BuildCraftTransport.java +++ b/common/buildcraft/BuildCraftTransport.java @@ -269,7 +269,6 @@ public class BuildCraftTransport { pipeWaterproof = new ItemBuildCraft(pipeWaterproofId.getInt()); pipeWaterproof.setUnlocalizedName("pipeWaterproof"); - pipeWaterproof.setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); LanguageRegistry.addName(pipeWaterproof, "Pipe Waterproof"); genericPipeBlock = new BlockGenericPipe(genericPipeId.getInt()); CoreProxy.proxy.registerBlock(genericPipeBlock.setUnlocalizedName("pipeBlock"), ItemBlock.class); diff --git a/common/buildcraft/builders/BlockArchitect.java b/common/buildcraft/builders/BlockArchitect.java index b9c29da9..c88b2bca 100644 --- a/common/buildcraft/builders/BlockArchitect.java +++ b/common/buildcraft/builders/BlockArchitect.java @@ -42,7 +42,7 @@ public class BlockArchitect extends BlockContainer { public BlockArchitect(int i) { super(i, Material.iron); setHardness(5F); - //setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + //setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/builders/BlockBlueprintLibrary.java b/common/buildcraft/builders/BlockBlueprintLibrary.java index 31026b61..10276562 100644 --- a/common/buildcraft/builders/BlockBlueprintLibrary.java +++ b/common/buildcraft/builders/BlockBlueprintLibrary.java @@ -32,7 +32,7 @@ public class BlockBlueprintLibrary extends BlockContainer { public BlockBlueprintLibrary(int i) { super(i, Material.wood); - //setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + //setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); setHardness(5F); } diff --git a/common/buildcraft/builders/BlockBuilder.java b/common/buildcraft/builders/BlockBuilder.java index bdf20b08..e4681785 100644 --- a/common/buildcraft/builders/BlockBuilder.java +++ b/common/buildcraft/builders/BlockBuilder.java @@ -38,7 +38,7 @@ public class BlockBuilder extends BlockContainer { public BlockBuilder(int i) { super(i, Material.iron); setHardness(5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/builders/BlockFiller.java b/common/buildcraft/builders/BlockFiller.java index 32c7aae7..9e052f9d 100644 --- a/common/buildcraft/builders/BlockFiller.java +++ b/common/buildcraft/builders/BlockFiller.java @@ -39,7 +39,7 @@ public class BlockFiller extends BlockContainer { super(i, Material.iron); setHardness(5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/builders/BlockMarker.java b/common/buildcraft/builders/BlockMarker.java index adfc49e7..f4001be8 100644 --- a/common/buildcraft/builders/BlockMarker.java +++ b/common/buildcraft/builders/BlockMarker.java @@ -31,7 +31,7 @@ public class BlockMarker extends BlockContainer { super(i, Material.circuits); setLightValue(0.5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } private AxisAlignedBB getBoundingBox(int meta) { diff --git a/common/buildcraft/builders/ItemBptBase.java b/common/buildcraft/builders/ItemBptBase.java index 4f623d20..040137ad 100644 --- a/common/buildcraft/builders/ItemBptBase.java +++ b/common/buildcraft/builders/ItemBptBase.java @@ -27,7 +27,7 @@ public abstract class ItemBptBase extends ItemBuildCraft { super(i); maxStackSize = 1; - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @SuppressWarnings({ "all" }) diff --git a/common/buildcraft/core/BlockBuildCraft.java b/common/buildcraft/core/BlockBuildCraft.java index 74e84669..5cb35417 100644 --- a/common/buildcraft/core/BlockBuildCraft.java +++ b/common/buildcraft/core/BlockBuildCraft.java @@ -14,7 +14,7 @@ public abstract class BlockBuildCraft extends BlockContainer { protected BlockBuildCraft(int id, Material material) { super(id, material); this.rand = new Random(); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/core/BlockSpring.java b/common/buildcraft/core/BlockSpring.java index 6fd5e1a8..b6a3e503 100644 --- a/common/buildcraft/core/BlockSpring.java +++ b/common/buildcraft/core/BlockSpring.java @@ -45,7 +45,7 @@ public class BlockSpring extends Block { setStepSound(soundStoneFootstep); disableStats(); setTickRandomly(true); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/core/CreativeTabBuildCraft.java b/common/buildcraft/core/CreativeTabBuildCraft.java index dcb77115..da3c6b07 100644 --- a/common/buildcraft/core/CreativeTabBuildCraft.java +++ b/common/buildcraft/core/CreativeTabBuildCraft.java @@ -1,24 +1,59 @@ package buildcraft.core; import buildcraft.BuildCraftCore; +import buildcraft.core.utils.Localization; +import buildcraft.transport.ItemFacade; +import java.util.Locale; +import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; -public class CreativeTabBuildCraft extends CreativeTabs { +public enum CreativeTabBuildCraft { - public static final CreativeTabs tabBuildCraft = new CreativeTabBuildCraft("buildcraft"); - - public CreativeTabBuildCraft(String label) { - super(label); + MACHINES, + FACADES; + private final CreativeTabs tab; + + private CreativeTabBuildCraft() { + tab = new Tab(); } - @Override - public ItemStack getIconItemStack() { - return new ItemStack(BuildCraftCore.diamondGearItem); + public CreativeTabs get() { + return tab; } - - @Override - public String getTranslatedTabLabel() { - return "BuildCraft"; + + private String getLabel() { + return "buildcraft." + name().toLowerCase(Locale.ENGLISH); + } + + private String translate() { + return Localization.get("tab." + name().toLowerCase(Locale.ENGLISH)); + } + + private ItemStack getItem() { + switch (this) { + case FACADES: + return ItemFacade.getStack(Block.stoneBrick, 0); + default: + return new ItemStack(BuildCraftCore.diamondGearItem); + } + + } + + private class Tab extends CreativeTabs { + + private Tab() { + super(getLabel()); + } + + @Override + public ItemStack getIconItemStack() { + return getItem(); + } + + @Override + public String getTranslatedTabLabel() { + return translate(); + } } } diff --git a/common/buildcraft/core/ItemBuildCraft.java b/common/buildcraft/core/ItemBuildCraft.java index 57baa729..8b4980bb 100644 --- a/common/buildcraft/core/ItemBuildCraft.java +++ b/common/buildcraft/core/ItemBuildCraft.java @@ -22,7 +22,7 @@ public class ItemBuildCraft extends Item { public ItemBuildCraft(int i) { super(i); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/energy/BlockEngine.java b/common/buildcraft/energy/BlockEngine.java index f5275da1..8382700d 100644 --- a/common/buildcraft/energy/BlockEngine.java +++ b/common/buildcraft/energy/BlockEngine.java @@ -35,7 +35,7 @@ public class BlockEngine extends BlockContainer { super(i, Material.iron); setHardness(5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); setUnlocalizedName("engineBlock"); } diff --git a/common/buildcraft/energy/ItemBucketBuildcraft.java b/common/buildcraft/energy/ItemBucketBuildcraft.java index b4a2ff46..8501e23d 100644 --- a/common/buildcraft/energy/ItemBucketBuildcraft.java +++ b/common/buildcraft/energy/ItemBucketBuildcraft.java @@ -22,7 +22,7 @@ public class ItemBucketBuildcraft extends ItemBucket { public ItemBucketBuildcraft(int i, int blockId) { super(i, blockId); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); setContainerItem(Item.bucketEmpty); } diff --git a/common/buildcraft/factory/BlockFloodGate.java b/common/buildcraft/factory/BlockFloodGate.java index cd123bd4..c0ce9c3d 100644 --- a/common/buildcraft/factory/BlockFloodGate.java +++ b/common/buildcraft/factory/BlockFloodGate.java @@ -32,7 +32,7 @@ public class BlockFloodGate extends BlockContainer { public BlockFloodGate(int i) { super(i, Material.iron); setHardness(5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/factory/BlockMachineRoot.java b/common/buildcraft/factory/BlockMachineRoot.java index 31f337d7..d98bc802 100644 --- a/common/buildcraft/factory/BlockMachineRoot.java +++ b/common/buildcraft/factory/BlockMachineRoot.java @@ -20,7 +20,7 @@ public abstract class BlockMachineRoot extends BlockContainer { protected BlockMachineRoot(int i, Material material) { super(i, material); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); setHardness(5F); } diff --git a/common/buildcraft/factory/BlockPump.java b/common/buildcraft/factory/BlockPump.java index ed30afe5..6dc5585f 100644 --- a/common/buildcraft/factory/BlockPump.java +++ b/common/buildcraft/factory/BlockPump.java @@ -32,7 +32,7 @@ public class BlockPump extends BlockContainer { public BlockPump(int i) { super(i, Material.iron); setHardness(5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/factory/BlockRefinery.java b/common/buildcraft/factory/BlockRefinery.java index 3417eac1..de22da93 100644 --- a/common/buildcraft/factory/BlockRefinery.java +++ b/common/buildcraft/factory/BlockRefinery.java @@ -43,7 +43,7 @@ public class BlockRefinery extends BlockContainer { super(i, Material.iron); setHardness(5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/factory/BlockTank.java b/common/buildcraft/factory/BlockTank.java index 8ab8840a..75bbc95c 100644 --- a/common/buildcraft/factory/BlockTank.java +++ b/common/buildcraft/factory/BlockTank.java @@ -37,7 +37,7 @@ public class BlockTank extends BlockContainer { super(i, Material.glass); setBlockBounds(0.125F, 0F, 0.125F, 0.875F, 1F, 0.875F); setHardness(0.5F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/silicon/BlockLaser.java b/common/buildcraft/silicon/BlockLaser.java index 95b080a7..b0eb8320 100644 --- a/common/buildcraft/silicon/BlockLaser.java +++ b/common/buildcraft/silicon/BlockLaser.java @@ -28,7 +28,7 @@ public class BlockLaser extends BlockContainer { public BlockLaser(int i) { super(i, Material.iron); setHardness(10F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/silicon/BlockLaserTable.java b/common/buildcraft/silicon/BlockLaserTable.java index 65f5a54c..4cd9204f 100644 --- a/common/buildcraft/silicon/BlockLaserTable.java +++ b/common/buildcraft/silicon/BlockLaserTable.java @@ -27,7 +27,7 @@ public class BlockLaserTable extends BlockContainer { setBlockBounds(0, 0, 0, 1, 9F / 16F, 1); setHardness(10F); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.MACHINES.get()); } @Override diff --git a/common/buildcraft/transport/ItemFacade.java b/common/buildcraft/transport/ItemFacade.java index 67ecc66a..d520c6bc 100644 --- a/common/buildcraft/transport/ItemFacade.java +++ b/common/buildcraft/transport/ItemFacade.java @@ -17,15 +17,12 @@ import java.util.Set; import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; public class ItemFacade extends ItemBuildCraft { @@ -36,7 +33,7 @@ public class ItemFacade extends ItemBuildCraft { setHasSubtypes(true); setMaxDamage(0); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); + setCreativeTab(CreativeTabBuildCraft.FACADES.get()); } @Override diff --git a/common/buildcraft/transport/ItemGate.java b/common/buildcraft/transport/ItemGate.java index 62ef67f7..4e7286af 100644 --- a/common/buildcraft/transport/ItemGate.java +++ b/common/buildcraft/transport/ItemGate.java @@ -3,7 +3,6 @@ package buildcraft.transport; import buildcraft.api.gates.ActionManager; import buildcraft.api.gates.IAction; import buildcraft.api.gates.ITrigger; -import buildcraft.core.CreativeTabBuildCraft; import buildcraft.core.ItemBuildCraft; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -45,7 +44,6 @@ public class ItemGate extends ItemBuildCraft { setHasSubtypes(true); setMaxDamage(0); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); setPassSneakClick(true); } diff --git a/common/buildcraft/transport/ItemPipe.java b/common/buildcraft/transport/ItemPipe.java index 6f655718..c286c6ef 100644 --- a/common/buildcraft/transport/ItemPipe.java +++ b/common/buildcraft/transport/ItemPipe.java @@ -10,7 +10,6 @@ package buildcraft.transport; import buildcraft.BuildCraftCore; import buildcraft.BuildCraftTransport; import buildcraft.api.core.IIconProvider; -import buildcraft.core.CreativeTabBuildCraft; import buildcraft.core.IItemPipe; import buildcraft.core.ItemBuildCraft; import cpw.mods.fml.relauncher.Side; @@ -32,7 +31,6 @@ public class ItemPipe extends ItemBuildCraft implements IItemPipe { protected ItemPipe(int i) { super(i); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); } @Override diff --git a/common/buildcraft/transport/ItemPlug.java b/common/buildcraft/transport/ItemPlug.java index 46498201..94b5fcbf 100644 --- a/common/buildcraft/transport/ItemPlug.java +++ b/common/buildcraft/transport/ItemPlug.java @@ -1,21 +1,16 @@ package buildcraft.transport; -import buildcraft.core.CreativeTabBuildCraft; import buildcraft.core.ItemBuildCraft; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; -import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; -import net.minecraftforge.common.ForgeDirection; public class ItemPlug extends ItemBuildCraft { public ItemPlug(int i) { super(i); - setCreativeTab(CreativeTabBuildCraft.tabBuildCraft); } @Override