revert commandconfig to java

This commit is contained in:
Bella 2020-04-22 18:15:43 -04:00
parent be8790b412
commit 9f477d941b
No known key found for this signature in database
GPG Key ID: DBD4A6030080C8B3
3 changed files with 30 additions and 35 deletions

View File

@ -122,7 +122,7 @@ public class KamiMod {
@Mod.EventHandler
public void postInit(FMLPostInitializationEvent event) {
setCustomIcons();
if (MODULE_MANAGER.getModuleT(CommandConfig.class).customTitle.getValue()) {
if (MODULE_MANAGER.getModuleT(CommandConfig.class).windowTitle.getValue()) {
Display.setTitle(MODNAME + " " + KAMI_KANJI + " " + MODVERSMALL);
}
}

View File

@ -0,0 +1,29 @@
package me.zeroeightsix.kami.module.modules.client;
import me.zeroeightsix.kami.module.Module;
import me.zeroeightsix.kami.setting.Setting;
import me.zeroeightsix.kami.setting.Settings;
import static me.zeroeightsix.kami.KamiMod.MODULE_MANAGER;
import static me.zeroeightsix.kami.util.MessageSendHelper.sendErrorMessage;
/**
* @author dominikaaaa
*/
@Module.Info(
name = "CommandConfig",
category = Module.Category.CLIENT,
description = "Configures PrefixChat and Alias options",
showOnArray = Module.ShowOnArray.OFF
)
public class CommandConfig extends Module {
public Setting<Boolean> aliasInfo = register(Settings.b("Alias Info", true));
public Setting<Boolean> prefixChat = register(Settings.b("PrefixChat", true));
public Setting<Boolean> windowTitle = register(Settings.b("Window Title", true));
public void onDisable() { sendDisableMessage(this.getClass()); }
private void sendDisableMessage(Class clazz) {
sendErrorMessage("Error: The " + MODULE_MANAGER.getModule(clazz).getName() + " module is only for configuring command options, disabling it doesn't do anything.");
MODULE_MANAGER.getModule(clazz).enable();
}
}

View File

@ -1,34 +0,0 @@
package me.zeroeightsix.kami.module.modules.client
import me.zeroeightsix.kami.KamiMod
import me.zeroeightsix.kami.module.Module
import me.zeroeightsix.kami.setting.Setting
import me.zeroeightsix.kami.setting.Settings
import me.zeroeightsix.kami.util.MessageSendHelper
/**
* @author dominikaaaa
*/
@Module.Info(
name = "CommandConfig",
category = Module.Category.CLIENT,
description = "Configures PrefixChat and Alias options",
showOnArray = Module.ShowOnArray.OFF
)
class CommandConfig : Module() {
@JvmField
var aliasInfo: Setting<Boolean> = register(Settings.b("Alias Info", true))
@JvmField
var prefixChat: Setting<Boolean> = register(Settings.b("PrefixChat", true))
@JvmField
var customTitle: Setting<Boolean> = register(Settings.b("Window Title", true))
public override fun onDisable() {
sendDisableMessage()
}
private fun sendDisableMessage() {
MessageSendHelper.sendErrorMessage("Error: The " + KamiMod.MODULE_MANAGER.getModule(this.javaClass).name + " module is only for configuring command options, disabling it doesn't do anything.")
KamiMod.MODULE_MANAGER.getModule(this.javaClass).enable()
}
}