Package net.minecraft.entity.item

Examples of net.minecraft.entity.item.EntityItem


    return "item.benchTools." + benchToolsNames[meta];
  }

  protected void generateItemStack(ItemStack stack, EntityPlayer player)
  {
    EntityItem entityitem = player.dropPlayerItemWithRandomChoice(stack, false);
    entityitem.delayBeforeCanPickup = 0;
  }
View Full Code Here


          if(amountToDrop > itemstack.stackSize)
          {
            amountToDrop = itemstack.stackSize;
          }
          itemstack.stackSize -= amountToDrop;
          EntityItem entityitem = new EntityItem(world, x + xOffset, y + yOffset, z + zOffset, new ItemStack(itemstack.itemID, amountToDrop, itemstack.getItemDamage()));
          if(itemstack.getTagCompound() != null)
          {
            entityitem.getEntityItem().setTagCompound(itemstack.getTagCompound());
          }
          float motionMultiplier = 0.05F;
          entityitem.motionX = (float)world.rand.nextGaussian() * motionMultiplier;
          entityitem.motionY = (float)world.rand.nextGaussian() * motionMultiplier + 0.2F;
          entityitem.motionZ = (float)world.rand.nextGaussian() * motionMultiplier;
 
View Full Code Here

    else if(horizDirection == 3)
    {
      motionX = -0.05D;
    }
   
    EntityItem entityitem = new EntityItem(worldObj, xCoord + dropOffsetX, yCoord + dropOffsetY, zCoord + dropOffsetZ, stack.copy());
    entityitem.motionX = motionX;
    entityitem.motionY = motionY;
    entityitem.motionZ = motionZ;
    entityitem.delayBeforeCanPickup = 20;
    worldObj.spawnEntityInWorld(entityitem);
View Full Code Here

          if(target.isShearable(stack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ)) {
            ArrayList<ItemStack> drops = target.onSheared(stack, entity.worldObj, (int)entity.posX, (int)entity.posY, (int)entity.posZ, EnchantmentHelper.getEnchantmentLevel(Enchantment.fortune.effectId, stack));

            Random rand = new Random();
            for(ItemStack drop : drops) {
              EntityItem ent = entity.entityDropItem(drop, 1.0F);
              ent.motionY += rand.nextFloat() * 0.05F;
              ent.motionX += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
              ent.motionZ += (rand.nextFloat() - rand.nextFloat()) * 0.1F;
            }

 
View Full Code Here

    else if(enchanter.stage > 2)
      alphaMod = 1F;

    if(enchanter.itemToEnchant != null) {
      if(item == null)
        item = new EntityItem(enchanter.getWorldObj(), enchanter.xCoord, enchanter.yCoord + 1, enchanter.zCoord, enchanter.itemToEnchant);

      item.age = ClientTickHandler.ticksInGame;
      item.setEntityItemStack(enchanter.itemToEnchant);

      GL11.glColor4f(1F, 1F, 1F, 1F);
View Full Code Here

      mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);

      float s = 0.25F;
      GL11.glScalef(s, s, s);
      GL11.glScalef(2F, 2F, 2F);
      if(!ForgeHooksClient.renderEntityItem(new EntityItem(brewery.getWorldObj(), brewery.xCoord, brewery.yCoord, brewery.zCoord, stack), stack, 0F, 0F, brewery.getWorldObj().rand, mc.renderEngine, RenderBlocks.getInstance(), 1)) {
        GL11.glScalef(0.5F, 0.5F, 0.5F);
        if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) {
          GL11.glScalef(0.5F, 0.5F, 0.5F);
          GL11.glTranslatef(1F, 1.1F, 0F);
          GL11.glPushMatrix();
View Full Code Here

      Minecraft mc = Minecraft.getMinecraft();
      if(stack != null) {
        mc.renderEngine.bindTexture(stack.getItem() instanceof ItemBlock ? TextureMap.locationBlocksTexture : TextureMap.locationItemsTexture);

        GL11.glScalef(2F, 2F, 2F);
        if(!ForgeHooksClient.renderEntityItem(new EntityItem(altar.getWorldObj(), altar.xCoord, altar.yCoord, altar.zCoord, stack), stack, 0F, 0F, altar.getWorldObj().rand, mc.renderEngine, renderBlocks, 1)) {
          GL11.glScalef(0.5F, 0.5F, 0.5F);
          if(stack.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.getBlockFromItem(stack.getItem()).getRenderType())) {
            GL11.glScalef(0.5F, 0.5F, 0.5F);
            GL11.glTranslatef(1F, 1.1F, 0F);
            renderBlocks.renderBlockAsItem(Block.getBlockFromItem(stack.getItem()), stack.getItemDamage(), 1F);
View Full Code Here

      for(Entity e : entities) {
        if(e == player)
          continue;

        if(e instanceof EntityItem) {
          EntityItem item = (EntityItem) e;
          ItemStack istack = item.getEntityItem();
          if(player.isSneaking() || istack.isItemEqual(pstack) && ItemStack.areItemStackTagsEqual(istack, pstack))
            positionsBuilder.append(item.getEntityId()).append(";");

        } else if(e instanceof IInventory) {
          IInventory inv = (IInventory) e;
          if(scanInventory(inv, pstack))
            positionsBuilder.append(e.getEntityId()).append(";");
View Full Code Here

      }
    }
  }

  private void addDrop(LivingDropsEvent event, ItemStack drop) {
    EntityItem entityitem = new EntityItem(event.entityLiving.worldObj, event.entityLiving.posX, event.entityLiving.posY, event.entityLiving.posZ, drop);
    entityitem.delayBeforeCanPickup = 10;
    event.drops.add(entityitem);
  }
View Full Code Here

        EntityPlayer entityPlayer = event.entityPlayer;

        PlayerSave playerSave = new PlayerSave(entityPlayer);
        ItemStack backpack = playerSave.getPersonalBackpack();
        if(backpack != null) {
            event.drops.add(new EntityItem(entityPlayer.worldObj, entityPlayer.posX, entityPlayer.posY, entityPlayer.posZ, backpack));
            playerSave.setPersonalBackpack(null);
        }
    }
View Full Code Here

TOP

Related Classes of net.minecraft.entity.item.EntityItem

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.