Skip to content

Commit

Permalink
updated to not call listener twice and set priority to monitor
Browse files Browse the repository at this point in the history
slash bullied me into changing it <3
  • Loading branch information
sh0inx committed Nov 11, 2023
1 parent 0e258a8 commit 75a7b22
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@
import com.iridium.iridiumskyblock.IridiumSkyblock;
import org.bukkit.Bukkit;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

public class PlayerJoinListener implements Listener {

@EventHandler
@EventHandler (priority = EventPriority.MONITOR)
public void onPlayerJoin(PlayerJoinEvent event) {
IridiumSkyblock.getInstance().getTeamManager().sendIslandBorder(event.getPlayer());
}

@EventHandler
public void onServerJoin(PlayerJoinEvent event) {
if(IridiumSkyblock.getInstance().getConfiguration().islandCreateOnJoin && !event.getPlayer().hasPlayedBefore())
Bukkit.getServer().dispatchCommand(event.getPlayer(), "is create");

IridiumSkyblock.getInstance().getTeamManager().sendIslandBorder(event.getPlayer());
}
}

0 comments on commit 75a7b22

Please sign in to comment.