Fix facade recipes. Hopefully the last null check fix.

This commit is contained in:
Gunther De Wachter
2017-06-27 20:39:06 +02:00
parent b819fe4adb
commit 61b81fc802
52 changed files with 101 additions and 83 deletions
@@ -32,6 +32,7 @@ import com.google.common.collect.ImmutableSet;
import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.inventory.InventoryCrafting;
@@ -1225,13 +1226,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
BAD_BLOCKS.add( directedBlock ); // nope!
}
if( what.getItem() != null )
if( what.getItem() != Items.AIR )
{
return what.getUnlocalizedName();
}
final Item item = Item.getItemFromBlock( directedBlock );
if( item == null )
if( item == Items.AIR )
{
return directedBlock.getUnlocalizedName();
}
@@ -89,7 +89,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
this.crafting.setInventorySlotContents( x, gs );
if( gs != null && ( !this.isCrafting || !gs.hasTagCompound() ) )
if( !gs.isEmpty() && ( !this.isCrafting || !gs.hasTagCompound() ) )
{
this.markItemAs( x, gs, TestStatus.ACCEPT );
}
@@ -121,7 +121,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
{
final ItemStack gs = new ItemStack( outTag.getCompoundTagAt( x ) );
if( gs != null )
if( !gs.isEmpty() )
{
out.add( AEApi.instance().storage().createItemStack( gs ) );
}
@@ -330,7 +330,7 @@ public class PatternHelper implements ICraftingPatternDetails, Comparable<Patter
private TestStatus getStatus( final int slotIndex, final ItemStack i )
{
if( this.crafting.getStackInSlot( slotIndex ) == null )
if( this.crafting.getStackInSlot( slotIndex ).isEmpty() )
{
return i == null ? TestStatus.ACCEPT : TestStatus.DECLINE;
}