/** * 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); }
@SubscribeEvent public void tooltipEvent(ItemTooltipEvent event) { if (!event.getItemStack().isEmpty() && event.getItemStack().hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) { IBauble bauble = event.getItemStack().getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null); BaubleType bt = bauble.getBaubleType(event.getItemStack()); event.getToolTip().add(TextFormatting.GOLD + I18n.format("name."+bt)); } } }
for (int baubleSlot : bauble.getBaubleType(itemstack).getValidSlots()) { if ( bauble.canEquip(itemstack1, thePlayer) && !((Slot)this.inventorySlots.get(baubleSlot+9)).getHasStack() && !this.mergeItemStack(itemstack1, baubleSlot+9, baubleSlot + 10, false))
if (!st.isEmpty() && st.hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null)) { IBauble bauble = st.getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null); BaubleType bt = bauble.getBaubleType(st); sender.sendMessage(new TextComponentTranslation("\u00a73 [Slot "+a+"] "+bt+" "+st.getDisplayName()));