[SPIGOT-2206] Play effect doesn't accept sub classes of the expected data type Created: 23/Apr/16 Updated: 25/Apr/16 Resolved: 25/Apr/16 |
|
| Status: | Resolved |
| Project: | Spigot |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor |
| Reporter: | MrBlobman | Assignee: | Unassigned |
| Resolution: | Fixed | Votes: | 1 |
| Labels: | Craftbukkit | ||
| Description |
|
Purple wool is the block I first noticed it with, but all MaterialData sub classes cannot be passed as data to World#playEffect(Location, Effect, T) when the effect is Effect.TILE_BREAK. I'm not 100% sure if the line number is correct but the method signature above is the method I am referring to in CraftWorld. Validate.isTrue(data.getClass().isAssignableFrom(effect.getData()), "Wrong kind of data for this effect!");
The validation check is backwards, the expected effect data should be assignable from the given data's type: Validate.isTrue(effect.getData() != null && effect.getData().isAssignableFrom(data.getClass()), "Wrong kind of data for this effect!"); |
| Comments |
| Comment by Jikoo [ 24/Apr/16 ] |
|
Dang, I had tested this with my use case and it was working fine, so I said it was fixed. I obviously didn't test enough - duplicate of |