Package net.minecraft.item

Examples of net.minecraft.item.ItemStack


    }
    return String.format("%s-%d", name, datahash);
  }

  public ItemStack getPickedBlock(ItemStack stack) {
    ItemStack focus;
    if (stack.getItem() instanceof ItemWandCasting) {
      ItemWandCasting wand = (ItemWandCasting) stack.getItem();
      focus = wand.getFocusItem(stack);
    } else {
      focus = stack;
View Full Code Here


    return null;
  }

  @Override
  public ThaumicTinkererRecipe getRecipeItem() {
    return new ThaumicTinkererRecipeMulti(new ThaumicTinkererCraftingBenchRecipe(LibResearch.KEY_INFUSED_INKWELL + 0, new ItemStack(this),
        "QQQ", "QCQ", "QQQ",
        'Q', new ItemStack(Items.dye, 1, 0),
        'C', new ItemStack(this, 1, 32767)),
        new ThaumicTinkererInfusionRecipe(LibResearch.KEY_INFUSED_INKWELL, new ItemStack(this), 2, new AspectList().add(Aspect.VOID, 8).add(Aspect.DARKNESS, 8), new ItemStack(ConfigItems.itemInkwell),
            new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigItems.itemResource, 1, 3))
    );
  }
View Full Code Here

    }
    return (ItemNBTHelper.getBoolean(focus, TAG_AVAILABLE, false)) ? getPickedBlockStack(stack) : null;
  }

  public ItemStack getPickedBlockStack(ItemStack stack) {
    ItemStack focus;
    if (stack.getItem() instanceof ItemWandCasting) {
      ItemWandCasting wand = (ItemWandCasting) stack.getItem();
      focus = wand.getFocusItem(stack);
    } else {
      focus = stack;
    }
    String name = ItemNBTHelper.getString(focus, TAG_BLOCK_NAME, "");
    Block block = Block.getBlockFromName(name);
    if (block == Blocks.air) {
      int id = ItemNBTHelper.getInt(focus, TAG_BLOCK_ID, 0);
      block = Block.getBlockById(id);
    }
    int meta = ItemNBTHelper.getInt(focus, TAG_BLOCK_META, 0);
    ItemStack stck;
    //if(block instanceof BlockReed)
    //{
    //   stck=new ItemStack(Items.reeds,1,meta);
    //}
    stck = new ItemStack(new ItemBlock(block), 1, meta);
    return stck;
  }
View Full Code Here

    stck = new ItemStack(new ItemBlock(block), 1, meta);
    return stck;
  }

  public NBTTagCompound getStackTileEntity(ItemStack stack) {
    ItemStack focus;
    if (stack.getItem() instanceof ItemWandCasting) {
      ItemWandCasting wand = (ItemWandCasting) stack.getItem();
      focus = wand.getFocusItem(stack);
    } else {
      focus = stack;
View Full Code Here

    return ItemNBTHelper.getCompound(focus, TAG_TILE_CMP, true);
  }

  private void storePickedBlock(ItemStack stack, Block block, short meta, TileEntity tile) {
    ItemWandCasting wand = (ItemWandCasting) stack.getItem();
    ItemStack focus = wand.getFocusItem(stack);
    String blockName = Block.blockRegistry.getNameForObject(block);
    ItemNBTHelper.setString(focus, TAG_BLOCK_NAME, blockName);
    ItemNBTHelper.setInt(focus, TAG_BLOCK_META, meta);
    NBTTagCompound cmp = new NBTTagCompound();
    if (tile != null)
View Full Code Here

    wand.setFocus(stack, focus);
  }

  private void clearPickedBlock(ItemStack stack) {
    ItemWandCasting wand = (ItemWandCasting) stack.getItem();
    ItemStack focus = wand.getFocusItem(stack);
    ItemNBTHelper.setBoolean(focus, TAG_AVAILABLE, false);
    wand.setFocus(stack, focus);
  }
View Full Code Here

  @Override
  public IRegisterableResearch getResearchItem() {
    if (!Config.allowMirrors) {
      return null;
    }
    return (TTResearchItem) new TTResearchItem(LibResearch.KEY_FOCUS_DISLOCATION, new AspectList().add(Aspect.ELDRITCH, 2).add(Aspect.MAGIC, 1).add(Aspect.EXCHANGE, 1), -5, -5, 2, new ItemStack(this)).setSecondary().setParents(LibResearch.KEY_FOCUS_FLIGHT).setConcealed()
        .setPages(new ResearchPage("0"), new ResearchPage("1"), ResearchHelper.infusionPage(LibResearch.KEY_FOCUS_DISLOCATION));

  }
View Full Code Here

  }

  @Override
  public ThaumicTinkererRecipe getRecipeItem() {
    return new ThaumicTinkererInfusionRecipe(LibResearch.KEY_FOCUS_DISLOCATION, new ItemStack(this), 8, new AspectList().add(Aspect.ELDRITCH, 20).add(Aspect.DARKNESS, 10).add(Aspect.VOID, 25).add(Aspect.MAGIC, 20).add(Aspect.TAINT, 5), new ItemStack(Items.ender_pearl),
        new ItemStack(Items.quartz), new ItemStack(Items.quartz), new ItemStack(Items.quartz), new ItemStack(Items.quartz), new ItemStack(ConfigItems.itemResource, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 6), new ItemStack(Items.diamond));
  }
View Full Code Here

  @SubscribeEvent
  public void onDrops(LivingDropsEvent event) {
    if (event.source.damageType.equals("player")) {

      EntityPlayer player = (EntityPlayer) event.source.getEntity();
      ItemStack stack = player.getCurrentEquippedItem();
      if (stack != null && stack.getItem() == this && stack.stackTagCompound != null && stack.stackTagCompound.getInteger("Activated") == 1) {
        Aspect[] aspects = EnumMobAspect.getAspectsForEntity(event.entity);
        //ScanResult sr=new ScanResult((byte)2,0,0,event.entity,"");
        //AspectList as=ScanManager.getScanAspects(sr,event.entity.worldObj);
        //if(as!=null && as.size()!=0){
        if (aspects != null) {
View Full Code Here

    if (!handle)
      handleNext--;

    if (event.entityLiving instanceof EntityPlayer && handle) {
      EntityPlayer player = (EntityPlayer) event.entityLiving;
            ItemStack itemInUse = player.itemInUse;
            if (itemInUse != null && itemInUse.getItem() == this) {

        event.setCanceled(true);
        handleNext = 3;
        player.attackEntityFrom(DamageSource.magic, 3);
      }
    }

    if (handle) {
      Entity source = event.source.getSourceOfDamage();
      if (source != null && source instanceof EntityLivingBase) {
        EntityLivingBase attacker = (EntityLivingBase) source;
        ItemStack itemInUse = attacker.getHeldItem();
        if (itemInUse != null && itemInUse.getItem() == this)
          attacker.attackEntityFrom(DamageSource.magic, 2);
      }
    }
  }
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.