Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.20.4] Some Immersive Portals Fixes #256

Open
wants to merge 2 commits into
base: Multiloader-1.20.4
Choose a base branch
from

Conversation

hammy275
Copy link
Contributor

@hammy275 hammy275 commented Feb 24, 2024

Port to 1.20.4 of #246 with the not-really-working rendering fixes not included.

This PR fixes a few issues with Immersive Portals while still leaving some behind:

  • Fixes teleportation failing when positions don't line up between dimensions.
  • Fixes the "head stuck in block" effect when rendering an ImmersivePortals portal.

Issues that still remain:

  • Portals that change player orientation still don't work. Considering the vanilla /tp command also can't rotate the player, I don't consider this to be a showstopper. Will likely open an issue for this at some point.
  • The game renders the portal on the opposite side in the dimension being traveled from when the eye has crossed the dimension boundary but the player hasn't (or vice-versa). The actual result of this is effectively a "flash" in your vision during the traversal, or seeing the wrong side of the portal in one eye if you are standing on the boundary.
  • Hotswapping out of VR effectively breaks a large amount of rendering. Leaving and re-joining the world fixes this, and hotswapping into VR does not cause the same issue.

What makes this PR so hack-y:

  • Mixing into ImmersivePortals probably isn't great, especially with how different their internals can be between versions. These fixes work for Minecraft 1.20.1, but likely will NOT work for Minecraft 1.18.2.

From testing, this does not cause any issues in an environment without ImmersivePortals.

To test this PR, in the build.gradle for the modloader, flip the modCompileOnly for ImmersivePortals to modApi, then add the following lines:

modApi("com.github.iPortalTeam:DimLib:v1.0.2-mc1.20.4") {
        exclude(group: "net.fabricmc.fabric-api")
    }

If wanted, I can include some or all of these changes in the PR, however they aren't at the moment.

@Techjar
Copy link
Collaborator

Techjar commented Feb 26, 2024

With how hacky and constantly-changing some of this Immersive Portals compatibility stuff is, I'm thinking it might almost be better to just distribute as its own "extension" mod (if possible). That way it can be updated as needed, independently of the Vivecraft version.

I dunno though, maybe it's too heavily integrated with Vivecraft's rendering for that to make any sense.

@hammy275
Copy link
Contributor Author

To my knowledge, it hasn't really changed that much. Only reason I closed #246 for this was to have it be based on 1.20.4 instead of 1.20.1. Code is identical between the two, though I know for older Minecraft versions, there were pretty major changes.

I don't have much knowledge on the compat for ImmersivePortals that was written before this, so I don't know how much effort that's taken to port between versions, nor how deeply it integrates with Vivecraft. This effort is really just a Mixin into ImmersivePortals and a slight modification to to use Player#level instead of Minecraft#level in one of Vivecraft's functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants