aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java
index 8a50a45..1e9ee3c 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java
@@ -4,15 +4,18 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.inventory.Inventory;
import net.minecraft.item.ItemStack;
import net.minecraft.screen.slot.Slot;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
public class ValidatedSlot extends Slot {
+ private static final Logger LOGGER = LogManager.getLogger();
private final int slotNumber;
private boolean insertingAllowed = true;
private boolean takingAllowed = true;
- public ValidatedSlot(Inventory inventoryIn, int index, int xPosition, int yPosition) {
- super(inventoryIn, index, xPosition, yPosition);
- if (inventoryIn==null) throw new IllegalArgumentException("Can't make an itemslot from a null inventory!");
+ public ValidatedSlot(Inventory inventory, int index, int x, int y) {
+ super(inventory, index, x, y);
+ if (inventory==null) throw new IllegalArgumentException("Can't make an itemslot from a null inventory!");
this.slotNumber = index;
}
@@ -29,13 +32,13 @@ public class ValidatedSlot extends Slot {
@Override
public ItemStack getStack() {
if (inventory==null) {
- System.out.println("Prevented null-inventory from WItemSlot with slot #: "+slotNumber);
+ LOGGER.warn("Prevented null-inventory from WItemSlot with slot #: {}", slotNumber);
return ItemStack.EMPTY;
}
ItemStack result = super.getStack();
if (result==null) {
- System.out.println("Prevented null-itemstack crash from: "+inventory.getClass().getCanonicalName());
+ LOGGER.warn("Prevented null-itemstack crash from: {}", inventory.getClass().getCanonicalName());
return ItemStack.EMPTY;
}