summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormd_5 <git@md-5.net>2017-11-07 19:32:24 +1100
committermd_5 <git@md-5.net>2017-11-07 19:32:24 +1100
commitc3047a5df70a74fc83af11aa0839d3c67d2fd48b (patch)
tree7a3b02c54f712d6eeca67790f2eaaddd84915c92
parent2fae23c2514026af765e1fcbb8002a60423305c6 (diff)
downloadcraftbukkit-c3047a5df70a74fc83af11aa0839d3c67d2fd48b.tar
craftbukkit-c3047a5df70a74fc83af11aa0839d3c67d2fd48b.tar.gz
craftbukkit-c3047a5df70a74fc83af11aa0839d3c67d2fd48b.tar.lz
craftbukkit-c3047a5df70a74fc83af11aa0839d3c67d2fd48b.tar.xz
craftbukkit-c3047a5df70a74fc83af11aa0839d3c67d2fd48b.zip
SPIGOT-3629: Greatly expand entity effect API
-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) {