diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-16 22:35:15 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-16 22:35:15 +0300 |
commit | 8ee43fdb284a4aa2fa3c25d6c7f6694b79ad391c (patch) | |
tree | ae0f12d9858569bfffbb68cd9eaeebba4a860493 | |
parent | 49f8daea8780f79ebbec7fec8dacf0dff884329b (diff) | |
download | LibGui-8ee43fdb284a4aa2fa3c25d6c7f6694b79ad391c.tar.gz LibGui-8ee43fdb284a4aa2fa3c25d6c7f6694b79ad391c.tar.bz2 LibGui-8ee43fdb284a4aa2fa3c25d6c7f6694b79ad391c.zip |
Use logger instead of println in ValidatedSlot, improve ctor param names
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/ValidatedSlot.java | 13 |
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; } |