[SuperiorSkyblockAPI] New events and methods #1825
-
I am currently developing a small addon for SuperiorSkyblock and while doing so I found various things that I needed missing in the API. EventsCurrently the API has only events related to when the plugin is initializing or initialized (PluginInitializeEvent and PluginInitializedEvent) and when the data manager is loaded or reloaded (PluginLoadDataEvent). PluginReloadEventAn event called before actually reloading, similarly to PluginInitializeEvent; it may be useful also to have the possibility to change providers or other settings when called. PluginReloadedEventAs you can deduce, this is an event called when SuperiorSkyblock finished reloading all its stuff. MethodsWhile developing my addon I thought of some simple (maybe) methods that can be really useful in some situations. getDatabaseSession() methodAs the name says, this method will return the current running SQL session, this would permit to devs to manipolate as they wish data in the same database used by SuperiorSkyblock being able to also create new tables with island-related data. I know that currently you can get from the API the database settings in the config permitting you to establish by yourself a connection with it but this would need some extra work that could be easily avoided by introducing this method. getMessage(Message, Locale) methodThis method will allow you to obtain the string, or the list, set for the message specified (one of the Message's enums) in one of the lang files depending on the locale argument. setMessage(Message, Locale, MessageComponent) methodIn this case using this method you will have the possibility to set to the message for the locale specified a message component built by you (this would maybe need the following method, otherwise instead of the MessageComponent you'll need a string or string list). getMessagesService() methodJust for utility, the method will return the MessagesService used by the plugin in order to easily get or parse components (this would mean also to add the various MessageComponents used by SuperiorSkyblock). These are my API-related features requests, I'm aware that some of them could be considered useless or not really necessary but I wanted to write them anyway. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hey, thanks for all the suggestions! Reload EventsIf you develop a module for the plugin, you already have such thing. If you don't use the modules system, then you should if it is an addon dedicated for SSB only. getDatabaseSession() methodThe database can be other things than SQL, therefore such thing will never be exposed to the API. getMessage(Message, Locale) methodAlready exists - https://bg-software.com/superiorskyblock/api/ setMessage(Message, Locale, MessageComponent) methodMessages are by-design only editable by the player, through the config files. getMessagesService() methodThis already exists. Look at Bukkit's services system. |
Beta Was this translation helpful? Give feedback.
Hey, thanks for all the suggestions!
Reload Events
If you develop a module for the plugin, you already have such thing. If you don't use the modules system, then you should if it is an addon dedicated for SSB only.
getDatabaseSession() method
The database can be other things than SQL, therefore such thing will never be exposed to the API.
You can use the database bridges to manipulate the DB.
Btw, you should not do such thing and instead use the persistent data API to track data regarding players / islands.
getMessage(Message, Locale) method
Already exists - https://bg-software.com/superiorskyblock/api/
Look for MessageService#getComponent
setMessage(Message, Locale, MessageComponent) method