From 168178e96dd85ce7d94c587e23a0923729a1e7a2 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Sat, 12 Jul 2025 19:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=91=E5=AE=9A=E6=96=87?= =?UTF-8?q?=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java | 6 ++++-- .../superbwarfare/entity/vehicle/Mle1934Entity.java | 6 ++++-- .../superbwarfare/entity/vehicle/MortarEntity.java | 6 ++++-- src/main/resources/assets/superbwarfare/lang/en_us.json | 2 ++ src/main/resources/assets/superbwarfare/lang/zh_cn.json | 2 ++ 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java index 4ca431953..1734fc3d0 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java @@ -165,13 +165,15 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, CannonEntity if (player instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), SoundEvents.ARROW_HIT_PLAYER, SoundSource.PLAYERS, 0.5F, 1); } - player.displayClientMessage(Component.literal("added"), true); + player.displayClientMessage(Component.translatable("des.superbwarfare.artillery_indicator.add", this.getDisplayName()) + .withStyle(ChatFormatting.GREEN), true); return InteractionResult.SUCCESS; } else if (indicator.removeCannon(stack, getStringUUID())) { if (player instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), SoundEvents.ARROW_HIT_PLAYER, SoundSource.PLAYERS, 0.5F, 1); } - player.displayClientMessage(Component.literal("removed"), true); + player.displayClientMessage(Component.translatable("des.superbwarfare.artillery_indicator.remove", this.getDisplayName()) + .withStyle(ChatFormatting.RED), true); return InteractionResult.SUCCESS; } else { return InteractionResult.FAIL; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java index 14ffdb83f..b39ad85be 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java @@ -171,13 +171,15 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, CannonEnt if (player instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), SoundEvents.ARROW_HIT_PLAYER, SoundSource.PLAYERS, 0.5F, 1); } - player.displayClientMessage(Component.literal("added"), true); + player.displayClientMessage(Component.translatable("des.superbwarfare.artillery_indicator.add", this.getDisplayName()) + .withStyle(ChatFormatting.GREEN), true); return InteractionResult.SUCCESS; } else if (indicator.removeCannon(stack, getStringUUID())) { if (player instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), SoundEvents.ARROW_HIT_PLAYER, SoundSource.PLAYERS, 0.5F, 1); } - player.displayClientMessage(Component.literal("removed"), true); + player.displayClientMessage(Component.translatable("des.superbwarfare.artillery_indicator.remove", this.getDisplayName()) + .withStyle(ChatFormatting.RED), true); return InteractionResult.SUCCESS; } else { return InteractionResult.FAIL; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java index 0afed07b5..4db6f5562 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MortarEntity.java @@ -160,13 +160,15 @@ public class MortarEntity extends VehicleEntity implements GeoEntity, Container, if (player instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), SoundEvents.ARROW_HIT_PLAYER, SoundSource.PLAYERS, 0.5F, 1); } - player.displayClientMessage(Component.literal("added"), true); + player.displayClientMessage(Component.translatable("des.superbwarfare.artillery_indicator.add", this.getDisplayName()) + .withStyle(ChatFormatting.GREEN), true); return InteractionResult.SUCCESS; } else if (indicator.removeCannon(mainHandItem, getStringUUID())) { if (player instanceof ServerPlayer serverPlayer) { serverPlayer.level().playSound(null, serverPlayer.getOnPos(), SoundEvents.ARROW_HIT_PLAYER, SoundSource.PLAYERS, 0.5F, 1); } - player.displayClientMessage(Component.literal("removed"), true); + player.displayClientMessage(Component.translatable("des.superbwarfare.artillery_indicator.remove", this.getDisplayName()) + .withStyle(ChatFormatting.RED), true); return InteractionResult.SUCCESS; } else { return InteractionResult.FAIL; diff --git a/src/main/resources/assets/superbwarfare/lang/en_us.json b/src/main/resources/assets/superbwarfare/lang/en_us.json index cb951f2f0..0e385737d 100644 --- a/src/main/resources/assets/superbwarfare/lang/en_us.json +++ b/src/main/resources/assets/superbwarfare/lang/en_us.json @@ -260,6 +260,8 @@ "des.superbwarfare.artillery_indicator_3": "Right-click to zoom, scroll wheel to adjust zoom ratio, middle mouse button to mark target location", "des.superbwarfare.artillery_indicator_4": "Hold left mouse button to send fire command", "des.superbwarfare.artillery_indicator_5": "When in off-hand: use drone to mark locations (same controls as above)", + "des.superbwarfare.artillery_indicator.add": "%1$s has been added to the artillery array", + "des.superbwarfare.artillery_indicator.remove": "%1$s has been removed from the artillery array", "attribute.superbwarfare.bullet_resistance": "Bullet Resistance", diff --git a/src/main/resources/assets/superbwarfare/lang/zh_cn.json b/src/main/resources/assets/superbwarfare/lang/zh_cn.json index da7064df0..2a9656ee1 100644 --- a/src/main/resources/assets/superbwarfare/lang/zh_cn.json +++ b/src/main/resources/assets/superbwarfare/lang/zh_cn.json @@ -260,6 +260,8 @@ "des.superbwarfare.artillery_indicator_3": "鼠标右键缩放,滚轮调节缩放倍率,鼠标中键标记目标位置", "des.superbwarfare.artillery_indicator_4": "长按鼠标左键发送射击指令", "des.superbwarfare.artillery_indicator_5": "放置在副手时可使用无人机标记位置,操作方式同上", + "des.superbwarfare.artillery_indicator.add": "已将%1$s添加至火炮阵列", + "des.superbwarfare.artillery_indicator.remove": "已将%1$s从火炮阵列中移除", "attribute.superbwarfare.bullet_resistance": "子弹防护",