Beispiel #1
0
  public void a(Packet7UseEntity packet7useentity) {
    // CraftBukkit start
    if (this.player.dead) {
      return;
    }
    // CraftBukkit end

    WorldServer worldserver = this.minecraftServer.a(this.player.dimension);
    Entity entity = worldserver.getEntity(packet7useentity.target);

    if (entity != null && this.player.e(entity) && this.player.g(entity) < 36.0D) {
      if (packet7useentity.c == 0) {
        // CraftBukkit start
        PlayerInteractEntityEvent piee =
            new PlayerInteractEntityEvent((Player) getPlayer(), entity.getBukkitEntity());
        server.getPluginManager().callEvent(piee);
        if (piee.isCancelled()) {
          return;
        }
        // CraftBukkit end
        this.player.c(entity);
      } else if (packet7useentity.c == 1) {
        this.player.d(entity);
      }
    }
  }
  public Entity a(UUID uuid) {
    // CraftBukkit start
    for (int j = 0; j < worlds.size(); ++j) {
      WorldServer worldserver = worlds.get(j);
      // CraftBukkit end

      if (worldserver != null) {
        Entity entity = worldserver.getEntity(uuid);

        if (entity != null) {
          return entity;
        }
      }
    }

    return null;
  }