Implement requested changes

This commit is contained in:
Zax71 2023-09-10 10:22:13 +01:00
parent 3b7a801a0c
commit c8e1143e32
2 changed files with 12 additions and 15 deletions

View File

@ -112,21 +112,23 @@ class MVCoreConfigNodes {
.name("first-spawn-location")
.build());
public final ConfigNode<String> JOIN_DESTINATION = node(ConfigNode.builder("spawn.always-spawn-destination", String.class)
.comment("")
.comment("Sets the destination that Multiverse will use to spawn players on every login")
.comment("Set blank to disable")
.defaultValue("")
.name("always-spawn-destination")
.build());
public final ConfigNode<Boolean> ENABLE_JOIN_DESTINATION = node(ConfigNode.builder("spawn.enable-always-spawn-destination", Boolean.class)
public final ConfigNode<Boolean> ENABLE_JOIN_DESTINATION = node(ConfigNode.builder("spawn.enable-join-destination", Boolean.class)
.comment("")
.comment("Enables always-spawn-destination")
.defaultValue(false)
.name("enable-always-spawn-destination")
.name("enable-join-destination")
.build());
public final ConfigNode<String> JOIN_DESTINATION = node(ConfigNode.builder("spawn.join-destination", String.class)
.comment("")
.comment("Sets the destination that Multiverse will use to spawn players on every login")
.comment("Set enable join destination to false to disable")
.defaultValue("")
.name("join-destination")
.build());
private final ConfigHeaderNode PORTAL_HEADER = node(ConfigHeaderNode.builder("portal")
.comment("")
.comment("")

View File

@ -169,7 +169,6 @@ public class MVPlayerListener implements InjectableListener {
this.sendPlayerToDefaultWorld(player);
}
return;
} else {
Logging.finer("Player joined AGAIN!");
// Ensure the player still has permission to access the world they were in
@ -203,10 +202,7 @@ public class MVPlayerListener implements InjectableListener {
return;
}
Logging.finer("JoinDestination is " + config.getJoinDestination());
ParsedDestination<?> joinDestination = destinationsProvider.parseDestination(config.getJoinDestination());
if (joinDestination == null) {
@ -215,7 +211,6 @@ public class MVPlayerListener implements InjectableListener {
}
Location joinDestinationLocation = joinDestination.getLocation(player);
if (joinDestinationLocation == null) {
Logging.finer("Not teleporting " + player.getName() + " because joinDestination is null");
return;