
fuzzybat23
Members-
Posts
131 -
Joined
-
Last visited
Everything posted by fuzzybat23
-
Now that we have the prop, how do we set NumberSliderEntry as its config GUI entry type?
-
Well, whatever it was I did with those (), that was keeping the cycle string box from saving. Everything in my config file saves as it should, now. Weird. Anyway, ConfigCategory cat = config.getCategory("general.aFrame"); Property prop = cat.get("Red"); for getting the category and prop, right, if the ModConfig is structured as so @Config(modid = CSBR.MODID) @LangKey("csbr.config.title") public class ModConfig { @Name("Custom Selection Box Frame") @Comment("Color and opacity for custom selection box wire frame.") public static final Frame aFrame = new Frame(); @Name("Custom Selection Box Cube") @Comment("Color and opacity for custom selection box inner cube.") public static final BlinkAnimation bBlink = new BlinkAnimation(); @Name("Custom Selection Box Animation") @Comment({"Break animation style and toggle the depth", "buffer for the custom selection box wire frame.."}) public static final BreakAnimation cBreak = new BreakAnimation(); public static class Frame { @Name("1) Red") @Comment("Choose a value for red between 0 and 255.") @RangeInt(min = 0, max = 255) public int Red = 255; @Name("2) Green") @Comment("Choose a value for green between 0 and 255.") @RangeInt(min = 0, max = 255) public int Green = 255; @Name("3) Blue") @Comment("Choose a value for blue between 0 and 255.") @RangeInt(min = 0, max = 255) public int Blue = 255; @Name("4) Alpha Channel") @Comment("Choose a value for the opacity between 0 and 255.") @RangeInt(min = 0, max = 255) public int Alpha = 255; @Name("5) Wire Thickness") @Comment("Choose a value for the wire frame thickness between 1 and 7.") @RangeInt(min = 1, max = 7) public int Width = 2; } public static class BlinkAnimation { @Name("1) Red") @Comment("Choose a value for red between 0 and 255.") @RangeInt(min = 0, max = 255) public int Red = 255; @Name("2) Green") @Comment("Choose a value for green between 0 and 255.") @RangeInt(min = 0, max = 255) public int Green = 255; @Name("3) Blue") @Comment("Choose a value for blue between 0 and 255.") @RangeInt(min = 0, max = 255) public int Blue = 255; @Name("4) Alpha Channel") @Comment("Choose a value for the opacity between 0 and 255.") @RangeInt(min = 0, max = 255) public int Alpha = 255; } public static class BreakAnimation { @Name("2) Break Animation") @Comment("Break Animation") public enumAnimation animation = enumAnimation.NONE; @Name("2) Blink Animation Speed") @Comment("Choose how fast the custom selection box blinks.") @RangeInt(min = 0, max = 100) public int Speed = 0; @Name("3) Depth Buffer") @Comment("Enable or disable the depth buffer for the custom selection box wire frame.") public boolean dBuffer = false; public enum enumAnimation { NONE, SHRINK, DOWN, ALPHA } }
-
BAsically, those first @Name calls only name the buttons. I was thinking I could use the 1) 2) and 3) to sort them properly on the screen. Instead I'll have to just alphabetize the frameRender, blinkAnimation and breakAnimation
-
Ok... I did something and I have no idea what, but the game crashes as Forge begins to load. It generates the cfg file, but it's blank. Time: 7/15/17 6:09 AM Description: There was a severe problem during mod loading that has caused the game to fail net.minecraftforge.fml.common.LoaderExceptionModCrash: Caught exception from Custom Selection Box Revised (csbr) Caused by: net.minecraftforge.fml.common.LoaderException: java.lang.RuntimeException: Error syncing field 'Red' of class 'com.fuzzybat23.csbr.ModConfig$Frame'! at net.minecraftforge.common.config.ConfigManager.sync(ConfigManager.java:192) at net.minecraftforge.fml.common.FMLModContainer.constructMod(FMLModContainer.java:609) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.sendEventToModContainer(LoadController.java:252) at net.minecraftforge.fml.common.LoadController.propogateStateMessage(LoadController.java:230) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at com.google.common.eventbus.Subscriber.invokeSubscriberMethod(Subscriber.java:91) at com.google.common.eventbus.Subscriber$SynchronizedSubscriber.invokeSubscriberMethod(Subscriber.java:150) at com.google.common.eventbus.Subscriber$1.run(Subscriber.java:76) at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:399) at com.google.common.eventbus.Subscriber.dispatchEvent(Subscriber.java:71) at com.google.common.eventbus.Dispatcher$PerThreadQueuedDispatcher.dispatch(Dispatcher.java:116) at com.google.common.eventbus.EventBus.post(EventBus.java:217) at net.minecraftforge.fml.common.LoadController.distributeStateMessage(LoadController.java:147) at net.minecraftforge.fml.common.Loader.loadMods(Loader.java:570) at net.minecraftforge.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:227) at net.minecraft.client.Minecraft.init(Minecraft.java:508) at net.minecraft.client.Minecraft.run(Minecraft.java:416) at net.minecraft.client.main.Main.main(Main.java:118) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) at GradleStart.main(GradleStart.java:26) Caused by: java.lang.RuntimeException: Error syncing field 'Red' of class 'com.fuzzybat23.csbr.ModConfig$Frame'! at net.minecraftforge.common.config.ConfigManager.sync(ConfigManager.java:300) at net.minecraftforge.common.config.ConfigManager.sync(ConfigManager.java:323) at net.minecraftforge.common.config.ConfigManager.sync(ConfigManager.java:184) ... 43 more Caused by: java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 8 general.1) custom selection box frame. ^ at java.util.regex.Pattern.error(Pattern.java:1955) at java.util.regex.Pattern.compile(Pattern.java:1700) at java.util.regex.Pattern.<init>(Pattern.java:1351) at java.util.regex.Pattern.compile(Pattern.java:1028) at java.lang.String.replaceFirst(String.java:2178) at net.minecraftforge.common.config.ConfigManager.sync(ConfigManager.java:252) ... 45 more A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- System Details -- Details: Minecraft Version: 1.12 Operating System: Windows 10 (amd64) version 10.0 Java Version: 1.8.0_131, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 950245328 bytes (906 MB) / 1135607808 bytes (1083 MB) up to 3808428032 bytes (3632 MB) JVM Flags: 0 total; IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP 9.40 Powered by Forge 14.21.1.2387 6 mods loaded, 6 mods active States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored UC minecraft{1.12} [Minecraft] (minecraft.jar) UC mcp{9.19} [Minecraft Coder Pack] (minecraft.jar) UC FML{8.0.99.99} [Forge Mod Loader] (forgeSrc-1.12-14.21.1.2387.jar) UC forge{14.21.1.2387} [Minecraft Forge] (forgeSrc-1.12-14.21.1.2387.jar) UE csbr{1.0} [Custom Selection Box Revised] (CSBR_main) UC squeedometer{1.0.3} [Squeedometer] (Squeedometer-mc1.12.x-1.0.3.jar) Loaded coremods (and transformers): GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.5.0 NVIDIA 384.76' Renderer: 'GeForce GTX 770/PCIe/SSE2' [06:09:48] [main/INFO] [STDOUT]: [net.minecraft.init.Bootstrap:printToSYSOUT:629]: #@!@# Game crashed! Crash report saved to: #@!@# E:\Users\RigAlpha\Documents\My Projects\Minecraft\Git\CSBR\run\.\crash-reports\crash-2017-07-15_06.09.48-client.txt Process finished with exit code -1 package com.fuzzybat23.csbr; import net.minecraftforge.common.config.Config; 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 = CSBR.MODID) @LangKey("csbr.config.title") public class ModConfig { @Name("1) Custom Selection Box Frame") @Comment("Color and opacity for custom selection box wire frame.") public static final Frame frameRender = new Frame(); @Name("2) Custom Selection Box Cube") @Comment("Color and opacity for custom selection box inner cube.") public static final BlinkAnimation blinkAnimation = new BlinkAnimation(); @Name("3) Custom Selection Box Animation") @Comment({"Break animation style and toggle the depth", "buffer for the custom selection box wire frame.."}) public static final BreakAnimation breakAnimation = new BreakAnimation(); public static class Frame { @Name("1) Red") @Comment("Choose a value for red between 0 and 255.") @RangeInt(min = 0, max = 255) public int Red = 255; @Name("2) Green") @Comment("Choose a value for green between 0 and 255.") @RangeInt(min = 0, max = 255) public int Green = 255; @Name("3) Blue") @Comment("Choose a value for blue between 0 and 255.") @RangeInt(min = 0, max = 255) public int Blue = 255; @Name("4) Alpha Channel") @Comment("Choose a value for the opacity between 0 and 255.") @RangeInt(min = 0, max = 255) public int Alpha = 255; @Name("5) Wire Thickness") @Comment("Choose a value for the wire frame thickness between 1 and 7.") @RangeInt(min = 1, max = 7) public int Width = 2; } public static class BlinkAnimation { @Name("1) Red") @Comment("Choose a value for red between 0 and 255.") @RangeInt(min = 0, max = 255) public int Red = 255; @Name("2) Green") @Comment("Choose a value for green between 0 and 255.") @RangeInt(min = 0, max = 255) public int Green = 255; @Name("3) Blue") @Comment("Choose a value for blue between 0 and 255.") @RangeInt(min = 0, max = 255) public int Blue = 255; @Name("4) Alpha Channel") @Comment("Choose a value for the opacity between 0 and 255.") @RangeInt(min = 0, max = 255) public int Alpha = 255; } public static class BreakAnimation { @Name("2) Break Animation") @Comment("Break Animation") public enumAnimation animation = enumAnimation.NONE; @Name("2) Blink Animation Speed") @Comment("Choose how fast the custom selection box blinks.") @RangeInt(min = 0, max = 100) public int Speed = 0; @Name("3) Depth Buffer") @Comment("Enable or disable the depth buffer for the custom selection box wire frame.") public boolean dBuffer = false; public enum enumAnimation { NONE, SHRINK, DOWN, ALPHA } } @Mod.EventBusSubscriber(modid = CSBR.MODID) private static class Handler { @SubscribeEvent public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { if (event.getModID().equals(CSBR.MODID)) { ConfigManager.sync(CSBR.MODID, Config.Type.INSTANCE); } } } }
-
Oh, the full path as it appears in the config.cfg file, then?
-
Full path of the property's category.. So.. Say, in static class Frame ConfigCategory cat = config.getCategory("ModConfig.frame"); or ConfigCategory cat = config.getCategory("com.fuzzybat23.csbr.ModConfig.frame");
-
Ahh, gotcha. Method method = ReflectionHelper.findMethod(ConfigManager.class, "getConfiguration", null, String.class, String.class); Configuration config = (Configuration)method.invoke(null, CSBR.MODID, null); So then what were we doing with this new config object that contains what again, the instance of the configuration file created in ModConfig.java?
-
config = (Configuration)method.invoke(null, CSBR.MODID, null); Is that about right?
-
I imagine of the type Configuration? Like.. Configuration config; config = method.invoke(null, CSBR.MODID, null); Only that throws an error. Incompatible Type Required: nett.minecraftforge.common.config.Configuration Found: java.lang.Object
-
Ok, so this then: @Override public void preInit(FMLPreInitializationEvent event) throws InvocationTargetException, IllegalAccessException { Method method = ReflectionHelper.findMethod(ConfigManager.class, "getConfiguration", null, String.class, String.class); method.invoke(null, CSBR.MODID, null); } But what is method.invoke being passed into, or should it look just like this?
-
So, still in public void PreInit, Method method = ReflectionHelper.findMethod(ConfigManager.class, "getConfiguration", null, String.class, String.class); is fine, it doesn't need private static final before Method? Method method = ReflectionHelper.findMethod(ConfigManager.class, "getConfiguration", null, String.class, String.class); method.invoke(Object obj, Object... args) so.. Object obj = (This needs to be an instance of ConfigManager class?) And what would the two arguments being passed into getConfiguration be, again? method.invoke(obj, string arg 1, string arg 2)
-
Now.. if I'm going to have x number of number sliders, then I wouldn't want to put all of this in public void preInit(FMLPreInitializationEvent event){ } at all, but you said in a private static final? package com.fuzzybat23.csbr.proxy; import com.fuzzybat23.csbr.CSBR; import com.fuzzybat23.csbr.ModConfig; import net.minecraftforge.common.config.ConfigManager; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.relauncher.ReflectionHelper; import java.lang.reflect.Method; public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent event) { } @Override public void Init(FMLInitializationEvent event) { } @Override public void postInit(FMLPostInitializationEvent event) { } private static final NumberSlider { Method method = ReflectionHelper.findMethod(ConfigManager.class, "getConfiguration", null, String.class, String.class); } } And I assume this Method#invoke thing would go in there as well? Now how exactly do I invoke this method? Because Method#invoke really doesn't mean anything to me at all. I even tried typing in Method#invoke and all it did was throw angry errors at me.
-
Yeah, without an actual code example that explanation is lost on me -.- So.. to grab the number slider method, then this? Method m = ReflectionHelper.findMethod(@Nonnull Class<?> clazz, @Nonnull String methodName, @Nullable String MethodObfName, Class<?>... parameterTypes) clazz = NumberSliderEntry methodName = NumberSliderEntry methodObfName = ? parameterTypes = GuiConfig owningScreen, GuiConfigEntries owningEntryList, IConfigElement configElement
-
As for the cycle string, I did it like yours and put it outside of public static class Break public enum Animation { NONE, SHRINK, DOWN, ALPHA } @Name("1) Break Animation") @Comment({"Choose a value for the animation to display when breaking blocks.", "0) NONE, 1) SHRINK, 2) DOWN. 3) ALPHA"}) public Animation animation = Animation.NONE; public static class Break { @Name("2) Depth Buffer") @Comment("Enable or disable the depth buffer for the custom selection box wire frame.") public boolean dBuffer = false; } and it did work. It refuses to save if it's inside of a class, though, which kind of sucks because I'm trying to group them by button so the different categories have their own pages.
-
You said " Use reflection to call ConfigManager.getConfiguration with the mod ID and name specified in the @Config annotation and get the Configuration instance: " I tried that. I put in Configuration c = ConfigManager.GetConfiguration But while I'm typing it in, IntelliJ tells me there is no such thing as ConfigManager.GetConfiguration. Only ConfigManager.getModConfigClasses(String modid)
-
I just don't understand this reflection stuff. I'm tryin to use tutorials but they aren't helpful either since this seems to be a very specific thing I'm trying to do. I tried this to start out, but it just throws errors in my face. package com.fuzzybat23.csbr.proxy; import com.fuzzybat23.csbr.CSBR; import com.fuzzybat23.csbr.ModConfig; import net.minecraftforge.fml.common.event.FMLInitializationEvent; import net.minecraftforge.fml.common.event.FMLPostInitializationEvent; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.relauncher.ReflectionHelper; import java.lang.reflect.Method; public class ClientProxy extends CommonProxy { @Override public void preInit(FMLPreInitializationEvent event) { Class c = null; c = Class.forName("ModConfig"); Object o = c.newInstance(); } @Override public void Init(FMLInitializationEvent event) { } @Override public void postInit(FMLPostInitializationEvent event) { } }
-
Actually, the cycle selection control only half works. It does cycle through NONE, SHRINK, DOWN and ALPHA, but it doesn't save the value last selected when clicking the Done button.
-
Yeah, normally I use PascalCase. I was writing that email from my phone at work, since our internet blocks out this forum because someone just had to put the keyword "game" in its meta data. Anyway, I did get the cycle string working. public static class Break { public enum Animation { NONE, SHRINK, DOWN, ALPHA } @Name("1) Break Animation") @Comment({"Choose a value for the animation to display when breaking blocks.", "0) NONE, 1) SHRINK, 2) DOWN. 3) ALPHA"}) public Animation animation = Animation.NONE; @Name("2) Depth Buffer") @Comment("Enable or disable the depth buffer for the custom selection box wire frame.") public boolean dBuffer = false; } Now as to the number slider.. I think I need to start fresh from scratch on that. That's the first thing you said in regard to the number slider control. So first, how exactly do I get the property from the Configuration instance forge created when I first called @Config? You mentioned that would need to go in the preInit in my ClientProxy.java, or could I insert this into my ModConfig.java? @Mod.EventHandler @SideOnly(Side.CLIENT) public void preInit(FMLPreInitializationEvent event) { }
-
I Tried, but since, as I've said, I know nothing about reflection, I'm stumbling in the dark. What I need is actual code examples I can learn from. Just simply saying use reflection confuses the hell out of me As far as the enumerate field goes, it'd look something like this? Public static class Break { @Name("Break animation") @Comment("0) none, 1)shrink 2)down 3)alpha") public enum animation { NONE, SHRINK, DOWN, ALPHA } }
-
Like I said, I know absolutely nothing about reflection, so saying call it with reflection means pretty much zero to me. I have absolutely no idea what needs to go in ClientProxy.java's preinit. Anyway, to put it into perspective, I suppose that I would need to use the expensive lookup more than once. I would prefer every data entry of my config screen to be a slider, all except for the boolean, and maybe the cycle string, which I have no idea how to create with an enum field either. As it stands, my config looks like this. package com.fuzzybat23.csbr; import net.minecraftforge.common.config.Config; 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 = CSBR.MODID) @LangKey("csbr.config.title") public class ModConfig { @Name("Custom Selection Box Frame") @Comment("Color and opacity for custom selection box wire frame.") public static final Frame frame = new Frame(); @Name("Custom Selection Box Cube") @Comment("Color and opacity for custom selection box inner cube.") public static final Blink blink = new Blink(); @Name("Animation and frame thickness.") @Comment("Break animation style and speed for custom selection box.") public static final Break b = new Break(); public static class Frame { @Name("1) Red") @Comment("Choose a value for red between 0 and 255.") @RangeInt(min = 0, max = 255) public int Red = 255; @Name("2) Green") @Comment("Choose a value for green between 0 and 255.") @RangeInt(min = 0, max = 255) public int Green = 255; @Name("3) Blue") @Comment("Choose a value for blue between 0 and 255.") @RangeInt(min = 0, max = 255) public int Blue = 255; @Name("4) Alpha Channel") @Comment("Choose a value for the opacity between 0 and 255.") @RangeInt(min = 0, max = 255) public int Alpha = 255; @Name("5) Wire Thickness") @Comment("Choose a value for the wire frame thickness between 1 and 7.") @RangeInt(min = 1, max = 7) public int Width = 2; } public static class Blink { @Name("1) Red") @Comment("Choose a value for red between 0 and 255.") @RangeInt(min = 0, max = 255) public int Red = 255; @Name("2) Green") @Comment("Choose a value for green between 0 and 255.") @RangeInt(min = 0, max = 255) public int Green = 255; @Name("3) Blue") @Comment("Choose a value for blue between 0 and 255.") @RangeInt(min = 0, max = 255) public int Blue = 255; @Name("4) Alpha Channel") @Comment("Choose a value for the opacity between 0 and 255.") @RangeInt(min = 0, max = 255) public int Alpha = 255; @Name("5) Blink Speed") @Comment("Choose how fast the custom selection box blinks.") @RangeInt(min = 0, max = 100) public int Speed = 0; } public static class Break { @Name("1) Break Animation") @Comment({"Choose a value for the animation to display when breaking blocks.", "0) NONE, 1) SHRINK, 2) DOWN. 3) ALPHA"}) @RangeInt(min = 0, max = 3) public int Animation = 0; @Name("2) Depth Buffer") @Comment("Enable or disable the depth buffer for the custom selection box wire frame.") public boolean dBuffer = false; } @Mod.EventBusSubscriber(modid = CSBR.MODID) private static class Handler { @SubscribeEvent public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) { if (event.getModID().equals(CSBR.MODID)) { ConfigManager.sync(CSBR.MODID, Config.Type.INSTANCE); } } } } which generates a nice pretty cfg as such # Configuration file general { ########################################################################################################## # custom selection box frame #--------------------------------------------------------------------------------------------------------# # Color and opacity for custom selection box wire frame. ########################################################################################################## "custom selection box frame" { # Choose a value for red between 0 and 255. # Min: 0 # Max: 255 I:"1) Red"=255 # Choose a value for green between 0 and 255. # Min: 0 # Max: 255 I:"2) Green"=255 # Choose a value for blue between 0 and 255. # Min: 0 # Max: 255 I:"3) Blue"=255 # Choose a value for the opacity between 0 and 255. # Min: 0 # Max: 255 I:"4) Alpha Channel"=255 # Choose a value for the wire frame thickness between 1 and 7. # Min: 1 # Max: 7 I:"5) Wire Thickness"=2 } ########################################################################################################## # custom selection box cube #--------------------------------------------------------------------------------------------------------# # Color and opacity for custom selection box inner cube. ########################################################################################################## "custom selection box cube" { # Choose a value for red between 0 and 255. # Min: 0 # Max: 255 I:"1) Red"=255 # Choose a value for green between 0 and 255. # Min: 0 # Max: 255 I:"2) Green"=255 # Choose a value for blue between 0 and 255. # Min: 0 # Max: 255 I:"3) Blue"=255 # Choose a value for the opacity between 0 and 255. # Min: 0 # Max: 255 I:"4) Alpha Channel"=255 # Choose how fast the custom selection box blinks. # Min: 0 # Max: 100 I:"5) Blink Speed"=0 } ########################################################################################################## # animation and frame thickness #--------------------------------------------------------------------------------------------------------# # Break animation style and speed for custom selection box. ########################################################################################################## "animation and frame thickness" { # Choose a value for the animation to display when breaking blocks. # 0) NONE, 1) SHRINK, 2) DOWN. 3) ALPHA # Min: 0 # Max: 3 I:"1) Break Animation"=0 # Enable or disable the depth buffer for the custom selection box wire frame. B:"2) Depth Buffer"=false } }
-
This is frustrating. I know nothing about reflection or the # symbol. The annotation system has a @Config.RangeInt(min = x, max = y) built in, I'd think that by using that would automatically insert a number slider.
-
So.. my main java file is pretty empty right now. package com.fuzzybat23.csbr; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @net.minecraftforge.fml.common.Mod(modid = "csbr", version = "1.0", clientSideOnly = true, acceptedMinecraftVersions = "[1.12, 1.13)") public class CSBR { @net.minecraftforge.fml.common.Mod.Instance("CSBR") public static final String MODID = "csbr"; public static CSBR instance; @Mod.EventHandler @SideOnly(Side.CLIENT) public void preInit(FMLPreInitializationEvent event) { I'd put some of that stuff you mentioned here, correct? } } I just tried putting ConfigManager.getConfiguration in there, but when I started typing, there was no option for getConfiguration, only getModConfigClasses(String str)
-
Because ConfigManager is where the numberLlist and stringList methods are located, right?
-
What would the code look like as far as the number slider goes? I think instead of a cycle button, I'll just use a number slider for that also, with a set between 0 and 4
-
I don't know how I missed that Late night coding, no doubt. Thanks! I don't suppose you know how to do a slider bar with the annotation system, or a Cycle Value String or a slider bar for picking a number, say between 0 amd 255, do you? In the other system, that uses GuiFactory, it went something like this: stringsList.add(new DummyConfigElement("cycleString", "this", ConfigGuiType.STRING, "fml.config.sample.cycleString", new String[] {"this", "property", "cycles", "through", "a", "list", "of", "valid", "choices"})); and numbersList.add((new DummyConfigElement("sliderInteger", 2000, ConfigGuiType.INTEGER, "fml.config.sample.sliderInteger", 100, 10000)).setCustomListEntryClass(NumberSliderEntry.class));