mirror of
https://github.com/Brettflan/WorldBorder.git
synced 2025-01-09 09:27:38 +01:00
Fix for error on border crossing if player is riding on something which is not classifiable as a Vehicle (as only provided by another plugin, presumably, like one that makes wolves ride-able)
This commit is contained in:
parent
6a55b0be45
commit
59cba09a35
@ -2,8 +2,8 @@ package com.wimbli.WorldBorder;
|
|||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Effect;
|
import org.bukkit.Effect;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.entity.Vehicle;
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.Server;
|
import org.bukkit.Server;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
@ -65,7 +65,7 @@ public class BorderCheckTask implements Runnable
|
|||||||
player.teleport(newLoc);
|
player.teleport(newLoc);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Vehicle ride = (Vehicle)player.getVehicle();
|
Entity ride = player.getVehicle();
|
||||||
if (ride != null)
|
if (ride != null)
|
||||||
{ // vehicles need to be offset vertically and have velocity stopped
|
{ // vehicles need to be offset vertically and have velocity stopped
|
||||||
double vertOffset = ride.getLocation().getY() - loc.getY();
|
double vertOffset = ride.getLocation().getY() - loc.getY();
|
||||||
|
Loading…
Reference in New Issue
Block a user