Package net.minecraft.entity.item

Examples of net.minecraft.entity.item.EntityItem


        ItemStack itemstack = inv.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float)random.nextGaussian() * f3;
            entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float)random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here


        ItemStack itemstack = inv.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float)random.nextGaussian() * f3;
            entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float)random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

                            {
                                var13 = var9.stackSize;
                            }

                            var9.stackSize -= var13;
                            EntityItem var14 = new EntityItem(par1World, (double)((float)par2 + var10), (double)((float)par3 + var11), (double)((float)par4 + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage()));

                            if (var9.hasTagCompound())
                            {
                                var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy());
                            }

                            float var15 = 0.05F;
                            var14.motionX = (double)((float)this.researchRand.nextGaussian() * var15);
                            var14.motionY = (double)((float)this.researchRand.nextGaussian() * var15 + 0.2F);
View Full Code Here

                if (var9 != null)
                {
                    float var10 = Utility.rng.nextFloat() * 0.8F + 0.1F;
                    float var11 = Utility.rng.nextFloat() * 0.8F + 0.1F;
                    EntityItem var14;

                    for (float var12 = Utility.rng.nextFloat() * 0.8F + 0.1F; var9.stackSize > 0; theWorld.spawnEntityInWorld(var14))
                    {
                        int var13 = Utility.rng.nextInt(21) + 10;

                        if (var13 > var9.stackSize)
                        {
                            var13 = var9.stackSize;
                        }

                        var9.stackSize -= var13;
                        var14 = new EntityItem(theWorld, (double)((float)x + var10), (double)((float)y + var11), (double)((float)z + var12), new ItemStack(var9.itemID, var13, var9.getItemDamage()));
                        float var15 = 0.05F;
                        var14.motionX = (double)((float)Utility.rng.nextGaussian() * var15);
                        var14.motionY = (double)((float)Utility.rng.nextGaussian() * var15 + 0.2F);
                        var14.motionZ = (double)((float)Utility.rng.nextGaussian() * var15);

                        if (var9.hasTagCompound())
                        {
                            var14.getEntityItem().setTagCompound((NBTTagCompound)var9.getTagCompound().copy());
                        }
                    }
                }
            }
        }
View Full Code Here

      if (item != null && item.stackSize > 0) {
        float rx = Utility.rng.nextFloat() * 0.8F + 0.1F;
        float ry = Utility.rng.nextFloat() * 0.8F + 0.1F;
        float rz = Utility.rng.nextFloat() * 0.8F + 0.1F;

        EntityItem entityItem = new EntityItem(world,
            x + rx, y + ry, z + rz,
            new ItemStack(item.itemID, item.stackSize, item.getItemDamage()));

        if (item.hasTagCompound()) {
          entityItem.getEntityItem().setTagCompound((NBTTagCompound) item.getTagCompound().copy());
        }

        float factor = 0.05F;
        entityItem.motionX = Utility.rng.nextGaussian() * factor;
        entityItem.motionY = Utility.rng.nextGaussian() * factor + 0.2F;
View Full Code Here

        {
            return null;
        }
        else
        {
            EntityItem var3 = new EntityItem(this.worldObj, this.posX, this.posY - 0.30000001192092896D + (double)this.getEyeHeight(), this.posZ, par1ItemStack);
            var3.delayBeforeCanPickup = 40;
            float var4 = 0.1F;
            float var5;

            if (par2)
View Full Code Here

    ItemStack itemstack = enchanter.itemToEnchant;

    if (itemstack != null) {
      float f = random.nextFloat() * 0.8F + 0.1F;
      float f1 = random.nextFloat() * 0.8F + 0.1F;
      EntityItem entityitem;

      for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
        int k1 = random.nextInt(21) + 10;

        if (k1 > itemstack.stackSize)
          k1 = itemstack.stackSize;

        itemstack.stackSize -= k1;
        entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
        float f3 = 0.05F;
        entityitem.motionX = (float)random.nextGaussian() * f3 * 0.5;
        entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
        entityitem.motionZ = (float)random.nextGaussian() * f3 * 0.5;

        if (itemstack.hasTagCompound())
          entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
      }
    }

    par1World.func_147453_f(par2, par3, par4, par5);

View Full Code Here

        ItemStack itemstack = inv.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float)random.nextGaussian() * f3;
            entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float)random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
View Full Code Here

    if(beacon.getLevels() <= 0)
      return -1;

    List<EntityItem> items = item.worldObj.getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1));

    EntityItem diamond = null;
    EntityItem pearl = null;

    for(EntityItem otherItem : items) {
      if(otherItem == item)
        continue;
View Full Code Here

        ItemStack itemstack = inv.getStackInSlot(j1);

        if (itemstack != null) {
          float f = random.nextFloat() * 0.8F + 0.1F;
          float f1 = random.nextFloat() * 0.8F + 0.1F;
          EntityItem entityitem;

          for (float f2 = random.nextFloat() * 0.8F + 0.1F; itemstack.stackSize > 0; par1World.spawnEntityInWorld(entityitem)) {
            int k1 = random.nextInt(21) + 10;

            if (k1 > itemstack.stackSize)
              k1 = itemstack.stackSize;

            itemstack.stackSize -= k1;
            entityitem = new EntityItem(par1World, par2 + f, par3 + f1, par4 + f2, new ItemStack(itemstack.getItem(), k1, itemstack.getItemDamage()));
            float f3 = 0.05F;
            entityitem.motionX = (float)random.nextGaussian() * f3;
            entityitem.motionY = (float)random.nextGaussian() * f3 + 0.2F;
            entityitem.motionZ = (float)random.nextGaussian() * f3;

            if (itemstack.hasTagCompound())
              entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
          }
        }
      }

      par1World.func_147453_f(par2, par3, par4, par5);
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.