mirror of
https://github.com/xzb23/Minecraft-Command-Permission-Control.git
synced 2026-11-22 16:54: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) {
|
for (String command: commands) {
|
||||||
List<String> black = new ArrayList<>(Arrays.asList(command.split(CMDSEPARATOR)));
|
List<String> black = new ArrayList<>(Arrays.asList(command.split(CMDSEPARATOR)));
|
||||||
if (black.isEmpty()){
|
if (black.isEmpty()){
|
||||||
LOGGER.warn("{} 配置不可用, 长度错误", command);
|
LOGGER.warn("{} configuration unavailable, length error", command);
|
||||||
} else if (black.size() < 3){
|
} else if (black.size() < 3){
|
||||||
for (int i = 0; black.size() + i < 3; i++){
|
for (int i = 0; black.size() + i < 3; i++){
|
||||||
black.add("0");
|
black.add("0");
|
||||||
@@ -41,7 +41,7 @@ public class CommandInterceptor {
|
|||||||
} else if (black.size() == 3){
|
} else if (black.size() == 3){
|
||||||
blackList.add(black);
|
blackList.add(black);
|
||||||
} else {
|
} else {
|
||||||
LOGGER.warn("{} 配置不可用, 长度错误", command);
|
LOGGER.warn("{} configuration unavailable, length error", command);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return blackList;
|
return blackList;
|
||||||
@@ -77,19 +77,19 @@ public class CommandInterceptor {
|
|||||||
try {
|
try {
|
||||||
stopIndex = Integer.parseInt(blackCommands.get(arg_CHECKINDEX)); // 将blackCommands[args_STOPINDEX] 转换为为Integer
|
stopIndex = Integer.parseInt(blackCommands.get(arg_CHECKINDEX)); // 将blackCommands[args_STOPINDEX] 转换为为Integer
|
||||||
}catch (NumberFormatException e){
|
}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;
|
stopIndex = arg_blackLISTCOMMANDNAME;
|
||||||
}
|
}
|
||||||
if (stopIndex == 0){ // 禁止整个指令而不是特定参数的指令
|
if (stopIndex == 0){ // 禁止整个指令而不是特定参数的指令
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
LOGGER.info("{} 使用 {} 命令被拦截", source.getTextName(), raw);
|
LOGGER.info("{} used {} command and was intercepted", source.getTextName(), raw);
|
||||||
broadcast(source);
|
broadcast(source);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
List<String> blackArgs = Arrays.asList(blackCommands.get(arg_PARAMETERS).split(","));
|
List<String> blackArgs = Arrays.asList(blackCommands.get(arg_PARAMETERS).split(","));
|
||||||
if (blackArgs.contains(parts[stopIndex])){ // 禁止特定参数的指令,在配置中定义
|
if (blackArgs.contains(parts[stopIndex])){ // 禁止特定参数的指令,在配置中定义
|
||||||
event.setCanceled(true);
|
event.setCanceled(true);
|
||||||
LOGGER.info("{} 使用 {} 命令被拦截", source.getTextName(), raw);
|
LOGGER.info("{} used {} command and was intercepted", source.getTextName(), raw);
|
||||||
broadcast(source);
|
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