Make unsettable properties have null name

This commit is contained in:
Ben Woo 2023-09-11 16:38:49 +08:00
parent 404a2f4183
commit c2ff8a467f
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8

View File

@ -102,7 +102,7 @@ public class WorldConfigNodes {
public final ConfigNode<World.Environment> ENVIRONMENT = node(ConfigNode
.builder("environment", World.Environment.class)
.defaultValue(World.Environment.NORMAL)
.name("environment")
.name(null)
.build());
public final ConfigNode<GameMode> GAMEMODE = node(ConfigNode.builder("gamemode", GameMode.class)
@ -112,7 +112,7 @@ public class WorldConfigNodes {
public final ConfigNode<String> GENERATOR = node(ConfigNode.builder("generator", String.class)
.defaultValue("@error") // this should be set on world creation
.name("generator")
.name(null)
.build());
public final ConfigNode<Boolean> HIDDEN = node(ConfigNode.builder("hidden", Boolean.class)
@ -167,12 +167,12 @@ public class WorldConfigNodes {
public final ConfigNode<Long> SEED = node(ConfigNode.builder("seed", Long.class)
.defaultValue(Long.MIN_VALUE)
.name("seed")
.name(null)
.build());
public final ConfigNode<Location> SPAWN_LOCATION = node(ConfigNode.builder("spawn-location", Location.class)
.defaultValue(new NullLocation())
.name("spawn-location")
.name(null)
.onSetValue((oldValue, newValue) -> {
if (world == null) return;
world.getBukkitWorld().peek(world -> {