From c218ae51576cf89a97e42787e7b2b385a4b6bb10 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 22 Apr 2025 01:14:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=98=E6=9C=AF=E5=86=B2?= =?UTF-8?q?=E5=88=BA=E7=9A=84=E6=8C=87=E4=BB=A4=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/command/ConfigCommand.java | 17 ++++++++++++++++- .../assets/superbwarfare/lang/en_us.json | 2 ++ .../assets/superbwarfare/lang/zh_cn.json | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/command/ConfigCommand.java b/src/main/java/com/atsuishio/superbwarfare/command/ConfigCommand.java index f002eacd9..af09f27af 100644 --- a/src/main/java/com/atsuishio/superbwarfare/command/ConfigCommand.java +++ b/src/main/java/com/atsuishio/superbwarfare/command/ConfigCommand.java @@ -1,6 +1,7 @@ package com.atsuishio.superbwarfare.command; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; +import com.atsuishio.superbwarfare.config.server.MiscConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.mojang.brigadier.arguments.BoolArgumentType; import com.mojang.brigadier.builder.LiteralArgumentBuilder; @@ -37,6 +38,8 @@ public class ConfigCommand { VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(false); VehicleConfig.COLLISION_DESTROY_BLOCKS.save(); + VehicleConfig.COLLISION_DESTROY_HARD_BLOCKS.save(); + VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.save(); context.getSource().sendSuccess(() -> Component.translatable("commands.config.collision_destroy.soft"), true); return 0; @@ -47,6 +50,8 @@ public class ConfigCommand { VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(false); VehicleConfig.COLLISION_DESTROY_BLOCKS.save(); + VehicleConfig.COLLISION_DESTROY_HARD_BLOCKS.save(); + VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.save(); context.getSource().sendSuccess(() -> Component.translatable("commands.config.collision_destroy.hard"), true); return 0; @@ -57,10 +62,20 @@ public class ConfigCommand { VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(true); VehicleConfig.COLLISION_DESTROY_BLOCKS.save(); + VehicleConfig.COLLISION_DESTROY_HARD_BLOCKS.save(); + VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.save(); context.getSource().sendSuccess(() -> Component.translatable("commands.config.collision_destroy.beastly"), true); return 0; })) - ); + ) + .then(Commands.literal("tacticalSprint").requires(s -> s.hasPermission(2)).then(Commands.argument("value", BoolArgumentType.bool()).executes(context -> { + var value = BoolArgumentType.getBool(context, "value"); + MiscConfig.ALLOW_TACTICAL_SPRINT.set(value); + MiscConfig.ALLOW_TACTICAL_SPRINT.save(); + + context.getSource().sendSuccess(() -> Component.translatable(value ? "commands.config.tactical_sprint.enabled" : "commands.config.tactical_sprint.disabled"), true); + return 0; + }))); } } diff --git a/src/main/resources/assets/superbwarfare/lang/en_us.json b/src/main/resources/assets/superbwarfare/lang/en_us.json index 1e383b91c..b4d1caade 100644 --- a/src/main/resources/assets/superbwarfare/lang/en_us.json +++ b/src/main/resources/assets/superbwarfare/lang/en_us.json @@ -491,6 +491,8 @@ "commands.config.collision_destroy.soft": "Enabled vehicle collision destroy blocks (Soft Mode)", "commands.config.collision_destroy.hard": "Enabled vehicle collision destroy blocks (Hard Mode)", "commands.config.collision_destroy.beastly": "Enabled vehicle collision destroy blocks (Beastly Mode)", + "commands.config.tactical_sprint.enabled": "Enabled tactical sprint", + "commands.config.tactical_sprint.disabled": "Disabled tactical sprint", "tips.superbwarfare.sensitivity": "Current Sensitivity of This Gun: %1$s", "tips.superbwarfare.monitor.linked": "Connect!", diff --git a/src/main/resources/assets/superbwarfare/lang/zh_cn.json b/src/main/resources/assets/superbwarfare/lang/zh_cn.json index f6ab02966..66a6eed89 100644 --- a/src/main/resources/assets/superbwarfare/lang/zh_cn.json +++ b/src/main/resources/assets/superbwarfare/lang/zh_cn.json @@ -490,6 +490,8 @@ "commands.config.collision_destroy.soft": "已开启载具碰撞破坏方块(柔软模式)", "commands.config.collision_destroy.hard": "已开启载具碰撞破坏方块(坚固模式)", "commands.config.collision_destroy.beastly": "已开启载具碰撞破坏方块(野兽模式)", + "commands.config.tactical_sprint.enabled": "已启用战术冲刺", + "commands.config.tactical_sprint.disabled": "已禁用战术冲刺", "tips.superbwarfare.sensitivity": "当前枪械的灵敏度为:%1$s", "tips.superbwarfare.monitor.linked": "连接成功!",