use of pl.asie.charset.lib.ui.SlotBlocked in project Charset by CharsetMC.
the class ContainerPocketTable method addSlotToContainer.
@Override
protected Slot addSlotToContainer(Slot slot) {
if (slot.inventory instanceof InventoryPlayer) {
if (slot.isHere(slot.inventory, heldPos)) {
slot = new SlotBlocked(slot.inventory, slot.getSlotIndex(), slot.xPos, slot.yPos);
}
if (slot.getSlotIndex() >= 9 && (slot.getSlotIndex() % 9) >= 6) {
slot = new Slot(slot.inventory, slot.getSlotIndex(), slot.xPos, slot.yPos) {
@Override
public void onSlotChanged() {
super.onSlotChanged();
updateCraft();
}
};
craftingSlots.add(slot);
} else {
nonCraftingInventorySlots.add(slot);
if (slot.getSlotIndex() < 9) {
hotbarSlots.add(slot);
} else {
mainInvSlots.add(slot);
}
if (slot.getSlotIndex() < 9 && slot.getHasStack() && slot.getStack().getItem() == CharsetCraftingPocket.pocketTable) {
slot = new Slot(slot.inventory, slot.getSlotIndex(), slot.xPos, slot.yPos) {
@Override
public boolean canTakeStack(EntityPlayer playerIn) {
return false;
}
};
}
}
}
return super.addSlotToContainer(slot);
}
Aggregations