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) with export default Plugin;.
    If the plugin is tracked in the plugins repository, replace 0.5.0 in the version field with 0.6.0, and the date 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 of canUpgrade with canPlanetUpgrade. example
    entityStore.planetCanUpgrade is now a static method; any instance of df.entityStore.planetCanUpgrade(planet) should be replaced with df.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 modified 4mo ago
Copy link