Skip to content

Commit

Permalink
Fix for #162
Browse files Browse the repository at this point in the history
  • Loading branch information
lewmilburn committed Oct 4, 2024
1 parent a39ff19 commit 1c5d875
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/main/java/net/lewmc/essence/events/JoinEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ public void onPlayerJoin(PlayerJoinEvent event) {
if (plugin.getConfig().getBoolean("motd.enabled")) { this.motd(event); }

if (plugin.getConfig().getBoolean("teleportation.spawn.always-spawn") || firstJoin) {
this.spawn(event, log);
try {
this.spawn(event, log);
} catch (Exception e) {
log.severe("Unknown exception: " + e.getMessage());
}
}

if (this.plugin.hasPendingUpdate) {
Expand Down Expand Up @@ -101,8 +105,9 @@ private void spawn(PlayerJoinEvent event, LogUtil log) {

if (spawnConfiguration.get("spawn") == null) {
if (Bukkit.getServer().getWorld(spawnName) == null) {
WorldCreator creator = new WorldCreator(spawnName);
creator.createWorld();
message.send("spawn", "notexist");
log.severe("The spawn world does not exist. Please check your Essence configuration.");
return;
}
if (Bukkit.getServer().getWorld(spawnName) != null && Bukkit.getServer().getWorld(spawnName).getSpawnLocation() != null) {
TeleportUtil tp = new TeleportUtil(plugin);
Expand Down

0 comments on commit 1c5d875

Please sign in to comment.