Fixed UtilEnt.isGrounded for non-player entities.
Updated UtilEnt.isGrounded(Entity) to only apply custom handling of players. Non-player entities now uses the default .isOnGround() check. Implemented to fix entities like minecart which applies custom is-on-ground checks.
This commit is contained in:
parent
99fd88473b
commit
ba171f95c6
@ -496,6 +496,11 @@ public class UtilEnt
|
||||
|
||||
public static boolean isGrounded(Entity ent)
|
||||
{
|
||||
|
||||
if(!(ent instanceof Player)) {
|
||||
return ent.isOnGround();
|
||||
}
|
||||
|
||||
AxisAlignedBB box = ((CraftEntity)ent).getHandle().boundingBox;
|
||||
Location bottom_corner_1 = new Location(ent.getWorld(), box.a, ent.getLocation().getY()-0.1, box.c);
|
||||
Location bottom_corner_2 = new Location(ent.getWorld(), box.d, ent.getLocation().getY()-0.1, box.f);
|
||||
|
@ -1,8 +1,19 @@
|
||||
package mineplex.core.mount.types;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
|
||||
import mineplex.core.common.util.F;
|
||||
import mineplex.core.common.util.UtilAction;
|
||||
import mineplex.core.common.util.UtilAlg;
|
||||
import mineplex.core.common.util.UtilEnt;
|
||||
import mineplex.core.common.util.UtilMath;
|
||||
import mineplex.core.common.util.UtilPlayer;
|
||||
import mineplex.core.mount.Mount;
|
||||
@ -11,17 +22,6 @@ import mineplex.core.recharge.Recharge;
|
||||
import mineplex.core.updater.UpdateType;
|
||||
import mineplex.core.updater.event.UpdateEvent;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.Sound;
|
||||
import org.bukkit.craftbukkit.v1_7_R4.entity.CraftMinecart;
|
||||
import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.entity.EntityTargetEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.vehicle.VehicleDamageEvent;
|
||||
|
||||
public class MountCart extends Mount<Minecart>
|
||||
{
|
||||
public MountCart(MountManager manager)
|
||||
@ -110,12 +110,9 @@ public class MountCart extends Mount<Minecart>
|
||||
if (cart.getPassenger() == null)
|
||||
continue;
|
||||
|
||||
if (!((CraftMinecart) cart).getHandle().onGround)
|
||||
if (!UtilEnt.isGrounded(cart))
|
||||
continue;
|
||||
|
||||
// if (!UtilEnt.isGrounded(cart))
|
||||
// continue;
|
||||
|
||||
if (!(cart.getPassenger() instanceof Player))
|
||||
continue;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user