添加tips,这还不会用的人斗鲨了(恼

This commit is contained in:
Atsuishio 2025-07-12 12:40:28 +08:00 committed by Light_Quanta
parent 4ca89c305f
commit 8d9bb92241
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
5 changed files with 32 additions and 0 deletions

View file

@ -3,6 +3,7 @@ package com.atsuishio.superbwarfare.item;
import com.atsuishio.superbwarfare.client.TooltipTool;
import com.atsuishio.superbwarfare.client.screens.ArtilleryIndicatorScreen;
import com.atsuishio.superbwarfare.tools.NBTTool;
import net.minecraft.ChatFormatting;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.ListTag;
@ -36,6 +37,12 @@ public class ArtilleryIndicator extends Item implements ItemScreenProvider {
@ParametersAreNonnullByDefault
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
TooltipTool.addScreenProviderText(tooltipComponents);
tooltipComponents.add(Component.translatable("des.superbwarfare.artillery_indicator_1").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.translatable("des.superbwarfare.artillery_indicator_2").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.translatable("des.superbwarfare.artillery_indicator_3").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.translatable("des.superbwarfare.artillery_indicator_4").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.literal(" ").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.translatable("des.superbwarfare.artillery_indicator_5").withStyle(ChatFormatting.GRAY));
}
@Override

View file

@ -78,5 +78,6 @@ public class Crowbar extends SwordItem {
@ParametersAreNonnullByDefault
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("des.superbwarfare.crowbar").withStyle(ChatFormatting.GRAY));
tooltipComponents.add(Component.translatable("des.superbwarfare.crowbar_2").withStyle(ChatFormatting.GRAY));
}
}

View file

@ -1,8 +1,10 @@
package com.atsuishio.superbwarfare.item;
import com.atsuishio.superbwarfare.entity.vehicle.MortarEntity;
import net.minecraft.ChatFormatting;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.stats.Stats;
import net.minecraft.world.InteractionHand;
@ -12,6 +14,7 @@ import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.item.TooltipFlag;
import net.minecraft.world.item.context.UseOnContext;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.level.Level;
@ -27,6 +30,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
import org.jetbrains.annotations.NotNull;
import javax.annotation.ParametersAreNonnullByDefault;
import java.util.List;
import java.util.Objects;
public class MortarDeployer extends Item {
@ -112,4 +116,10 @@ public class MortarDeployer extends Item {
}
}
}
@Override
@ParametersAreNonnullByDefault
public void appendHoverText(ItemStack stack, TooltipContext context, List<Component> tooltipComponents, TooltipFlag tooltipFlag) {
tooltipComponents.add(Component.translatable("des.superbwarfare.mortar_deployer").withStyle(ChatFormatting.GRAY));
}
}

View file

@ -205,11 +205,13 @@
"des.superbwarfare.electric_baton.close": "Electroshock Mode Disabled",
"item.superbwarfare.crowbar": "Crowbar",
"des.superbwarfare.crowbar": "Right-click to open containers. Pick up vehicles when sneaking",
"des.superbwarfare.crowbar_2": "Right-click loaded artillery to fire",
"item.superbwarfare.defuser": "Defuser",
"item.superbwarfare.mortar_bipod": "Mortar Bipod",
"item.superbwarfare.mortar_base_plate": "Mortar Base Plate",
"item.superbwarfare.mortar_barrel": "Mortar Barrel",
"item.superbwarfare.mortar_deployer": "Mortar",
"des.superbwarfare.mortar_deployer": "While sneaking, right-click mortar with remote controller to convert to intelligent mortar",
"item.superbwarfare.claymore_mine": "Claymore",
"item.superbwarfare.c4_bomb": "C4",
"des.superbwarfare.c4_bomb.time": "Timed Explosive",
@ -253,6 +255,11 @@
"item.superbwarfare.heavy_armament_module": "Heavy Armament Module",
"item.superbwarfare.artillery_indicator": "Artillery Indicator",
"des.superbwarfare.item_screen_provider": "Press %1$s key to open GUI",
"des.superbwarfare.artillery_indicator_1": "Right-click on artillery or intelligent mortar while sneaking to add to target list",
"des.superbwarfare.artillery_indicator_2": "Right-click again to remove",
"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)",
"attribute.superbwarfare.bullet_resistance": "Bullet Resistance",

View file

@ -205,11 +205,13 @@
"des.superbwarfare.electric_baton.close": "已关闭电击模式",
"item.superbwarfare.crowbar": "撬棍",
"des.superbwarfare.crowbar": "右击以开启集装箱,潜行时右击以回收载具",
"des.superbwarfare.crowbar_2": "右击装载好炮弹的火炮以发射",
"item.superbwarfare.defuser": "拆弹器",
"item.superbwarfare.mortar_bipod": "迫击炮架",
"item.superbwarfare.mortar_base_plate": "迫击炮座钣",
"item.superbwarfare.mortar_barrel": "迫击炮管",
"item.superbwarfare.mortar_deployer": "迫击炮",
"des.superbwarfare.mortar_deployer": "潜行时,用遥控器右键迫击炮可将其转化为智能迫击炮",
"item.superbwarfare.claymore_mine": "阔剑地雷",
"item.superbwarfare.c4_bomb": "C4炸药",
"des.superbwarfare.c4_bomb.time": "定时",
@ -253,6 +255,11 @@
"item.superbwarfare.heavy_armament_module": "重型武装模块",
"item.superbwarfare.artillery_indicator": "火炮指示器",
"des.superbwarfare.item_screen_provider": "按下 %1$s 以打开GUI",
"des.superbwarfare.artillery_indicator_1": "潜行时右键火炮或者智能化迫击炮将其添加到目录当中",
"des.superbwarfare.artillery_indicator_2": "再次右键移除",
"des.superbwarfare.artillery_indicator_3": "鼠标右键缩放,滚轮调节缩放倍率,鼠标中键标记目标位置",
"des.superbwarfare.artillery_indicator_4": "长按鼠标左键发送射击指令",
"des.superbwarfare.artillery_indicator_5": "放置在副手时可使用无人机标记位置,操作方式同上",
"attribute.superbwarfare.bullet_resistance": "子弹防护",