mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-13 11:18:23 +01:00
SPIGOT-1235: Correctly validate MaterialData for playEffect.
Thanks Jikoo for the report / fix. By: md_5 <git@md-5.net>
This commit is contained in:
parent
1c505181d5
commit
21f51e5f5b
2 changed files with 2 additions and 2 deletions
|
@ -826,7 +826,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().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!");
|
||||
}
|
||||
|
|
|
@ -325,7 +325,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().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!");
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue