diff --git a/src/main/java/net/knarcraft/stargate/portal/Portal.java b/src/main/java/net/knarcraft/stargate/portal/Portal.java index 2f476c8..7df9f4e 100644 --- a/src/main/java/net/knarcraft/stargate/portal/Portal.java +++ b/src/main/java/net/knarcraft/stargate/portal/Portal.java @@ -25,11 +25,10 @@ import org.bukkit.block.data.BlockData; import org.bukkit.block.data.Orientable; import org.bukkit.block.data.type.Slab; import org.bukkit.entity.AbstractHorse; -import org.bukkit.entity.Boat; import org.bukkit.entity.Entity; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.entity.Vehicle; -import org.bukkit.entity.minecart.RideableMinecart; import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.util.Vector; @@ -552,7 +551,7 @@ public class Portal { loadChunks(); if (!passengers.isEmpty()) { - if (vehicle instanceof RideableMinecart || vehicle instanceof Boat) { + if (!(vehicle instanceof LivingEntity)) { World vehicleWorld = exit.getWorld(); if (vehicleWorld == null) { Stargate.logger.warning(Stargate.getString("prefix") + @@ -584,7 +583,11 @@ public class Portal { } /** - * Creates a new vehicle equal to the player's previous vehicle and + * Creates a new vehicle equal to the player's previous vehicle and puts any passengers inside + * + *
While it is possible to teleport boats and minecarts using the same methods as "teleportLivingVehicle", this + * method works better with CraftBook with minecart options enabled. Using normal teleportation, CraftBook destroys + * the minecart once the player is ejected, causing the minecart to disappear and the player to teleport without it.
* * @param vehicleThe player's old vehicle
* @param passengersA list of all passengers in the vehicle