mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-23 01:27:40 +01:00
Fix passenger check not working on versions below 1.11.2 (#3132)
This commit is contained in:
parent
b08d380643
commit
85a5e517c9
@ -6,11 +6,10 @@ import io.papermc.lib.PaperLib;
|
||||
import net.ess3.api.IEssentials;
|
||||
import net.ess3.api.ITeleport;
|
||||
import net.ess3.api.IUser;
|
||||
import net.ess3.api.events.UserWarpEvent;
|
||||
import net.ess3.api.events.UserTeleportEvent;
|
||||
import net.ess3.api.events.UserWarpEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerRespawnEvent;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
|
||||
@ -132,13 +131,11 @@ public class Teleport implements ITeleport {
|
||||
|
||||
teleportee.setLastLocation();
|
||||
|
||||
if (!teleportee.getBase().getPassengers().isEmpty()) {
|
||||
if (!teleportee.getBase().isEmpty()) {
|
||||
if (!ess.getSettings().isTeleportPassengerDismount()) {
|
||||
throw new Exception(tl("passengerTeleportFail"));
|
||||
}
|
||||
for (Entity entity : teleportee.getBase().getPassengers()) {
|
||||
entity.leaveVehicle();
|
||||
}
|
||||
teleportee.getBase().eject();
|
||||
}
|
||||
|
||||
if (LocationUtil.isBlockUnsafeForUser(teleportee, loc.getWorld(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())) {
|
||||
|
Loading…
Reference in New Issue
Block a user