Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.halestormxv.inventory;
- import com.halestormxv.item.CelestialCraft_items;
- import com.halestormxv.item.keyPouch;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- /*
- Making the custom slot is very simple, if you're going that route:
- */
- public class CelestialKeypouchSlot extends Slot
- {
- public CelestialKeypouchSlot(IInventory inv, int index, int xPos, int yPos)
- {
- super(inv, index, xPos, yPos);
- }
- // This is the only method we need to override so that
- // we can't place our inventory-storing Item within
- // its own inventory (thus making it permanently inaccessible)
- // as well as preventing abuse of storing backpacks within backpacks
- /**
- * Check if the stack is a valid item for this slot.
- */
- @Override
- public boolean isItemValid(ItemStack itemstack)
- {
- //Only allows Celestial Keys into the Bag and disallows the Key Pouch into itself.
- return !(itemstack.getItem() instanceof keyPouch || !(itemstack.getItem() == CelestialCraft_items.celKeys));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement