mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2026-11-04 08:42:11 -05:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d34f3adccc | ||
|
|
b3862faf88 | ||
|
|
a41476de89 | ||
|
|
fe75e497e4 |
No files matched your search
@@ -16,6 +16,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
import com.dumptruckman.minecraft.util.Logging;
|
||||
import com.google.common.base.Strings;
|
||||
import io.papermc.lib.PaperLib;
|
||||
import io.vavr.control.Option;
|
||||
import io.vavr.control.Try;
|
||||
import jakarta.inject.Inject;
|
||||
@@ -379,7 +380,7 @@ public final class WorldManager {
|
||||
// Properties from the bukkit world
|
||||
worldConfig.setDifficulty(world.getDifficulty());
|
||||
worldConfig.setKeepSpawnInMemory(world.getKeepSpawnInMemory());
|
||||
worldConfig.setScale(world.getCoordinateScale());
|
||||
worldConfig.setScale(getCoordinateScale(world));
|
||||
|
||||
worldConfig.save();
|
||||
|
||||
@@ -398,6 +399,17 @@ public final class WorldManager {
|
||||
return loadedWorld;
|
||||
}
|
||||
|
||||
private double getCoordinateScale(World world) {
|
||||
if (PaperLib.isPaper()) {
|
||||
return world.getCoordinateScale();
|
||||
}
|
||||
return switch (world.getEnvironment()) {
|
||||
case NORMAL -> 1;
|
||||
case NETHER -> 8;
|
||||
default -> 1;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads an existing world in config.
|
||||
*
|
||||
|
||||
@@ -167,20 +167,12 @@ public final class SpawnCategoryConfig {
|
||||
final ConfigNode<Integer> tickRate = node(ConfigNode.builder("tick-rate", Integer.class)
|
||||
.defaultValue(-1)
|
||||
.suggester(input -> List.of("-1", "10", "100", "400", "1000"))
|
||||
.validator(input -> config.getApplyEntitySpawnRate()
|
||||
? Try.success(null)
|
||||
: Try.failure(new IllegalStateException("Cannot set tick rate as 'apply-entity-spawn-rate' is false in config. " +
|
||||
"You can re-enable this option with '/mv config set apply-entity-spawn-rate true' command.")))
|
||||
.onSetValue((oldValue, newValue) -> applyConfigToWorld())
|
||||
.build());
|
||||
|
||||
final ConfigNode<Integer> spawnLimit = node(ConfigNode.builder("spawn-limit", Integer.class)
|
||||
.defaultValue(-1)
|
||||
.suggester(input -> List.of("-1", "10", "100", "400", "1000"))
|
||||
.validator(input -> config.getApplyEntitySpawnLimit()
|
||||
? Try.success(null)
|
||||
: Try.failure(new IllegalStateException("Cannot set spawn limit as 'apply-entity-spawn-limit' is false in config. " +
|
||||
"You can re-enable this option with '/mv config set apply-entity-spawn-limit true' command.")))
|
||||
.onSetValue((oldValue, newValue) -> applyConfigToWorld())
|
||||
.build());
|
||||
|
||||
|
||||
Reference in new issue
Block a user