Bandaid fix for Effect
Effect or LevelEvent needs to be replaced but ideally after the enum PR has been merged upstream. Until then, this test and these fixes should address all the known issues with them
This commit is contained in:
1 parent
3b2125b47d
commit
8bb902842c
4 files changed
+110
-2
No files matched your search
@@ -924,7 +924,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
Preconditions.checkArgument(effect != null, "Effect cannot be null");
|
||||
if (data != null) {
|
||||
Preconditions.checkArgument(effect.getData() != null, "Effect.%s does not have a valid Data", effect);
|
||||
Preconditions.checkArgument(effect.getData().isAssignableFrom(data.getClass()), "%s data cannot be used for the %s effect", data.getClass().getName(), effect);
|
||||
Preconditions.checkArgument(effect.isApplicable(data), "%s data cannot be used for the %s effect", data.getClass().getName(), effect); // Paper
|
||||
} else {
|
||||
// Special case: the axis is optional for ELECTRIC_SPARK
|
||||
Preconditions.checkArgument(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for the %s effect", effect);
|
||||
|
||||
Reference in new issue
Block a user