Remove NukerFilterConfig from Export & Load commands

This commit is contained in:
noil 2023-05-17 01:19:03 -04:00
parent 607fcb9b8d
commit 2cd23c3632
3 changed files with 7 additions and 9 deletions

View File

@ -44,10 +44,6 @@ public final class ExportCommand extends Command {
final JsonObject searchJson = cfg.getJsonObject();
endJson.add("Search", searchJson);
}
if (cfg.getClass().equals(NukerFilterConfig.class)) {
final JsonObject nukerFilterJson = cfg.getJsonObject();
endJson.add("NukerFilter", nukerFilterJson);
}
if (cfg.getClass().equals(ModuleConfig.class)) {
final JsonObject moduleJson = cfg.getJsonObject();
final ModuleConfig moduleConfig = (ModuleConfig) cfg;

View File

@ -3,7 +3,6 @@ package me.rigamortis.seppuku.impl.command;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import me.rigamortis.seppuku.Seppuku;
import me.rigamortis.seppuku.api.cape.CapeUser;
import me.rigamortis.seppuku.api.command.Command;
import me.rigamortis.seppuku.impl.config.*;
import net.minecraft.client.Minecraft;
@ -67,9 +66,6 @@ public final class LoadCommand extends Command {
this.loadConfigForClass(SearchConfig.class, entry.getValue().getAsJsonObject());
}
if (entry.getKey().equalsIgnoreCase("NukerFilter")) {
this.loadConfigForClass(NukerFilterConfig.class, entry.getValue().getAsJsonObject());
}
Seppuku.INSTANCE.getModuleManager().getModuleList().forEach(module -> {
if (entry.getKey().equalsIgnoreCase("Module" + module.getDisplayName())) {
this.loadModuleConfigForClass(ModuleConfig.class, entry.getValue().getAsJsonObject(), module.getDisplayName());

View File

@ -20,7 +20,7 @@ public class NukerFilterConfig extends Configurable {
public NukerFilterConfig(File dir) {
super(FileUtil.createJsonFile(dir, "NukerFilter"));
this.nukerModule = (NukerModule) Seppuku.INSTANCE.getModuleManager().find("Nuker");
this.nukerModule = (NukerModule) Seppuku.INSTANCE.getModuleManager().find(NukerModule.class);
}
@Override
@ -51,6 +51,12 @@ public class NukerFilterConfig extends Configurable {
if (this.nukerModule == null)
return;
if (this.nukerModule.getFilter().getValue() == null)
return;
if (this.nukerModule.getFilter().getValue().isEmpty())
return;
JsonObject save = new JsonObject();
JsonArray xrayIdsJsonArray = new JsonArray();