use of riskyken.armourersWorkshop.common.items.ItemSkinTemplate in project Armourers-Workshop by RiskyKen.
the class GuiSkinLibrary method isLoading.
/**
* Returns true if the player is trying to load and item
* or false if they are trying to save.
* @return true = loading, false = saving
*/
private boolean isLoading() {
Slot slot = (Slot) inventorySlots.inventorySlots.get(36);
ItemStack stack = slot.getStack();
if (stack != null && !(stack.getItem() instanceof ItemSkinTemplate)) {
return false;
}
return true;
}
use of riskyken.armourersWorkshop.common.items.ItemSkinTemplate in project Armourers-Workshop by RiskyKen.
the class ContainerArmourLibrary 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 < 36) {
if ((stack.getItem() instanceof ItemSkinTemplate & stack.getItemDamage() == 0) | stack.getItem() instanceof ItemSkin) {
if (!this.mergeItemStack(stack, 36, 37, false)) {
return null;
}
} else {
return null;
}
} else {
if (!this.mergeItemStack(stack, 9, 36, false)) {
if (!this.mergeItemStack(stack, 0, 9, false)) {
return null;
}
}
}
if (stack.stackSize == 0) {
slot.putStack(null);
} else {
slot.onSlotChanged();
}
slot.onPickupFromSlot(player, stack);
return result;
}
return null;
}
use of riskyken.armourersWorkshop.common.items.ItemSkinTemplate 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