feat,refactor: add useCorePlaceBlock in config and refactor default config

This commit is contained in:
ChomeNS
2024-11-17 17:01:09 +07:00
parent a942cfd557
commit 71d9caa0db
3 changed files with 25 additions and 12 deletions

View File

@@ -169,6 +169,7 @@ public class Configuration {
public boolean creayun = false;
public String serverName;
public boolean useCore = true;
public boolean useCorePlaceBlock = false;
public boolean useChat = false;
public boolean coreCommandSpy = false;
public boolean resolveSRV = true;

View File

@@ -171,6 +171,11 @@ public class CorePlugin extends PositionPlugin.Listener {
if (!ready || command.length() > 32767) return;
if (bot.options.useCore) {
if (bot.options.useCorePlaceBlock) {
runPlaceBlock(command);
return;
}
if (isRateLimited() && hasRateLimit()) return;
forceRun(command);
@@ -185,6 +190,11 @@ public class CorePlugin extends PositionPlugin.Listener {
public CompletableFuture<Component> runTracked (String command) {
if (!bot.options.useCore) return null;
if (bot.options.useCorePlaceBlock) {
runPlaceBlock(command);
return null;
}
final Vector3i coreBlock = block;
run(command);