From 5f8e2647b28f1fe09aabbda9ac1033b2fdfbe173 Mon Sep 17 00:00:00 2001 From: C-H716 <1536152356@qq.com> Date: Wed, 5 Nov 2025 21:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0jade=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=BF=BB=E8=AF=91=E9=94=AE=EF=BC=9B=E8=B0=83=E6=95=B4=E6=97=A0?= =?UTF-8?q?=E7=BA=BF=E6=94=B6=E5=8F=91=E5=99=A8=E7=9A=84tooltips=E7=BF=BB?= =?UTF-8?q?=E8=AF=91=E9=94=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wireless/WirelessTransceiverBlock.java | 18 ++--- .../com/extendedae_plus/hooks/WrenchHook.java | 2 +- ...relessTransceiverJadePluginComponents.java | 33 +++++----- .../assets/extendedae_plus/lang/en_us.json | 65 ++++++++++--------- .../assets/extendedae_plus/lang/zh_cn.json | 63 ++++++++++-------- 5 files changed, 100 insertions(+), 81 deletions(-) diff --git a/src/main/java/com/extendedae_plus/content/wireless/WirelessTransceiverBlock.java b/src/main/java/com/extendedae_plus/content/wireless/WirelessTransceiverBlock.java index 55fda89..0e3dd0b 100644 --- a/src/main/java/com/extendedae_plus/content/wireless/WirelessTransceiverBlock.java +++ b/src/main/java/com/extendedae_plus/content/wireless/WirelessTransceiverBlock.java @@ -61,7 +61,7 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock { // 潜行左键(其他物品):减频(-1 或 -10) if (player.isShiftKeyDown()) { if (te.isLocked()) { - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.transceiver_locked"), true); + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.locked"), true); super.attack(state, level, pos, player); return; } @@ -72,7 +72,7 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock { f -= step; if (f < 0) f = 0; te.setFrequency(f); - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.channel", te.getFrequency()), true); + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.channel", te.getFrequency()), true); } } } @@ -91,13 +91,13 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock { te.setPlacerId(cardOwner, teamName); String displayName = teamName != null ? teamName : cardOwner.toString().substring(0, 8); player.displayClientMessage( - Component.translatable("extendedae_plus.tooltips.wireless.bound_to", displayName), + Component.translatable("extendedae_plus.chat.wireless_transceiver.bound_to", displayName), true ); } else { // 频道卡未绑定所有者,使用当前玩家 te.setPlacerId(player.getUUID(), player.getName().getString()); - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.card_unbound_using_player"), true); + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.card_unbound"), true); } } @@ -111,7 +111,7 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock { boolean sneaking = player.isShiftKeyDown(); if (sneaking) { if (te.isLocked()) { - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.transceiver_locked"), true); + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.locked"), true); return InteractionResult.CONSUME; } // 频率调节:主手 +1(或 +10),副手 -1(或 -10) @@ -128,15 +128,15 @@ public class WirelessTransceiverBlock extends Block implements EntityBlock { if (f < 0) f = 0; } te.setFrequency(f); - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.channel", te.getFrequency()), true); + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.channel", te.getFrequency()), true); } else { if (te.isLocked()) { - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.transceiver_locked"), true); + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.locked"), true); return InteractionResult.CONSUME; } te.setMasterMode(!te.isMasterMode()); - String modeKey = te.isMasterMode() ? "extendedae_plus.tooltips.wireless.mode_master" : "extendedae_plus.tooltips.wireless.mode_slave"; - player.displayClientMessage(Component.translatable("extendedae_plus.tooltips.wireless.mode", Component.translatable(modeKey)), true); + String modeKey = te.isMasterMode() ? "extendedae_plus.chat.wireless_transceiver.mode_master" : "extendedae_plus.chat.wireless_transceiver.mode_slave"; + player.displayClientMessage(Component.translatable("extendedae_plus.chat.wireless_transceiver.mode", Component.translatable(modeKey)), true); } return InteractionResult.CONSUME; } diff --git a/src/main/java/com/extendedae_plus/hooks/WrenchHook.java b/src/main/java/com/extendedae_plus/hooks/WrenchHook.java index d8cc677..92654ff 100644 --- a/src/main/java/com/extendedae_plus/hooks/WrenchHook.java +++ b/src/main/java/com/extendedae_plus/hooks/WrenchHook.java @@ -95,7 +95,7 @@ public final class WrenchHook { boolean newLocked = !te.isLocked(); te.setLocked(newLocked); // 提示玩家 - String translationKey = newLocked ? "extendedae_plus.tooltips.wireless.transceiver_locked_status" : "extendedae_plus.tooltips.wireless.transceiver_unlocked_status"; + String translationKey = newLocked ? "extendedae_plus.chat.wireless_transceiver.locked_status" : "extendedae_plus.chat.wireless_transceiver.unlocked_status"; player.displayClientMessage(Component.translatable(translationKey), true); // 轻微反馈音效 level.playSound(player, hit.getBlockPos(), SoundEvents.LEVER_CLICK, SoundSource.BLOCKS, 0.5F, newLocked ? 0.6F : 0.9F); diff --git a/src/main/java/com/extendedae_plus/integration/jade/WirelessTransceiverJadePluginComponents.java b/src/main/java/com/extendedae_plus/integration/jade/WirelessTransceiverJadePluginComponents.java index 3f8f1d4..de8da38 100644 --- a/src/main/java/com/extendedae_plus/integration/jade/WirelessTransceiverJadePluginComponents.java +++ b/src/main/java/com/extendedae_plus/integration/jade/WirelessTransceiverJadePluginComponents.java @@ -18,7 +18,7 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr protected void add(BlockAccessor accessor, ITooltip tooltip, IPluginConfig config, CompoundTag data) { if (data.contains("frequency")) { long frequency = data.getLong("frequency"); - tooltip.add(Component.translatable("extendedae_plus.tooltip.frequency", frequency)); + tooltip.add(Component.translatable("extendedae_plus.jade.frequency", frequency)); } } }, @@ -27,7 +27,8 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr protected void add(BlockAccessor accessor, ITooltip tooltip, IPluginConfig config, CompoundTag data) { if (data.contains("masterMode")) { boolean masterMode = data.getBoolean("masterMode"); - tooltip.add(Component.translatable("extendedae_plus.tooltip.master_mode", masterMode ? "主模式" : "从模式")); + String modeKey = masterMode ? "extendedae_plus.jade.mode_master" : "extendedae_plus.jade.mode_slave"; + tooltip.add(Component.translatable("extendedae_plus.jade.mode", Component.translatable(modeKey))); } } }, @@ -39,12 +40,14 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr String dim = data.contains("masterDim") ? data.getString("masterDim") : ""; String customName = data.contains("customName") ? data.getString("customName") : null; if (customName != null) { - tooltip.add(Component.literal("主节点: " + customName + "(" + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + ")")); + tooltip.add(Component.translatable("extendedae_plus.jade.master_node_with_name", + customName, pos.getX(), pos.getY(), pos.getZ())); } else { - tooltip.add(Component.literal("主节点位置: (" + pos.getX() + ", " + pos.getY() + ", " + pos.getZ() + ")")); + tooltip.add(Component.translatable("extendedae_plus.jade.master_node_location", + pos.getX(), pos.getY(), pos.getZ())); } if (!dim.isEmpty()) { - tooltip.add(Component.literal("维度: " + dim)); + tooltip.add(Component.translatable("extendedae_plus.jade.dimension", dim)); } } } @@ -54,7 +57,8 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr protected void add(BlockAccessor accessor, ITooltip tooltip, IPluginConfig config, CompoundTag data) { if (data.contains("locked")) { boolean locked = data.getBoolean("locked"); - tooltip.add(Component.translatable("extendedae_plus.tooltip.locked", locked ? "已锁定" : "未锁定")); + String statusKey = locked ? "extendedae_plus.jade.locked" : "extendedae_plus.jade.unlocked"; + tooltip.add(Component.translatable("extendedae_plus.jade.lock_status", Component.translatable(statusKey))); } } }, @@ -63,7 +67,8 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr protected void add(BlockAccessor accessor, ITooltip tooltip, IPluginConfig config, CompoundTag data) { if (data.contains("networkUsable")) { boolean usable = data.getBoolean("networkUsable"); - tooltip.add(Component.literal((usable ? "设备在线" : "设备离线"))); + String statusKey = usable ? "extendedae_plus.jade.online" : "extendedae_plus.jade.offline"; + tooltip.add(Component.translatable(statusKey)); } } }, @@ -76,10 +81,10 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr // 参考AE2的显示方式 if (maxChannels <= 0) { // 无限频道或未设置 - tooltip.add(Component.translatable("extendedae_plus.tooltip.channels", usedChannels)); + tooltip.add(Component.translatable("extendedae_plus.jade.channels", usedChannels)); } else { // 显示 "已使用/最大" - tooltip.add(Component.translatable("extendedae_plus.tooltip.channels_of", usedChannels, maxChannels)); + tooltip.add(Component.translatable("extendedae_plus.jade.channels_of", usedChannels, maxChannels)); } } } @@ -89,14 +94,14 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr protected void add(BlockAccessor accessor, ITooltip tooltip, IPluginConfig config, CompoundTag data) { if (data.contains("ownerName")) { String ownerName = data.getString("ownerName"); - tooltip.add(Component.translatable("extendedae_plus.tooltip.owner", ownerName)); + tooltip.add(Component.translatable("extendedae_plus.jade.owner", ownerName)); } else if (data.contains("placerId")) { // 有placerId但没有名称,显示UUID java.util.UUID placerId = data.getUUID("placerId"); - tooltip.add(Component.translatable("extendedae_plus.tooltip.owner", placerId.toString().substring(0, 8) + "...")); + tooltip.add(Component.translatable("extendedae_plus.jade.owner", placerId.toString().substring(0, 8) + "...")); } else { // 没有所有者信息(公共收发器) - tooltip.add(Component.translatable("extendedae_plus.tooltip.owner.public")); + tooltip.add(Component.translatable("extendedae_plus.jade.owner.public")); } } }; @@ -120,6 +125,4 @@ public enum WirelessTransceiverJadePluginComponents implements IBlockComponentPr } protected abstract void add(BlockAccessor accessor, ITooltip tooltip, IPluginConfig config, CompoundTag data); -} - - +} \ No newline at end of file diff --git a/src/main/resources/assets/extendedae_plus/lang/en_us.json b/src/main/resources/assets/extendedae_plus/lang/en_us.json index 5c4bb7d..81e5362 100644 --- a/src/main/resources/assets/extendedae_plus/lang/en_us.json +++ b/src/main/resources/assets/extendedae_plus/lang/en_us.json @@ -87,20 +87,6 @@ "item.extendedae_plus.entity_speed_ticker.tip.max": "Maximum up to 1024x speed", "item.extendedae_plus.entity_speed_ticker.tip.energy": "Acceleration consumes AE network power; insufficient power disables acceleration", - "config.jade.plugin_extendedae_plus.wireless_transceiver_info": "Wireless Transceiver Info", - "config.jade.plugin_extendedae_plus.wt_frequency": "Show Frequency", - "config.jade.plugin_extendedae_plus.wt_master_mode": "Show Master/Slave Mode", - "config.jade.plugin_extendedae_plus.wt_master_location": "Show Master Position", - "config.jade.plugin_extendedae_plus.wt_locked": "Show Locked State", - "config.jade.plugin_extendedae_plus.wt_network_usable": "Show Network Online State", - "config.jade.plugin_extendedae_plus.wt_channels": "Show Channel Usage", - "config.jade.plugin_extendedae_plus.wt_owner": "Show Owner Information", - "extendedae_plus.tooltip.frequency": "Frequency: %d", - "extendedae_plus.tooltip.master_mode": "Mode: %s", - "extendedae_plus.tooltip.locked": "Locked: %s", - "extendedae_plus.tooltip.channels": "Channels: %d", - "extendedae_plus.tooltip.channels_of": "Channels: %d / %d", - "config.screen.extendedae_plus": "ExtendedAE Plus Config", "config.extendedae_plus.option.pageMultiplier": "Pattern Provider Page Multiplier", "config.extendedae_plus.option.pageMultiplier_with_range": "Pattern Provider Page Multiplier", @@ -130,27 +116,48 @@ "item.extendedae_plus.channel_card.owner.player": "Owner: Player %s", "item.extendedae_plus.channel_card.owner.bound": "Bound to: %s", "item.extendedae_plus.channel_card.owner.cleared": "Owner binding cleared", - - "extendedae_plus.tooltip.owner": "Owner: %s", - "extendedae_plus.tooltip.owner.unset": "Owner: Unset", - "extendedae_plus.tooltip.owner.public": "Owner: Public", - + "extendedae_plus.screen.frequency_input.title": "Set Frequency", "extendedae_plus.screen.frequency_input.current": "Current Frequency: %s", "extendedae_plus.screen.frequency_input.field": "Frequency", "extendedae_plus.screen.frequency_input.confirm": "Confirm", - + "group.pattern_provider.name": "Pattern Provider", "group.entity_ticker.name": "Entity Accelerator", "group.storage.name": "StorageBus", - "extendedae_plus.tooltips.wireless.transceiver_locked": "Transceiver locked, cannot modify", - "extendedae_plus.tooltips.wireless.channel": "Channel: %s", - "extendedae_plus.tooltips.wireless.bound_to": "Transceiver bound to: %s", - "extendedae_plus.tooltips.wireless.card_unbound_using_player": "Channel card unbound, using current player", - "extendedae_plus.tooltips.wireless.mode": "Mode: %s", - "extendedae_plus.tooltips.wireless.mode_master": "Master", - "extendedae_plus.tooltips.wireless.mode_slave": "Slave", - "extendedae_plus.tooltips.wireless.transceiver_locked_status": "Transceiver Locked", - "extendedae_plus.tooltips.wireless.transceiver_unlocked_status": "Transceiver Unlocked" + "extendedae_plus.chat.wireless_transceiver.locked": "Transceiver locked, cannot modify", + "extendedae_plus.chat.wireless_transceiver.channel": "Channel: %s", + "extendedae_plus.chat.wireless_transceiver.bound_to": "Transceiver bound to: %s", + "extendedae_plus.chat.wireless_transceiver.card_unbound": "Channel card unbound, using current player", + "extendedae_plus.chat.wireless_transceiver.mode": "Mode: %s", + "extendedae_plus.chat.wireless_transceiver.mode_master": "Master", + "extendedae_plus.chat.wireless_transceiver.mode_slave": "Slave", + "extendedae_plus.chat.wireless_transceiver.locked_status": "Transceiver Locked", + "extendedae_plus.chat.wireless_transceiver.unlocked_status": "Transceiver Unlocked", + + "config.jade.plugin_extendedae_plus.wireless_transceiver_info": "Wireless Transceiver Info", + "config.jade.plugin_extendedae_plus.wt_frequency": "Show Frequency", + "config.jade.plugin_extendedae_plus.wt_master_mode": "Show Master/Slave Mode", + "config.jade.plugin_extendedae_plus.wt_master_location": "Show Master Position", + "config.jade.plugin_extendedae_plus.wt_locked": "Show Locked State", + "config.jade.plugin_extendedae_plus.wt_network_usable": "Show Network Online State", + "config.jade.plugin_extendedae_plus.wt_channels": "Show Channel Usage", + "config.jade.plugin_extendedae_plus.wt_owner": "Show Owner Information", + "extendedae_plus.jade.frequency": "Frequency: %s", + "extendedae_plus.jade.mode": "Mode: %s", + "extendedae_plus.jade.mode_master": "Master", + "extendedae_plus.jade.mode_slave": "Slave", + "extendedae_plus.jade.master_node_with_name": "Master Node: %s(%s, %s, %s)", + "extendedae_plus.jade.master_node_location": "Master Node Location: (%s, %s, %s)", + "extendedae_plus.jade.dimension": "Dimension: %s", + "extendedae_plus.jade.lock_status": "Lock Status: %s", + "extendedae_plus.jade.locked": "Locked", + "extendedae_plus.jade.unlocked": "Unlocked", + "extendedae_plus.jade.online": "Device Online", + "extendedae_plus.jade.offline": "Device Offline", + "extendedae_plus.jade.channels": "Channels: %s", + "extendedae_plus.jade.channels_of": "Channels: %s/%s", + "extendedae_plus.jade.owner": "Owner: %s", + "extendedae_plus.jade.owner.public": "Owner: Public" } \ No newline at end of file diff --git a/src/main/resources/assets/extendedae_plus/lang/zh_cn.json b/src/main/resources/assets/extendedae_plus/lang/zh_cn.json index b41d7c6..95564ef 100644 --- a/src/main/resources/assets/extendedae_plus/lang/zh_cn.json +++ b/src/main/resources/assets/extendedae_plus/lang/zh_cn.json @@ -87,19 +87,7 @@ "item.extendedae_plus.entity_speed_ticker.tip.max": "最高可达 1024x 加速", "item.extendedae_plus.entity_speed_ticker.tip.energy": "加速将消耗 AE 网络能量,网络能量不足时无法加速", - "config.jade.plugin_extendedae_plus.wireless_transceiver_info": "无线收发器信息", - "config.jade.plugin_extendedae_plus.wt_frequency": "显示频率", - "config.jade.plugin_extendedae_plus.wt_master_mode": "显示主/从模式", - "config.jade.plugin_extendedae_plus.wt_master_location": "显示主节点位置", - "config.jade.plugin_extendedae_plus.wt_locked": "显示锁定状态", - "config.jade.plugin_extendedae_plus.wt_network_usable": "显示网络在线状态", - "config.jade.plugin_extendedae_plus.wt_channels": "显示频道使用情况", - "config.jade.plugin_extendedae_plus.wt_owner": "显示所有者信息", - "extendedae_plus.tooltip.frequency": "频率: %d", - "extendedae_plus.tooltip.master_mode": "模式: %s", - "extendedae_plus.tooltip.locked": "锁定状态: %s", - "extendedae_plus.tooltip.channels": "频道: %d", - "extendedae_plus.tooltip.channels_of": "频道: %d / %d", + "config.screen.extendedae_plus": "ExtendedAE Plus 配置", "config.extendedae_plus.option.pageMultiplier": "扩展样板供应器槽位倍率", @@ -130,11 +118,7 @@ "item.extendedae_plus.channel_card.owner.player": "所有者:玩家 %s", "item.extendedae_plus.channel_card.owner.bound": "已绑定至:%s", "item.extendedae_plus.channel_card.owner.cleared": "已清除所有者绑定", - - "extendedae_plus.tooltip.owner": "所有者: %s", - "extendedae_plus.tooltip.owner.unset": "所有者: 未设置", - "extendedae_plus.tooltip.owner.public": "所有者: 公共", - + "extendedae_plus.screen.frequency_input.title": "设置频率", "extendedae_plus.screen.frequency_input.current": "当前频率:%s", "extendedae_plus.screen.frequency_input.field": "频率", @@ -144,13 +128,38 @@ "group.entity_ticker.name": "实体加速器", "group.storage.name": "存储总线", - "extendedae_plus.tooltips.wireless.transceiver_locked": "收发器已锁定,无法修改", - "extendedae_plus.tooltips.wireless.channel": "频道:%s", - "extendedae_plus.tooltips.wireless.bound_to": "已将收发器绑定至:%s", - "extendedae_plus.tooltips.wireless.card_unbound_using_player": "频道卡未绑定,已使用当前玩家", - "extendedae_plus.tooltips.wireless.mode": "模式:%s", - "extendedae_plus.tooltips.wireless.mode_master": "主端", - "extendedae_plus.tooltips.wireless.mode_slave": "从端", - "extendedae_plus.tooltips.wireless.transceiver_locked_status": "已锁定收发器", - "extendedae_plus.tooltips.wireless.transceiver_unlocked_status": "已解锁收发器" + "extendedae_plus.chat.wireless_transceiver.locked": "收发器已锁定,无法修改", + "extendedae_plus.chat.wireless_transceiver.channel": "频道:%s", + "extendedae_plus.chat.wireless_transceiver.bound_to": "已将收发器绑定至:%s", + "extendedae_plus.chat.wireless_transceiver.card_unbound": "频道卡未绑定,已使用当前玩家", + "extendedae_plus.chat.wireless_transceiver.mode": "模式:%s", + "extendedae_plus.chat.wireless_transceiver.mode_master": "主端", + "extendedae_plus.chat.wireless_transceiver.mode_slave": "从端", + "extendedae_plus.chat.wireless_transceiver.locked_status": "已锁定收发器", + "extendedae_plus.chat.wireless_transceiver.unlocked_status": "已解锁收发器", + + "config.jade.plugin_extendedae_plus.wireless_transceiver_info": "无线收发器信息", + "config.jade.plugin_extendedae_plus.wt_frequency": "显示频率", + "config.jade.plugin_extendedae_plus.wt_master_mode": "显示主/从模式", + "config.jade.plugin_extendedae_plus.wt_master_location": "显示主节点位置", + "config.jade.plugin_extendedae_plus.wt_locked": "显示锁定状态", + "config.jade.plugin_extendedae_plus.wt_network_usable": "显示网络在线状态", + "config.jade.plugin_extendedae_plus.wt_channels": "显示频道使用情况", + "config.jade.plugin_extendedae_plus.wt_owner": "显示所有者信息", + "extendedae_plus.jade.frequency": "频率: %s", + "extendedae_plus.jade.mode": "模式: %s", + "extendedae_plus.jade.mode_master": "主模式", + "extendedae_plus.jade.mode_slave": "从模式", + "extendedae_plus.jade.master_node_with_name": "主节点: %s(%s, %s, %s)", + "extendedae_plus.jade.master_node_location": "主节点位置: (%s, %s, %s)", + "extendedae_plus.jade.dimension": "维度: %s", + "extendedae_plus.jade.lock_status": "锁定状态: %s", + "extendedae_plus.jade.locked": "已锁定", + "extendedae_plus.jade.unlocked": "未锁定", + "extendedae_plus.jade.online": "设备在线", + "extendedae_plus.jade.offline": "设备离线", + "extendedae_plus.jade.channels": "频道: %s", + "extendedae_plus.jade.channels_of": "频道: %s/%s", + "extendedae_plus.jade.owner": "所有者: %s", + "extendedae_plus.jade.owner.public": "所有者: 公共" } \ No newline at end of file