Skip to content

Commit d73dfae

Browse files
committed
Slight improvement to repair-level option tooltip
1 parent 9b40ad7 commit d73dfae

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

.github/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ which is located at `.minecraft/config/civmodern.json`.
2424
- Better toggle-sneak (bound to `]` by default). Will automatically deactivate itself if you manually `SHIFT` sneak, or
2525
if you enter water, or start swimming, sprinting, elytra gliding, or creative flying.
2626

27-
- Added option that shows an item's base-repair level either always, only in advanced tooltips, or never. Set to always
28-
by default.
27+
- Added option that shows an item's base-repair level in its tooltip either always, only in advanced tooltips, or never.
28+
Set to always by default.
2929

30-
- Added option that shows an item's damage level either always, only in advanced tooltips, or never. Set to always by
31-
default.
30+
- Added option that shows an item's damage level in its tooltip either always, only in advanced tooltips, or never. Set
31+
to always by default.
3232

3333
## Changed
3434

src/main/java/sh/okx/civmodern/mod/config/ItemSettings.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,7 @@ public final class ItemSettings {
7272
) {
7373
return Option.<TooltipLineOption>createBuilder()
7474
.name(Component.translatable("civmodern.config.group.items.repairLevel"))
75-
.description(OptionDescription.of(
76-
Component.translatable("civmodern.config.group.items.repairLevel.desc"),
77-
Component.empty(),
78-
Component.translatable("civmodern.config.group.items.repairLevel.desc.warning")
79-
))
75+
.description(OptionDescription.of(Component.translatable("civmodern.config.group.items.repairLevel.desc")))
8076
.controller(TooltipLineOption::controller)
8177
.binding(
8278
DEFAULT_SHOW_REPAIR_LEVEL,

src/main/java/sh/okx/civmodern/mod/mixins/ItemStackMixin.java

+4
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ private void addDamageLevelLine(
141141
));
142142
}
143143

144+
/**
145+
* Prevents the default durability line from being added, giving control of that to
146+
* {@link #addDamageLevelLine(net.minecraft.world.item.TooltipFlag, sh.okx.civmodern.mod.config.TooltipLineOption)}
147+
*/
144148
@Redirect(
145149
method = "getTooltipLines",
146150
at = @At(

src/main/resources/assets/civmodern/lang/en_us.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,9 @@
1212
"civmodern.config.group.items.compactedColour": "Compacted-Items Colour",
1313
"civmodern.config.group.items.compactedColour.desc": "Compacted items will always show their item count. What colour would you prefer to differentiate them?",
1414
"civmodern.config.group.items.repairLevel": "Show base-repair level?",
15-
"civmodern.config.group.items.repairLevel.desc": "Should item tooltips include the item's base repair level?",
16-
"civmodern.config.group.items.repairLevel.desc.warning": "WARNING: This is NOT the level that will show up in anvils. That is usually the base-level + 2.",
15+
"civmodern.config.group.items.repairLevel.desc": "Should item tooltips include the item's base repair level?\n\nWARNING: This is NOT the level that will show up in anvils, which is typically the base-level + 2.",
1716
"civmodern.config.group.items.damageLevel": "Show damage level?",
18-
"civmodern.config.group.items.damageLevel.desc": "Minecraft limits this information to advanced-tooltips by default.",
17+
"civmodern.config.group.items.damageLevel.desc": "Minecraft limits this information to advanced tooltips by default.",
1918
"civmodern.config.group.iceRoad": "Ice Road Settings",
2019
"civmodern.config.group.iceRoad.snapPitch": "Snap pitch",
2120
"civmodern.config.group.iceRoad.snapYaw": "Snap yaw",

0 commit comments

Comments
 (0)