Do not obfuscate air#4149
Merged
Merged
Conversation
kashike
approved these changes
Aug 20, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
For further details about the issue see #4123 (comment) and #4123 (comment). This line prevents
flagDirtyfrom being invoked for blocks with negative y values, which throws anArrayIndexOutOfBoundsExceptionin 1.16.2. However,flagDirtyis invoked if the arrayobfuscateGlobalis true for air. This is the case, when air is either added tohidden-blocksorreplacement-blocksin engine-mode 2. This commit does not prevent adding air to thehidden-blockslist (as I often suggest) and thus being added to the chunk, but rather prevents "covered" air from being replaced (obfuscated) by other blocks, which makes no sense at all. In other words air isn't set to true in theobfuscateGlobalarray, which prevents air from being replaced and prevents unnecessary block updates for air blocks (including the failing void block updates in 1.16.2).Actually the same issue also exists in versions before 1.16.2 but without throwing an exception. Thus it might be a good idea to also apply these changes to other supported versions.