refactor tests + add static class test
This commit is contained in:
@@ -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,20 @@
|
||||
package draylar.omegatest.config;
|
||||
|
||||
import draylar.omegaconfig.api.Config;
|
||||
|
||||
public class ClassConfigTest implements Config {
|
||||
|
||||
public TestClass[] testClass = {
|
||||
new TestClass()
|
||||
};
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "class-config";
|
||||
}
|
||||
|
||||
public static class TestClass {
|
||||
public boolean a = true;
|
||||
public int b = 1;
|
||||
}
|
||||
}
|
||||
+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