3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

SPIGOT-2206: playEffect doesn't accept sub classes of the expected data type

Dieser Commit ist enthalten in:
md_5 2016-04-26 09:35:17 +10:00
Ursprung 4377b86b29
Commit 935f18b476
2 geänderte Dateien mit 2 neuen und 2 gelöschten Zeilen

Datei anzeigen

@ -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!");
}

Datei anzeigen

@ -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!");
}