|
@@ -2,11 +2,10 @@ package me.lortseam.completeconfig.data;
|
|
|
|
|
|
import me.lortseam.completeconfig.ConfigHandler;
|
|
import me.lortseam.completeconfig.ConfigHandler;
|
|
import me.lortseam.completeconfig.ModController;
|
|
import me.lortseam.completeconfig.ModController;
|
|
-import me.lortseam.completeconfig.gui.GuiBuilder;
|
|
|
|
-import me.lortseam.completeconfig.io.ConfigSource;
|
|
|
|
import me.lortseam.completeconfig.api.ConfigGroup;
|
|
import me.lortseam.completeconfig.api.ConfigGroup;
|
|
import me.lortseam.completeconfig.data.text.TranslationIdentifier;
|
|
import me.lortseam.completeconfig.data.text.TranslationIdentifier;
|
|
-import me.lortseam.completeconfig.util.TypeUtils;
|
|
|
|
|
|
+import me.lortseam.completeconfig.gui.GuiBuilder;
|
|
|
|
+import me.lortseam.completeconfig.io.ConfigSource;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.EnvType;
|
|
import net.fabricmc.api.Environment;
|
|
import net.fabricmc.api.Environment;
|
|
import org.apache.logging.log4j.LogManager;
|
|
import org.apache.logging.log4j.LogManager;
|
|
@@ -62,7 +61,6 @@ public class Config extends CollectionMap {
|
|
private final String modID;
|
|
private final String modID;
|
|
private String[] branch = new String[0];
|
|
private String[] branch = new String[0];
|
|
private final List<ConfigGroup> topLevelGroups = new ArrayList<>();
|
|
private final List<ConfigGroup> topLevelGroups = new ArrayList<>();
|
|
- private TypeSerializerCollection typeSerializers;
|
|
|
|
private GuiBuilder guiBuilder;
|
|
private GuiBuilder guiBuilder;
|
|
|
|
|
|
private Builder(String modID) {
|
|
private Builder(String modID) {
|
|
@@ -94,20 +92,6 @@ public class Config extends CollectionMap {
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
|
|
|
|
- /**
|
|
|
|
- * Registers custom type serializers, applied only to this config.
|
|
|
|
- *
|
|
|
|
- * <p>To register type serializers for every config of your mod, use
|
|
|
|
- * {@link ModController#registerTypeSerializers(TypeSerializerCollection)}.
|
|
|
|
- *
|
|
|
|
- * @param typeSerializers the type serializers
|
|
|
|
- * @return this builder
|
|
|
|
- */
|
|
|
|
- public Builder registerTypeSerializers(TypeSerializerCollection typeSerializers) {
|
|
|
|
- this.typeSerializers = TypeUtils.mergeSerializers(this.typeSerializers, Objects.requireNonNull(typeSerializers));
|
|
|
|
- return this;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* Sets a custom client GUI builder for the config.
|
|
* Sets a custom client GUI builder for the config.
|
|
*
|
|
*
|
|
@@ -130,7 +114,7 @@ public class Config extends CollectionMap {
|
|
LOGGER.warn("[CompleteConfig] Mod " + modID + " tried to create an empty config!");
|
|
LOGGER.warn("[CompleteConfig] Mod " + modID + " tried to create an empty config!");
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- return new ConfigHandler(new Config(new ConfigSource(ModController.of(modID), branch, typeSerializers), topLevelGroups), guiBuilder);
|
|
|
|
|
|
+ return new ConfigHandler(new Config(new ConfigSource(ModController.of(modID), branch), topLevelGroups), guiBuilder);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|