Package net.minecraft.server.v1_7_R1

Examples of net.minecraft.server.v1_7_R1.EntityHuman


      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null && human instanceof EntityPlayer) {
        return block.onBlockInteract(world.getWorld(), x, y, z, ((SpoutPlayer) human.getBukkitEntity()));
      }
    } else if (method.getName().equals("getDamage")) {
      EntityHuman human = (EntityHuman) args[0];
      World world = (World) args[1];
      int x = (Integer) args[2];
      int y = (Integer) args[3];
      int z = (Integer) args[4];
      org.getspout.spoutapi.material.CustomBlock block = getCustomBlock(world, x, y, z);
      if (block != null) {
        if (block instanceof org.getspout.spoutapi.material.CustomBlock) {
          SpoutPlayer player = (SpoutPlayer) human.getBukkitEntity();
          float def;
          SpoutItemStack inHand = player.getItemInHand() == null ? null : new SpoutItemStack(player.getItemInHand());
          org.getspout.spoutapi.material.Material item = inHand.getMaterial();

          float hardness = block.getHardness();
          if (hardness <= 0F) {
            return m.invoke(wrapped, args);
          }

          def = (!human.a(wrapped) ? 1.0F / hardness / 100.0F : human.a(wrapped, false) / hardness / 30.0F); //TODO EntityHuman.a(Block, boolean) appears to not make any use of the flag variable...

          if (!(item instanceof CustomItem)) {
            return def;
          }
View Full Code Here


    @Override
    public void doTick() {
        if (isTame)
            return;
        EntityHuman closest = getClosestPlayer(this.range);
        if (!hasTarget() && closest != null) {
            if (!PermissionManager.hasPermission((Player) closest.getBukkitEntity(), "citizens.evils.immune")) {
                targetClosestPlayer(true, this.range);
            }
        }
        super.doTick();
    }
View Full Code Here

    private double distance(Entity entity) {
        return entity.getBukkitEntity().getLocation().distance(this.getBukkitEntity().getLocation());
    }

    protected EntityHuman getClosestPlayer(double range) {
        EntityHuman entityhuman = this.world.findNearbyPlayer(this, range);
        return entityhuman != null && isInSight(entityhuman) ? entityhuman : null;
    }
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

TOP

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

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.