Fixes NPE due to using wrong field.

This commit is contained in:
yueh 2017-08-11 21:33:57 +02:00
parent 3b58f5e8da
commit 542a2e5d5a

View file

@ -409,16 +409,21 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
{
return 0;
}
final EnumFacing targetSide = this.getSide().getFacing().getOpposite();
if( target.hasCapability( Capabilities.STORAGE_MONITORABLE_ACCESSOR, targetSide ) )
{
return 0;
}
final IItemHandler itemHandler = target.getCapability( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, targetSide );
if( handler != null )
if( itemHandler != null )
{
return Objects.hash( target, itemHandler, itemHandler.getSlots() );
}
return 0;
}