Compare commits
6
Commits
1.0.4-beta
...
1.0.5-beta
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c21e5ff3ff | ||
|
|
a6d2e3b1f8 | ||
|
|
0ff71f0a09 | ||
|
|
1b636fa0d8 | ||
|
|
1e3e886346 | ||
|
|
8b42f5a9c5 |
+3
-3
@@ -15,7 +15,7 @@ buildscript {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "fabric-loom" version "0.7-SNAPSHOT"
|
||||
id "fabric-loom" version "0.8-SNAPSHOT"
|
||||
id "maven-publish"
|
||||
id "java-library"
|
||||
}
|
||||
@@ -207,8 +207,8 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile project(":omega-config-base")
|
||||
compile project(":omega-config-gui")
|
||||
implementation project(":omega-config-base")
|
||||
implementation project(":omega-config-gui")
|
||||
modRuntime "com.terraformersmc:modmenu:1.16.8"
|
||||
modCompileOnly "com.terraformersmc:modmenu:1.16.8"
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ yarn_mappings=1.16.5+build.5
|
||||
loader_version=0.11.2
|
||||
|
||||
# Mod Properties
|
||||
mod_version=1.0.4
|
||||
mod_version=1.0.5
|
||||
maven_group=draylar
|
||||
archives_base_name=omega-config
|
||||
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,2 @@
|
||||
jdk:
|
||||
- openjdk16
|
||||
@@ -85,14 +85,16 @@ public class OmegaConfig {
|
||||
writeConfig(configClass, object);
|
||||
REGISTERED_CONFIGURATIONS.add(object);
|
||||
return object;
|
||||
} catch (IOException ioException) {
|
||||
LOGGER.error(ioException);
|
||||
LOGGER.info(String.format("Read error, using default values for config %s.", configClass.toString()));
|
||||
} catch (Exception e) {
|
||||
LOGGER.error(e);
|
||||
LOGGER.info(String.format("Encountered an error while reading %s config, falling back to default values.", config.getName()));
|
||||
LOGGER.info(String.format("If this problem persists, delete the config file %s and try again.", config.getName() + "." + config.getExtension()));
|
||||
}
|
||||
}
|
||||
|
||||
return config;
|
||||
} catch (NoSuchMethodException | InstantiationException | IllegalAccessException | InvocationTargetException exception) {
|
||||
exception.printStackTrace();
|
||||
throw new NoValidConstructorException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
dependencies {
|
||||
compile project(":omega-config-base")
|
||||
implementation project(":omega-config-base")
|
||||
}
|
||||
@@ -1,13 +1,18 @@
|
||||
package draylar.omegatest;
|
||||
|
||||
import draylar.omegaconfig.OmegaConfig;
|
||||
import draylar.omegatest.config.ClassConfigTest;
|
||||
import draylar.omegatest.config.NestedConfigTest;
|
||||
import draylar.omegatest.config.StructuresConfigTest;
|
||||
import draylar.omegatest.config.SimpleConfigTest;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class OmegaTestMain implements ModInitializer {
|
||||
|
||||
public static final TestConfig CONFIG = OmegaConfig.register(TestConfig.class);
|
||||
public static final NewTestConfig MO_CONFIG = OmegaConfig.register(NewTestConfig.class);
|
||||
public static final NestedConfig NESTED = OmegaConfig.register(NestedConfig.class);
|
||||
public static final SimpleConfigTest CONFIG = OmegaConfig.register(SimpleConfigTest.class);
|
||||
public static final StructuresConfigTest MO_CONFIG = OmegaConfig.register(StructuresConfigTest.class);
|
||||
public static final NestedConfigTest NESTED = OmegaConfig.register(NestedConfigTest.class);
|
||||
public static final ClassConfigTest CLASS = OmegaConfig.register(ClassConfigTest.class);
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package draylar.omegatest.config;
|
||||
|
||||
import draylar.omegaconfig.api.Config;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class ClassConfigTest implements Config {
|
||||
|
||||
public List<TestClass> l = Arrays.asList(
|
||||
new TestClass(true, 1, "hello")
|
||||
);
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "class-config";
|
||||
}
|
||||
|
||||
public static class TestClass {
|
||||
public final boolean a;
|
||||
public final int b;
|
||||
public String c;
|
||||
|
||||
public TestClass(boolean a, int b, String c) {
|
||||
this.a = a;
|
||||
this.b = b;
|
||||
this.c = c;
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
package draylar.omegatest;
|
||||
package draylar.omegatest.config;
|
||||
|
||||
import draylar.omegaconfig.api.Config;
|
||||
|
||||
public class NestedConfig implements Config {
|
||||
public class NestedConfigTest implements Config {
|
||||
|
||||
public boolean test = false;
|
||||
|
||||
+5
-5
@@ -1,4 +1,4 @@
|
||||
package draylar.omegatest;
|
||||
package draylar.omegatest.config;
|
||||
|
||||
import draylar.omegaconfig.api.Comment;
|
||||
import draylar.omegaconfig.api.Config;
|
||||
@@ -6,15 +6,15 @@ import draylar.omegaconfig.api.Syncing;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@Syncing
|
||||
public class TestConfig implements Config {
|
||||
public class SimpleConfigTest implements Config {
|
||||
|
||||
@Comment(value = "Hello!")
|
||||
boolean v = false;
|
||||
public boolean v = false;
|
||||
|
||||
@Comment(value = "I'm a double.")
|
||||
double doubleTest = 0.0;
|
||||
public double doubleTest = 0.0;
|
||||
|
||||
String stringTest = "Hello, world!";
|
||||
public String stringTest = "Hello, world!";
|
||||
|
||||
@Comment(value = "This is an inner static class.")
|
||||
public Test test = new Test();
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
package draylar.omegatest;
|
||||
package draylar.omegatest.config;
|
||||
|
||||
import draylar.omegaconfig.api.Comment;
|
||||
import draylar.omegaconfig.api.Config;
|
||||
|
||||
public class NewTestConfig implements Config {
|
||||
public class StructuresConfigTest implements Config {
|
||||
@Comment("Mo' Structures feature toggles.")
|
||||
public Features features = new Features();
|
||||
|
||||
Reference in New Issue
Block a user