mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 03:49:29 +00:00
Remove the need for ToolPartHidden.
This commit is contained in:
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));
|
||||
|
||||
Reference in new issue
Block a user