Package nallar.collections

Examples of nallar.collections.LongSet


      return 0;
    }

    profiler.startSection("spawnableChunks");
    int attemptedSpawnedMobs = 0;
    LongSet closeChunks = new LongSet();
    Collection<EntityPlayer> entityPlayers = worldServer.playerEntities;
    LongList spawnableChunks = new LongList(entityPlayers.size() * maxChunksPerPlayer);
    for (EntityPlayer entityPlayer : entityPlayers) {
      int pX = entityPlayer.chunkCoordX;
      int pZ = entityPlayer.chunkCoordZ;
      int x = pX - closeRange;
      int maxX = pX + closeRange;
      int startZ = pZ - closeRange;
      int maxZ = pZ + closeRange;
      for (; x <= maxX; x++) {
        for (int z = startZ; z <= maxZ; z++) {
          closeChunks.add(hash(x, z));
        }
      }
    }
    for (EntityPlayer entityPlayer : entityPlayers) {
      int pX = entityPlayer.chunkCoordX;
      int pZ = entityPlayer.chunkCoordZ;
      int x = pX - farRange;
      int maxX = pX + farRange;
      int startZ = pZ - farRange;
      int maxZ = pZ + farRange;
      for (; x <= maxX; x++) {
        for (int z = startZ; z <= maxZ; z++) {
          long hash = hash(x, z);
          if (!closeChunks.contains(hash)) {
            spawnableChunks.add(hash);
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of nallar.collections.LongSet

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.