You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deduct Covenant aura via Nature's Aura IAuraChunk; drop misleading message
User report after deploy 58e26a1: casting Ars spells produced
"Insufficient Aura: Need 20, have 1000000" (visibly contradictory)
and the bar didn't deplete.
Diagnosis from latest.log + Covenant 2.2.6 bytecode trace:
1. The misleading message came from VirtueRingHandler.onSpellResolvePost,
not from the pre-cast mixin (no DENIED warn in log). The post-resolve
handler fires after the spell already cast and shows the message
whenever SanctifiedLegacyCompat.consumeCovenantAura returns false.
2. consumeCovenantAura short-circuited to false because
covenantConsumeAuraMethod is null. The startup log confirmed:
[OK] Covenant aura reflection initialized — consume=false, ...
3. There IS no consume method on Covenant's ModUtils because Covenant's
"aura" is not a per-player resource. ResourceSyncEvents.getPlayerAuraChunk
reads ambient aura via:
IAuraChunk.triangulateAuraInArea(level, playerPos, 35)
The value belongs to the surrounding chunks (Nature's Aura's
world-aura system), not the player.
The canonical way to spend aura is to drain it from the chunks via
Nature's Aura's public IAuraChunk API. Covenant's next server tick
re-triangulates and ships a CurrentAuraSyncPacket, so the HUD bar
moves naturally.
Changes:
compat/SanctifiedLegacyCompat.java
- Add 4 new Method fields for IAuraChunk: getAuraChunk, getHighestSpot,
triangulateAuraInArea, drainAura (instance).
- New initNaturesAuraReflection() called from init() right after
initCovenantAuraReflection(). Logs OK or DEGRADED at boot.
- Rewrite consumeCovenantAura(Player, int):
* Server-side only (ServerPlayer check).
* IAuraChunk.getHighestSpot(level, playerPos, 35, playerPos)
finds the highest-aura spot in the same 35-block radius Covenant
samples from.
* IAuraChunk.getAuraChunk(level, spot) -> chunk.drainAura(spot, cost).
* Returns true iff drained > 0.
- Augment getCovenantAura(Player) with a server-context fast path
(triangulateAuraInArea). Now works on dedicated servers (where
ClientResourceData is never populated).
- Augment hasEnoughCovenantAura(Player, int) with the same fast path.
- Added a tryGetInstance() helper next to the existing tryGetStatic.
events/VirtueRingHandler.java
- onSpellResolvePost: when consumeCovenantAura returns false, log a
single WARN line and return. Do NOT show the player a chat message
("Insufficient Aura: Need X, have Y") — that text is misleading
because the spell already cast and the bar IS the canonical visual
cue (it won't move, telling the user the deduction failed).
- Success-path message ("Consumed X aura (Y remaining)") unchanged.
Build verified: ./gradlew build runs reobfJar; deployed jar 283,429 bytes.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments