Fixes #1339: Was not able to retrieve the name of an unregistered part
Added an additional map to store all parts and be able to access them if needed. Added public preconditions Added private asserts Excluded public overridden methods, since behaviour can be unexpected
This commit is contained in:
@@ -3,8 +3,6 @@ package appeng.core.api.definitions;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import com.google.common.base.Optional;
|
||||
|
||||
import appeng.api.definitions.IBlockDefinition;
|
||||
import appeng.api.definitions.IItemDefinition;
|
||||
import appeng.api.definitions.ITileDefinition;
|
||||
@@ -91,13 +89,9 @@ public class DefinitionConstructor
|
||||
|
||||
for( AEColor color : AEColor.values() )
|
||||
{
|
||||
ItemStackSrc multiPartSource = target.createPart( type, color );
|
||||
final Optional<ItemStackSrc> maybeSource = Optional.fromNullable( multiPartSource );
|
||||
final ItemStackSrc multiPartSource = target.createPart( type, color );
|
||||
|
||||
if( maybeSource.isPresent() )
|
||||
{
|
||||
definition.add( color, multiPartSource );
|
||||
}
|
||||
definition.add( color, multiPartSource );
|
||||
}
|
||||
|
||||
return definition;
|
||||
|
||||
Reference in New Issue
Block a user