mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +09:00
Add feature flags to first party plugins
This commit is contained in:
12 files changed
+27
-34
No files matched your search
@@ -9,6 +9,11 @@ export const plugin: lib.PluginDeclaration = {
|
||||
instanceEntrypoint: "dist/node/instance",
|
||||
controllerEntrypoint: "dist/node/controller",
|
||||
|
||||
features: [
|
||||
"SavePatching",
|
||||
"ScriptCommands",
|
||||
],
|
||||
|
||||
messages: [
|
||||
messages.ContributionEvent,
|
||||
messages.ProgressEvent,
|
||||
|
||||
@@ -27,13 +27,6 @@ export class InstancePlugin extends BaseInstancePlugin {
|
||||
}
|
||||
|
||||
async init() {
|
||||
if (!this.instance.config.get("factorio.enable_save_patching")) {
|
||||
throw new Error("research_sync plugin requires save patching.");
|
||||
}
|
||||
if (!this.instance.config.get("factorio.enable_script_commands")) {
|
||||
throw new Error("research_sync plugin requires script commands.");
|
||||
}
|
||||
|
||||
this.instance.server.on("ipc-research_sync:contribution", (tech: IpcContribution) => {
|
||||
this.researchContribution(tech).catch(err => this.unexpectedError(err));
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user