@SubscribeEvent(priority = LOWEST) @SuppressWarnings("unused") public void onToolTipEvent(ItemTooltipEvent event) { if(event.getItemStack() ==null) { return; } if(ConfigurationHandler.getInstance().tooltipOnLinkItems && BoatLinker.getInstance().isValidLinkKey(event.getItemStack())) { this.addBoatLinkTooltip(event.getToolTip()); } if(ConfigurationHandler.getInstance().tooltipOnChests && event.getItemStack().getItem() == Item.getItemFromBlock(Blocks.CHEST)) { this.addChestBoatTooltip(event.getToolTip()); } if(ConfigurationHandler.getInstance().tooltipOnBoats && event.getItemStack().getItem() instanceof ItemBoat) { this.addBoatTooltip(event.getToolTip()); } }
/** * Returns the number of ticks that the supplied fuel item will keep the furnace burning, or 0 if the item isn't * fuel */ public static int getItemBurnTime(ItemStack stack) { if (stack.func_190926_b()) { return 0; } else { Item item = stack.getItem(); return item == Item.getItemFromBlock(Blocks.WOODEN_SLAB) ? 150 : (item == Item.getItemFromBlock(Blocks.WOOL) ? 100 : (item == Item.getItemFromBlock(Blocks.CARPET) ? 67 : (item == Item.getItemFromBlock(Blocks.LADDER) ? 300 : (item == Item.getItemFromBlock(Blocks.WOODEN_BUTTON) ? 100 : (Block.getBlockFromItem(item).getDefaultState().getMaterial() == Material.WOOD ? 300 : (item == Item.getItemFromBlock(Blocks.COAL_BLOCK) ? 16000 : (item instanceof ItemTool && "WOOD".equals(((ItemTool)item).getToolMaterialName()) ? 200 : (item instanceof ItemSword && "WOOD".equals(((ItemSword)item).getToolMaterialName()) ? 200 : (item instanceof ItemHoe && "WOOD".equals(((ItemHoe)item).getMaterialName()) ? 200 : (item == Items.STICK ? 100 : (item != Items.BOW && item != Items.FISHING_ROD ? (item == Items.SIGN ? 200 : (item == Items.COAL ? 1600 : (item == Items.LAVA_BUCKET ? 20000 : (item != Item.getItemFromBlock(Blocks.SAPLING) && item != Items.BOWL ? (item == Items.BLAZE_ROD ? 2400 : (item instanceof ItemDoor && item != Items.IRON_DOOR ? 200 : (item instanceof ItemBoat ? 400 : 0))) : 100)))) : 300))))))))))); } }
public static boolean canItemAcceptSockets(ItemStack stack) { Item item = stack.getItem(); if (item == PhysisItems.socketable) { return false; } if (item instanceof ItemBlock || item instanceof ItemReed || item instanceof ItemBed || item instanceof ItemFood || item instanceof ItemPotion || item instanceof ItemMinecart || item instanceof ItemBoat || item instanceof ItemEnchantedBook || item instanceof ItemWritableBook || item instanceof ItemBucket || item instanceof ItemBucketMilk || item instanceof ItemDoor) { return false; } if (item.getItemStackLimit(stack) > 1) { return false; } if (item.hasContainerItem(stack)){ ItemStack container = item.getContainerItem(stack); if (container != null && container.getItem() instanceof ItemBucket) { return false; } } if (item.getUnlocalizedName(stack).toLowerCase().contains("bucket")) { return false; } return true; }