initial commit
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package draylar.omegaconfig;
|
||||
|
||||
import net.fabricmc.api.ClientModInitializer;
|
||||
import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.text.LiteralText;
|
||||
|
||||
public class OmegaConfigClientTest implements ClientModInitializer {
|
||||
|
||||
@Override
|
||||
public void onInitializeClient() {
|
||||
OmegaConfigClient.registerConfigScreen(OmegaConfigTest.CONFIG);
|
||||
|
||||
HudRenderCallback.EVENT.register((stack, delta) -> {
|
||||
MinecraftClient.getInstance().textRenderer.draw(stack, new LiteralText(String.valueOf(OmegaConfigTest.CONFIG.v)), 15, 15, 0xffffff);
|
||||
MinecraftClient.getInstance().textRenderer.draw(stack, new LiteralText(String.valueOf(OmegaConfigTest.CONFIG.doubleTest)), 15, 30, 0xffffff);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package draylar.omegaconfig;
|
||||
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class OmegaConfigTest implements ModInitializer {
|
||||
|
||||
public static final TestConfig CONFIG = OmegaConfig.register(TestConfig.class);
|
||||
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
System.out.printf("Config value: %s%n", CONFIG.v);
|
||||
System.out.printf("Inner class value: %s%n", CONFIG.test.innerTest);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package draylar.omegaconfig;
|
||||
|
||||
import draylar.omegaconfig.api.Comment;
|
||||
import draylar.omegaconfig.api.Config;
|
||||
import draylar.omegaconfig.api.Syncing;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@Syncing
|
||||
public class TestConfig implements Config {
|
||||
|
||||
@Comment(value = "Hello!")
|
||||
boolean v = false;
|
||||
|
||||
@Comment(value = "I'm a double.")
|
||||
double doubleTest = 0.0;
|
||||
|
||||
@Comment(value = "This is an inner static class.")
|
||||
public Test test = new Test();
|
||||
|
||||
public static class Test {
|
||||
|
||||
@Comment(value = "This is the value inside the class!")
|
||||
public boolean innerTest = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "test-config";
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable String getModid() {
|
||||
return "omega-config-test";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "omega-config-test",
|
||||
"version": "${version}",
|
||||
"name": "OmegaConfig Test",
|
||||
"description": "Test mod for Omega Config.",
|
||||
"authors": [
|
||||
"Draylar"
|
||||
],
|
||||
"contact": {},
|
||||
"license": "MIT",
|
||||
"icon": "assets/omega-config/icon.png",
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"draylar.omegaconfig.OmegaConfigTest"
|
||||
],
|
||||
"client": [
|
||||
"draylar.omegaconfig.OmegaConfigClientTest"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
"fabricloader": ">=0.11.2",
|
||||
"fabric": "*",
|
||||
"minecraft": "1.16.5"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user