@Command(
     aliases = {"/setskylight"},
     desc = "Set sky lighting in a selection",
     min = 1,
     max = 1)
 @CommandPermissions("worldedit.light.set")
 public void setskylighting(
     Player player, EditSession editSession, @Selection Region region, int value) {
   FawePlayer fp = FawePlayer.wrap(player);
   final FaweLocation loc = fp.getLocation();
   final int cx = loc.x >> 4;
   final int cz = loc.z >> 4;
   final NMSMappedFaweQueue queue =
       (NMSMappedFaweQueue) SetQueue.IMP.getNewQueue(fp.getWorld(), true, false);
   for (Vector pt : region) {
     queue.setSkyLight((int) pt.x, (int) pt.y, (int) pt.z, value);
   }
   int count = 0;
   for (Vector2D chunk : region.getChunks()) {
     queue.sendChunk(queue.getFaweChunk(chunk.getBlockX(), chunk.getBlockZ()));
     count++;
   }
   BBC.UPDATED_LIGHTING_SELECTION.send(fp, count);
 }
Esempio n. 2
0
 @Override
 public boolean setBiome(Vector2D position, BaseBiome biome) {
   return WEManager.maskContains(this.mask, position.getBlockX(), position.getBlockZ())
       && super.setBiome(position, biome);
 }