fix: take confirm-large from default limit for unlimited, add option to override (#2782)

- fixes #2706
This commit is contained in:
Jordan 2024-06-20 18:24:41 +02:00 committed by GitHub
parent eaeb3a633a
commit d69dc97958
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 1 deletions

View File

@ -2,6 +2,7 @@ package com.fastasyncworldedit.core;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.internal.exception.FaweException;
import com.fastasyncworldedit.core.limit.FaweLimit;
import com.fastasyncworldedit.core.queue.implementation.QueueHandler;
import com.fastasyncworldedit.core.util.CachedTextureUtil;
import com.fastasyncworldedit.core.util.CleanTextureUtil;
@ -105,6 +106,8 @@ public class Fawe {
* Implementation dependent stuff
*/
this.setupConfigs();
FaweLimit.MAX.CONFIRM_LARGE =
Settings.settings().LIMITS.get("default").CONFIRM_LARGE || Settings.settings().GENERAL.LIMIT_UNLIMITED_CONFIRMS;
TaskManager.IMP = this.implementation.getTaskManager();
TaskManager.taskManager().async(() -> {

View File

@ -791,6 +791,11 @@ public class Settings extends Config {
})
public boolean UNSTUCK_ON_GENERATE = true;
@Comment({
"If unlimited limits should still require /confirm on large. Defaults to limits.default.confirm-large otherwise."
})
public boolean LIMIT_UNLIMITED_CONFIRMS = true;
}
}

View File

@ -1,6 +1,7 @@
package com.fastasyncworldedit.core.limit;
import com.fastasyncworldedit.core.FaweCache;
import com.fastasyncworldedit.core.configuration.Settings;
import java.util.Collections;
import java.util.Set;
@ -121,7 +122,8 @@ public class FaweLimit {
MAX.SCHEM_FILE_SIZE_LIMIT = Integer.MAX_VALUE;
MAX.MAX_EXPRESSION_MS = 50;
MAX.FAST_PLACEMENT = true;
MAX.CONFIRM_LARGE = true;
MAX.CONFIRM_LARGE =
Settings.settings().LIMITS.get("default").CONFIRM_LARGE || Settings.settings().GENERAL.LIMIT_UNLIMITED_CONFIRMS;
MAX.RESTRICT_HISTORY_TO_REGIONS = false;
MAX.STRIP_NBT = Collections.emptySet();
MAX.UNIVERSAL_DISALLOWED_BLOCKS = false;

View File

@ -22,6 +22,8 @@ package com.sk89q.worldedit.command;
import com.fastasyncworldedit.core.Fawe;
import com.fastasyncworldedit.core.FaweVersion;
import com.fastasyncworldedit.core.configuration.Caption;
import com.fastasyncworldedit.core.configuration.Settings;
import com.fastasyncworldedit.core.limit.FaweLimit;
import com.fastasyncworldedit.core.util.UpdateNotification;
import com.intellectualsites.paster.IncendoPaster;
import com.sk89q.worldedit.LocalSession;
@ -97,6 +99,8 @@ public class WorldEditCommands {
.getConfiguration()));
//FAWE start
Fawe.instance().setupConfigs();
FaweLimit.MAX.CONFIRM_LARGE =
Settings.settings().LIMITS.get("default").CONFIRM_LARGE || Settings.settings().GENERAL.LIMIT_UNLIMITED_CONFIRMS;
//FAWE end
actor.print(Caption.of("worldedit.reload.config"));
}