mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-17 01:35:10 +01:00
Update MidnightConfigExample.java
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
package eu.midnightdust.lib.config;
|
package eu.midnightdust.lib.config;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/** MidnightConfig documentation & examples:
|
/** MidnightConfig documentation & examples:
|
||||||
* Thanks for choosing MidnightConfig - the fancy, tiny and lightweight config library.
|
* Thanks for choosing MidnightConfig - the fancy, tiny and lightweight config library.
|
||||||
* If you want to use the lib in your mod, here are some examples and hints:
|
* If you want to use the lib in your mod, here are some examples and hints:
|
||||||
@@ -12,14 +14,15 @@ public class MidnightConfigExample extends MidnightConfig {
|
|||||||
@Entry public static int fabric = 16777215; // Example for a int option
|
@Entry public static int fabric = 16777215; // Example for a int option
|
||||||
@Entry public static double world = 1.4D; // Example for a double option
|
@Entry public static double world = 1.4D; // Example for a double option
|
||||||
@Entry public static boolean showInfo = true; // Example for a boolean option
|
@Entry public static boolean showInfo = true; // Example for a boolean option
|
||||||
@Entry public static String name = "Hi"; // Example for a string option
|
@Entry public static String name = "Hello World!"; // Example for a string option
|
||||||
@Entry public static TestEnum testEnum = TestEnum.FABRIC; // Example for a enum option
|
@Entry public static TestEnum testEnum = TestEnum.FABRIC; // Example for a enum option
|
||||||
public static enum TestEnum { // Enums allow the user to cycle through predefined options
|
public enum TestEnum { // Enums allow the user to cycle through predefined options
|
||||||
QUILT, FABRIC
|
QUILT, FABRIC
|
||||||
}
|
}
|
||||||
@Entry(min=10,max=30) public static int hello = 15675965; // - The entered number has to be larger than 10 and smaller than 30
|
@Entry(min=69,max=420) public static int hello = 420; // - The entered number has to be larger than 69 and smaller than 420
|
||||||
@Entry(width = 7, min = 7, isColor = true) public static String titleColor = "#ffffff"; // The isColor property adds a preview box for a hexadecimal color
|
@Entry(width = 7, min = 7, isColor = true, name = "I am a color!") public static String titleColor = "#ffffff"; // The isColor property adds a preview box for a hexadecimal color
|
||||||
@Entry public static List<String> blurExclusions = Mod.defaultExclusions; // Array String Lists are also supported
|
@Entry(name = "I am an array list!") public static List<String> arrayList = List.of("String1", "String2"); // Array String Lists are also supported
|
||||||
|
// The name field can be used to specify a custom translation string or plain text
|
||||||
|
|
||||||
public static int imposter = 16777215; // - Entries without an @Entry or @Comment annotation are ignored
|
public static int imposter = 16777215; // - Entries without an @Entry or @Comment annotation are ignored
|
||||||
|
|
||||||
@@ -28,9 +31,9 @@ public class MidnightConfigExample extends MidnightConfig {
|
|||||||
{
|
{
|
||||||
"modid.midnightconfig.title":"I am a title", // "*.midnightconfig.title" defines the title of the screen
|
"modid.midnightconfig.title":"I am a title", // "*.midnightconfig.title" defines the title of the screen
|
||||||
"modid.midnightconfig.text1":"I am a comment *u*", // Translation for the comment "text1" defined in the example config
|
"modid.midnightconfig.text1":"I am a comment *u*", // Translation for the comment "text1" defined in the example config
|
||||||
"modid.midnightconfig.name":"Pet Name", // Translation for the field "name" defined in the example config
|
"modid.midnightconfig.name":"I am a string!", // Translation for the field "name" defined in the example config
|
||||||
|
|
||||||
"modid.midnightconfig.name.tooltip":"Name your Pet! \n I am a new line uwu",
|
"modid.midnightconfig.name.tooltip":"uwu \n I am a new line",
|
||||||
// When hovering over the option "showInfo",
|
// When hovering over the option "showInfo",
|
||||||
// this text will appear as a tooltip.
|
// this text will appear as a tooltip.
|
||||||
// "\n" inserts a line break.
|
// "\n" inserts a line break.
|
||||||
|
|||||||
Reference in New Issue
Block a user