aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/Java/gtPlusPlus/core/slots/SlotLunchBox.java')
-rw-r--r--src/Java/gtPlusPlus/core/slots/SlotLunchBox.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java b/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java
new file mode 100644
index 0000000000..bb82a28936
--- /dev/null
+++ b/src/Java/gtPlusPlus/core/slots/SlotLunchBox.java
@@ -0,0 +1,30 @@
+package gtPlusPlus.core.slots;
+
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemFood;
+import net.minecraft.item.ItemStack;
+
+import gtPlusPlus.api.objects.Logger;
+import gtPlusPlus.core.util.minecraft.FoodUtils;
+
+public class SlotLunchBox extends SlotGtTool {
+
+ public SlotLunchBox(final IInventory base, final int x, final int y, final int z) {
+ super(base, x, y, z);
+ }
+
+ @Override
+ public boolean isItemValid(final ItemStack itemstack) {
+ return isItemValid_STATIC(itemstack);
+ }
+
+ public static boolean isItemValid_STATIC(final ItemStack itemstack) {
+ if ((itemstack.getItem() instanceof ItemFood) || (FoodUtils.isFood(itemstack))) {
+ Logger.WARNING(itemstack.getDisplayName() + " is a valid food.");
+ return true;
+ }
+ Logger.WARNING(itemstack.getDisplayName() + " is not a valid food.");
+ return false;
+ }
+
+}