Skip to content

Commit

Permalink
Added check for if a player has a bed spawn
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasDeBruijn committed Jan 2, 2022
1 parent 55c47f8 commit 7469bf7
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerRespawnEvent;
import org.bukkit.scheduler.BukkitRunnable;
Expand All @@ -20,8 +21,12 @@ public PlayerRespawnEventListener(ReSpawn module) {
this.module = module;
}

@EventHandler
public void onPlayerRespawnEvent(PlayerRespawnEvent event) {
@EventHandler(priority = EventPriority.HIGH)
public void onPlayerRespawnEvent(PlayerRespawnEvent event) {
if(event.getPlayer().getBedSpawnLocation() == null) {
return;
}

String spawnPos = (String) this.module.getModuleFileHandler().getModuleConfiguration().getValue("spawnPos");
if(spawnPos == null) {
return;
Expand Down

0 comments on commit 7469bf7

Please sign in to comment.