Tests parts before adding them.

Proxied IC2 Events.
This commit is contained in:
AlgorithmX2
2014-01-28 14:08:51 -06:00
parent f1aeca203d
commit 1a95fb5b0e
4 changed files with 31 additions and 15 deletions
+11
View File
@@ -48,6 +48,17 @@ public class ItemPart extends AEBaseItem implements IPartItem, IItemGroup
public ItemStack createPart(PartType mat, Enum varient)
{
try
{
ItemStack is = new ItemStack( this );
PartType t = getTypeByStack( is );
t.getPart().getConstructor( ItemStack.class ).newInstance( is );
}
catch (Throwable e)
{
return null; // part not supported..
}
String name = varient == null ? mat.name() : mat.name() + "." + varient.name();
int varID = varient == null ? 0 : varient.ordinal();