Skip to content

Commit

Permalink
Update activity when joining a team (#2)
Browse files Browse the repository at this point in the history
Signed-off-by: Pugzy <pugzy@mail.com>
  • Loading branch information
Pugzy authored Mar 11, 2022
1 parent 903547d commit 9730f95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/tc/oc/occ/idly/IdlyListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import tc.oc.pgm.api.party.Competitor;
import tc.oc.pgm.events.PlayerPartyChangeEvent;

public class IdlyListener implements Listener {

Expand All @@ -22,6 +24,13 @@ public void onPlayerJoin(PlayerJoinEvent event) {
this.manager.logMovement(event.getPlayer());
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerPartyChange(PlayerPartyChangeEvent event) {
if (event.getNewParty() != null && event.getNewParty() instanceof Competitor) {
this.manager.logMovement(event.getPlayer().getBukkit());
}
}

@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerChatEvent(AsyncPlayerChatEvent event) {
if (config.isChatCheck()) {
Expand Down

0 comments on commit 9730f95

Please sign in to comment.