baileyholl / Ars-Nouveau

Repository for the Ars Nouveau minecraft mod. https://www.curseforge.com/minecraft/mc-mods/ars-nouveau
https://www.curseforge.com/minecraft/mc-mods/ars-nouveau
Other
181 stars 108 forks source link

fix: ignore frozen ticks in EventQueue #1416

Closed Vonr closed 2 months ago

Vonr commented 2 months ago

1.21 adds /tick, which allows you to freeze the game.

NeoForge will fire ServerTickEvent.Post regardless of whether the game is frozen.

We also can not observe the effects of a one-tick tick step in ServerTickEvent.Post, so we need to hook into ServerTickEvent.Pre to find out if it was stepping.

Vonr commented 2 months ago

also added a fix to prevent events added to the queue while ticking the events in the queue from being executed in the same tick. this caused DelayedSpellEvent appearing to last 1 tick shorter when it isnt the first DelayedSpellEvent fired by the spell.