Skip to content

Commit d741f41

Browse files
committed
Seed Map Button Toggle
1 parent e100b1a commit d741f41

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ This has now been implemented by upstream. They have unified both End City Ships
138138

139139
![Elytra](https://i.imgur.com/fFxoFX4.png)
140140

141+
### Hideable Seed Map Buttons
142+
Don't want those annoying buttons on your map screen? Toggle them with ```/sm:config SeedMapButtonsEnabled true/false```
143+
141144
### Export SeedMap
142145
- Added **Export JSON** button on the top right of the SeedMap screen which will export all selected locations to a JSON in the folder ```SeedMapper/exports/<Server IP>_<Seed>-<Date/Time>.json```.
143146
- Added **Export Xaero** button on the top right of the SeedMap screen which will export all selected locations into Xaero World Map waypoints for the server you're in. Disconnect from the server you're in and reconnect and the waypoints will appear in Xaero.

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ private static void setSeedMapMinPixelsPerBiome(double minPixelsPerBiome) {
306306
PixelsPerBiome = clampSeedMapZoom(PixelsPerBiome);
307307
}
308308

309+
@Config(comment = "getSeedMapButtonsEnabledComment")
310+
public static boolean SeedMapButtonsEnabled = true;
311+
private static Component getSeedMapButtonsEnabledComment() {
312+
return Component.literal("Show action buttons on the SeedMap screen (Loot Table, Export, Import Wurst).");
313+
}
314+
309315
@Config(comment = "getWorldBorderComment", setter = @Config.Setter("setWorldBorder"))
310316
public static int WorldBorder = 0;
311317

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ public void write(JsonWriter writer, MapFeature feature) throws IOException {
1515

1616
@Override
1717
public MapFeature read(JsonReader reader) throws IOException {
18-
return MapFeature.BY_NAME.get(reader.nextString());
18+
String name = reader.nextString();
19+
MapFeature feature = MapFeature.BY_NAME.get(name);
20+
// Keep config loading resilient to stale/unknown feature names from older builds.
21+
return feature != null ? feature : MapFeature.WAYPOINT;
1922
}
2023
}

src/main/java/dev/xpple/seedmapper/seedmap/SeedMapScreen.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -938,6 +938,9 @@ private void createWaypointNameField() {
938938
}
939939

940940
private void createExportButton() {
941+
if (!Configs.SeedMapButtonsEnabled) {
942+
return;
943+
}
941944
int buttonWidth = 120;
942945
int buttonHeight = 20;
943946
int buttonSpacing = 5;

0 commit comments

Comments
 (0)