Package net.minecraft.world

Examples of net.minecraft.world.ChunkCoordIntPair


        int maxZ = (zWorld + radius) >> 4;

        Set<ChunkCoordIntPair> chunkList = new HashSet<ChunkCoordIntPair>();
        for (int xx = minX; xx <= maxX; xx++) {
            for (int zz = minZ; zz <= maxZ; zz++) {
                chunkList.add(new ChunkCoordIntPair(xx, zz));
            }
        }
        return chunkList;
    }
View Full Code Here


        for (ChunkCoordIntPair chunk : chunks) {
            ForgeChunkManager.forceChunk(ticket, chunk);
            ForgeChunkManager.reorderChunk(ticket, chunk);
        }

        ChunkCoordIntPair myChunk = new ChunkCoordIntPair(xChunk, zChunk);
        ForgeChunkManager.forceChunk(ticket, myChunk);
        ForgeChunkManager.reorderChunk(ticket, myChunk);
    }
View Full Code Here

      return;
    }
    chunkTicket.getModData().setInteger("quarryX", xCoord);
    chunkTicket.getModData().setInteger("quarryY", yCoord);
    chunkTicket.getModData().setInteger("quarryZ", zCoord);
    ForgeChunkManager.forceChunk(chunkTicket, new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4));

    IAreaProvider a = null;

    if (!useDefault) {
      a = Utils.getNearbyAreaProvider(worldObj, xCoord, yCoord, zCoord);
View Full Code Here

      chunkTicket = ticket;
    }

    Set<ChunkCoordIntPair> chunks = Sets.newHashSet();
    isAlive = true;
    ChunkCoordIntPair quarryChunk = new ChunkCoordIntPair(xCoord >> 4, zCoord >> 4);
    chunks.add(quarryChunk);
    ForgeChunkManager.forceChunk(ticket, quarryChunk);

    for (int chunkX = box.xMin >> 4; chunkX <= box.xMax >> 4; chunkX++) {
      for (int chunkZ = box.zMin >> 4; chunkZ <= box.zMax >> 4; chunkZ++) {
        ChunkCoordIntPair chunk = new ChunkCoordIntPair(chunkX, chunkZ);
        ForgeChunkManager.forceChunk(ticket, chunk);
        chunks.add(chunk);
      }
    }
View Full Code Here

    if (!entityPlayerMP.loadedChunks.isEmpty()) {
      ArrayList<ChunkCoordIntPair> unpopulatedChunks = new ArrayList<ChunkCoordIntPair>();
      ArrayList<Chunk> chunks = new ArrayList<Chunk>(5);
      ArrayList<TileEntity> tileEntities = new ArrayList<TileEntity>();
      synchronized (entityPlayerMP.loadedChunks) {
        ChunkCoordIntPair chunkCoordIntPair;

        while (chunks.size() < 5 && (chunkCoordIntPair = (ChunkCoordIntPair) entityPlayerMP.loadedChunks.remove(0)) != null) {
          int x = chunkCoordIntPair.chunkXPos;
          int z = chunkCoordIntPair.chunkZPos;
View Full Code Here

      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

    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

          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

    // 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

  }

  @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

TOP

Related Classes of net.minecraft.world.ChunkCoordIntPair

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.