diff options
author | md_5 <git@md-5.net> | 2016-04-26 09:35:17 +1000 |
---|---|---|
committer | md_5 <git@md-5.net> | 2016-04-26 09:35:17 +1000 |
commit | 935f18b476b31523b8f01560ada487ec1bea6b3c (patch) | |
tree | cbef8ba2563c3b83e165f3930ba1e39cf1b465a4 /src/main/java/org | |
parent | 4377b86b29aca85a0c6f3e310613330a847a6ab3 (diff) | |
download | craftbukkit-935f18b476b31523b8f01560ada487ec1bea6b3c.tar craftbukkit-935f18b476b31523b8f01560ada487ec1bea6b3c.tar.gz craftbukkit-935f18b476b31523b8f01560ada487ec1bea6b3c.tar.lz craftbukkit-935f18b476b31523b8f01560ada487ec1bea6b3c.tar.xz craftbukkit-935f18b476b31523b8f01560ada487ec1bea6b3c.zip |
SPIGOT-2206: playEffect doesn't accept sub classes of the expected data type
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2be8a568..04e99b1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -863,7 +863,7 @@ public class CraftWorld implements World { public <T> void playEffect(Location loc, Effect effect, T data, int radius) { if (data != null) { - Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!"); + Validate.isTrue(effect.getData() != null && effect.getData().isAssignableFrom(data.getClass()), "Wrong kind of data for this effect!"); } else { Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index cf307e59..681cc9b4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -322,7 +322,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public <T> void playEffect(Location loc, Effect effect, T data) { if (data != null) { - Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!"); + Validate.isTrue(effect.getData() != null && effect.getData().isAssignableFrom(data.getClass()), "Wrong kind of data for this effect!"); } else { Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); } |