SPIGOT-1235: Correctly validate MaterialData for playEffect.

Thanks Jikoo for the report / fix.
Dieser Commit ist enthalten in:
md_5 2015-10-18 19:40:00 +11:00
Ursprung f4c67a5c32
Commit 18fbb24b46
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -826,7 +826,7 @@ public class CraftWorld implements World {
public <T> void playEffect(Location loc, Effect effect, T data, int radius) { public <T> void playEffect(Location loc, Effect effect, T data, int radius) {
if (data != null) { 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 { } else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
} }

Datei anzeigen

@ -325,7 +325,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
@Override @Override
public <T> void playEffect(Location loc, Effect effect, T data) { public <T> void playEffect(Location loc, Effect effect, T data) {
if (data != null) { 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 { } else {
Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!"); Validate.isTrue(effect.getData() == null, "Wrong kind of data for this effect!");
} }