last_one_core-1.6.1
Curse Maven Snippet
What's new
1.6.1
- Fix every KubeJS script and mod that changes damage through
LivingHurtEvent.amountsilently doing nothing while Confluence is installed. PortLib - mandatory for Confluence 1.2.5 and newer - ports NeoForge 1.21's damage pipeline onto 1.20.1:LivingEntity#hurtpushes aPortDamageContainerand firesPortLivingIncomingDamageEvent, andLivingEntity#actuallyHurtwraps thegetDamageAfterArmorAbsorbcall so its result is replaced withcontainer.getNewDamage().ForgeHooks#onLivingHurtstill runs right before that wrap, so the event fires,event.getAmount()reads back exactly what a listener wrote, and logging, particles and every other side effect still happen - but the value itself is discarded one line later, which is why a crit script can print its new number and the mob still loses the same health. Confluence itself never touchesLivingHurtEvent(its damage logic sits onPortLivingIncomingDamageEvent,PortLivingDamageEventandProcessCriticalDamageEvent); the overwrite belongs to PortLib's container.[portLibDamageBridge] enabled(default on) records the amount the event starts with atHIGHESTpriority and, atLOWEST, applies that ratio to the container's current damage, so scaling keeps whatever PortLib listeners already did to the container (boss damage multipliers and the like) instead of replacing it, and the armor step that follows reduces the corrected value as usual. Cancelled events and events nobody changed are skipped, aNaNsentinel keeps capture and apply paired when the toggle is edited at runtime, nested damage is tracked on a per-thread stack with the event reference as a pairing check, and the bridge no-ops when PortLib is absent or the damage path carries no container. The cost is one field read and one float write per damage event, with no reflection and no allocation. Disabling the toggle restores PortLib's original behaviour, whereLivingHurtEventchanges have no effect.
This mod has no additional files