From 21f51e5f5b3f7f64f58b86e06199125cd6ff2de4 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 18 Oct 2015 19:40:00 +1100 Subject: [PATCH] SPIGOT-1235: Correctly validate MaterialData for playEffect. Thanks Jikoo for the report / fix. By: md_5 --- .../src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 2 +- .../main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 2bbbdd377..d4c1a1233 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -826,7 +826,7 @@ public class CraftWorld implements World { public void playEffect(Location loc, Effect effect, T data, int radius) { if (data != null) { - Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!"); + Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!"); } else { Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 40f52f1ec..bffb03898 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -325,7 +325,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @Override public void playEffect(Location loc, Effect effect, T data) { if (data != null) { - Validate.isTrue(data.getClass().equals(effect.getData()), "Wrong kind of data for this effect!"); + Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!"); } else { Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); }