Splits the PortalTeleporter into a PlayerTeleporter and a VehicleTeleporter for better structuring

Moves player-related teleportation code to PlayerTeleporter, moves vehicle-related teleportation code to VehicleTeleporter and makes them both extend the Teleporter which now contains all common teleportation code.
This commit is contained in:
2021-10-18 18:38:36 +02:00
parent f4ec5e05d6
commit 0506cf1b61
11 changed files with 512 additions and 458 deletions

View File

@ -1,9 +1,9 @@
package net.knarcraft.stargate.utility;
import net.knarcraft.stargate.Stargate;
import net.knarcraft.stargate.portal.PlayerTeleporter;
import net.knarcraft.stargate.portal.Portal;
import net.knarcraft.stargate.portal.PortalHandler;
import net.knarcraft.stargate.portal.PortalTeleporter;
import org.bukkit.entity.Player;
import java.io.ByteArrayInputStream;
@ -131,7 +131,7 @@ public final class BungeeHelper {
Stargate.logger.info(Stargate.getString("prefix") + "Bungee gate " + destination + " does not exist");
return;
}
new PortalTeleporter(destinationPortal).teleport(player, destinationPortal, null);
new PlayerTeleporter(destinationPortal, player).teleport(destinationPortal, null);
}
}