Skip to content

Commit 307d3ac

Browse files
committed
Add missing lang keys for the built-in config
1 parent 7beb0fa commit 307d3ac

File tree

2 files changed

+78
-0
lines changed

2 files changed

+78
-0
lines changed

src/generated/resources/assets/constructionstick/lang/en_us.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,46 @@
1616
"constructionstick.alias.emi.construction": "Construction",
1717
"constructionstick.alias.emi.construction_wand": "Construction Wand",
1818
"constructionstick.alias.emi.wand": "Wand",
19+
"constructionstick.configuration.AngelFalling": "Angel Place",
20+
"constructionstick.configuration.AngelFalling.tooltip": "Place blocks below you while falling > 10 blocks with angel upgrade (Can be used to save you from drops/the void)",
21+
"constructionstick.configuration.BEList": "Block Entity List",
22+
"constructionstick.configuration.BEList.tooltip": "White/Blacklist for Block Entities. Allow/Prevent blocks with BEs from being placed by stick. You can either add block ids like minecraft:chest or mod ids like minecraft",
23+
"constructionstick.configuration.BEWhitelist": "Block Entity Whitelist",
24+
"constructionstick.configuration.BEWhitelist.tooltip": "If set to TRUE, treat BEList as a whitelist, otherwise blacklist",
25+
"constructionstick.configuration.MaxRange": "Max Range",
26+
"constructionstick.configuration.MaxRange.tooltip": "Maximum placement range (0: unlimited). Affects all sticks and is meant for lag prevention, not game balancing.",
27+
"constructionstick.configuration.SimilarBlocks": "Similar Blocks",
28+
"constructionstick.configuration.SimilarBlocks.tooltip": "Blocks to treat equally when in Similar mode. Enter block IDs seperated by ;",
29+
"constructionstick.configuration.UndoHistory": "Undo History",
30+
"constructionstick.configuration.UndoHistory.tooltip": "Number of operations that can be undone",
31+
"constructionstick.configuration.angel": "Angel Upgrade",
32+
"constructionstick.configuration.angel.tooltip": "Stick destruction block limit (0 to disable destruction upgrade)",
33+
"constructionstick.configuration.batteryStorage": "Battery Storage",
34+
"constructionstick.configuration.batteryStorage.tooltip": "Battery power storage",
35+
"constructionstick.configuration.batteryUsage": "Battery Usage",
36+
"constructionstick.configuration.batteryUsage.tooltip": "Battery power usage per block",
37+
"constructionstick.configuration.blockentity": "Block entity",
38+
"constructionstick.configuration.blockentity.tooltip": "Block Entity Settings",
39+
"constructionstick.configuration.copper_stick": "Copper Stick",
40+
"constructionstick.configuration.copper_stick.tooltip": "Copper Stick Settings",
41+
"constructionstick.configuration.destruction": "Destruction Upgrade",
42+
"constructionstick.configuration.destruction.tooltip": "Stick destruction block limit (0 to disable destruction upgrade)",
43+
"constructionstick.configuration.diamond_stick": "Diamond Stick",
44+
"constructionstick.configuration.diamond_stick.tooltip": "Diamond Stick Settings",
45+
"constructionstick.configuration.durability": "Durability",
46+
"constructionstick.configuration.durability.tooltip": "Stick durability",
47+
"constructionstick.configuration.iron_stick": "Iron Stick",
48+
"constructionstick.configuration.iron_stick.tooltip": "Iron Stick Settings",
49+
"constructionstick.configuration.limit": "Placement Limit",
50+
"constructionstick.configuration.limit.tooltip": "Max placement distance with angel upgrade (0 to disable angel upgrade)",
51+
"constructionstick.configuration.misc": "Misc",
52+
"constructionstick.configuration.misc.tooltip": "Miscellaneous Settings",
53+
"constructionstick.configuration.netherite_stick": "Netherite Stick",
54+
"constructionstick.configuration.netherite_stick.tooltip": "Netherite Stick Settings",
55+
"constructionstick.configuration.upgradeable": "Upgradeable",
56+
"constructionstick.configuration.upgradeable.tooltip": "Allow stick upgrading by putting the stick together with a stick upgrade in a smithing table.",
57+
"constructionstick.configuration.wooden_stick": "Stickiest Stick",
58+
"constructionstick.configuration.wooden_stick.tooltip": "Stickiest Stick Settings",
1959
"constructionstick.description.durability.limited": "for %d blocks",
2060
"constructionstick.description.key.sneak": "Sneak",
2161
"constructionstick.description.key.sneak_opt": "Sneak+%s",

src/main/java/mrbysco/constructionstick/data/client/LanguageGenerator.java

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
package mrbysco.constructionstick.data.client;
22

33
import mrbysco.constructionstick.ConstructionStick;
4+
import mrbysco.constructionstick.items.stick.ItemStick;
45
import mrbysco.constructionstick.registry.ModItems;
56
import net.minecraft.data.PackOutput;
67
import net.neoforged.neoforge.common.data.LanguageProvider;
8+
import net.neoforged.neoforge.registries.DeferredItem;
9+
import org.jetbrains.annotations.Nullable;
710

811
public class LanguageGenerator extends LanguageProvider {
912

@@ -114,6 +117,28 @@ protected void addTranslations() {
114117
addAdvancement("template_replacement", "Replacement Stick Template", "Out with the old, in with the new");
115118
addAdvancement("template_unbreakable", "Unbreakable Template", "There's no limit!");
116119
addAdvancement("template_battery", "Battery Template", "Power up your construction game");
120+
121+
addConfig(ModItems.STICK_WOODEN.getId().getPath(), "Stickiest Stick", "Stickiest Stick Settings");
122+
addConfig(ModItems.STICK_COPPER.getId().getPath(), "Copper Stick", "Copper Stick Settings");
123+
addConfig(ModItems.STICK_IRON.getId().getPath(), "Iron Stick", "Iron Stick Settings");
124+
addConfig(ModItems.STICK_DIAMOND.getId().getPath(), "Diamond Stick", "Diamond Stick Settings");
125+
addConfig(ModItems.STICK_NETHERITE.getId().getPath(), "Netherite Stick", "Netherite Stick Settings");
126+
addConfig("durability", "Durability", "Stick durability");
127+
addConfig("batteryStorage", "Battery Storage", "Battery power storage");
128+
addConfig("batteryUsage", "Battery Usage", "Battery power usage per block");
129+
addConfig("limit", "Placement Limit", "Max placement distance with angel upgrade (0 to disable angel upgrade)");
130+
addConfig("angel", "Angel Upgrade", "Stick destruction block limit (0 to disable destruction upgrade)");
131+
addConfig("destruction", "Destruction Upgrade", "Stick destruction block limit (0 to disable destruction upgrade)");
132+
addConfig("upgradeable", "Upgradeable", "Allow stick upgrading by putting the stick together with a stick upgrade in a smithing table.");
133+
134+
addConfig("misc", "Misc", "Miscellaneous Settings");
135+
addConfig("MaxRange", "Max Range", "Maximum placement range (0: unlimited). Affects all sticks and is meant for lag prevention, not game balancing.");
136+
addConfig("UndoHistory", "Undo History", "Number of operations that can be undone");
137+
addConfig("AngelFalling", "Angel Place", "Place blocks below you while falling > 10 blocks with angel upgrade (Can be used to save you from drops/the void)");
138+
addConfig("SimilarBlocks", "Similar Blocks", "Blocks to treat equally when in Similar mode. Enter block IDs seperated by ;");
139+
addConfig("blockentity", "Block entity", "Block Entity Settings");
140+
addConfig("BEList", "Block Entity List", "White/Blacklist for Block Entities. Allow/Prevent blocks with BEs from being placed by stick. You can either add block ids like minecraft:chest or mod ids like minecraft");
141+
addConfig("BEWhitelist", "Block Entity Whitelist", "If set to TRUE, treat BEList as a whitelist, otherwise blacklist");
117142
}
118143

119144
private void addKeybind(String path, String translation) {
@@ -138,4 +163,17 @@ private void addAdvancement(String id, String name, String description) {
138163
add(prefix + id + ".title", name);
139164
add(prefix + id + ".desc", description);
140165
}
166+
167+
/**
168+
* Add the translation for a config entry
169+
*
170+
* @param path The path of the config entry
171+
* @param name The name of the config entry
172+
* @param description The description of the config entry (optional in case of targeting "title" or similar entries that have no tooltip)
173+
*/
174+
private void addConfig(String path, String name, @Nullable String description) {
175+
this.add("constructionstick.configuration." + path, name);
176+
if (description != null && !description.isEmpty())
177+
this.add("constructionstick.configuration." + path + ".tooltip", description);
178+
}
141179
}

0 commit comments

Comments
 (0)