From 56d5c1048170a6911f5e92b4c5e7dc293835471e Mon Sep 17 00:00:00 2001 From: NewGarbo Date: Thu, 26 Nov 2015 07:29:59 +0000 Subject: [PATCH] oops util ent new method didn't commit in last commit --- .../src/mineplex/core/common/util/UtilEnt.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java index 6d5867e27..602b5d974 100644 --- a/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java +++ b/Plugins/Mineplex.Core.Common/src/mineplex/core/common/util/UtilEnt.java @@ -541,6 +541,18 @@ public class UtilEnt } return false; } + + public static boolean isGrounded(Entity ent, Location loc) + { + AxisAlignedBB box = ((CraftEntity)ent).getHandle().getBoundingBox(); + Location bottom_corner_1 = new Location(ent.getWorld(), box.a, loc.getY()-0.1, box.c); + Location bottom_corner_2 = new Location(ent.getWorld(), box.d, loc.getY()-0.1, box.f); + + for(Block b : UtilBlock.getInBoundingBox(bottom_corner_1, bottom_corner_2)){ + if(UtilBlock.solid(b)) return true; + } + return false; + } public static void PlayDamageSound(LivingEntity damagee) {