Package net.minecraft.entity.item

Examples of net.minecraft.entity.item.EntityItem


          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);
        }
      }
    }
View Full Code Here


      for (ItemStack stack : drops) {
        if(!removed && stack.isItemEqual(getSeeds())) {
          stack.stackSize--;
          removed = true;
          if(stack.stackSize > 0) {
            result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));
          }
        } else {
          result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, stack.copy()));
        }
      }
    }

    if(removed) {
      if(!plant(farm, worldObj, bc)) {
        result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, getSeeds().copy()));
        worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
      }
    } else {
      worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
    }
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);

      } else {
        System.out.println("dropBlockAsItem_do: No tile entity.");
View Full Code Here

      Block blk = farm.getBlock(coord);

      ArrayList<ItemStack> drops = blk.getDrops(farm.getWorldObj(), bc.x, bc.y, bc.z, farm.getBlockMeta(coord), farm.getAxeLootingValue());
      if(drops != null) {
        for (ItemStack drop : drops) {
          res.drops.add(new EntityItem(farm.getWorldObj(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, drop.copy()));
        }
      }
      boolean isWood = true;
      if(!isWood(blk)) { //leaves
        isWood = Config.farmAxeDamageOnLeafBreak;
        int leaveMeta = farm.getBlockMeta(coord);
        if(TreeHarvestUtil.canDropApples(blk, leaveMeta)) {
          if(farm.getWorldObj().rand.nextInt(200) == 0) {
            res.drops.add(new EntityItem(farm.getWorldObj(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, new ItemStack(Items.apple)));
          }
        }       
      }
      farm.actionPerformed(isWood);     
      if(isWood) {
View Full Code Here

        setIoOnItem(hc, itemStack);
        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);

        ItemRecieveBuffer rb = hc.getRecieveBuffer();
        Util.dropItems(world, rb, x, y, z, true);
View Full Code Here

  }

  private void insertHarvestDrop(Entity entity) {
    if(!worldObj.isRemote) {
      if(entity instanceof EntityItem && !entity.isDead) {
        EntityItem item = (EntityItem) entity;
        ItemStack stack = item.getEntityItem().copy();

        int numInserted = insertResult(stack);
        stack.stackSize -= numInserted;
        item.setEntityItemStack(stack);
        if(stack.stackSize == 0) {
          item.setDead();
        }
      }
    }

  }
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);
      }
    }
View Full Code Here

    for(int slot=0;slot < inv.length;slot++) {
      ItemStack stack = inv[slot];
      if(stack != null) {
        inv[slot] = null;       
       
        EntityItem entityitem = new EntityItem(world, bc.x + 0.5, bc.y + 1, bc.z + 0.5, stack);
        drops.add(entityitem);
      }
    }
    farm.actionPerformed(false);
    farm.damageHoe(1, bc);
View Full Code Here

      if(plantedBlock == farm.getBlock(harvestCoord) && farm.hasHoe()) {
        res.harvestedBlocks.add(harvestCoord);
        ArrayList<ItemStack> drops = plantedBlock.getDrops(farm.getWorldObj(), harvestCoord.x, harvestCoord.y, harvestCoord.z, meta, farm.getMaxLootingValue());
        if(drops != null) {
          for(ItemStack drop : drops) {
            res.drops.add(new EntityItem(farm.getWorldObj(), bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, drop.copy()));
          }

        }
        farm.damageHoe(1, harvestCoord);
        farm.actionPerformed(false);
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

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.