Package net.minecraft.item

Examples of net.minecraft.item.Item


    }
    if (dmgItems[0] == null || dmgItems[0].getItem() == null) {
      return null;
    } else if (dmgItems[1] != null && dmgItems[0].getItem() == dmgItems[1].getItem() && dmgItems[0].stackSize == 1 && dmgItems[1].stackSize == 1
        && dmgItems[0].getItem().isRepairable()) {
      Item theItem = dmgItems[0].getItem();
      int var13 = theItem.getMaxDamage() - dmgItems[0].getItemDamageForDisplay();
      int var8 = theItem.getMaxDamage() - dmgItems[1].getItemDamageForDisplay();
      int var9 = var13 + var8 + theItem.getMaxDamage() * 5 / 100;
      int var10 = Math.max(0, theItem.getMaxDamage() - var9);

      return new ItemStack(dmgItems[0].getItem(), 1, var10);
    } else {
      IRecipe recipe;
      for (int i = 0; i < CraftingManager.getInstance().getRecipeList().size(); i++) {
View Full Code Here


  }

  /* EMPOWERED ITEM HELPERS */
  public static boolean isPlayerHoldingEmpowerableItem(EntityPlayer player) {

    Item equipped = player.getCurrentEquippedItem() != null ? player.getCurrentEquippedItem().getItem() : null;
    return equipped instanceof IEmpowerableItem;
  }
View Full Code Here

    return equipped instanceof IEmpowerableItem;
  }

  public static boolean isPlayerHoldingEmpoweredItem(EntityPlayer player) {

    Item equipped = player.getCurrentEquippedItem() != null ? player.getCurrentEquippedItem().getItem() : null;
    return equipped instanceof IEmpowerableItem && ((IEmpowerableItem) equipped).isEmpowered(player.getCurrentEquippedItem());
  }
View Full Code Here

    return id >= 0 && id == oreProxy.getOreID(stackB);
  }

  public static boolean isBlacklist(ItemStack output) {

    Item item = output.getItem();
    return Item.getItemFromBlock(Blocks.birch_stairs) == item || Item.getItemFromBlock(Blocks.jungle_stairs) == item
        || Item.getItemFromBlock(Blocks.oak_stairs) == item || Item.getItemFromBlock(Blocks.spruce_stairs) == item
        || Item.getItemFromBlock(Blocks.planks) == item || Item.getItemFromBlock(Blocks.wooden_slab) == item;
  }
View Full Code Here

  @Override
  public Map<String, Object> getItemStackMetadata(ItemStack itemstack) {
    if (itemstack == null) return NULL;

    Map<String, Object> map = Maps.newHashMap();
    Item item = itemstack.getItem();

    fillBasicProperties(map, item, itemstack);

    @SuppressWarnings("unchecked")
    final Iterable<IItemStackMetadataProvider<Object>> providers = (Iterable<IItemStackMetadataProvider<Object>>)MetaProvidersRegistry.ITEMS.getProviders(item.getClass());

    for (IItemStackMetadataProvider<Object> provider : providers) {
      Object converted = provider.getMeta(item, itemstack);
      if (converted != null) {
        final String key = provider.getKey();
View Full Code Here

  }

  @Override
  public void renderItem(ItemRenderType type, ItemStack stack, Object... data) {

    Item item = stack.getItem();
    FluidStack fluid = null;
    if (item instanceof IFluidContainerItem) {
      IFluidContainerItem fluidItem = (IFluidContainerItem) item;
      fluid = fluidItem.getFluid(stack);
    } else if (item instanceof IFluidOverlayItem) {
      if (item.getRenderPasses(ItemHelper.getItemDamage(stack)) == 2) {
        fluid = FluidContainerRegistry.getFluidForFilledItem(stack);
      }
    }
    doRenderItem(type, stack, item, fluid);
  }
View Full Code Here

        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

        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

        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

        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

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.