|
|
|
@ -1,6 +1,12 @@
|
|
|
|
|
package io.github.minecraftcursedlegacy.example;
|
|
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
import io.github.minecraftcursedlegacy.api.config.Configs;
|
|
|
|
|
import io.github.minecraftcursedlegacy.api.registry.Id;
|
|
|
|
|
import net.fabricmc.api.ModInitializer;
|
|
|
|
|
import tk.valoeghese.zoesteriaconfig.api.container.WritableConfig;
|
|
|
|
|
import tk.valoeghese.zoesteriaconfig.api.template.ConfigTemplate;
|
|
|
|
|
|
|
|
|
|
public class ExampleMod implements ModInitializer {
|
|
|
|
|
@Override
|
|
|
|
@ -10,5 +16,19 @@ public class ExampleMod implements ModInitializer {
|
|
|
|
|
// Proceed with mild caution.
|
|
|
|
|
|
|
|
|
|
System.out.println("Hello Fabric world!");
|
|
|
|
|
|
|
|
|
|
// example config
|
|
|
|
|
try {
|
|
|
|
|
config = Configs.loadOrCreate(new Id("modid", "example"),
|
|
|
|
|
ConfigTemplate.builder().addContainer("exampleContainer", e -> e
|
|
|
|
|
.addDataEntry("someData", "0.5"))
|
|
|
|
|
.build());
|
|
|
|
|
} catch (IOException e) {
|
|
|
|
|
throw new RuntimeException(e);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println(config.getDoubleValue("exampleContainer.someData"));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static WritableConfig config;
|
|
|
|
|
}
|
|
|
|
|