forked from RepoMirrors/kami-blue
revert commandconfig to java
This commit is contained in:
parent
be8790b412
commit
9f477d941b
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -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()
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue