From 28cb9e1ebfb7ffa5ebb8f14d17e53c2776be79c0 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 11 Mar 2025 20:52:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=BB=8B=E5=B4=A9=E7=9A=84?= =?UTF-8?q?=E5=BC=80=E5=8F=91=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../atsuishio/superbwarfare/client/TooltipTool.java | 2 +- .../com/atsuishio/superbwarfare/item/BeamTest.java | 10 ++++++++++ .../resources/assets/superbwarfare/lang/en_us.json | 2 ++ .../resources/assets/superbwarfare/lang/zh_cn.json | 2 ++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/client/TooltipTool.java b/src/main/java/com/atsuishio/superbwarfare/client/TooltipTool.java index 389b9d420..73d88c118 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/TooltipTool.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/TooltipTool.java @@ -20,7 +20,7 @@ public class TooltipTool { } public static void addDevelopingText(List tooltip) { - tooltip.add(Component.literal("本物品还在开发中").withStyle(ChatFormatting.LIGHT_PURPLE).withStyle(ChatFormatting.BOLD)); + tooltip.add(Component.translatable("des.superbwarfare.developing").withStyle(ChatFormatting.LIGHT_PURPLE).withStyle(ChatFormatting.BOLD)); } public static double perkDamage(ItemStack stack) { diff --git a/src/main/java/com/atsuishio/superbwarfare/item/BeamTest.java b/src/main/java/com/atsuishio/superbwarfare/item/BeamTest.java index 4cb761f53..374553c64 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/BeamTest.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/BeamTest.java @@ -4,11 +4,13 @@ import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.capability.LaserCapability; import com.atsuishio.superbwarfare.capability.LaserHandler; import com.atsuishio.superbwarfare.capability.ModCapabilities; +import com.atsuishio.superbwarfare.client.TooltipTool; import com.atsuishio.superbwarfare.entity.projectile.LaserEntity; import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.network.message.LaserShootMessage; import com.atsuishio.superbwarfare.network.message.ShakeClientMessage; import com.atsuishio.superbwarfare.tools.TraceTool; +import net.minecraft.network.chat.Component; import net.minecraft.network.protocol.game.ClientboundStopSoundPacket; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundEvent; @@ -20,12 +22,15 @@ import net.minecraft.world.entity.LivingEntity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.TooltipFlag; import net.minecraft.world.level.Level; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.Vec3; import net.minecraftforge.network.PacketDistributor; +import org.jetbrains.annotations.Nullable; import java.util.Comparator; +import java.util.List; import java.util.Set; public class BeamTest extends Item { @@ -131,4 +136,9 @@ public class BeamTest extends Item { public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { return slotChanged; } + + @Override + public void appendHoverText(ItemStack pStack, @Nullable Level pLevel, List pTooltipComponents, TooltipFlag pIsAdvanced) { + TooltipTool.addDevelopingText(pTooltipComponents); + } } diff --git a/src/main/resources/assets/superbwarfare/lang/en_us.json b/src/main/resources/assets/superbwarfare/lang/en_us.json index 16aa806f1..fb1c7aa5b 100644 --- a/src/main/resources/assets/superbwarfare/lang/en_us.json +++ b/src/main/resources/assets/superbwarfare/lang/en_us.json @@ -531,6 +531,8 @@ "des.superbwarfare.revolver.da": "DA", "des.superbwarfare.revolver.sa": "SA", + "des.superbwarfare.developing": "This item is still under development", + "jei.superbwarfare.ancient_cpu": "Mysterious ancient technology, can be found at ancient cities.", "jei.superbwarfare.charging_station": "Generates power by consuming fuel or food, and can also accept FE energy input. This block supplies FE energy to adjacent blocks, and can also charge rechargeable vehicles within range.", diff --git a/src/main/resources/assets/superbwarfare/lang/zh_cn.json b/src/main/resources/assets/superbwarfare/lang/zh_cn.json index 59f301290..0a9d60685 100644 --- a/src/main/resources/assets/superbwarfare/lang/zh_cn.json +++ b/src/main/resources/assets/superbwarfare/lang/zh_cn.json @@ -531,6 +531,8 @@ "des.superbwarfare.revolver.da": "双动", "des.superbwarfare.revolver.sa": "单动", + "des.superbwarfare.developing": "本物品还在开发中", + "jei.superbwarfare.ancient_cpu": "神秘的古代科技,可以在古城找到。", "jei.superbwarfare.charging_station": "使用燃料或食物进行发电,也可以接收主动输入的FE能量。能够为相邻的方块提供FE能量,为周围一定范围内的可充能载具充能。",