Files
purpur-ignis/src/main/java/games/dmg/spigotignis/EffectOwnership.java
T
dmg 183b6660b2
Release / release (push) Successful in 4m47s
CI / build (push) Successful in 1m13s
feat(ignis): add earned Mask crafting and invisibility
2026-09-10 21:46:16 -04:00

23 lines
874 B
Java

package games.dmg.spigotignis;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/** Server-thread ownership of this plugin's effective invisibility contribution. */
public final class EffectOwnership {
private final Set<UUID> applying = new HashSet<>();
private final Set<UUID> owned = new HashSet<>();
public void applying(UUID player, boolean active) {
if (active) applying.add(player); else applying.remove(player);
}
public void changed(UUID player, boolean actuallyChanged, boolean remainsPresent) {
if (!actuallyChanged) return;
if (remainsPresent && applying.contains(player)) owned.add(player);
else owned.remove(player);
}
public boolean owns(UUID player) { return owned.contains(player); }
public void forget(UUID player) { applying.remove(player); owned.remove(player); }
}