Examples of ChunkCoordIntPair


Examples of net.minecraft.world.ChunkCoordIntPair

      byte var8 = 8;

      for (int var9 = -var8; var9 <= var8; ++var9) {
        for (int var10 = -var8; var10 <= var8; ++var10) {
          boolean var11 = var9 == -var8 || var9 == var8 || var10 == -var8 || var10 == var8;
          ChunkCoordIntPair var12 = new ChunkCoordIntPair(var9 + var6, var10 + var7);

          if (!var11) {
            eligibleChunksForSpawning.put(var12, false);
          } else if (!eligibleChunksForSpawning.containsKey(var12)) {
            eligibleChunksForSpawning.put(var12, true);
          }
        }
      }
    }

    var4 = 0;
    ChunkCoordinates var32 = par0WorldServer.getSpawnPoint();
    EnumCreatureType[] var33 = EnumCreatureType.values();
    var7 = var33.length;

    for (int var34 = 0; var34 < var7; ++var34) {
      EnumCreatureType var35 = var33[var34];

      if ((tpsFactor >= 1 || Math.random() < tpsFactor) && ((!var35.getPeacefulCreature() || par2) && (var35.getPeacefulCreature() || par1) && (!var35.getAnimal() || par3) && par0WorldServer.countEntities(var35.getCreatureClass()) <= var35.getMaxNumberOfCreature() * eligibleChunksForSpawning.size() / 256)) {
        ArrayList<ChunkCoordIntPair> tmp = new ArrayList<ChunkCoordIntPair>(eligibleChunksForSpawning.keySet());
        Collections.shuffle(tmp);
        Iterator<ChunkCoordIntPair> var37 = tmp.iterator();
        label110:

        while (var37.hasNext()) {
          ChunkCoordIntPair var36 = var37.next();

          if (par0WorldServer.theChunkProviderServer.chunkExists(var36.chunkXPos, var36.chunkZPos) && !eligibleChunksForSpawning.get(var36)) {
            ChunkPosition var38 = getRandomSpawningPointInChunk(par0WorldServer, var36.chunkXPos, var36.chunkZPos);
            int var13 = var38.x;
            int var14 = var38.y;
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

    requestedChunks.add(chunk);
    MinecraftForge.EVENT_BUS.post(new ForceChunkEvent(ticket, chunk));

    forceChunkInternal(ticket, chunk);
    if (ticket.getChunkListDepth() > 0 && requestedChunks.size() > ticket.getChunkListDepth()) {
      ChunkCoordIntPair removed = requestedChunks.iterator().next();
      unforceChunk(ticket, removed);
    }
    ticket.world.getChunkProvider().loadChunk(chunk.chunkXPos, chunk.chunkZPos);
  }
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

          NBTTagList ticketChunks = ticket.getTagList("Chunks");
          for (int k = 0; k < ticketChunks.tagCount(); k++) {
            NBTTagCompound nbtChunk = (NBTTagCompound) ticketChunks.tagAt(k);
            int chunkX = nbtChunk.getInteger("chunkX");
            int chunkZ = nbtChunk.getInteger("chunkZ");
            ChunkCoordIntPair chunkCoordIntPair = new ChunkCoordIntPair(chunkX, chunkZ);
            forceChunkInternal(tick, chunkCoordIntPair);
            chunkProviderServer.cacheChunk(chunkX, chunkZ);
          }
          // MCPC+ end
        }
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

    // Handle unload requests
    final ConcurrentQueueSet<Long> unloadStage0 = this.unloadStage0;
    if (!unloadStage0.isEmpty()) {
      ImmutableSetMultimap<ChunkCoordIntPair, ForgeChunkManager.Ticket> persistentChunks = world.getPersistentChunks();
      PlayerManager playerManager = world.getPlayerManager();
      ChunkCoordIntPair chunkCoordIntPair = new ChunkCoordIntPair(0, 0);
      Long key_;
      int done = 0;
      while (++done != 75 && (key_ = unloadStage0.take()) != null) {
        long key = key_;
        int x = (int) key;
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

  }

  @Override
  @Declare
  public boolean unloadChunk(int x, int z) {
    if (world.getPersistentChunks().keySet().contains(new ChunkCoordIntPair(x, z))) {
      return false;
    }
    long hash = key(x, z);
    Chunk chunk = (Chunk) chunks.getValueByKey(hash);
    if (chunk == null) {
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

        int z = (int) (entityPlayer.posZ / 16.0D);
        byte var5 = 6;

        for (int var6 = -var5; var6 <= var5; ++var6) {
          for (int var7 = -var5; var7 <= var5; ++var7) {
            activeChunkSet.add(new ChunkCoordIntPair(var6 + x, var7 + z));
          }
        }
      }

      profiler.endSection();
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

    final WorldProvider provider = this.provider;
    int updateLCG = this.updateLCG;
    // We use a random per thread - randoms are threadsafe, however it can result in some contention. See Random.nextInt - compareAndSet.
    // This reduces contention -> slightly increased performance, woo! :P
    while (true) {
      ChunkCoordIntPair chunkCoordIntPair;
      synchronized (chunkCoordIterator) {
        if (!chunkCoordIterator.hasNext()) {
          break;
        }
        try {
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

    int x = MathHelper.floor_double(entity.posX);
    int z = MathHelper.floor_double(entity.posZ);
    boolean periodicUpdate = forcedUpdateCount++ % 32 == 0;
    Boolean isForced_ = entity.isForced;
    if (isForced_ == null || periodicUpdate) {
      entity.isForced = isForced_ = getPersistentChunks().containsKey(new ChunkCoordIntPair(x >> 4, z >> 4));
    }
    boolean isForced = isForced_;
    Boolean canUpdate_ = entity.canUpdate;
    if (canUpdate_ == null || periodicUpdate) {
      byte range = isForced ? (byte) 0 : 48;
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

    chunkCache = CacheBuilder.newBuilder().maximumSize(cacheSize = TickThreading.instance.chunkCacheSize).build();
    regionFileCache = new RegionFileCache(chunkSaveLocation);
  }

  public boolean chunkExists(World world, int i, int j) {
    ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(i, j);

    synchronized (this.syncLockObject) {
      if (pendingSaves.containsKey(chunkcoordintpair)) {
        return true;
      }
View Full Code Here

Examples of net.minecraft.world.ChunkCoordIntPair

  @Override
  @Declare
  public NBTTagCompound readChunkNBT(World world, int x, int z, boolean readOnly) {
    NBTTagCompound nbtTagCompound;
    ChunkCoordIntPair chunkcoordintpair = new ChunkCoordIntPair(x, z);

    synchronized (this.syncLockObject) {
      AnvilChunkLoaderPending pendingchunktosave = pendingSaves.get(chunkcoordintpair);

      long key = key(x, z);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.