Clean up some checks to use isEmpty(), which is the same as checking the count is equal to 0.

This commit is contained in:
alexbegt committed 2017-04-02 16:17:22 -04:00
1 parent 330300e191
commit 2c966ad656
2 files changed
+7 -7

No files matched your search

@@ -216,7 +216,7 @@ public abstract class BaseContainer<T extends TileEntity> extends Container {
return ItemStack.EMPTY;
}
if(itemstack1.getCount() == 0) {
if(itemstack1.isEmpty()) {
slot.putStack(ItemStack.EMPTY);
}
else {
@@ -327,7 +327,7 @@ public abstract class BaseContainer<T extends TileEntity> extends Container {
slot.onSlotChanged();
flag1 = true;
if(stack.getCount() == 0) {
if(stack.isEmpty()) {
break;
}
}
@@ -187,7 +187,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
slot.putStack(stack);
slot.onTake(player, stack);
if(slot.getHasStack() && slot.getStack().getCount() == 0) {
if(slot.getHasStack() && slot.getStack().isEmpty()) {
slot.putStack(ItemStack.EMPTY);
}
@@ -195,7 +195,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
}
protected boolean moveToTileInventory(ItemStack itemstack) {
if(itemstack.isEmpty() || itemstack.getCount() == 0) {
if(itemstack.isEmpty()) {
return false;
}
@@ -207,7 +207,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
}
protected boolean moveToPlayerInventory(ItemStack itemstack) {
if(itemstack.isEmpty() || itemstack.getCount() == 0) {
if(itemstack.isEmpty()) {
return false;
}
@@ -216,7 +216,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
}
protected boolean moveToAnyContainer(ItemStack itemstack, Collection<Container> containers) {
if(itemstack.isEmpty() || itemstack.getCount() == 0) {
if(itemstack.isEmpty()) {
return false;
}
@@ -236,7 +236,7 @@ public class ContainerMultiModule<T extends TileEntity & IInventory> extends Bas
protected boolean refillAnyContainer(ItemStack itemstack, Collection<Container> containers) {
if(itemstack.isEmpty() || itemstack.getCount() == 0) {
if(itemstack.isEmpty()) {
return false;
}