mirror of
https://github.com/GTNewHorizons/Postea.git
synced 2026-11-19 03:49:05 +00:00
Initial commit
This commit is contained in:
1 parent
4101fb1d1c
commit
5a6afe6098
20 files changed
+1003
No files matched your search
@@ -0,0 +1,31 @@
|
||||
package com.myname.mymodid;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class Config {
|
||||
|
||||
private static class Defaults {
|
||||
public static final String greeting = "Hello World";
|
||||
}
|
||||
|
||||
private static class Categories {
|
||||
public static final String general = "general";
|
||||
}
|
||||
|
||||
public static String greeting = Defaults.greeting;
|
||||
|
||||
public static void syncronizeConfiguration(File configFile) {
|
||||
Configuration configuration = new Configuration(configFile);
|
||||
configuration.load();
|
||||
|
||||
Property greetingProperty = configuration.get(Categories.general, "greeting", Defaults.greeting, "How shall I greet?");
|
||||
greeting = greetingProperty.getString();
|
||||
|
||||
if(configuration.hasChanged()) {
|
||||
configuration.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user