Merge pull request #43 from zeroeightysix/feature-modifier-binds

Fix debug code & add prefix command
This commit is contained in:
Ridan Vandenbergh 2018-10-10 19:21:53 +02:00 committed by GitHub
commit 6b11150f93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 5 deletions

View File

@ -0,0 +1,26 @@
package me.zeroeightsix.kami.command.commands;
import me.zeroeightsix.kami.command.Command;
import me.zeroeightsix.kami.command.syntax.ChunkBuilder;
/**
* Created by 086 on 10/10/2018.
*/
public class PrefixCommand extends Command {
public PrefixCommand() {
super("prefix", new ChunkBuilder().append("character").build());
}
@Override
public void call(String[] args) {
if (args.length == 0) {
Command.sendChatMessage("Please specify a new prefix!");
return;
}
Command.COMMAND_PREFIX = args[0];
Command.sendChatMessage("Prefix set to &b" + Command.COMMAND_PREFIX);
}
}

View File

@ -99,8 +99,6 @@ public class ModuleManager {
if (eventKey == 0) return; // if key is the 'none' key (stuff like mod key in i3 might return 0)
modules.forEach(module -> {
if (module.getBind().isDown()) {
System.out.println(module.getBind() + " is down!");
module.toggle();
}
});

View File

@ -76,7 +76,7 @@ public class SettingsPool {
try {
Command.COMMAND_PREFIX = String.valueOf(rootObject.get("command_prefix").getAsString());
}catch (Exception e) {
KamiMod.log.error("Couldn't load command prefix! Please make sure it is only one character long.");
e.printStackTrace();
}
JsonObject guiMap = rootObject.get("gui").getAsJsonObject();
@ -120,7 +120,6 @@ public class SettingsPool {
}
public static void save(File file) throws IOException {
JsonObject root = new JsonObject();
JsonObject settings = new JsonObject();
classes.forEach(settingsClass ->
@ -131,7 +130,6 @@ public class SettingsPool {
try {
FieldConverter converter = getConverter(setting.converter());
jsonElement = converter.toJson(staticSetting);
// value = setting.converter().getMethod("toJson", SettingsClass.StaticSetting.class).invoke(getConverter(setting.converter()), staticSetting);
} catch (Exception e) {
e.printStackTrace();
System.err.println("FAILED TO CONVERT TO SAVE REPRESENTATION (" + staticSetting.field + " -> " + setting.converter().getSimpleName() + " -> " + staticSetting.getField().getType());