-
-
Save JayZX535/70d5040a2e2186854c8d22722818ca5f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.wildcraft.wildcraft.util; | |
import com.wildcraft.wildcraft.items.collars.canine.WildCraftCanineCollar; | |
import com.wildcraft.wildcraft.items.genetics.WildCraftSyringe; | |
import net.minecraft.init.Items; | |
import net.minecraft.inventory.IInventory; | |
import net.minecraft.inventory.InventoryBasic; | |
import net.minecraft.inventory.Slot; | |
import net.minecraft.item.ItemStack; | |
import net.minecraftforge.items.SlotItemHandler; | |
import net.minecraftforge.items.IItemHandler; | |
public class WildCraftSlotRestrict extends WildCraftSlotBasic{ | |
private static IInventory emptyInventory = new InventoryBasic("[Null]", true, 0); | |
private final IItemHandler itemHandler; | |
private final int index; | |
private int slottype; | |
public WildCraftSlotRestrict(IItemHandler handler, int index, int xPosition, int yPosition, int slottype) { | |
super(handler, index, xPosition, yPosition); | |
this.itemHandler = handler; | |
this.index = index; | |
this.slottype = slottype; | |
//SLOT TYPES: | |
//-1 genetic tester | |
//caniform- 0 (collar), 1 (armor), 2 (amulet) | |
} | |
@Override | |
public boolean isItemValid(ItemStack stack) | |
{ | |
if (stack != null) | |
{ | |
if (this.slottype == 0) | |
{ | |
if (stack.getItem() instanceof WildCraftCanineCollar) | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
else if (this.slottype == -1) | |
{ | |
if (stack.getItem() instanceof WildCraftSyringe) | |
{ | |
return true; | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
else | |
{ | |
return false; | |
} | |
} | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment