summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
index 700c0072..8477337b 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
@@ -436,8 +436,13 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return entity;
}
+ @Override
public void playEffect(EntityEffect type) {
- this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
+ Preconditions.checkArgument(type != null, "type");
+
+ if (this.getClass().isAssignableFrom(type.getApplicable())) {
+ this.getHandle().world.broadcastEntityEffect(getHandle(), type.getData());
+ }
}
public void setHandle(final Entity entity) {