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
+1 -1
View File
@@ -426,7 +426,7 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
{
final ItemStack memCardIS = player.inventory.getCurrentItem();
if( memCardIS != null && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard )
if( !memCardIS.isEmpty() && this.useStandardMemoryCard() && memCardIS.getItem() instanceof IMemoryCard )
{
final IMemoryCard memoryCard = (IMemoryCard) memCardIS.getItem();
@@ -436,7 +436,7 @@ public class PartPlacement
boolean supportedItem = items.memoryCard().isSameAs( held );
supportedItem |= items.colorApplicator().isSameAs( held );
if( event.getEntityPlayer().isSneaking() && held != null && supportedItem )
if( event.getEntityPlayer().isSneaking() && !held.isEmpty() && supportedItem )
{
NetworkHandler.instance().sendToServer( new PacketClick( event.getPos(), event.getFace(), 0, 0, 0, event.getHand() ) );
}
@@ -23,6 +23,7 @@ import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -86,7 +87,7 @@ public class PartIdentityAnnihilationPlane extends PartAnnihilationPlane
final List<ItemStack> out = new ArrayList<ItemStack>( 1 );
final Item item = Item.getItemFromBlock( state.getBlock() );
if( item != null )
if( item != Items.AIR )
{
int meta = 0;
if( item.getHasSubtypes() )
@@ -20,6 +20,7 @@ package appeng.parts.automation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
@@ -88,7 +89,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
@Override
public boolean canInsert( final ItemStack stack )
{
if( stack.isEmpty() || stack.getItem() == null )
if( stack.isEmpty() || stack.getItem() == Items.AIR )
{
return false;
}
@@ -19,6 +19,7 @@
package appeng.parts.automation;
import net.minecraft.init.Items;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
@@ -117,7 +118,7 @@ public abstract class UpgradeInventory extends AppEngInternalInventory implement
for( final ItemStack is : this )
{
if( is == null || is.getItem() == null || !( is.getItem() instanceof IUpgradeModule ) )
if( is == null || is.getItem() == Items.AIR || !( is.getItem() instanceof IUpgradeModule ) )
{
continue;
}
@@ -91,13 +91,13 @@ public class PartConversionMonitor extends AbstractPartMonitor
boolean ModeB = false;
ItemStack item = player.getHeldItem( hand );
if( item == null && this.getDisplayed() != null )
if( item.isEmpty() && this.getDisplayed() != null )
{
ModeB = true;
item = ( (IAEItemStack) this.getDisplayed() ).getItemStack();
}
if( item != null )
if( !item.isEmpty() )
{
try
{