Prevent clientside state mutations in QuarkTechSuite helmet #4322
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
The QuarkTechSuite helmet calls functions to modify the gamestate during both logical sides in the onArmorTick. This can cause a number of issues and is generally discouraged.
Outcome
This PR limits the mutations (food, air, negative effects) to the serverside only.
Additional Information
I ran into this when making a mixin for this bug: TerraFirmaGreg-Team/Modpack-Modern#1640
I noticed supplyFood gets called during the clientside ticks as well as the serverside ticks, and the clientside ticks can't properly check if the player is in a PlayerRevive:bleeding state or not.
While that is all a mod compatibility stuff that brings it to light the actual bug in GTm is a standalone latent bug.
I worked around the bug in TerraFirmaGreg-Team/Core-Modern#216 by checking for clientside in the mixin and not running supplyFood at all on clientside, which worked fine.