Examples of HeightChunk


Examples of org.spoutcraft.client.chunkcache.HeightMap.HeightChunk

public class HeightMapAgent {
  public static void scanChunk(Chunk chunk) {
    try {
      HeightMap map = HeightMap.getHeightMap(MinimapUtils.getWorldName());
      synchronized (map) {
        HeightChunk hchunk = map.getChunk(chunk.xPosition, chunk.zPosition, true);
        for (int x = 0; x < 16; x++) {
          for (int z = 0; z < 16; z++) {
            int h = getHighestBlock(chunk, x, z);
            if (h > -1) {
              byte id = (byte) chunk.getBlockID(x, h, z);
              byte data = (byte) chunk.getBlockMetadata(x, h, z);

              // Check if block above is snow
              if (chunk.getBlockID(x, h + 1, z) == 78) {
                id = 78;
              }
              hchunk.setHeight(x, z, (short) h);
              hchunk.setBlockId(x, z, id);
              hchunk.setData(x, z, data);
            }
          }
        }
      }
    }
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.