aboutsummaryrefslogtreecommitdiff
path: root/src/Java/gtPlusPlus/core/slots/SlotJukebox.java
blob: 0f8af988a1a6cfea599706f2ac257d1efc51081a (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
36
37
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;
	}

}