コード例 #1
0
 /**
  * Instantiates a new chunk builder.
  *
  * @param buffer the MutableBlockVolume buffer to attach ore/rocks too
  * @param key the Chunk Coordinate key
  */
 public ChunkBuilder(MutableBlockVolume buffer, TwoPoint key) {
   this.key = key;
   orestructs = null;
   rockstructs = null;
   if (BlockInformation.oreExists(key)) {
     orestructs = new HashSet<Integer>();
     orestructs.addAll(BlockInformation.getBlocks(true, key).getKeys());
     structParse(buffer, BlockInformation.getBlocks(true, key), key);
   }
   if (BlockInformation.rocksExists(key)) {
     rockstructs = new HashSet<Integer>();
     rockstructs.addAll(BlockInformation.getBlocks(false, key).getKeys());
     structParse(buffer, BlockInformation.getBlocks(false, key), key);
   }
 }
コード例 #2
0
 /**
  * Instantiates a new chunk builder.
  *
  * @param chunk the chunk to commit changes to.
  * @param key the chunk String coordinates of the chunk in question
  */
 public ChunkBuilder(Chunk chunk, TwoPoint key) {
   this.key = key;
   orestructs = null;
   rockstructs = null;
   if (BlockInformation.oreExists(key)) {
     orestructs = new HashSet<Integer>();
     orestructs.addAll(BlockInformation.getBlocks(true, key).getKeys());
     structParse(
         chunk.getBlockView(chunk.getBlockMin(), chunk.getBlockMax()),
         BlockInformation.getBlocks(true, key),
         key);
   }
   if (BlockInformation.rocksExists(key)) {
     rockstructs = new HashSet<Integer>();
     rockstructs.addAll(BlockInformation.getBlocks(false, key).getKeys());
     structParse(
         chunk.getBlockView(chunk.getBlockMin(), chunk.getBlockMax()),
         BlockInformation.getBlocks(false, key),
         key);
   }
 }