From 232bc98881ac4b40e40c05add35bc885c4b55a1c Mon Sep 17 00:00:00 2001 From: Sergey Shatunov Date: Sun, 14 Feb 2016 22:46:12 +0700 Subject: [PATCH] Implement deprecated get/set shooter bukkit's methods fix #368 --- src/main/java/kcauldron/entity/CustomProjectileEntity.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/kcauldron/entity/CustomProjectileEntity.java b/src/main/java/kcauldron/entity/CustomProjectileEntity.java index b758fcc..ed9c7a9 100644 --- a/src/main/java/kcauldron/entity/CustomProjectileEntity.java +++ b/src/main/java/kcauldron/entity/CustomProjectileEntity.java @@ -18,7 +18,9 @@ public class CustomProjectileEntity extends CraftCustomEntity implements Project @Override public LivingEntity _INVALID_getShooter() { - throw new IllegalStateException("Not implemented!"); + if (shooter instanceof LivingEntity) + return (LivingEntity) shooter; + return null; } @Override @@ -28,7 +30,7 @@ public class CustomProjectileEntity extends CraftCustomEntity implements Project @Override public void _INVALID_setShooter(LivingEntity shooter) { - throw new IllegalStateException("Not implemented!"); + this.shooter = shooter instanceof ProjectileSource ? (ProjectileSource) shooter : null; } @Override