ESSX Discord: Added a check for announceAdvancements gamerule #4866
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.
Information
This PR fixes #4865.
Details
Proposed fix:
Added a check for the player's current world's announceAdvancements gamerule in the advancements listener to prevent the message from being sent if that gamerule is disabled for the world.
Environments tested:
OS: Windows 10 for client, assuming some version of Ubuntu LTS for the server (server provider doesn't specify, so assuming the same as what they run for VPS services)
Java version: Built on openjdk 17.0.1, ran on unknown version of Java 17 (server provider doesn't specify beyond 17)
Demonstration:
Before fix, while testing the gamerule
(Only the first one should've been sent, the rest are erroneous from the advancement being automatically revoked)
After fix, only one advancement sent, even after completing the criteria multiple times in a world with announceAdvancements disabled.