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;
|
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.ConfigNode;
|
||||||
import com.onarandombox.MultiverseCore.configuration.node.Node;
|
import com.onarandombox.MultiverseCore.configuration.node.Node;
|
||||||
import com.onarandombox.MultiverseCore.configuration.node.NodeGroup;
|
import com.onarandombox.MultiverseCore.configuration.node.NodeGroup;
|
||||||
@ -175,9 +174,10 @@ public class WorldConfigNodes {
|
|||||||
.name(null)
|
.name(null)
|
||||||
.onSetValue((oldValue, newValue) -> {
|
.onSetValue((oldValue, newValue) -> {
|
||||||
if (world == null) return;
|
if (world == null) return;
|
||||||
world.getBukkitWorld().peek(world -> {
|
if (newValue == null || newValue instanceof NullLocation) return;
|
||||||
world.setSpawnLocation(newValue.getBlockX(), newValue.getBlockY(), newValue.getBlockZ());
|
world.getBukkitWorld().peek(bukkitWorld -> {
|
||||||
newValue.setWorld(world);
|
bukkitWorld.setSpawnLocation(newValue.getBlockX(), newValue.getBlockY(), newValue.getBlockZ());
|
||||||
|
newValue.setWorld(bukkitWorld);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.build());
|
.build());
|
||||||
|
Loading…
Reference in New Issue
Block a user