Java 类net.minecraft.item.ItemBoat 实例源码

项目:Boatifull    文件:TooltipHandler.java   
@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());
    }
}
项目:Backmemed    文件:TileEntityFurnace.java   
/**
 * 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)))))))))));
    }
}
项目:ShadowsOfPhysis    文件:PhysisArtifacts.java   
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;
}