Make ItemInfoEvent cancellable (to cancel /iteminfo command)
Making this because I need to cancel /iteminfo depending on if the item has specific properties (e.g. custom nbt data)
Haven't been able to test but because this is so straight forward and small I don't see any way for it to cause any issues.
Doesn't this result in the item meta information getting sent before the ID messages? For this to work properly without changing the existing output you would need to move the item ID messages to their own listeners too.
Will look into that. So just to be clear, you're saying that both trys are required to be successful before it sends the ItemInfoEvent and if so, why is that?
Do you think we could get away with some sort of cancellable PreItemInfoEvent?
An additionally event is not necessary, simply make the command fully event driven by moving the two hard coded message sends into their own event handlers (e.g. in the ItemInfoListener class) on a lower priority than the existing meta ones and make sure that all ItemInfoEvent handlers ignore cancelled events as well.
Sure I can do that, do you mind if i add a feedback boolean to the event to prevent sending the feedback message? I want to have a custom message when a player tries to /iteminfo specific items.
Wouldn't cancelling already do that shop of removing the message?
Fair point, just gotta ignorecancelled real quick and then it should be ready for review. EDIT: Should be ready for review
Will fix this tomorrow, my ide auto formats on saving.