journeymap icon indicating copy to clipboard operation
journeymap copied to clipboard

[1.18.2, 1.19, Fabric] Compatibility with Immersive Portals

Open qouteall opened this issue 3 years ago • 1 comments

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.

qouteall avatar Jun 14 '22 16:06 qouteall

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 avatar Jun 20 '22 17:06 mysticdrew

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 avatar Dec 13 '22 23:12 mysticdrew

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 avatar Dec 15 '22 15:12 mysticdrew

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

mysticdrew avatar Dec 15 '22 21:12 mysticdrew

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 avatar Dec 16 '22 12:12 qouteall

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

qouteall avatar Dec 16 '22 12:12 qouteall

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

mysticdrew avatar Dec 18 '22 01:12 mysticdrew

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.

qouteall avatar Dec 18 '22 01:12 qouteall