Fix facade recipes. Hopefully the last null check fix.
This commit is contained in:
@@ -58,7 +58,7 @@ public class InWorldToolOperationResult
|
||||
|
||||
for( final ItemStack l : items )
|
||||
{
|
||||
if( b == null )
|
||||
if( b.isEmpty() )
|
||||
{
|
||||
final Block bl = Block.getBlockFromItem( l.getItem() );
|
||||
|
||||
|
||||
@@ -681,7 +681,7 @@ public class Platform
|
||||
return new ArrayList();
|
||||
}
|
||||
|
||||
ItemStack itemStack = null;
|
||||
ItemStack itemStack = ItemStack.EMPTY;
|
||||
if( o instanceof AEItemStack )
|
||||
{
|
||||
final AEItemStack ais = (AEItemStack) o;
|
||||
@@ -724,7 +724,7 @@ public class Platform
|
||||
return "** Null";
|
||||
}
|
||||
|
||||
ItemStack itemStack = null;
|
||||
ItemStack itemStack = ItemStack.EMPTY;
|
||||
if( o instanceof AEItemStack )
|
||||
{
|
||||
final String n = ( (AEItemStack) o ).getDisplayName();
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
@@ -140,7 +141,7 @@ public class ItemComparisonHelper
|
||||
*/
|
||||
|
||||
// test damageable items..
|
||||
if( a.getItem() != null && b.getItem() != null && a.getItem().isDamageable() && a.getItem() == b.getItem() )
|
||||
if( a.getItem() != Items.AIR && b.getItem() != Items.AIR && a.getItem().isDamageable() && a.getItem() == b.getItem() )
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -379,11 +380,11 @@ public class ItemComparisonHelper
|
||||
*/
|
||||
private boolean hasSameNbtTag( final ItemStack a, final ItemStack b )
|
||||
{
|
||||
if( a == null && b == null )
|
||||
if( a.isEmpty() && b.isEmpty() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if( a == null || b == null )
|
||||
if( a.isEmpty() || b.isEmpty() )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import javax.annotation.Nullable;
|
||||
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompressedStreamTools;
|
||||
@@ -68,14 +69,14 @@ public final class AEItemStack extends AEStack<IAEItemStack> implements IAEItemS
|
||||
}
|
||||
|
||||
final Item item = is.getItem();
|
||||
if( item == null )
|
||||
if( item == Items.AIR )
|
||||
{
|
||||
throw new InvalidParameterException( "Contained item is null, thus not a valid ItemStack for AEItemStack." );
|
||||
}
|
||||
|
||||
this.setDefinition( new AEItemDef( item ) );
|
||||
|
||||
if( this.getDefinition().getItem() == null )
|
||||
if( this.getDefinition().getItem() == Items.AIR )
|
||||
{
|
||||
throw new InvalidParameterException( "This ItemStack is bad, it has a null item." );
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ package appeng.util.item;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.WeakHashMap;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
@@ -81,7 +82,7 @@ public class AESharedNBT extends NBTTagCompound implements IAETagCompound
|
||||
|
||||
final Item item = s.getItem();
|
||||
int meta = -1;
|
||||
if( s.getItem() != null && s.isItemStackDamageable() && s.getHasSubtypes() )
|
||||
if( s.getItem() != Items.AIR && s.isItemStackDamageable() && s.getHasSubtypes() )
|
||||
{
|
||||
meta = s.getItemDamage();
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
@@ -54,7 +55,7 @@ public class OreReference
|
||||
{
|
||||
for( final ItemStack is : OreHelper.INSTANCE.getCachedOres( oreName ) )
|
||||
{
|
||||
if( is.getItem() != null )
|
||||
if( is.getItem() != Items.AIR )
|
||||
{
|
||||
this.aeOtherOptions.add( AEItemStack.create( is ) );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user