Porting v0.5 plugins to v0.6
For most v0.5 plugins, upgrading is as simple as following these two steps:
First, replace
plugin.register(new Plugin());
(usually the last line of the v0.5 plugin) withexport default Plugin;
.If the plugin is tracked in the plugins repository, replace
0.5.0
in theversion
field with0.6.0
, and thedate
to the current date.
Here's an example port (doesn't update the date
field).
In a few cases, you might have to alter a few more lines. Here is a (possibly incomplete) list of additional modifications you may have to make:
If the plugin is importing utils dynamically with
import('https://plugins.zkga.me/utils/utils.js')
, you should replace any instances ofcanUpgrade
withcanPlanetUpgrade
. exampleentityStore.planetCanUpgrade
is now a static method; any instance ofdf.entityStore.planetCanUpgrade(planet)
should be replaced withdf.entityStore.constructor.planetCanUpgrade(planet)
.
If you want to inspect the differences between the v0.5 and v0.6 clients, you can find the last v0.5 client source code here. Documentation on the v0.6 df
and ui
objects can be found here and here, and the source code can be found in the Dark Forest open-source client.
Last updated