mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
SPIGOT-1235: Correctly validate MaterialData for playEffect.
Thanks Jikoo for the report / fix.
This commit is contained in:
1 parent
f4c67a5c32
commit
18fbb24b46
2 files changed
+2
-2
No files matched your search
@@ -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!");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user