Package net.minecraft.server.v1_7_R1

Examples of net.minecraft.server.v1_7_R1.EntityVillager


  @Override
  public AlmostBoolean isIllegalBounds(final Player player) {
    final EntityPlayer entityPlayer = ((CraftPlayer) player).getHandle();
    if (entityPlayer.dead) return AlmostBoolean.NO;
    // TODO: Does this need a method call for the "real" box? Might be no problem during moving events, though.
    final AxisAlignedBB box = entityPlayer.boundingBox;
    if (!entityPlayer.isSleeping()){
      // This can not really test stance but height of bounding box.
      final double dY = Math.abs(box.e - box.b);
      if (dY > 1.8) return AlmostBoolean.YES; // dY > 1.65D ||
      if (dY < 0.1D && entityPlayer.length >= 0.1) return AlmostBoolean.YES;
View Full Code Here


    try{
      // TODO: Probably check other ids too before doing this ?
     
      final net.minecraft.server.v1_7_R1.Entity mcEntity  = ((CraftEntity) entity).getHandle();
     
      final AxisAlignedBB box = useBox.b(minX, minY, minZ, maxX, maxY, maxZ);
      @SuppressWarnings("rawtypes")
      final List list = world.getEntities(mcEntity, box);
      @SuppressWarnings("rawtypes")
      final Iterator iterator = list.iterator();
      while (iterator.hasNext()) {
        final net.minecraft.server.v1_7_R1.Entity other = (net.minecraft.server.v1_7_R1.Entity) iterator.next();
        if (!(other instanceof EntityBoat)){ // && !(other instanceof EntityMinecart)) continue;
          continue;
        }
        if (minY >= other.locY && minY - other.locY <= 0.7){
          return true;
        }
        // Still check this for some reason.
        final AxisAlignedBB otherBox = other.boundingBox;
        if (box.a > otherBox.d || box.d < otherBox.a || box.b > otherBox.e || box.e < otherBox.b || box.c > otherBox.f || box.f < otherBox.c) continue;
        else {
          return true;
        }
      }
View Full Code Here

    } else return entityHeight;
  }

  @Override
  public AlmostBoolean isBlockSolid(final int id) {
    final Block block = Block.e(id);
    if (block == null || block.getMaterial() == null) return AlmostBoolean.MAYBE;
    else return AlmostBoolean.match(block.getMaterial().isSolid());
  }
View Full Code Here

    else return AlmostBoolean.match(block.getMaterial().isSolid());
  }

  @Override
  public AlmostBoolean isBlockLiquid(final int id) {
    final Block block = Block.e(id);
    if (block == null || block.getMaterial() == null) return AlmostBoolean.MAYBE;
    else return AlmostBoolean.match(block.getMaterial().isLiquid());
  }
View Full Code Here

  {
    if(this.getEntityHandle() == null || NMSUtil.isInHomeArea(this.getEntityHandle()))
      return false;
    else
    {
      ChunkCoordinates chunkCoords = NMSUtil.getChunkCoordinates(this.getEntityHandle());
      Vec3D vec = RandomPositionGenerator.a(this.getEntityHandle(), 16, 7, this.getEntityHandle().world.getVec3DPool().create(chunkCoords.x, chunkCoords.y, chunkCoords.z));
      if(vec == null)
        return false;
      else
      {
View Full Code Here

    if(this.m_animal.getAge() >= 0)
      return false;
    else
    {
      List animals = this.m_animal.world.a(this.m_animal.getClass(), this.m_animal.boundingBox.grow(8, 4, 8));
      EntityAnimal nearest = null;
      double minDist = Double.MAX_VALUE;
      Iterator it = animals.iterator();
      while(it.hasNext())
      {
        EntityAnimal animal = (EntityAnimal)it.next();
        if(animal.getAge() >= 0)
        {
          double distance = this.m_animal.e(animal);
          if(distance <= minDist)
          {
            minDist = distance;
View Full Code Here

      return false;
    else if(this.getEntityHandle().velocityChanged)
      return false;
    else
    {
      EntityHuman trader = this.m_villager.b();
      if(trader == null)
        return false;

      return this.m_villager.e(trader) <= 16 && trader.activeContainer != null;
    }
View Full Code Here

  }

  @Override
  public boolean isAffected()
  {
    EntityLiving handle = this.m_entity.getHandle();
    return !(handle instanceof EntityAnimal) || ((EntityAnimal)handle).cc();
  }
View Full Code Here

  public boolean shouldExecute()
  {
    if(this.getEntityHandle() == null)
      return false;

    EntityLiving target = NMSUtil.getGoalTarget(this.getEntityHandle());
    if(target == null)
      return false;

    this.m_target = target;
    return false;
View Full Code Here

  }

  @Override
  public boolean update()
  {
    EntityLiving entity = this.getEntityHandle();
    NMSUtil.getControllerLook(this.getEntityHandle()).a(this.m_target, 30, 30);
    double minDist = entity.width * entity.width * 4;
    double dist = entity.e(this.m_target.locX, this.m_target.boundingBox.b, this.m_target.locZ);
    float speed = 0.23F;

    if(dist > minDist && dist < 16)
      speed = 0.4F;
    else if(dist < 255)
View Full Code Here

TOP

Related Classes of net.minecraft.server.v1_7_R1.EntityVillager

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.