MinecraftForge.EVENT_BUS.register( OreDictionaryHandler.instance );
Items items = appeng.core.Api.instance.items();
Materials materials = appeng.core.Api.instance.materials();
Parts parts = appeng.core.Api.instance.parts();
Blocks blocks = appeng.core.Api.instance.blocks();
AEItemDefinition materialItem = addFeature( ItemMultiMaterial.class );
Class materialClass = materials.getClass();
for (MaterialType mat : MaterialType.values())
{
try
{
if ( mat == MaterialType.InvalidType )
((ItemMultiMaterial) materialItem.item()).createMaterial( mat );
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 )