mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-10 21:01:17 +01:00
Do not apply spawn location if it's a null location
This commit is contained in:
parent
c2ff8a467f
commit
ef0cb4b893
@ -1,6 +1,5 @@
|
||||
package com.onarandombox.MultiverseCore.worldnew.config;
|
||||
|
||||
import com.onarandombox.MultiverseCore.config.MVCoreConfig;
|
||||
import com.onarandombox.MultiverseCore.configuration.node.ConfigNode;
|
||||
import com.onarandombox.MultiverseCore.configuration.node.Node;
|
||||
import com.onarandombox.MultiverseCore.configuration.node.NodeGroup;
|
||||
@ -175,9 +174,10 @@ public class WorldConfigNodes {
|
||||
.name(null)
|
||||
.onSetValue((oldValue, newValue) -> {
|
||||
if (world == null) return;
|
||||
world.getBukkitWorld().peek(world -> {
|
||||
world.setSpawnLocation(newValue.getBlockX(), newValue.getBlockY(), newValue.getBlockZ());
|
||||
newValue.setWorld(world);
|
||||
if (newValue == null || newValue instanceof NullLocation) return;
|
||||
world.getBukkitWorld().peek(bukkitWorld -> {
|
||||
bukkitWorld.setSpawnLocation(newValue.getBlockX(), newValue.getBlockY(), newValue.getBlockZ());
|
||||
newValue.setWorld(bukkitWorld);
|
||||
});
|
||||
})
|
||||
.build());
|
||||
|
Loading…
Reference in New Issue
Block a user