[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.
I found this line 829 in CraftWorld and 382 in CraftPlayer

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 SPIGOT-1235

Generated at Sat Dec 13 15:23:12 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.