Changes a lot of teleportation code to be able to teleport entities with passengers

Moves some teleportation code to the TeleportHelper class
Changes some teleportation method names
Tries to reduce some code duplication between teleporters
Recursively teleports entities to make sure the teleported entity will arrive in the same shape it entered as
Makes player checks for teleported vehicles account for any number of players riding any entity in the stack
This commit is contained in:
2022-01-28 23:23:09 +01:00
parent 95293204d5
commit 7f08763624
9 changed files with 407 additions and 353 deletions

View File

@ -190,7 +190,7 @@ public final class BungeeHelper {
}
//Teleport the player back to this gate, for sanity's sake
new PlayerTeleporter(entrancePortal, player).teleport(entrancePortal, event);
new PlayerTeleporter(entrancePortal, player).teleportPlayer(entrancePortal, event);
//Send the SGBungee packet first, it will be queued by BC if required
if (!BungeeHelper.sendTeleportationMessage(player, entrancePortal)) {