Remove the need for ToolPartHidden.

This commit is contained in:
Bernhard Bonigl committed 2014-09-22 14:36:50 +02:00
1 parent 74c92e5939
commit 1e8c0097b3
4 files changed
+18 -1

No files matched your search

@@ -25,6 +25,8 @@ public class DynamicToolPart extends CraftingItem implements IToolPart
public String texture;
public IIcon defaultIcon;
private boolean hidden = false;
public DynamicToolPart(String texture, String name)
{
this(texture, name, "tinker");
@@ -38,6 +40,16 @@ public class DynamicToolPart extends CraftingItem implements IToolPart
this.texture = texture;
}
/**
* Doesn't add the item to creative tabs
*/
public DynamicToolPart hide()
{
hidden = true;
return this;
}
// item meta = material id
@Override
public int getMaterialID (ItemStack stack)
@@ -82,6 +94,9 @@ public class DynamicToolPart extends CraftingItem implements IToolPart
@Override
public void getSubItems (Item item, CreativeTabs tab, List list)
{
if(hidden)
return;
// material id == metadata
for(Integer matID : TConstructRegistry.toolMaterials.keySet())
list.add(new ItemStack(item, 1, matID));