ColinHDev / CPlot

Land and world management plugin for PocketMine-MP
https://discord.gg/cAYKEtaqnp
GNU General Public License v3.0
29 stars 12 forks source link

Improve integration of database methods in API classes #8

Closed ColinHDev closed 2 years ago

ColinHDev commented 2 years ago

While the switch to libasynql and await-generator is not finished yet, it already resulted in a mess of certain methods, behaviours and return types. This made fancy methods like BasePlot::toPlot() : ?Plot incredibly awkward (BasePlot::toSyncPlot() : ?Plot and BasePlot::toAsyncPlot() : \Generator). This is also a problem since those parts of the plugin were meant to be part of the API, which other plugins can interact with, but with such a mess, they are difficult for plugin devs to even understand.

ColinHDev commented 2 years ago

With the introduction of the CPlotAPI class and the upcoming removal of methods like BasePlot::toSyncPlot() : ?Plot or Plot::loadFromPositionIntoCache() : Plot|BasePlot|null, this will be resolved.