添加战术冲刺的指令开关

This commit is contained in:
17146 2025-04-22 01:14:46 +08:00 committed by Light_Quanta
parent 17ca208db6
commit c218ae5157
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
3 changed files with 20 additions and 1 deletions

View file

@ -1,6 +1,7 @@
package com.atsuishio.superbwarfare.command; package com.atsuishio.superbwarfare.command;
import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
import com.atsuishio.superbwarfare.config.server.MiscConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.mojang.brigadier.arguments.BoolArgumentType; import com.mojang.brigadier.arguments.BoolArgumentType;
import com.mojang.brigadier.builder.LiteralArgumentBuilder; import com.mojang.brigadier.builder.LiteralArgumentBuilder;
@ -37,6 +38,8 @@ public class ConfigCommand {
VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(false); VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(false);
VehicleConfig.COLLISION_DESTROY_BLOCKS.save(); 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); context.getSource().sendSuccess(() -> Component.translatable("commands.config.collision_destroy.soft"), true);
return 0; return 0;
@ -47,6 +50,8 @@ public class ConfigCommand {
VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(false); VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(false);
VehicleConfig.COLLISION_DESTROY_BLOCKS.save(); 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); context.getSource().sendSuccess(() -> Component.translatable("commands.config.collision_destroy.hard"), true);
return 0; return 0;
@ -57,10 +62,20 @@ public class ConfigCommand {
VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(true); VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.set(true);
VehicleConfig.COLLISION_DESTROY_BLOCKS.save(); 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); context.getSource().sendSuccess(() -> Component.translatable("commands.config.collision_destroy.beastly"), true);
return 0; 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;
})));
} }
} }

View file

@ -491,6 +491,8 @@
"commands.config.collision_destroy.soft": "Enabled vehicle collision destroy blocks (Soft Mode)", "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.hard": "Enabled vehicle collision destroy blocks (Hard Mode)",
"commands.config.collision_destroy.beastly": "Enabled vehicle collision destroy blocks (Beastly 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.sensitivity": "Current Sensitivity of This Gun: %1$s",
"tips.superbwarfare.monitor.linked": "Connect", "tips.superbwarfare.monitor.linked": "Connect",

View file

@ -490,6 +490,8 @@
"commands.config.collision_destroy.soft": "已开启载具碰撞破坏方块(柔软模式)", "commands.config.collision_destroy.soft": "已开启载具碰撞破坏方块(柔软模式)",
"commands.config.collision_destroy.hard": "已开启载具碰撞破坏方块(坚固模式)", "commands.config.collision_destroy.hard": "已开启载具碰撞破坏方块(坚固模式)",
"commands.config.collision_destroy.beastly": "已开启载具碰撞破坏方块(野兽模式)", "commands.config.collision_destroy.beastly": "已开启载具碰撞破坏方块(野兽模式)",
"commands.config.tactical_sprint.enabled": "已启用战术冲刺",
"commands.config.tactical_sprint.disabled": "已禁用战术冲刺",
"tips.superbwarfare.sensitivity": "当前枪械的灵敏度为:%1$s", "tips.superbwarfare.sensitivity": "当前枪械的灵敏度为:%1$s",
"tips.superbwarfare.monitor.linked": "连接成功!", "tips.superbwarfare.monitor.linked": "连接成功!",