BetterPortals

BetterPortals

1M Downloads

[Draconic Evolution] - Portal / Teleportation

ShiroSFX opened this issue ยท 1 comments

commented

Hello,

I tested your mod with the mod Draconic Evolution and with all the teleport way, i've the same bug.

Tested : Dislocator and Portal.
Not tested : Advanced Dislocator but i think it's the same.

I've already checked this issue #455 .
But it's not possible to make a system that disable BP for DE ?
Or create a blacklist or something similar ?

Otherwise, good job :)

commented

No, this needs to be fixed in DE.

BP needs to unload all but the main world whenever you use a third-party teleporter, or the be more precise, shortly before you use a third-party teleporter. It needs to do this because the third-party teleporter is usually not aware that there are multiple worlds loaded on the client and will only unload the primary one before loading its destination. As a result, if its destination was already loaded before the teleport (e.g. because of a portal), then it would now be loaded twice, hence why BP must unload all but the main world before the third-party teleporter does its thing.
This should explain why "disabling BP for DE" or a blacklist doesn't work: It's not that BP does additional stuff which breaks. It breaks because it does not do a specific thing (the unloading).

Now, why does it not do that thing? Well, normally, BP dynamically (i.e. each time the game starts) modifies a specific part of MC's code and adds its unloading code there. Most mods then as part of their teleporter, call that part of MC's code, which gives BP a chance to do its thing.

The issue with DE is that they just made a verbatim copy of a good chunk of MC's code, including the part which BP hooks into. So even though BP hooks into the specific part of MC's code as usual, DE just never calls that and switches dimension anyway. BP eventually detects that (but after DE's code has ran, so it's too late) and decides it's better to fail fast than to continue at the risk of world corruption or who-knows-what.

While I could change BP to hook into DE's copy as well (and I have done so for Sponge), I don't think that's a good idea because it's a huge maintenance burden (especially once I start working around bugs other mods as well), there's really no good reason for DE to copy the code instead of calling the original (whereas Sponge had a very valid reason to do so), and it should be fairly easy to fix in DE (easier even than to add the workaround to BP).