diff --git a/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerDeathListener.java b/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerDeathListener.java index fdfba9e..b01af1e 100644 --- a/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerDeathListener.java +++ b/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerDeathListener.java @@ -19,7 +19,6 @@ import me.lokka30.phantomworlds.PhantomWorlds; import me.lokka30.phantomworlds.misc.Utils; -import org.bukkit.Location; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.entity.PlayerDeathEvent; @@ -46,7 +45,7 @@ public void onDeath(PlayerDeathEvent event) { if(event.getEntity().getBedSpawnLocation() == null) { - event.getEntity().teleport(Utils.spawn(event.getEntity().getWorld())); + event.getEntity().teleport(Utils.parseSpawn(event.getEntity().getWorld())); } } } \ No newline at end of file diff --git a/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerJoinListener.java b/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerJoinListener.java index 4fc5a98..0288645 100644 --- a/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerJoinListener.java +++ b/src/main/java/me/lokka30/phantomworlds/listeners/player/PlayerJoinListener.java @@ -20,7 +20,6 @@ import me.lokka30.phantomworlds.PhantomWorlds; import me.lokka30.phantomworlds.misc.Utils; import org.bukkit.Bukkit; -import org.bukkit.Location; import org.bukkit.World; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; @@ -51,7 +50,7 @@ public void onJoin(PlayerJoinEvent event) { //We don't manage so send the player to the spawn world if(!event.getPlayer().hasPlayedBefore()) { - event.getPlayer().teleport(Utils.spawn(sWorld)); + event.getPlayer().teleport(Utils.parseSpawn(sWorld)); } } } \ No newline at end of file diff --git a/src/main/java/me/lokka30/phantomworlds/misc/Utils.java b/src/main/java/me/lokka30/phantomworlds/misc/Utils.java index e27f4ec..9166172 100644 --- a/src/main/java/me/lokka30/phantomworlds/misc/Utils.java +++ b/src/main/java/me/lokka30/phantomworlds/misc/Utils.java @@ -307,7 +307,7 @@ public static void teleportToWorld(@NotNull CommandSender sender, @NotNull Strin ))).send(sender); return; } - targetPlayer.teleport(spawn(world)); + targetPlayer.teleport(parseSpawn(world)); (new MultiMessage( PhantomWorlds.instance().messages.getConfig() @@ -321,7 +321,7 @@ public static void teleportToWorld(@NotNull CommandSender sender, @NotNull Strin ))).send(sender); } - public static Location spawn(final World world) { + public static Location parseSpawn(final World world) { final String cfgPath = "worlds-to-load." + world.getName() + ".spawn"; if(PhantomWorlds.instance().data.getConfig().contains(cfgPath)) { final double x = PhantomWorlds.instance().data.getConfig().getDouble(cfgPath + ".x", world.getSpawnLocation().getX());