mirror of
https://github.com/GTNewHorizons/Mantle.git
synced 2026-11-18 19:29:32 +00:00
Clean up some checks to use isEmpty(), which is the same as checking the count is equal to 0.
This commit is contained in:
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user