Package net.minecraft.item

Examples of net.minecraft.item.ItemStack


      return new Object[]{ this.tileEntity.hasFocus };
    }

    @Callback(doc = "function():boolean -- is the pickaxe near broken?")
    public Object[] isPickaxeBroken(final Context context, final Arguments arguments) {
      ItemStack pickaxe = tileEntity.getStackInSlot(1);
      boolean nearBroken = pickaxe != null && pickaxe.getItemDamage() + 1 == pickaxe.getMaxDamage();
      return new Object[]{ nearBroken };
    }
View Full Code Here


      return new Object[]{ nearBroken };
    }

    @Callback(doc = "function():boolean -- Is the bore working?")
    public Object[] isWorking(final Context context, final Arguments arguments) {
      ItemStack pickaxe = tileEntity.getStackInSlot(1);
      boolean nearBroken = pickaxe != null && pickaxe.getItemDamage() + 1 == pickaxe.getMaxDamage();
      return new Object[]{ this.tileEntity.gettingPower() && this.tileEntity.hasFocus && this.tileEntity.hasPickaxe && pickaxe.isItemStackDamageable() && !nearBroken };
    }
View Full Code Here

      return new Object[]{ tileEntity.speed };
    }

    @Callback(doc = "function():boolean -- Will the bore get native clusters?")
    public Object[] hasNativeClusters(final Context context, final Arguments arguments) {
      ItemStack pickaxe = tileEntity.getStackInSlot(1);
      return new Object[]{ pickaxe != null && pickaxe.getItem() instanceof ItemElementalPickaxe };
    }
View Full Code Here

      return new Object[]{ pickaxe != null && pickaxe.getItem() instanceof ItemElementalPickaxe };
    }

    @Callback(doc = "function():number -- What level fortune on pick")
    public Object[] getFortune(final Context context, final Arguments arguments) {
      ItemStack pickaxe = tileEntity.getStackInSlot(1);
      return new Object[]{ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, pickaxe) };
    }
View Full Code Here

      return new Object[]{ EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, pickaxe) };
    }

    @Callback(doc = "function():boolean -- Does the pick have silk touch?")
    public Object[] hasSilkTouch(final Context context, final Arguments arguments) {
      ItemStack pickaxe = tileEntity.getStackInSlot(1);
      return new Object[]{ EnchantmentHelper.getEnchantmentLevel(Enchantment.silkTouch.effectId, pickaxe) > 0 };
    }
View Full Code Here

public class KamiDimensionHandler {

  @SubscribeEvent
  public void onInteract(PlayerInteractEvent event) {
    if (event.action == PlayerInteractEvent.Action.LEFT_CLICK_BLOCK) {
      ItemStack stack = event.entityPlayer.getCurrentEquippedItem();
      if (event.entityPlayer.worldObj.getBlock(event.x, event.y, event.z) == Blocks.bedrock) {
        if (stack != null && stack.getItem() instanceof ItemIchorPickAdv) {
          stack.getItem().onBlockStartBreak(stack, event.x, event.y, event.z, event.entityPlayer);

        }
      }
    }
  }
View Full Code Here

  }

  @Override
  public void getSubItems(Item item, CreativeTabs tab, List l) {
    for (PRIMAL_ASPECT_ENUM primal : PRIMAL_ASPECT_ENUM.values()) {
      l.add(new ItemStack(item, 1, primal.ordinal()));
    }
  }
View Full Code Here

    }

  @Override
  public ThaumicTinkererRecipe getRecipeItem() {
    return new ThaumicTinkererRecipeMulti(
                new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_POTIONS + "POT0", new ItemStack(this, 1, 0), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedGrain.class), 1, 0), new AspectList().add(Aspect.AURA, 5).add(Aspect.AIR, 5)),

                new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_POTIONS + "POT1", new ItemStack(this, 1, 1), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedGrain.class), 1, 1), new AspectList().add(Aspect.AURA, 5).add(Aspect.FIRE, 5)),

                new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_POTIONS + "POT2", new ItemStack(this, 1, 2), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedGrain.class), 1, 2), new AspectList().add(Aspect.AURA, 5).add(Aspect.EARTH, 5)),

                new ThaumicTinkererCrucibleRecipe(LibResearch.KEY_POTIONS + "POT3", new ItemStack(this, 1, 3), new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemInfusedGrain.class), 1, 3), new AspectList().add(Aspect.AURA, 5).add(Aspect.WATER, 5))
        );
  }
View Full Code Here

  @SubscribeEvent
  public void onEntityLivingDrops(LivingDropsEvent event) {
    if (event.source.getEntity() != null && event.source.getEntity() instanceof EntityPlayer) {
      if (event.entityLiving instanceof EntityEnderman && event.entityLiving.dimension == ConfigHandler.endDimensionID && Math.random() <= 1D / 32D)
        event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 7)));

      if (event.entityLiving instanceof EntityPigZombie && event.entityLiving.dimension == ConfigHandler.netherDimensionID && Math.random() <= 1D / 16D)
        event.drops.add(new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, new ItemStack(ThaumicTinkerer.registry.getFirstItemFromClass(ItemKamiResource.class), 1, 6)));
    }
  }
View Full Code Here

    return LibItemNames.FOCUS_FLIGHT;
  }

  @Override
  public IRegisterableResearch getResearchItem() {
    return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FOCUS_FLIGHT, new AspectList().add(Aspect.MOTION, 1).add(Aspect.MAGIC, 1).add(Aspect.AIR, 2), -3, -4, 2, new ItemStack(this)).setParents(LibResearch.KEY_FOCUS_SMELT).setConcealed()
        .setPages(new ResearchPage("0"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_FLIGHT));

  }
View Full Code Here

TOP

Related Classes of net.minecraft.item.ItemStack

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.