Closed qouteall closed 3 years ago
I copied the code(with modification) rather than just calling the teleport method to avoid a few of its functions(end credits and end platform for example).
I could instead look into mixing in and disabling these calls when doing a custom teleportation
moveToWorld
generates obsidian platform but teleport
does not. And teleport
does triggers dimension travel credit but won't wrongly trigger the end credit. The teleport
is being used for /tp
command and is safe to use
Ah I did not know ServerPlayerEntity
had a different overload of teleport
, I only saw it's implementation in Entity
. I will certainly use that, do you need entities other than players to also use the vanilla moveToWorld
, or would my own teleportation logic be okay for that?
I've implemented and uploaded the change to using teleport
in beta-25
The non-player entity teleporting code should be fine
IP has injection to
moveToWorld
andteleport
method to do the chunk tracking update, but custom portal api uses its own teleportation code so that it has an issue with IP (when coming back the chunks won't load). And IP's convert conventional portal functionality(https://qouteall.fun/immptl/wiki/Datapack-Based-Custom-Portal-Generation) is also not triggered. It's recommended to replace this vanilla copy code https://github.com/kyrptonaught/customportalapi/blob/main/src/main/java/net/kyrptonaught/customportalapi/util/CustomTeleporter.java#L58 withServerPlayerEntity
'steleport
method. Doing this cleans up the code and makes it compatible with IP.