Changed to Null ItemStack instead of null.

This commit is contained in:
yueh
2016-12-21 20:27:23 +01:00
parent ed9e6dd21c
commit 1cde7bc933
36 changed files with 95 additions and 78 deletions
@@ -144,7 +144,7 @@ public enum MaterialType
this( metaValue, modelName, features );
this.droppedEntity = c;
EntityRegistry.registerModEntity( new ResourceLocation( this.droppedEntity.getName() ), this.droppedEntity, this.droppedEntity.getSimpleName(),
EntityRegistry.registerModEntity( new ResourceLocation( this.droppedEntity.getName() ), this.droppedEntity, "appliedenergistics2:" + this.droppedEntity.getSimpleName(),
EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4,
true );
}
@@ -154,7 +154,7 @@ public enum MaterialType
this( metaValue, modelName, features );
this.oreName = oreDictionary;
this.droppedEntity = c;
EntityRegistry.registerModEntity( new ResourceLocation( this.droppedEntity.getName() ), this.droppedEntity, this.droppedEntity.getSimpleName(),
EntityRegistry.registerModEntity( new ResourceLocation( this.droppedEntity.getName() ), this.droppedEntity, "appliedenergistics2:" + this.droppedEntity.getSimpleName(),
EntityIds.get( this.droppedEntity ), AppEng.instance(), 16, 4,
true );
}
@@ -64,7 +64,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
{
this.setHasSubtypes( true );
EntityRegistry.registerModEntity( new ResourceLocation( EntityGrowingCrystal.class.getName() ), EntityGrowingCrystal.class, EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
EntityRegistry.registerModEntity( new ResourceLocation( EntityGrowingCrystal.class.getName() ), EntityGrowingCrystal.class, "appliedenergistics2:" + EntityGrowingCrystal.class.getSimpleName(), EntityIds.get( EntityGrowingCrystal.class ), AppEng.instance(), 16, 4, true );
}
@Nullable
@@ -139,7 +139,7 @@ public class ItemCrystalSeed extends AEBaseItem implements IGrowableCrystal
}
if( newDamage > FINAL_STAGE )
{
return null;
return ItemStack.EMPTY;
}
this.setProgress( is, newDamage );
@@ -175,14 +175,14 @@ public class ItemEncodedPattern extends AEBaseItem implements ICraftingPatternIt
final World w = AppEng.proxy.getWorld();
if( w == null )
{
return null;
return ItemStack.EMPTY;
}
final ICraftingPatternDetails details = this.getPatternForItem( item, w );
if( details == null )
{
return null;
return ItemStack.EMPTY;
}
SIMPLE_CACHE.put( item, out = details.getCondensedOutputs()[0].getItemStack() );
@@ -155,13 +155,13 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
{
if( l == null )
{
return null;
return ItemStack.EMPTY;
}
final Block b = Block.getBlockFromItem( l.getItem() );
if( b == null || l.hasTagCompound() )
{
return null;
return ItemStack.EMPTY;
}
final int metadata = l.getItem().getMetadata( l.getItemDamage() );
@@ -180,7 +180,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
catch( Exception e )
{
AELog.debug( e, "Cannot create a facade for " + b.getRegistryName() );
return null;
return ItemStack.EMPTY;
}
final boolean defaultValue = ( b.isFullyOpaque( blockState ) && hasSimpleModel( blockState ) && !b.getTickRandomly() && !hasTile && !disableOre ) || enableGlass;
@@ -198,7 +198,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
is.setTagCompound( data );
return is;
}
return null;
return ItemStack.EMPTY;
}
@Override
@@ -220,7 +220,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
if( nbt == null )
{
return null;
return ItemStack.EMPTY;
}
ResourceLocation itemId;
@@ -232,12 +232,12 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
int[] data = nbt.getIntArray( "x" );
if( data.length != 2 )
{
return null;
return ItemStack.EMPTY;
}
Item item = Item.REGISTRY.getObjectById( data[0] );
if ( item == null ) {
return null;
return ItemStack.EMPTY;
}
itemId = item.getRegistryName();
@@ -252,7 +252,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
if( baseItem == null )
{
return null;
return ItemStack.EMPTY;
}
return new ItemStack( baseItem, 1, itemDamage );
@@ -315,7 +315,7 @@ public class ItemFacade extends AEBaseItem implements IFacadeItem, IAlphaPassIte
// Convert back to a registry name...
Item item = Item.REGISTRY.getObjectById( ids[0] );
if ( item == null ) {
return null;
return ItemStack.EMPTY;
}
final NBTTagCompound facadeTag = new NBTTagCompound();
@@ -288,7 +288,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
if( list.size() <= 0 )
{
return null;
return ItemStack.EMPTY;
}
IAEItemStack where = list.getFirst();
@@ -66,7 +66,8 @@ public abstract class AERootPoweredItem extends AEBaseItem implements IAEItemPow
final double percent = internalCurrentPower / internalMaxPower;
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
lines.add( GuiText.StoredEnergy.getLocal() + ':' + MessageFormat.format( " {0,number,#} ", internalCurrentPower ) + Platform
.gui_localize( PowerUnits.AE.unlocalizedName ) + " - " + MessageFormat.format( " {0,number,#.##%} ", percent ) );
}
@Override
@@ -64,9 +64,7 @@ class PoweredItemCapabilities implements ICapabilityProvider, IEnergyStorage
@Override
public boolean hasCapability( Capability<?> capability, @Nullable EnumFacing facing )
{
return capability == CapabilityEnergy.ENERGY
|| capability == Capabilities.TESLA_CONSUMER
|| capability == Capabilities.TESLA_HOLDER;
return capability == CapabilityEnergy.ENERGY || capability == Capabilities.TESLA_CONSUMER || capability == Capabilities.TESLA_HOLDER;
}
@SuppressWarnings( "unchecked" )