添加新的指令

This commit is contained in:
17146 2025-06-07 19:15:21 +08:00 committed by Light_Quanta
parent fb8f8a4a3a
commit c9a904367d
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
3 changed files with 13 additions and 0 deletions

View file

@ -2,6 +2,7 @@ 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.MiscConfig;
import com.atsuishio.superbwarfare.config.server.ProjectileConfig;
import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig;
import com.atsuishio.superbwarfare.network.message.receive.ClientTacticalSprintSyncMessage; import com.atsuishio.superbwarfare.network.message.receive.ClientTacticalSprintSyncMessage;
import com.mojang.brigadier.arguments.BoolArgumentType; import com.mojang.brigadier.arguments.BoolArgumentType;
@ -82,6 +83,14 @@ public class ConfigCommand {
context.getSource().sendSuccess(() -> Component.translatable(value ? "commands.config.tactical_sprint.enabled" : "commands.config.tactical_sprint.disabled"), true); context.getSource().sendSuccess(() -> Component.translatable(value ? "commands.config.tactical_sprint.enabled" : "commands.config.tactical_sprint.disabled"), true);
return 0; return 0;
})))
.then(Commands.literal("glassDestroy").requires(s -> s.hasPermission(2)).then(Commands.argument("value", BoolArgumentType.bool()).executes(context -> {
var value = BoolArgumentType.getBool(context, "value");
ProjectileConfig.ALLOW_PROJECTILE_DESTROY_GLASS.set(value);
ProjectileConfig.ALLOW_PROJECTILE_DESTROY_GLASS.save();
context.getSource().sendSuccess(() -> Component.translatable(value ? "commands.config.glass_destroy.enabled" : "commands.config.glass_destroy.disabled"), true);
return 0;
}))); })));
} }
} }

View file

@ -536,6 +536,8 @@
"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.enabled": "Enabled tactical sprint",
"commands.config.tactical_sprint.disabled": "Disabled tactical sprint", "commands.config.tactical_sprint.disabled": "Disabled tactical sprint",
"commands.config.glass_destroy.enabled": "Enabled bullet glass breaking",
"commands.config.glass_destroy.disabled": "Disabled bullet glass breaking",
"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

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