use of me.superckl.api.superscript.script.command.BasicScriptCommandManager in project BiomeTweaker by superckl.
the class BiomeTweaker method onPreInit.
@EventHandler
public void onPreInit(final FMLPreInitializationEvent e) {
final ProgressBar bar = ProgressManager.push("BiomeTweaker PreInitialization", 6, true);
LogHelper.setLogger(e.getModLog());
bar.step("Reading config");
if (!this.signed) {
LogHelper.warn("Hey... uhm... this is awkward but, it looks like you're using an unofficial version of BiomeTweaker. Where exactly did you get this from?");
LogHelper.warn("Unless I (superckl) sent you this version, don't expect to get any support for it.");
}
this.config = new Config(new File(Loader.instance().getConfigDir(), ModData.MOD_NAME + "/"));
this.config.loadValues();
final List<IMCMessage> messages = FMLInterModComms.fetchRuntimeMessages(ModData.MOD_ID);
for (final IMCMessage message : messages) if (message.key.equals("enableTweak") && message.isStringMessage()) {
LogHelper.debug("Received enableTweak IMC message from " + message.getSender() + ", enabling tweak: " + message.getStringValue());
this.enabledTweaks.add(message.getStringValue());
}
bar.step("Initializing scripting enviroment");
final File scripts = new File(this.config.getBtConfigFolder(), "scripts/");
scripts.mkdirs();
this.commandManager = new BasicScriptCommandManager();
ScriptCommandRegistry.INSTANCE.registerScriptCommandManager(ModData.MOD_ID, this.commandManager);
BiomeTweaker.proxy.initProperties();
BiomeTweaker.proxy.setupScripts(e.getAsmData());
bar.step("Pre-Initializing Integration");
IntegrationManager.INSTANCE.preInit();
bar.step("Registering handlers");
BiomeTweaker.proxy.registerHandlers();
bar.step("Parsing scripts");
this.parseScripts();
bar.step("Applying scripts");
this.commandManager.applyCommandsFor(ApplicationStage.PRE_INIT);
ProgressManager.pop(bar);
}
Aggregations