Package net.minecraft.entity

Examples of net.minecraft.entity.Entity


  @Override
  public void cleanReferences()
  {
    for(int i = entitiesToGrind.size(); i-- > 0;)
    {
      Entity ent = entitiesToGrind.get(i);
      if(ent.isDead) entitiesToGrind.remove(ent);
    }
  }
View Full Code Here


          return;
        }
        entities = worldObj.getEntitiesWithinAABB(EntityXPOrb.class, _areaManager.getHarvestArea().toAxisAlignedBB());
        for (Object o : entities)
        {
          Entity e = (Entity)o;
          if (e != null & e instanceof EntityXPOrb && !e.isDead)
          {
            EntityXPOrb orb = (EntityXPOrb)o;
            int found = Math.min(orb.xpValue, maxAmount);
            orb.xpValue -= found;
View Full Code Here

        return false;
      }
    }
    else
    {
      Entity spawnedEntity = EntityList.createEntityByName(entityID, worldObj);
     
      if(!(spawnedEntity instanceof EntityLiving))
      {
        return false;
      }
View Full Code Here

 
  public static Entity prepareMob(Class<? extends Entity> entity, World world)
  {
    try
    {
      Entity e = entity.getConstructor(new Class[] {World.class}).newInstance(new Object[] { world });
      if(e instanceof EntityLiving)
      {
        ((EntityLiving)e).initCreature();
      }
      return e;
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
   
    return null;
  }
View Full Code Here

  @Override
  public IMessage onMessage(PacketSyncBauble message, MessageContext ctx) {
    World world = Baubles.proxy.getClientWorld();
    if (world==null) return null;
    Entity p = world.getEntityByID(message.playerId);
    if (p !=null && p instanceof EntityPlayer) {
      PlayerHandler.getPlayerBaubles((EntityPlayer) p).stackList[message.slot]=message.bauble;
    }
    return null;
  }
View Full Code Here

    {
      Class[] decodeAs = { Integer.class, Integer.class };
      Object[] packetReadout = PacketWrapper.readPacketData(data, decodeAs);
     
      World world = ((EntityPlayer)player).worldObj;
      Entity owner = world.getEntityByID((Integer)packetReadout[0]);
      Entity target = null;
      if(((Integer)packetReadout[1]) != Integer.MIN_VALUE)
      {
        target = world.getEntityByID((Integer)packetReadout[1]);
      }
     
View Full Code Here

  @Override
  public boolean inject(World world, EntityLiving entity, ItemStack syringe)
  {
    if(world.rand.nextInt(100) < 5)
    {
      Entity e;
      if(entity instanceof EntityPig)
      {
        e = new EntityPigZombie(world);
      }
      else
      {
        e = new EntityZombie(world);
      }
      e.setLocationAndAngles(entity.posX, entity.posY, entity.posZ, entity.rotationYaw, entity.rotationPitch);
      world.spawnEntityInWorld(e);
      entity.setDead();
    }
    else
    {
View Full Code Here

    int[] dropCoords = findSpaceForPlayer(x, y, z, world);
    if(dropCoords[1] < 0)
    {
      return;
    }
    Entity player = minecart.riddenByEntity;
    player.mountEntity(minecart);
    MineFactoryReloadedCore.proxy.movePlayerToCoordinates((EntityPlayer)player, dropCoords[0] + 0.5, dropCoords[1] + 0.5, dropCoords[2] + 0.5);
  }
View Full Code Here

    }
   
    ItemStack equipped = player.inventory.getCurrentItem();
    if(equipped != null && equipped.getItem() instanceof ItemRocketLauncher)
    {
      Entity e = rayTrace();
      if(_lastEntityOver != null && _lastEntityOver.isDead)
      {
        _lastEntityOver = null;
        _lockonTicks = 0;
      }
View Full Code Here

    List<?> list = Minecraft.getMinecraft().theWorld.getEntitiesWithinAABBExcludingEntity(Minecraft.getMinecraft().renderViewEntity,
        Minecraft.getMinecraft().renderViewEntity.boundingBox.addCoord(playerLook.xCoord * range, playerLook.yCoord * range, playerLook.zCoord * range)
            .expand(1, 1, 1));
   
    double entityDistTotal = range;
    Entity pointedEntity = null;
    for(int i = 0; i < list.size(); ++i)
    {
      Entity entity = (Entity)list.get(i);
     
      if(entity.canBeCollidedWith())
      {
        double entitySize = entity.getCollisionBorderSize();
        AxisAlignedBB axisalignedbb = entity.boundingBox.expand(entitySize, entitySize, entitySize);
        MovingObjectPosition movingobjectposition = axisalignedbb.calculateIntercept(playerPos, playerLookRel);
       
        if(axisalignedbb.isVecInside(playerPos))
        {
View Full Code Here

TOP

Related Classes of net.minecraft.entity.Entity

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.