Fix nether portal linking (#793): don't scale Y by dimension multiplier#905
Open
QueenRose4444 wants to merge 1 commit into
Open
Fix nether portal linking (#793): don't scale Y by dimension multiplier#905QueenRose4444 wants to merge 1 commit into
QueenRose4444 wants to merge 1 commit into
Conversation
… multiplier The NetherPortalBlockMixin was applying the dimension coordinate multiplier (8x for Nether->Overworld) to the Y coordinate in clampToBounds. Vanilla only scales X and Z - Y is never scaled. This caused the portal search target to have an incorrect Y position, making the game select the wrong destination portal.
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.
Fixes #793
Problem
NetherPortalBlockMixin applies the dimension coordinate multiplier (8x for Nether→Overworld, 0.125x for Overworld→Nether) to all three axes (X, Y, Z) when calculating the portal destination target position. Vanilla Minecraft only scales X and Z — the Y coordinate is never scaled by the dimension multiplier.
This causes the portal search target to have a wildly incorrect Y value (e.g., Y=118 becomes Y=944 when going Nether→Overworld), resulting in the game selecting the wrong destination portal.
Fix
Remove * multiplier from the Y coordinate in the clampToBounds call (line 31 of NetherPortalBlockMixin.java).
Tested
Verified fix resolves the issue in both singleplayer and multiplayer. Portal linking now correctly selects the closest portal by Euclidean distance, matching vanilla behavior.