Package net.minecraft.entity.item

Examples of net.minecraft.entity.item.EntityItem


    if(doRandomSpread) {
      float f1 = 0.7F;
      double d = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
      double d1 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
      double d2 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
      EntityItem entityitem = new EntityItem(world, x + d, y + d1, z + d2, stack);
      entityitem.delayBeforeCanPickup = 10;
      world.spawnEntityInWorld(entityitem);
    } else {
      EntityItem entityitem = new EntityItem(world, x, y, z, stack);
      entityitem.motionX = 0;
      entityitem.motionY = 0;
      entityitem.motionZ = 0;
      entityitem.delayBeforeCanPickup = 0;
      world.spawnEntityInWorld(entityitem);
View Full Code Here


    if(doRandomSpread) {
      float f1 = 0.7F;
      double d = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
      double d1 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
      double d2 = (world.rand.nextFloat() * f1) + (1.0F - f1) * 0.5D;
      EntityItem entityitem = new EntityItem(world, x + d, y + d1, z + d2, stack);
      entityitem.delayBeforeCanPickup = 10;
      world.spawnEntityInWorld(entityitem);
    } else {
      EntityItem entityitem = new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, stack);
      entityitem.motionX = 0;
      entityitem.motionY = 0;
      entityitem.motionZ = 0;
      entityitem.delayBeforeCanPickup = 0;
      world.spawnEntityInWorld(entityitem);
View Full Code Here

      float f = 0.7F;
      double d0 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
      double d1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
      double d2 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
      EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, stack);
      entityitem.delayBeforeCanPickup = 10;
      world.spawnEntityInWorld(entityitem);
    }
  }
View Full Code Here

    GL11.glPushMatrix();
    GL11.glTranslatef((float) x, (float) y, (float) z);

    GL11.glPopMatrix();

    EntityItem ei = new EntityItem(world, x, y, z, getFloatingStack(te, x, y, z, tick));
    ei.age = (int) world.getTotalWorldTime();

    //Remove the bob
    float bob = ((float) ei.age + tick) / 10.0F;
    ei.hoverStart = -bob;
View Full Code Here

        float f = 0.7F;
        double d0 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
        double d1 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
        double d2 = world.rand.nextFloat() * f + (1.0F - f) * 0.5D;
        EntityItem entityitem = new EntityItem(world, x + d0, y + d1, z + d2, itemStack);
        entityitem.delayBeforeCanPickup = 10;
        world.spawnEntityInWorld(entityitem);
      }
    }
    world.removeTileEntity(x, y, z);
View Full Code Here

    ArrayList<ItemStack> itemDrops = block.getDrops(worldObj, bc.x, bc.y, bc.z, meta, 0);
    worldObj.setBlockToAir(bc.x, bc.y, bc.z);
    boolean usedPower = false;
    if(itemDrops != null) {
      for (ItemStack stack : itemDrops) {               
        worldObj.spawnEntityInWorld(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));               
        if(TreeHarvestUtil.canDropApples(block, meta)) {
          if(worldObj.rand.nextInt(200) == 0) {           
            worldObj.spawnEntityInWorld(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, new ItemStack(Items.apple)));
          }
        } else if(block == refBlock) { //other wise leaves
          applyDamage(player, player.getCurrentEquippedItem(), 1, true);
          usedPower = true;
        }
View Full Code Here

              GL11.glTranslatef(0f, -0.25f, 0);
            } else {
              GL11.glTranslatef(0f, -0.5f, 0);
            }
            GL11.glScalef(2, 2, 2);
            EntityItem ei = new EntityItem(tileentity.getWorldObj(), x, y, z, itemLabel);
            ei.age = 0;
            ei.hoverStart = 0;
            RenderManager.instance.getEntityRenderObject(ei).doRender(ei, 0, 0, 0, 0, 0);
            GL11.glPopMatrix();
          }
View Full Code Here

      {
        float rx = rand.nextFloat() * 0.8F + 0.1F;
        float ry = rand.nextFloat() * 0.8F + 0.1F;
        float rz = rand.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 = rand.nextGaussian() * factor;
        entityItem.motionY = rand.nextGaussian() * factor + 0.2F;
View Full Code Here

                blockScale = 0.85F;
            }
            glPushMatrix();
            glDisable(2896 /* GL_LIGHTING */);
            glTranslatef((float) x, (float) y, (float) z);
            EntityItem customitem = new EntityItem(field_147501_a.field_147550_f);
            customitem.hoverStart = 0f;
            for (ItemStack item : tile.getTopItemStacks()) {
                if (shift > shifts.length) {
                    break;
                }
                if (item == null) {
                    shift++;
                    continue;
                }
                shiftX = shifts[shift][0];
                shiftY = shifts[shift][1];
                shiftZ = shifts[shift][2];
                shift++;
                glPushMatrix();
                glTranslatef(shiftX, shiftY, shiftZ);
                glRotatef(timeD, 0.0F, 1.0F, 0.0F);
                glScalef(blockScale, blockScale, blockScale);
                customitem.setEntityItemStack(item);
                itemRenderer.doRender(customitem, 0, 0, 0, 0, 0);
                glPopMatrix();
            }
            glEnable(2896 /* GL_LIGHTING */);
            glPopMatrix();
View Full Code Here

   */
  public static void dropItemAsEntity(World world, int x, int y, int z, ItemStack itemStack) {
    Random random = new Random();
    float var10 = random.nextFloat() * 0.8F + 0.1F;
    float var11 = random.nextFloat() * 0.8F + 0.1F;
    EntityItem item;

    for( float var12 = random.nextFloat() * 0.8F + 0.1F; itemStack.stackSize > 0; world.spawnEntityInWorld( item ) ) {
      int var13 = random.nextInt( 21 ) + 10;

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

      itemStack.stackSize -= var13;
      item = new EntityItem( world, (double) (x + var10), (double) (y + var11), (double) (z + var12), new ItemStack( itemStack.itemID, var13, itemStack.getItemDamage() ) );
      float var15 = 0.05F;
      item.motionX = (random.nextGaussian() * var15);
      item.motionY = (random.nextGaussian() * var15 + 0.2F);
      item.motionZ = (random.nextGaussian() * var15);

      if( itemStack.hasTagCompound() ) {
        item.getEntityItem().setTagCompound( (NBTTagCompound) itemStack.getTagCompound().copy() );
      }
    }
  }
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.