Skip to content

Commit

Permalink
指令统计可以被关闭
Browse files Browse the repository at this point in the history
添加一个开关,默认开启
  • Loading branch information
xia-mc committed Mar 5, 2024
1 parent d8b9fe2 commit 4764ee7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class CommonConfig extends AutoLoadTomlConfig {

@TableField(rightComment = "统计数据输出时间(24小时制)")
private String time = "00:00:00";
@TableField(rightComment = "允许统计指令")
private boolean allowCommandStats = true;
@TableField(rightComment = "统计指令列表")
private List<String> commandStatsList = new ArrayList<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
public class MixinCommand {
@Inject(method = "performCommand", at = @At("HEAD"))
public void performPrefixedCommand(@NotNull ParseResults<CommandSourceStack> parseResults, String string, CallbackInfoReturnable<Integer> cir) {
if (!ModConfig.INSTANCE.getCommon().isAllowCommandStats()) return; // 绷
CommandSourceStack commandSourceStack = parseResults.getContext().getSource();
if (!commandSourceStack.hasPermission(2)) return;

Expand Down

0 comments on commit 4764ee7

Please sign in to comment.