Files
purpur-fantasy-stick/src/main/java/games/dmg/fantasystick/party/PartyEvents.java
T
dmg 58d5ea82f1
Release / release (push) Successful in 8m24s
CI / build (push) Successful in 4m21s
feat(parties): complete book parties and native damage protection
Complete US-012 with consent-based player parties, lifecycle rules, session-bound book controls and current-session native damage protection. Preserve the existing approved inventory/input and read-only book prerequisites without claiming their broader stories complete.

Verify 516 tests with clean and versioned builds; scoped Semgrep and npm audit report no findings. No deployment changes.
2026-09-19 10:37:02 -04:00

18 lines
812 B
Java

package games.dmg.fantasystick.party;
import java.util.Objects;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerQuitEvent;
/** Quit is authoritative even before Bukkit's online flag changes. */
public final class PartyEvents implements Listener {
private final PartyRoster parties;
public PartyEvents(PartyRoster parties) { this.parties = Objects.requireNonNull(parties); }
@EventHandler(priority = EventPriority.MONITOR)
public void join(org.bukkit.event.player.PlayerJoinEvent event) { parties.arrive(event.getPlayer().getUniqueId()); }
@EventHandler(priority = EventPriority.MONITOR)
public void quit(PlayerQuitEvent event) { parties.disconnect(event.getPlayer().getUniqueId()); }
}