use of com.sk89q.worldedit.world.RegenOptions in project FastAsyncWorldEdit by IntellectualSites.
the class RegionCommands method regenerate.
@Command(name = "/regen", desc = "Regenerates the contents of the selection", descFooter = "This command might affect things outside the selection,\n" + "if they are within the same chunk.")
@CommandPermissions("worldedit.regen")
@Logging(REGION)
@Confirm(Confirm.Processor.REGION)
void regenerate(Actor actor, World world, LocalSession session, EditSession editSession, @Selection Region region, @Arg(desc = "The seed to regenerate with, otherwise uses world seed", def = "") Long seed, @Switch(name = 'b', desc = "Regenerate biomes as well") boolean regenBiomes, @Arg(desc = "Biome to apply for this regeneration (only works in overworld)", def = "") BiomeType biomeType) throws WorldEditException {
Mask mask = session.getMask();
boolean success;
try {
session.setMask(null);
// FAWE start
session.setSourceMask(null);
actor.print(Caption.of("fawe.regen.time"));
// FAWE end
RegenOptions options = RegenOptions.builder().seed(seed).regenBiomes(regenBiomes).biomeType(biomeType).build();
success = world.regenerate(region, editSession, options);
} finally {
session.setMask(mask);
// FAWE start
session.setSourceMask(mask);
// FAWE end
}
if (success) {
actor.print(Caption.of("worldedit.regen.regenerated"));
} else {
actor.print(Caption.of("worldedit.regen.failed"));
}
}
Aggregations