Add teunwhitelist command to remove modded TE from parallel whitelist
- New /dimensionalripper teunwhitelist <regname> removes a modded block entity from the parallel whitelist, restoring its default forced-serial processing; reports whether it was actually present - SerDesFilter.unwhitelistModded now returns boolean (removal success) - README: document whitelist/teunwhitelist commands and clarify the built-in blacklist is hardcoded, not command-editable
This commit is contained in:
1 parent
44e6fa2537
commit
350920eaed
3 files changed
+22
-4
No files matched your search
@@ -50,6 +50,9 @@ public final class MasterCommand {
|
||||
.then(literal("tewhitelist")
|
||||
.then(net.minecraft.commands.Commands.argument("type", net.minecraft.commands.arguments.ResourceLocationArgument.id())
|
||||
.executes(MasterCommand::teWhitelist)))
|
||||
.then(literal("teunwhitelist")
|
||||
.then(net.minecraft.commands.Commands.argument("type", net.minecraft.commands.arguments.ResourceLocationArgument.id())
|
||||
.executes(MasterCommand::teUnwhitelist)))
|
||||
.then(literal("status").executes(MasterCommand::status)));
|
||||
}
|
||||
|
||||
@@ -103,6 +106,17 @@ public final class MasterCommand {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** 将指定 TE 注册名移出 modded 并行白名单(恢复该 modded TE 默认的强制串行)。 */
|
||||
private static int teUnwhitelist(CommandContext<CommandSourceStack> ctx) {
|
||||
String type = ResourceLocationArgument.getId(ctx, "type").toString();
|
||||
boolean removed = SerDesFilter.unwhitelistModded(type);
|
||||
ctx.getSource().sendSuccess(() ->
|
||||
Component.literal("TE 白名单已" + (removed ? "移除" : "移除(原本不在白名单中)") + ": " + type
|
||||
+ "(清单: " + SerDesFilter.moddedWhitelist() + ")"), false);
|
||||
ModZuozhi.LOGGER.info("[ModZuozhi] TE 白名单移除 {}", type);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private static int status(CommandContext<CommandSourceStack> ctx) {
|
||||
String fine = FineGrainScheduler.isEnabled() ? "开启" : "关闭";
|
||||
String noCollide = ModZuozhi.MOB_COLLISION_OFF ? "开启" : "关闭";
|
||||
|
||||
Reference in new issue
Block a user