Add javadoc comments to generateTree

This commit is contained in:
dordsor21 2021-08-07 16:28:41 +01:00
parent e90b261196
commit 346223977d
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B
3 changed files with 11 additions and 3 deletions

View File

@ -359,6 +359,15 @@ public interface IBukkitAdapter {
}
}
/**
* Generate a given tree type to the given editsession.
*
* @param type Type of tree to generate
* @param editSession Editsession to set blocks to
* @param pt Point to generate tree at
* @param world World to "generate" tree from (seed-wise)
* @return If successsful
*/
default boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 pt, org.bukkit.World world) {
TreeType bukkitType = BukkitWorld.toBukkitTreeType(type);
if (bukkitType == TreeType.CHORUS_PLANT) {

View File

@ -330,8 +330,10 @@ public class BukkitWorld extends AbstractWorld {
@Override
public boolean generateTree(TreeGenerator.TreeType type, EditSession editSession, BlockVector3 pt) {
//FAWE start - allow tree commands to be undone and obey region restrictions
return TaskManager.IMP.sync(() -> WorldEditPlugin.getInstance().getBukkitImplAdapter().generateTree(type, editSession, pt,
getWorld()));
//FAWE end
}
@Override

View File

@ -241,9 +241,6 @@ public class GenerationCommands {
@Arg(desc = "The density of the forest, between 0 and 100", def = "5")
double density
) throws WorldEditException {
//FAWE start
actor.print(TextComponent.of("Warning: This brush is currently not undo-able due to a Spigot bug!").color(TextColor.RED));
//FAWE end
checkCommandArgument(0 <= density && density <= 100, "Density must be between 0 and 100");
worldEdit.checkMaxRadius(size);
density /= 100;