In this update, minor bugs have been fixed and the config has been slightly revised.

Config changes:
- check.onJoin -> check.onJoin.enable
- check.onInteract -> check.onInteract.enable
- check.onCommand -> check.onCommand.enable
- check.onChat -> check.onChat.enable
- add check.onCommand.whitelist

A whitelist has been added for commands for which no check is performed.
This commit is contained in:
2024-03-31 13:35:45 +02:00
parent 052592cff6
commit c89430b219
9 changed files with 104 additions and 11 deletions

View File

@@ -15,8 +15,11 @@ import net.t2code.t2codelib.SPIGOT.api.register.T2Cregister;
import net.t2code.t2codelib.SPIGOT.api.update.T2CupdateAPI;
import net.t2code.t2codelib.SPIGOT.system.config.config.SelectLibConfig;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.YamlConfiguration;
import org.checkerframework.checker.units.qual.C;
import java.io.File;
import java.io.IOException;
import java.util.List;
import java.util.logging.Level;
@@ -36,6 +39,8 @@ public class Load {
FileSelect.selectOpWhitelist();
FileSelect.selectPermissionWhitelist();
setConfigVersion();
plugin.getCommand("t2c-opsecurity").setExecutor(new CmdExecuter());
T2Cregister.listener(new OpCommand(), plugin);
@@ -52,4 +57,14 @@ public class Load {
Metrics.Bstats(plugin, Util.getBstatsID());
T2Ctemplate.onLoadFooter(Util.getPrefix(), long_);
}
public static void setConfigVersion() {
File config = new File(Main.getPath(), "config.yml");
YamlConfiguration yamlConfiguration = YamlConfiguration.loadConfiguration(config);
yamlConfiguration.set("configVersion", Util.getConfigVersion());
try {
yamlConfiguration.save(config);
} catch (IOException e) {
e.printStackTrace();
}
}
}