Replace Non created materials/parts with null item definitions instead of null.

This commit is contained in:
AlgorithmX2
2014-01-28 14:20:19 -06:00
parent 1a95fb5b0e
commit c40d6937d6
2 changed files with 49 additions and 1 deletions
+7 -1
View File
@@ -67,6 +67,7 @@ import appeng.core.features.AEFeatureHandler;
import appeng.core.features.ColoredItemDefinition;
import appeng.core.features.DamagedItemDefinition;
import appeng.core.features.IAEFeature;
import appeng.core.features.NullItemDefinition;
import appeng.core.features.registries.P2PTunnelRegistry;
import appeng.core.features.registries.entries.BasicCellHandler;
import appeng.core.features.registries.entries.CreativeCellHandler;
@@ -156,7 +157,10 @@ public class Registration
{
Field f = materialClass.getField( "material" + mat.name() );
ItemStack is = ((ItemMaterial) materialItem.item()).createMaterial( mat );
f.set( materials, new DamagedItemDefinition( is ) );
if ( is != null )
f.set( materials, new DamagedItemDefinition( is ) );
else
f.set( parts, new NullItemDefinition() );
}
catch (Throwable err)
{
@@ -179,6 +183,8 @@ public class Registration
ItemStack is = ((ItemPart) partItem.item()).createPart( type, null );
if ( is != null )
f.set( parts, new DamagedItemDefinition( is ) );
else
f.set( parts, new NullItemDefinition() );
}
else
{