Skip to content

Commit f5c22c3

Browse files
committed
feat: Don't require worldIDs to be UUIDs (fixes #22)
1 parent 9e125f4 commit f5c22c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

common/src/main/java/com/funniray/minimap/common/MinimapConfig.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
@ConfigSerializable
2020
public class MinimapConfig {
21-
public UUID worldId = UUID.randomUUID();
21+
public String worldId = UUID.randomUUID().toString();
2222
public JMConfig globalJourneymapConfig = new JMConfig();
2323
public XaerosConfig globalXaerosConfig = new XaerosConfig();
2424
@Comment("Only supports VoxelMap-Updated. See: https://github.com/funniray/minimap-control/issues/1")
@@ -46,7 +46,7 @@ public Collection<WorldConfig> getWorldConfigs() {
4646

4747
@ConfigSerializable
4848
public static class WorldConfig {
49-
public UUID worldId = UUID.randomUUID();
49+
public String worldId = UUID.randomUUID().toString();
5050
public JMWorldConfig journeymapConfig = new JMWorldConfig();
5151
public XaerosWorldConfig xaerosConfig = new XaerosWorldConfig();
5252
public VoxelWorldConfig voxelConfig = new VoxelWorldConfig();

common/src/main/java/com/funniray/minimap/common/worldinfo/WorldInfoHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public WorldInfoHandler(JavaMinimapPlugin plugin) {
2020
}
2121

2222
public void sendPacket(MinimapPlayer player) {
23-
UUID worldId;
23+
String worldId;
2424
// The entire server gets it's own worldId on 1.13
2525
// worldId on 1.12 and before is per-dimension, as bukkit reuses dimension IDs
2626
if (player.getVersion().greaterThanEqual(new Version(1,13,0))) {
@@ -31,7 +31,7 @@ public void sendPacket(MinimapPlayer player) {
3131
ByteArrayDataOutput out = ByteStreams.newDataOutput();
3232
out.writeByte(0);
3333
out.writeByte(42);
34-
NetworkUtils.writeUtf(worldId.toString(), out);
34+
NetworkUtils.writeUtf(worldId, out);
3535
player.sendPluginMessage(out.toByteArray(), WORLDINFO_CHANNEL);
3636
}
3737

0 commit comments

Comments
 (0)