Skip to content

Commit d34f3ad

Browse files
authored
Merge pull request #3366 from Multiverse/fix/coordinate-scale
Fix spigot compatibility with getCoordinateScale
2 parents a41476d + b3862fa commit d34f3ad

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/main/java/org/mvplugins/multiverse/core/world/WorldManager.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import com.dumptruckman.minecraft.util.Logging;
1818
import com.google.common.base.Strings;
19+
import io.papermc.lib.PaperLib;
1920
import io.vavr.control.Option;
2021
import io.vavr.control.Try;
2122
import jakarta.inject.Inject;
@@ -379,7 +380,7 @@ private LoadedMultiverseWorld newLoadedMultiverseWorld(
379380
// Properties from the bukkit world
380381
worldConfig.setDifficulty(world.getDifficulty());
381382
worldConfig.setKeepSpawnInMemory(world.getKeepSpawnInMemory());
382-
worldConfig.setScale(world.getCoordinateScale());
383+
worldConfig.setScale(getCoordinateScale(world));
383384

384385
worldConfig.save();
385386

@@ -398,6 +399,17 @@ private LoadedMultiverseWorld newLoadedMultiverseWorld(
398399
return loadedWorld;
399400
}
400401

402+
private double getCoordinateScale(World world) {
403+
if (PaperLib.isPaper()) {
404+
return world.getCoordinateScale();
405+
}
406+
return switch (world.getEnvironment()) {
407+
case NORMAL -> 1;
408+
case NETHER -> 8;
409+
default -> 1;
410+
};
411+
}
412+
401413
/**
402414
* Loads an existing world in config.
403415
*

0 commit comments

Comments
 (0)