Example #1
0
  public void die() {
    if (this.h) {
      for (int i = 0; i < this.getSize(); ++i) {
        ItemStack itemstack = this.getItem(i);

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

          while (itemstack.count > 0) {
            int j = this.random.nextInt(21) + 10;

            if (j > itemstack.count) {
              j = itemstack.count;
            }

            itemstack.count -= j;
            EntityItem entityitem =
                new EntityItem(
                    this.world,
                    this.locX + (double) f,
                    this.locY + (double) f1,
                    this.locZ + (double) f2,
                    new ItemStack(itemstack.id, j, itemstack.getData()));

            if (itemstack.hasTag()) {
              entityitem.itemStack.setTag((NBTTagCompound) itemstack.getTag().clone());
            }

            float f3 = 0.05F;

            entityitem.motX = (double) ((float) this.random.nextGaussian() * f3);
            entityitem.motY = (double) ((float) this.random.nextGaussian() * f3 + 0.2F);
            entityitem.motZ = (double) ((float) this.random.nextGaussian() * f3);
            this.world.addEntity(entityitem);
          }
        }
      }
    }

    super.die();
    if (this.g != null) {
      this.g.a();
    }
  }
 public void die() {
   super.die();
 }