Skip to content

Commit

Permalink
Implement event priority
Browse files Browse the repository at this point in the history
Fixes a bug where the cached discord user is not found on the join and leave event from other plugins
  • Loading branch information
Pequla committed Jun 13, 2022
1 parent b262744 commit fb39dc8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.pequla</groupId>
<artifactId>little-link</artifactId>
<version>1.1</version>
<version>1.2</version>
<packaging>jar</packaging>

<name>LittleLink</name>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/pequla/link/LittleLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ public void handlePlayerLogin(PlayerLoginEvent event) {
String role = getConfig().getString("role");
DataModel data = DataService.getInstance().getLinkData(uuid, guild, role);
playerData.put(player.getUniqueId(), data);
getLogger().info("Player " + player.getName() + " joined as " + data.getName());
getLogger().info("Player " + player.getName() + " authenticated as " + data.getName());
} catch (Exception e) {
event.disallow(PlayerLoginEvent.Result.KICK_OTHER,
e.getClass().getSimpleName() + ": " + e.getMessage());
}
}

@EventHandler
@EventHandler(priority = EventPriority.LOWEST)
public void handlePlayerQuit(PlayerQuitEvent event) {
playerData.remove(event.getPlayer().getUniqueId());
}
Expand Down

0 comments on commit fb39dc8

Please sign in to comment.