use of riskyken.armourersWorkshop.common.items.ItemArmourContainerItem in project Armourers-Workshop by RiskyKen.
the class ContainerArmourer method transferStackInSlot.
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotID) {
Slot slot = getSlot(slotID);
if (slot != null && slot.getHasStack()) {
ItemStack stack = slot.getStack();
ItemStack result = stack.copy();
if (slotID < 2) {
if (!this.mergeItemStack(stack, 11, 38, false)) {
if (!this.mergeItemStack(stack, 2, 11, false)) {
return null;
}
}
} else {
if ((stack.getItem() instanceof ItemSkinTemplate & stack.getItemDamage() == 0) | stack.getItem() instanceof ItemSkin | stack.getItem() instanceof ItemArmourContainerItem) {
if (!this.mergeItemStack(stack, 0, 1, false)) {
return null;
}
} else {
return null;
}
}
if (stack.stackSize == 0) {
slot.putStack(null);
} else {
slot.onSlotChanged();
}
slot.onPickupFromSlot(player, stack);
return result;
}
return null;
}
Aggregations