/** * Returns true if automation is allowed to insert the given stack (ignoring * stack size) into the given slot. */ @Override public boolean isItemValidForSlot(int slot, ItemStack stack, EntityLivingBase player) { if (stack==null || stack.isEmpty() || !stack.hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) return false; IBauble bauble = stack.getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null); return bauble.canEquip(stack, player) && bauble.getBaubleType(stack).hasSlot(slot); }
if ( bauble.canEquip(itemstack1, thePlayer) && !((Slot)this.inventorySlots.get(baubleSlot+9)).getHasStack() && !this.mergeItemStack(itemstack1, baubleSlot+9, baubleSlot + 10, false))