aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gtPlusPlus/core/slots/SlotJukebox.java
blob: 1351e5c1888d3a3c2ea08205f4b0d2d6e1715d48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package gtPlusPlus.core.slots;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemRecord;
import net.minecraft.item.ItemStack;

public class SlotJukebox extends SlotGeneric {

    private final boolean isDisplay;

    public SlotJukebox(IInventory inventory, int x, int y, int z) {
        this(inventory, x, y, z, false);
    }

    public SlotJukebox(IInventory inventory, int x, int y, int z, boolean display) {
        super(inventory, x, y, z);
        isDisplay = display;
    }

    @Override
    public boolean isItemValid(ItemStack itemstack) {
        return (itemstack != null && itemstack.getItem() instanceof ItemRecord);
    }

    @Override
    public int getSlotStackLimit() {
        return 1;
    }

    @Override
    public boolean canTakeStack(EntityPlayer p_82869_1_) {
        return !isDisplay;
    }
}