Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package melonslise.runicinscription.common.inventory;
- import melonslise.runicinscription.common.container.ContainerRuneInscription;
- import net.minecraft.entity.player.EntityPlayer;
- import net.minecraft.init.Items;
- import net.minecraft.inventory.IInventory;
- import net.minecraft.inventory.Slot;
- import net.minecraft.item.ItemStack;
- public class SlotRuneInscription extends Slot
- {
- ContainerRuneInscription containerInscription;
- public SlotRuneInscription(IInventory inventory, ContainerRuneInscription containerInscription, int index, int posX, int posY)
- {
- super(inventory, index, posX, posY);
- this.containerInscription = containerInscription;
- }
- @Override
- public boolean isItemValid(ItemStack itemStack)
- {
- switch (this.slotNumber)
- {
- case 0:
- return itemStack.getItem() == Items.dye;
- case 1:
- return false;
- }
- return true;
- }
- @Override
- public void onPickupFromSlot(EntityPlayer player, ItemStack itemStack)
- {
- if(this.slotNumber == 1)
- {
- ItemStack itemStack1 = this.inventory.getStackInSlot(0);
- if(itemStack1 != null)
- {
- this.inventory.decrStackSize(0, 1);
- for(int x = 0; x < 5; ++x)
- {
- for(int y = 0; y < 7; ++y)
- {
- this.containerInscription.grid[x][y] = true;
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment