mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 12:05:13 +01:00
Use sponge world UUIDs instead of the formatted resource-key to ensure uniqueness
This commit is contained in:
parent
c289fd8c13
commit
35cbdf67d6
@ -234,7 +234,8 @@ public Optional<ServerWorld> getWorld(Object world) {
|
|||||||
|
|
||||||
if (world instanceof String) {
|
if (world instanceof String) {
|
||||||
ResourceKey resourceKey = ResourceKey.resolve((String) world);
|
ResourceKey resourceKey = ResourceKey.resolve((String) world);
|
||||||
if (resourceKey != null) world = resourceKey;
|
var serverWorld = Sponge.server().worldManager().world(resourceKey).orElse(null);
|
||||||
|
if (serverWorld != null) world = serverWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world instanceof ResourceKey) {
|
if (world instanceof ResourceKey) {
|
||||||
|
@ -63,7 +63,7 @@ public Dimension getDimension() {
|
|||||||
public Optional<String> getId() {
|
public Optional<String> getId() {
|
||||||
var world = delegate.get();
|
var world = delegate.get();
|
||||||
if (world != null) {
|
if (world != null) {
|
||||||
return Optional.of(world.key().formatted());
|
return Optional.of(world.uniqueId().toString());
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
@ -234,7 +234,8 @@ public Optional<ServerWorld> getWorld(Object world) {
|
|||||||
|
|
||||||
if (world instanceof String) {
|
if (world instanceof String) {
|
||||||
ResourceKey resourceKey = ResourceKey.resolve((String) world);
|
ResourceKey resourceKey = ResourceKey.resolve((String) world);
|
||||||
if (resourceKey != null) world = resourceKey;
|
var serverWorld = Sponge.server().worldManager().world(resourceKey).orElse(null);
|
||||||
|
if (serverWorld != null) world = serverWorld;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (world instanceof ResourceKey) {
|
if (world instanceof ResourceKey) {
|
||||||
|
@ -63,7 +63,7 @@ public Dimension getDimension() {
|
|||||||
public Optional<String> getId() {
|
public Optional<String> getId() {
|
||||||
var world = delegate.get();
|
var world = delegate.get();
|
||||||
if (world != null) {
|
if (world != null) {
|
||||||
return Optional.of(world.key().formatted());
|
return Optional.of(world.uniqueId().toString());
|
||||||
}
|
}
|
||||||
return Optional.empty();
|
return Optional.empty();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user