Skip to content

Commit 37379ac

Browse files
committed
Move SeedMapper's key binds to separate category
1 parent ccc9ec0 commit 37379ac

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/main/java/dev/xpple/seedmapper/SeedMapper.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import net.fabricmc.loader.api.ModContainer;
3838
import net.minecraft.client.KeyMapping;
3939
import net.minecraft.commands.CommandBuildContext;
40+
import net.minecraft.resources.Identifier;
4041

4142
import java.io.IOException;
4243
import java.nio.file.Files;
@@ -82,8 +83,9 @@ public void onInitializeClient() {
8283

8384
SeedDatabaseHelper.fetchSeeds();
8485

85-
KeyMapping seedMapKeyMapping = KeyBindingHelper.registerKeyBinding(new KeyMapping("key.seedMap", InputConstants.KEY_M, KeyMapping.Category.GAMEPLAY));
86-
KeyMapping minimapKeyMapping = KeyBindingHelper.registerKeyBinding(new KeyMapping("key.minimap", InputConstants.KEY_COMMA, KeyMapping.Category.GAMEPLAY));
86+
KeyMapping.Category category = KeyMapping.Category.register(Identifier.fromNamespaceAndPath(MOD_ID, MOD_ID));
87+
KeyMapping seedMapKeyMapping = KeyBindingHelper.registerKeyBinding(new KeyMapping("key.seedMap", InputConstants.KEY_M, category));
88+
KeyMapping minimapKeyMapping = KeyBindingHelper.registerKeyBinding(new KeyMapping("key.minimap", InputConstants.KEY_COMMA, category));
8789
ClientTickEvents.END_CLIENT_TICK.register(minecraft -> {
8890
while (seedMapKeyMapping.consumeClick()) {
8991
minecraft.player.connection.sendCommand("sm:seedmap");

src/main/java/dev/xpple/seedmapper/config/Configs.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private static void setMinimapHeight(int height) {
120120
return toggledFeatures;
121121
});
122122

123-
public static Component listToggledFeatures() {
123+
private static Component listToggledFeatures() {
124124
return join(Component.literal(", "), ToggledFeatures.stream()
125125
.map(MapFeature::getName)
126126
.map(Component::literal));
@@ -129,7 +129,7 @@ public static Component listToggledFeatures() {
129129
@Config(comment = "getDevModeComment")
130130
public static boolean DevMode = false;
131131

132-
public static Component getDevModeComment() {
132+
private static Component getDevModeComment() {
133133
return Component.translatable("config.devMode.comment");
134134
}
135135
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"config.oreAirCheck.comment": "Whether or not SeedMapper should use in-game air checks to invalidate ore positions.",
9999
"config.devMode.comment": "Enables certain debug commands.",
100100

101+
"key.category.seedmapper.seedmapper": "SeedMapper",
101102
"key.seedMap": "Seed map",
102103
"key.minimap": "Seed minimap",
103104

0 commit comments

Comments
 (0)