Replace all emptiness checks == ItemStack.Empty
with .isEmpty()
(#1247)
Fixes #1157 and probably a few other things.
This commit is contained in:
parent
df808760ad
commit
a016a6dd49
24 changed files with 41 additions and 39 deletions
|
@ -76,10 +76,10 @@ public class BlockDigitalChest extends BlockMachineBase {
|
|||
for (int i = 0; i < droppables.size(); i++) {
|
||||
final ItemStack itemStack = droppables.get(i);
|
||||
|
||||
if (itemStack == ItemStack.EMPTY) {
|
||||
if (itemStack.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
|
||||
if (!itemStack.isEmpty() && itemStack.getCount() > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockStaticLiquid
|
||||
|
|
|
@ -80,10 +80,10 @@ public class BlockQuantumChest extends BlockMachineBase {
|
|||
for (int i = 0; i < droppables.size(); i++) {
|
||||
final ItemStack itemStack = droppables.get(i);
|
||||
|
||||
if (itemStack == ItemStack.EMPTY) {
|
||||
if (itemStack.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
|
||||
if (!itemStack.isEmpty() && itemStack.getCount() > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockStaticLiquid
|
||||
|
|
|
@ -158,7 +158,7 @@ public class BlockRubberLog extends Block {
|
|||
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ);
|
||||
ItemStack stack = playerIn.getHeldItem(EnumHand.MAIN_HAND);
|
||||
if (stack != ItemStack.EMPTY)
|
||||
if (!stack.isEmpty())
|
||||
if ((stack.getItem() instanceof ItemElectricTreetap && PoweredItem.canUseEnergy(20, stack)) || stack.getItem() instanceof ItemTreeTap)
|
||||
if (state.getValue(HAS_SAP)) {
|
||||
if (state.getValue(SAP_SIDE) == side) {
|
||||
|
|
|
@ -140,10 +140,10 @@ public abstract class BlockTransformer extends BaseTileBlock {
|
|||
for (int i = 0; i < inventory.getSizeInventory(); i++) {
|
||||
ItemStack itemStack = inventory.getStackInSlot(i);
|
||||
|
||||
if (itemStack == ItemStack.EMPTY) {
|
||||
if (itemStack.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
if (itemStack != ItemStack.EMPTY && itemStack.getCount() > 0) {
|
||||
if (!itemStack.isEmpty() && itemStack.getCount() > 0) {
|
||||
if (itemStack.getItem() instanceof ItemBlock) {
|
||||
if (((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockFluidBase
|
||||
|| ((ItemBlock) itemStack.getItem()).getBlock() instanceof BlockStaticLiquid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue