Last active
August 10, 2017 22:24
-
-
Save Gamebuster19901/0a5633c30839aa7ad05f31e0a0c948ea to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import static your.MODID; | |
import net.minecraftforge.common.config.Config; | |
import net.minecraftforge.common.config.ConfigManager; | |
import net.minecraftforge.fml.client.event.ConfigChangedEvent; | |
import net.minecraftforge.fml.common.Mod; | |
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; | |
@Config(modid = MODID) | |
public class ModConfigSortingExample { | |
/* | |
* Config begin | |
*/ | |
public static final Example EXAMPLE = new Example(); | |
public static class Example{ | |
@Config.Name((char)0xE000 + "I am zeroth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double zeroth = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE001 + "I am first") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double first = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE002 + "I am second") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double second = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE003 + "I am third") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double third = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE004 + "I am fourth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double fourth = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE005 + "I am fifth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double fifth = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE006 + "I am sixth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double sixth = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE007 + "I am seventh") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double seventh = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE008 + "I am eighth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double eighth = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE009 + "I am ninth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double ninth = Double.POSITIVE_INFINITY; | |
@Config.Name((char)0xE00A + "I am tenth") | |
@Config.RangeDouble(min = 1d, max = Double.POSITIVE_INFINITY) | |
public double tenth = Double.POSITIVE_INFINITY; | |
} | |
@Mod.EventBusSubscriber(modid = MODID) | |
private static class EventHandler { | |
@SubscribeEvent | |
public static void onConfigChanged(final ConfigChangedEvent.OnConfigChangedEvent event) { | |
if (event.getModID().equals(MODID)) { | |
ConfigManager.sync(MODID, Config.Type.INSTANCE); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment