mirror of
https://hub.spigotmc.org/stash/scm/spigot/craftbukkit.git
synced 2025-08-21 05:44:33 +00:00
SPIGOT-2206: playEffect doesn't accept sub classes of the expected data type
This commit is contained in:
parent
4377b86b29
commit
935f18b476
2 changed files with 2 additions and 2 deletions
|
@ -863,7 +863,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().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 {
|
} 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!");
|
||||||
}
|
}
|
||||||
|
|
|
@ -322,7 +322,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().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 {
|
} 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!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue