From 4743fdc82954389be8086a681d0c6800d9f2aabc Mon Sep 17 00:00:00 2001 From: Sobki Date: Sat, 28 Jan 2017 09:03:13 +1000 Subject: [PATCH] EarthGrab fixes (#712) --- .../projectkorra/earthbending/EarthGrab.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java b/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java index c935e204..8a76d8f8 100644 --- a/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java +++ b/src/com/projectkorra/projectkorra/earthbending/EarthGrab.java @@ -50,6 +50,8 @@ public class EarthGrab extends EarthAbility { if (!bPlayer.canBend(this)) { return; + } else if (player.getLocation().clone().add(0, -1, 0).getBlock().getType().isTransparent()) { + return; } if (bPlayer.isAvatarState()) { @@ -217,8 +219,13 @@ public class EarthGrab extends EarthAbility { remove(); return; } + if (blockType == null) { + return; + } else if (blockByte == null) { + return; + } ParticleEffect.BLOCK_CRACK.display((ParticleEffect.ParticleData) new ParticleEffect.BlockData(blockType, blockByte), 1F, 0.1F, 1F, 0.1F, 100, loc.add(0, -1, 0), 500); - + for (Entity e : GeneralMethods.getEntitiesAroundPoint(loc, 2.5)) { if (e.getEntityId() != player.getEntityId() && e instanceof LivingEntity) { closestEntity = e;