Package net.minecraft.server.v1_7_R1

Examples of net.minecraft.server.v1_7_R1.Vec3D


        EntityHuman entityhuman = this.world.findNearbyPlayer(this, range);
        return entityhuman != null && isInSight(entityhuman) ? entityhuman : null;
    }

    private Vec3D getPathVector() {
        Vec3D vec3d = path.a(this);
        double length = (this.width * 2.0F);
        while (vec3d != null && vec3d.d(this.locX, vec3d.d, this.locZ) < length * length) {
            this.path.a(); // Increment path index.
            // Is path finished?
            if (this.path.b()) {
                Vec3D.a.release(vec3d);
                vec3d = null;
View Full Code Here


        updateTarget();
        if (this.path != null || this.targetEntity != null) {
            updatePathingState();
        }
        if (this.path != null) {
            Vec3D vector = getPathVector();
            if (vector != null) {
                handleMove(vector);
            }
        }
        if (this.attackTicks > 0)
View Full Code Here

  @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

TOP

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

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.