feat(events): audit Low-Light Vision native lifecycle
Release / release (push) Failing after 10m47s

This commit is contained in:
dmg committed 2026-10-02 07:21:11 -04:00
1 parent d20c38a216
commit f1b4479e83
5 files changed
+205 -4

No files matched your search

@@ -876,6 +876,7 @@ public final class FantasyStickPlugin extends JavaPlugin {
eventLog::emit, Clock.systemUTC(), getDataFolder().toPath(),
failure -> getLogger().log(Level.WARNING, "Passive potion event intent failed", failure));
speedI.attachEvents(passivePotionEvents);
lowLightVision.attachEvents(passivePotionEvents);
recoveryEvents = new games.dmg.fantasystick.events.RecoveryEventBridge(
eventLog::emit, Clock.systemUTC(), getDataFolder().toPath(), sessions,
failure -> getLogger().log(Level.WARNING, "Recovery event intent failed", failure));
@@ -899,7 +899,8 @@ public final class CharacterBookController implements Consumer<ControlInput>, Au
var player=connection.getPlayer();String raw=event.getTag().string();if(raw.length()>120)return;var match=ABILITY_PAYLOAD.matcher(raw);if(!match.matches())return;String passive=match.group(2);var definition=passives.find(passive).orElse(null);if(definition==null)return;var view=passiveViews.get(player.getUniqueId());boolean owned=games.dmg.fantasystick.passive.QuickerRegenerationI.ID.equals(passive)
|| games.dmg.fantasystick.passive.QuickerRegenerationII.ID.equals(passive)
|| games.dmg.fantasystick.passive.HealthSteal.ID.equals(passive)
|| games.dmg.fantasystick.passive.SpeedI.ID.equals(passive);
|| games.dmg.fantasystick.passive.SpeedI.ID.equals(passive)
|| games.dmg.fantasystick.passive.LowLightVision.ID.equals(passive);
if (view == null || view.input().player() != player || !view.nonce().equals(match.group(1)) || !view.ids().contains(passive)
|| !passiveViews.remove(player.getUniqueId(), view) || !view.input().stillCurrent()) {if(owned)refusePassive(player,definition,unlock,"stale_forged_or_repeated_action");return;}
var audit=owned&&passiveEvents!=null?passiveEvents.begin(view.input(),view.before(),definition,unlock):null;
@@ -23,6 +23,7 @@ public final class LowLightVision implements AutoCloseable {
"Preserves unrelated Night Vision and does not change light, darkness or mob behavior."));
}
public void attachEvents(games.dmg.fantasystick.events.PassivePotionEventBridge bridge) { effect.attachEvents(bridge); }
public void install(org.bukkit.plugin.Plugin plugin) { effect.install(plugin); }
public void sweep() { effect.sweep(); }
@Override public void close() { effect.close(); }