From 99862ecf064e50a818b1a3b9bcdb3c7f14578146 Mon Sep 17 00:00:00 2001 From: fullwall Date: Sat, 5 Apr 2014 15:28:39 +0800 Subject: [PATCH] Player skin changes --- src/main/java/net/citizensnpcs/trait/Controllable.java | 3 ++- src/main/java/net/citizensnpcs/trait/PlayerSkin.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/citizensnpcs/trait/Controllable.java b/src/main/java/net/citizensnpcs/trait/Controllable.java index 5788a0133..dd81d22fc 100644 --- a/src/main/java/net/citizensnpcs/trait/Controllable.java +++ b/src/main/java/net/citizensnpcs/trait/Controllable.java @@ -162,7 +162,8 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab @Override public void run() { - if (!enabled || !npc.isSpawned() || getHandle().passenger == null) + if (!enabled || !npc.isSpawned() || getHandle().passenger == null + || !(getHandle().passenger.getBukkitEntity() instanceof Player)) return; controller.run((Player) getHandle().passenger.getBukkitEntity()); } diff --git a/src/main/java/net/citizensnpcs/trait/PlayerSkin.java b/src/main/java/net/citizensnpcs/trait/PlayerSkin.java index fd216bac6..721647fdb 100644 --- a/src/main/java/net/citizensnpcs/trait/PlayerSkin.java +++ b/src/main/java/net/citizensnpcs/trait/PlayerSkin.java @@ -104,7 +104,7 @@ public class PlayerSkin extends Trait { if (entity instanceof LivingEntity) { LivingEntity le = (LivingEntity) entity; le.setRemainingAir(20); - if (!le.hasPotionEffect(PotionEffectType.INVISIBILITY)) { + if (!(le instanceof Slime) && !le.hasPotionEffect(PotionEffectType.INVISIBILITY)) { ((LivingEntity) entity).addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, 20 * 60 * 60 * 24 * 7, 1)); }