mirror of
https://github.com/xzb23/Minecraft-Command-Permission-Control.git
synced 2026-11-22 00:34:36 +08:00
使用英文打印日志 and 删除语言文件(专用服务端没有I18n类)
This commit is contained in:
2 files changed
+5
-18
No files matched your search
@@ -32,7 +32,7 @@ public class CommandInterceptor {
|
||||
for (String command: commands) {
|
||||
List<String> black = new ArrayList<>(Arrays.asList(command.split(CMDSEPARATOR)));
|
||||
if (black.isEmpty()){
|
||||
LOGGER.warn("{} 配置不可用, 长度错误", command);
|
||||
LOGGER.warn("{} configuration unavailable, length error", command);
|
||||
} else if (black.size() < 3){
|
||||
for (int i = 0; black.size() + i < 3; i++){
|
||||
black.add("0");
|
||||
@@ -41,7 +41,7 @@ public class CommandInterceptor {
|
||||
} else if (black.size() == 3){
|
||||
blackList.add(black);
|
||||
} else {
|
||||
LOGGER.warn("{} 配置不可用, 长度错误", command);
|
||||
LOGGER.warn("{} configuration unavailable, length error", command);
|
||||
}
|
||||
}
|
||||
return blackList;
|
||||
@@ -77,19 +77,19 @@ public class CommandInterceptor {
|
||||
try {
|
||||
stopIndex = Integer.parseInt(blackCommands.get(arg_CHECKINDEX)); // 将blackCommands[args_STOPINDEX] 转换为为Integer
|
||||
}catch (NumberFormatException e){
|
||||
LOGGER.warn("{} 配置不可用, args_STOPINDEX错误,重置为0", String.join(CMDSEPARATOR, blackCommands));
|
||||
LOGGER.warn("{} configuration unavailable, args_STOPINDEX error, reset to 0", String.join(CMDSEPARATOR, blackCommands));
|
||||
stopIndex = arg_blackLISTCOMMANDNAME;
|
||||
}
|
||||
if (stopIndex == 0){ // 禁止整个指令而不是特定参数的指令
|
||||
event.setCanceled(true);
|
||||
LOGGER.info("{} 使用 {} 命令被拦截", source.getTextName(), raw);
|
||||
LOGGER.info("{} used {} command and was intercepted", source.getTextName(), raw);
|
||||
broadcast(source);
|
||||
}
|
||||
else {
|
||||
List<String> blackArgs = Arrays.asList(blackCommands.get(arg_PARAMETERS).split(","));
|
||||
if (blackArgs.contains(parts[stopIndex])){ // 禁止特定参数的指令,在配置中定义
|
||||
event.setCanceled(true);
|
||||
LOGGER.info("{} 使用 {} 命令被拦截", source.getTextName(), raw);
|
||||
LOGGER.info("{} used {} command and was intercepted", source.getTextName(), raw);
|
||||
broadcast(source);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"itemGroup.stopcheat": "Example Mod Tab",
|
||||
"block.stopcheat.example_block": "Example Block",
|
||||
"item.stopcheat.example_item": "Example Item",
|
||||
|
||||
"stopcheat.configuration.title": "stopcheat Configs",
|
||||
"stopcheat.configuration.section.stopcheat.common.toml": "stopcheat Configs",
|
||||
"stopcheat.configuration.section.stopcheat.common.toml.title": "stopcheat Configs",
|
||||
"stopcheat.configuration.items": "Item List",
|
||||
"stopcheat.configuration.logDirtBlock": "Log Dirt Block",
|
||||
"stopcheat.configuration.magicNumberIntroduction": "Magic Number Text",
|
||||
"stopcheat.configuration.magicNumber": "Magic Number"
|
||||
}
|
||||
Reference in new issue
Block a user