Package cofh.lib.util.position

Examples of cofh.lib.util.position.ChunkCoord


    if (event.phase == Phase.END) {
      ArrayDeque<RetroChunkCoord> chunks = chunksToGen.get(dim);

      if (chunks != null && chunks.size() > 0) {
        RetroChunkCoord r = chunks.pollFirst();
        ChunkCoord c = r.coord;
        CoFHCore.log.info("RetroGening " + c.toString() + ".");
        long worldSeed = world.getSeed();
        Random rand = new Random(worldSeed);
        long xSeed = rand.nextLong() >> 2 + 1L;
        long zSeed = rand.nextLong() >> 2 + 1L;
        rand.setSeed(xSeed * c.chunkX + zSeed * c.chunkZ ^ worldSeed);
        WorldHandler.instance.generateWorld(rand, r, world, false);
        chunksToGen.put(dim, chunks);
      } else if (chunks != null) {
        chunksToGen.remove(dim);
      }
    } else {
      ArrayDeque<ChunkCoord> chunks = chunksToPreGen.get(dim);

      if (chunks != null && chunks.size() > 0) {
        ChunkCoord c = chunks.pollFirst();
        CoFHCore.log.info("PreGening " + c.toString() + ".");
        world.getChunkFromChunkCoords(c.chunkX, c.chunkZ);
      } else if (chunks != null) {
        chunksToPreGen.remove(dim);
      }
    }
View Full Code Here


        chunks = new ArrayDeque<ChunkCoord>();
      }

      for (int x = xS; x <= xL; ++x) {
        for (int z = zS; z <= zL; ++z) {
          chunks.addLast(new ChunkCoord(x, z));
        }
      }
      TickHandlerWorld.chunksToPreGen.put(world.provider.dimensionId, chunks);
    }
  }
View Full Code Here

    int dim = event.world.provider.dimensionId;

    boolean regen = false;
    NBTTagCompound tag = (NBTTagCompound) event.getData().getTag(TAG_NAME);
    NBTTagList list = null;
    ChunkCoord cCoord = new ChunkCoord(event.getChunk());

    if (tag != null) {
      boolean genFeatures = false;
      boolean bedrock = retroFlatBedrock & genFlatBedrock && !tag.hasKey("Bedrock");
      if (retroGeneration) {
        genFeatures = tag.getLong("Hash") != genHash;
        if (tag.hasKey("List")) {
          list = tag.getTagList("List", Constants.NBT.TAG_STRING);
          genFeatures |= list.tagCount() != features.size();
        }
      }

      if (bedrock) {
        CoFHCore.log.info("Queuing RetroGen for flattening bedrock for the chunk at " + cCoord.toString() + ".");
        regen = true;
      }
      if (genFeatures) {
        CoFHCore.log.info("Queuing RetroGen for features for the chunk at " + cCoord.toString() + ".");
        regen = true;
      }
    } else {
      regen = retroFlatBedrock & genFlatBedrock | retroGeneration;
    }
View Full Code Here

TOP

Related Classes of cofh.lib.util.position.ChunkCoord

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.