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));
@@ -238,7 +238,7 @@ public class TinkerTools
TinkerTools.handGuard = new DynamicToolPart("_medium_guard", "MediumGuard");
TinkerTools.crossbar = new DynamicToolPart("_crossbar", "Crossbar");
TinkerTools.knifeBlade = new DynamicToolPart("_knife_blade", "KnifeBlade");
TinkerTools.fullGuard = new ToolPartHidden("_full_guard", "FullGuard").setUnlocalizedName("tconstruct.FullGuard"); // todo
TinkerTools.fullGuard = new DynamicToolPart("_full_guard", "FullGuard").hide();
TinkerTools.frypanHead = new DynamicToolPart("_frypan_head", "FrypanHead");
TinkerTools.signHead = new DynamicToolPart("_battlesign_head", "SignHead");
@@ -9,6 +9,7 @@ import tconstruct.library.TConstructRegistry;
import tconstruct.library.util.IToolPart;
import tconstruct.tools.TinkerTools;
@Deprecated
public class ToolPart extends CraftingItem implements IToolPart
{
public String partName;
@@ -4,6 +4,7 @@ import java.util.List;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
@Deprecated
public class ToolPartHidden extends ToolPart
{