else
{
Field f = materialClass.getField( "material" + mat.name() );
IStackSrc is = ((ItemMultiMaterial) materialItem.item()).createMaterial( mat );
if ( is != null )
f.set( materials, new DamagedItemDefinition( is ) );
else
f.set( materials, new NullItemDefinition() );
}
}
catch (Throwable err)
{
AELog.severe( "Error creating material: " + mat.name() );
throw new RuntimeException( err );
}
}
AEItemDefinition partItem = addFeature( ItemMultiPart.class );
Class partClass = parts.getClass();
for (PartType type : PartType.values())
{
try
{
if ( type == PartType.InvalidType )
((ItemMultiPart) partItem.item()).createPart( type, null );
else
{
Field f = partClass.getField( "part" + type.name() );
Enum variants[] = type.getVariants();
if ( variants == null )
{
ItemStackSrc is = ((ItemMultiPart) partItem.item()).createPart( type, null );
if ( is != null )
f.set( parts, new DamagedItemDefinition( is ) );
else
f.set( parts, new NullItemDefinition() );
}
else
{