Update on annotation system + version 4.0:
For version 4.0, I have decided to ditch the previous breaking changes in favour of these ones. This update will break every plugin using it, so I do not expect people to update to it readily. I will release a version 3.12 alongside it with some bugfixes but nothing API breaking, but 3.12 will be the last 3.X version I release. Going forwards, this annotation system will be easier to use and more powerful, so I look forward to seeing the transition.
As for progress, I am mostly done the core system, just need to make some minor improvements and then finish testing. I am going to mention that the Source
annotation is no longer necessary, method return type can be anything except void
, and the supported types for Source
and Observer
are Locatable
, User
, CommandSource
and any derivatives. This update breaks everything the previous versions had so I don’t expect people to start using this quickly. Placeholders themselves should be more powerful now, but I am still trying to figure out how to properly gather the non-essential or dynamic information about placeholders (for instance, JavaScript supported tokens are loaded scripts, which is a variable I am unable to pass into an annotation). Once I figure that out I will be able to finalize this update. Looks to me like it works and performs well (I decided to take the route of Sponge’s event system rather than using reflection because it saves on a decent chunk of performance, and I am using LoadingCache
s to reduce memory consumption by unused placeholders. The cache has no expiry yet because I figured writing a new class every x minutes might not be the best idea, but it seems to be fast so I might change that), so I will not be changing the core much more.
I still haven’t finalized the system so any input will be appreciated. I will be pushing the source code to the GitHub repo soon, under a separate branch so as to retain documentation of the old version, if you want to see it. Any help finishing this would be much appreciated :).