Package net.minecraft.item

Examples of net.minecraft.item.Item


        int id = this.idPicked(world, x, y, z);
       
        if (id == 0)
            return null;
       
        Item item = Item.itemsList[id];
        if (item == null)
            return null;
       
        return new ItemStack(id, 1, 0);
    }
View Full Code Here


                return Block.getIdFromBlock(block);
            }
        }

        for (Object itemObj : Item.itemRegistry) {
            Item item = (Item) itemObj;
            if (item == null) continue;
            if (item.getUnlocalizedName() == null) continue;
            if (item.getUnlocalizedName().startsWith("item.")) {
                if (item.getUnlocalizedName().equalsIgnoreCase("item." + name)) return Item.getIdFromItem(item);
            }
            if (item.getUnlocalizedName().startsWith("tile.")) {
                if (item.getUnlocalizedName().equalsIgnoreCase("tile." + name)) return Item.getIdFromItem(item);
            }
            if (item.getUnlocalizedName().equalsIgnoreCase(name)) return Item.getIdFromItem(item);
        }
        return 0;
    }
View Full Code Here

    public static void registerBoxable(Item item, IBoxable boxable) {
        boxableItems.put(item, boxable);
    }

    public static boolean canBeStoredInToolbox(ItemStack stack) {
        Item item = stack.getItem();
        // use customs first to allow for overriding behavior
        for (IBoxable boxable : boxableItems.get(item)) {
            if (boxable.canBeStoredInToolbox(stack)) return true;
        }
View Full Code Here

    public static void registerMetalArmor(Item item, IMetalArmor armor) {
        metalArmorItems.put(item, armor);
    }

    public static boolean isMetalArmor(ItemStack stack, EntityPlayer player) {
        Item item = stack.getItem();
        // use customs first to allow for overriding behavior
        for (IMetalArmor metalArmor : metalArmorItems.get(item)) {
            if (metalArmor.isMetalArmor(stack, player)) return true;
        }
View Full Code Here

    private static final String TAG_REPAIRCOUNT = "RepairCount";

    public static boolean isTConstructTool(ItemStack stack) {
        if (stack == null)
            return false;
        Item item = stack.getItem();

        if (item instanceof ToolCore) {
            return !(ItemNBTHelper.verifyExistance(stack, TAG_ENERGY) || ItemNBTHelper.verifyExistance(stack, TAG_CHARGE));
        } else
            return false;
View Full Code Here

                      //  this.decrStackSize(0, 1);
                       // markDirty();
                    //Block block = worldObj.getBlock(x, y, z);
                    boolean done=false;
                    FakePlayer player=FakePlayerFactory.getMinecraft((WorldServer)worldObj);
                    Item item=inventorySlots[0].getItem();
                    ItemStack stack=inventorySlots[0];
                    if (!done)
                        item.onItemUseFirst(stack, player, worldObj, x, y, z, ForgeDirection.OPPOSITES[orientation], 0F, 0F, 0F);
                    if (!done)
                        done = item.onItemUse(stack, player, worldObj, x, y, z, ForgeDirection.OPPOSITES[orientation], 0F, 0F, 0F);
                    if (!done) {
                        item.onItemRightClick(stack, worldObj, player);
                        done = true;
                    }

                    }
                //}
View Full Code Here

    return stacks;
  }

  public static ItemStack createStackedBlock(Block block, int bMeta) {

    Item item = Item.getItemFromBlock(block);
    if (item.getHasSubtypes()) {
      return new ItemStack(item, 1, bMeta);
    }
    return new ItemStack(item, 1, 0);
  }
View Full Code Here

    stickLeaves.setHardness(0.2F).setLightOpacity(1).setStepSound(Block.soundGrassFootstep).setBlockName("leaves").setRequiresSelfNotify();
    stickLeaves.setGraphicsLevel(true);
    GameRegistry.registerBlock(stickLeaves);
    LanguageRegistry.addName(stickLeaves, "leaves");

    Item axeFlint = new ItemAxe(getUnusedItemID(), EnumToolMaterial.STONE).setIconCoord(1, 7).setItemName("hatchetFlint");
    GameRegistry.addRecipe(new ItemStack(axeFlint), "sf", "s ", 'f', new ItemStack(Item.flint), 's', new ItemStack(Item.stick));
    axeFlint.setMaxDamage(3);
    LanguageRegistry.addName(axeFlint, "leaves");
   
    GameRegistry.registerTileEntity(TileEntityCampFire.class, "TileEntityCampFire");
 
    GlobalModifications.modifyToolEffectiveness();
View Full Code Here

            return 0;
        }
        else
        {
            int var1 = par0ItemStack.getItem().itemID;
            Item var2 = par0ItemStack.getItem();

            if (par0ItemStack.getItem() instanceof ItemBlock && Block.blocksList[var1] != null)
            {
                Block var3 = Block.blocksList[var1];
View Full Code Here

import crazypants.vecmath.Vector3d;

public class Util {

  public static Block getBlockFromItemId(ItemStack itemId) {
    Item item = itemId.getItem();
    if(item instanceof ItemBlock) {
      return ((ItemBlock) item).field_150939_a;
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of net.minecraft.item.Item

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.