Even more null fixes.

This commit is contained in:
Gunther De Wachter
2017-07-02 04:13:49 +02:00
parent c455ee69b8
commit eb0b304fd9
5 changed files with 11 additions and 11 deletions
@@ -109,7 +109,7 @@ public class BlockChest extends AEBaseTileBlock
else else
{ {
final ItemStack cell = tg.getStackInSlot( 1 ); final ItemStack cell = tg.getStackInSlot( 1 );
if( cell != null ) if( !cell.isEmpty() )
{ {
final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell ); final ICellHandler ch = AEApi.instance().registries().cell().getHandler( cell );
@@ -128,7 +128,7 @@ public class JEIPlugin extends BlankModPlugin
ItemStack grindstone = definitions.blocks().grindstone().maybeStack( 1 ).orElse( ItemStack.EMPTY ); ItemStack grindstone = definitions.blocks().grindstone().maybeStack( 1 ).orElse( ItemStack.EMPTY );
if( grindstone == null ) if( grindstone.isEmpty() )
{ {
return; return;
} }
@@ -143,24 +143,24 @@ public class JEIPlugin extends BlankModPlugin
{ {
ItemStack condenser = definitions.blocks().condenser().maybeStack( 1 ).orElse( ItemStack.EMPTY ); ItemStack condenser = definitions.blocks().condenser().maybeStack( 1 ).orElse( ItemStack.EMPTY );
if( condenser == null ) if( condenser.isEmpty() )
{ {
return; return;
} }
ItemStack matterBall = definitions.materials().matterBall().maybeStack( 1 ).orElse( ItemStack.EMPTY ); ItemStack matterBall = definitions.materials().matterBall().maybeStack( 1 ).orElse( ItemStack.EMPTY );
if( matterBall != null ) if( !matterBall.isEmpty() )
{ {
registry.addRecipes( ImmutableList.of( CondenserOutput.MATTER_BALLS ) ); registry.addRecipes( ImmutableList.of( CondenserOutput.MATTER_BALLS ) );
} }
ItemStack singularity = definitions.materials().singularity().maybeStack( 1 ).orElse( ItemStack.EMPTY ); ItemStack singularity = definitions.materials().singularity().maybeStack( 1 ).orElse( ItemStack.EMPTY );
if( singularity != null ) if( !singularity.isEmpty() )
{ {
registry.addRecipes( ImmutableList.of( CondenserOutput.SINGULARITY ) ); registry.addRecipes( ImmutableList.of( CondenserOutput.SINGULARITY ) );
} }
if( matterBall != null || singularity != null ) if( !matterBall.isEmpty() || !singularity.isEmpty() )
{ {
registry.addRecipeCategories( new CondenserCategory( registry.getJeiHelpers().getGuiHelper() ) ); registry.addRecipeCategories( new CondenserCategory( registry.getJeiHelpers().getGuiHelper() ) );
registry.addRecipeCategoryCraftingItem( condenser, CondenserCategory.UID ); registry.addRecipeCategoryCraftingItem( condenser, CondenserCategory.UID );
@@ -261,11 +261,11 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
*/ */
default: default:
newType = null; newType = ItemStack.EMPTY;
break; break;
} }
if( newType != null && !Platform.itemComparisons().isEqualItem( newType, this.getItemStack() ) ) if( !newType.isEmpty() && !Platform.itemComparisons().isEqualItem( newType, this.getItemStack() ) )
{ {
final boolean oldOutput = this.isOutput(); final boolean oldOutput = this.isOutput();
final long myFreq = this.getFrequency(); final long myFreq = this.getFrequency();
@@ -108,7 +108,7 @@ public class TileChest extends AENetworkPowerTile implements IMEChest, ITerminal
private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 ); private final AppEngInternalInventory inv = new AppEngInternalInventory( this, 2 );
private final BaseActionSource mySrc = new MachineSource( this ); private final BaseActionSource mySrc = new MachineSource( this );
private final IConfigManager config = new ConfigManager( this ); private final IConfigManager config = new ConfigManager( this );
private ItemStack storageType; private ItemStack storageType = ItemStack.EMPTY;
private long lastStateChange = 0; private long lastStateChange = 0;
private int priority = 0; private int priority = 0;
private int state = 0; private int state = 0;
@@ -242,7 +242,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
{ {
for( int x = 0; x < 6; x++ ) for( int x = 0; x < 6; x++ )
{ {
if( this.cells.getStackInSlot( x ) != null ) if( !this.cells.getStackInSlot( x ).isEmpty() )
{ {
return true; return true;
} }
@@ -572,7 +572,7 @@ public class TileIOPort extends AENetworkInvTile implements IUpgradeableHost, IC
{ {
final ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex ); final ItemStack stackInSlot = this.upgrades.getStackInSlot( upgradeIndex );
if( stackInSlot != null ) if( !stackInSlot.isEmpty() )
{ {
drops.add( stackInSlot ); drops.add( stackInSlot );
} }