Package net.minecraft.entity.item

Examples of net.minecraft.entity.item.EntityItem


        if(stack != null && !removed && isPlantableForBlock(stack, block)) {
          stack.stackSize--;
          removed = true;
          removedPlantable = stack.copy();
          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, (IPlantable) removedPlantable.getItem())) {
        result.add(new EntityItem(worldObj, bc.x + 0.5, bc.y + 0.5, bc.z + 0.5, removedPlantable.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


        }
      }

      if (itemStack != null)
      {
        this.worldObj.spawnEntityInWorld(new EntityItem(this.worldObj, this.xCoord + 0.5, this.yCoord + 1, this.zCoord + 0.5, itemStack));
      }
    }

    return false;
  }
View Full Code Here

                if (i1 > itemstack.stackSize)
                {
                    i1 = itemstack.stackSize;
                }
                itemstack.stackSize -= i1;
                EntityItem entityitem = new EntityItem(world, (float) xCoord + f, (float) yCoord + (newSize > 0 ? 1 : 0) + f1, (float) zCoord + f2,
                        new ItemStack(itemstack.getItem(), i1, 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());
                }
                world.spawnEntityInWorld(entityitem);
            }
        }
    }
View Full Code Here

      float motion = 0.7F;
      double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
      double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
      double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;

      EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, getPickBlock(null, world, x, y, z));

      world.spawnEntityInWorld(entityItem);
    }

    return world.setBlockToAir(x, y, z);
View Full Code Here

      float motion = 0.7F;
      double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
      double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
      double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;

      EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);

      world.spawnEntityInWorld(entityItem);
    }

    return itemStack;
View Full Code Here

        {
            if (world.isRemote)
                return true;

            world.setBlock(x, y, z, this, meta - 4, 3);
            EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(NContent.berryItem, 1, meta - 12));
            world.spawnEntityInWorld(entityitem);
            if (!(player instanceof FakePlayer))
                entityitem.onCollideWithPlayer(player);
            return true;
        }
        return false;
    }
View Full Code Here

        {
            int meta = world.getBlockMetadata(x, y, z);
            if (meta == 8)
            {
                world.setBlock(x, y, z, this, 6, 3);
                EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(NContent.plantItem, 1, 3));
                world.spawnEntityInWorld(entityitem);
                entityitem.onCollideWithPlayer(player);
            }
        }
    }
View Full Code Here

        {
            if (world.isRemote)
                return true;

            world.setBlock(x, y, z, this, 6, 3);
            EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(NContent.plantItem, 1, 3));
            world.spawnEntityInWorld(entityitem);
            entityitem.onCollideWithPlayer(player);
            return true;
        }
        return false;
    }
View Full Code Here

        {
            int meta = world.getBlockMetadata(x, y, z);
            if (meta >= 12)
            {
                world.setBlock(x, y, z, this, meta - 4, 3);
                EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(NContent.netherBerryItem, 1, meta - 12));
                world.spawnEntityInWorld(entityitem);
                entityitem.onCollideWithPlayer(player);
            }
        }
    }
View Full Code Here

        {
            if (world.isRemote)
                return true;

            world.setBlock(x, y, z, this, meta - 4, 3);
            EntityItem entityitem = new EntityItem(world, player.posX, player.posY - 1.0D, player.posZ, new ItemStack(NContent.netherBerryItem, 1, meta - 12));
            world.spawnEntityInWorld(entityitem);
            entityitem.onCollideWithPlayer(player);
            return true;
        }
        return false;
    }
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.