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.18.2, 1.19, Fabric] Compatibility with Immersive Portals #457

Closed
qouteall opened this issue Jun 14, 2022 · 8 comments
Closed

[1.18.2, 1.19, Fabric] Compatibility with Immersive Portals #457

qouteall opened this issue Jun 14, 2022 · 8 comments

Comments

@qouteall
Copy link

qouteall commented Jun 14, 2022

Currently, when used with Immersive Portals, the map will mix content of different dimensions.

Immersive Portals will switch the world when handling packets, rendering or ticking remote client dimensions. (The current version of ImmPtl switches both Minecraft#level and the client player's level field. But in the next version ImmPtl will not switch the client player's level field during ticking and packet handling)

JourneyMap can do:

  1. When the client accepts chunk data packet or chunk update packet, if Minecraft.getInstance().player.level != Minecraft.getInstance().level, ignore the packet.
  2. The client player can change dimension without reloading the client world (with loading screen). When the client player's level changes, JourneyMap should switch the map according to the player's dimension.
  3. When the map content nearby the player is empty, directly read the blocks nearby to fill the map content. (Because when player is in overworld, the nether packets are being ignored, then when the player go to nether, it should re-fill the map content)

The ideal way would be that JourneyMap load different dimensions' maps at once and discriminate them. But it may require JoruneyMap to do some refactoring.

@mysticdrew
Copy link
Member

The ideal way would be that JourneyMap load different dimensions' maps at once and discriminate them. But it may require JoruneyMap to do some refactoring.

This specifically will not happen anytime soon. The other options I will look into and gauge feasibility as long as it does not break vanilla mechanics.

@mysticdrew
Copy link
Member

mysticdrew commented Dec 13, 2022

I am working on this and have most of the issues addressed. But it seems there is a lighting issue with chunks, the lighting randomly changes it seems. Sections of chunks the lighting is randomly shifting, it's odd.

In the images below, you see some chunks are fully or half darkened.
I am still trying to diagnose the cause of this issue.

image
image
image

@mysticdrew
Copy link
Member

So the issues is with block lighting it seems.
Many of those chunks are returning 0 when they should not be because the lightengine is constantly getting updated with chunks from the other world.

Minecraft.getInstance().player.level.getLightEngine().getLayerListener(LightLayer.BLOCK).getLightValue(blockPos));

What do you suggest @qouteall ?

@mysticdrew
Copy link
Member

Also,
I am in the overworld and the player and the game world are both reporting as nether. I am not sure how I can work around this.
image

@qouteall
Copy link
Author

qouteall commented Dec 16, 2022

The player is not moved when ticking and processing remote packets. However, when rendering the portal, the player moves to the dimension that gets rendered. I am planning to change this in the future.

@qouteall
Copy link
Author

So currently you don't need to do more things for that.

@mysticdrew
Copy link
Member

Ok so, I put in a bunch of checks, I am going to mark this as complete for now. We will address anymore issues when you get your updates out with the player's level being correctly set.

I will close when I publish the release for 1.18.2 1.19.2 and 1.19.3

@qouteall
Copy link
Author

qouteall commented Dec 18, 2022

I made the change in immptl 2.4.2. (In 2.4.2 it doesn't change player world when rendering portal)

When the player is doing cross-portal block breaking/placing, it will still swtich the player world. (This is harder to change because the player level is passed into many places and requires mixin-ing many places)

It also switches player world when handling cross-portal collision.

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

No branches or pull requests

2 participants