Parts of reactor rendering in wrong world with Better Portals
Johni0702 opened this issue ยท 4 comments
Better Portals allows for see-through and loading-screen-less portals by spawning players on the server, tunneling their packets and then swapping out client state (e.g. mc.world
, mc.player
, etc.) as required during ticking and rendering.
It appears like DE does something special for rendering certain parts of its reactor which causes them to render in the wrong world (presumably because DE quite reasonably didn't expect there to be more than one).
MC: 1.12.2
DE: 2.3.23
BP: 0.2.7
Note: I haven't tried this myself, I'm just forwarding the issue here because you might have a pretty good idea about its cause.
Reactor is actually in the nether (appears to be at the same coordinates, see linked issue for more screenshots).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
It appears this happens with the Energy Core as well.
It also appears like the issue is with particle rendering, not the actual reactor components. If I can isolate the issue, I may be able to find a fix and issue a pull request.
EDIT: Either that or the shaders, or possibly both. I can't tell yet. I don't know enough about these systems to create a fix as of now.
My guess is my effect manager is not getting reset properly on world change which means the effects never get invalidated and so continue to render on the client in the new world.
I'm guessing they are not calling the world load event which is the event i use to clear the effect renderer.
Try this build. http://chickenbones.net/maven/com/brandon3055/brandonscore/BrandonsCore/1.12.2-2.4.17.209/
@brandon3055
No, you seem to be misunderstanding. The world load event is fired as usual with BP but multiple worlds are loaded at the same time, i.e. a world load event does not imply that the previous world has been unloaded, it may (and usually will) be in continued use.
While the new BrandonsCore version does remove the particles from the world in which they shouldn't be, it also removes them from the one where they should be. E.g. if the player is standing in the overworld and looks through the portal, then there won't be any particles in the nether even though there should be (https://i.johni0702.de/ZBY9u.png, third person only for getting a better angle).
The proper way to fix this is to have multiple of your effect managers, one per world (e.g. via WeakHashMap).
Or, if you must perform some cleanup which the GC won't do for you, then tie them to the EntityRenderer instance (BP re-uses those, so you'll only ever have a finite number) and do the currentWorld != mc.world
checks during RenderWorldLastEvent (the ClientTickEvent is only fired for the main world).
Out of general interest: What's the reason you aren't using the vanilla particle manager?