Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Forge config gui


fuzzybat23
 Share

Recommended Posts

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)
    {   }
}

 

Link to comment
Share on other sites

56 minutes ago, fuzzybat23 said:

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.

 

I just added an enum config property to my mod and it saves without issue. I'm not sure why it's not working for you.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

4 minutes ago, fuzzybat23 said:

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.

 

I've told you which methods you need to call, was there a particular part of my instructions that you didn't understand?

 

Class.forName requires the fully qualified name of the class, e.g. "java.lang.Thread" rather than just "Thread".

 

You only need to call Class.forName to get a Class object for a class that isn't known at compile-time. If you do know the class at compile-time, use a class literal instead.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

5 minutes ago, fuzzybat23 said:

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 then explained how to call it with reflection in more detail here:

 

12 hours ago, Choonster said:

You can use ReflectionHelper.findMethod to get a Method object referring to a method and then use Method#invoke to call the method. The first argument is the object to call it on (use null for static methods) and the vararg is the arguments to pass to the method.

 

If you were calling this method more than once, you'd want to store the Method object in a private static final field so you only do the expensive lookup once. The same applies to reflecting fields and Field objects.

 

When you use reflection to call a method, you don't call it directly like you would normally. You need to get the Method object for the method and then use that to call it.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

15 minutes ago, fuzzybat23 said:

As for the cycle string, I did it like yours and put it outside of public static class Break

 

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.

 

I just added two more enum properties to my mod, both of which are in a subcategory/nested class rather than the top-level category/class.

 

One uses an enum defined in the top-level class, the other uses an enum defined in the nested class. Both save without issue.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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

 

Link to comment
Share on other sites

3 minutes ago, fuzzybat23 said:

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

 

 

NumberSliderEntry isn't involved here.

 

You want to access the getConfiguration method in the ConfigManager class, so use ConfigManager.class as the clazz argument and "getConfiguration" as the methodName argument.

 

The method doesn't have an obfuscated name (since it's not added by vanilla), so use null as the methodObfName argument.

 

The method takes has two String parameters, so use String.class, String.class as the parameterTypes argument.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

2 minutes ago, fuzzybat23 said:

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? 

 

If you want to call a method multiple times, you should look up the Method object once and store it in a private static final field; yes. You then call Method#invoke on it when you want to call the method (which is usually at a different time to when the field is initialised, i.e. in a method rather than a field initialiser).

 

I've just realised that ConfigManager.getConfiguration only needs to be called once, so there's no need to store the Method object in a field. I forgot about this in my earlier posts.

 

9 minutes ago, fuzzybat23 said:

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.

 

When I say "call Class#method", I mean "call the method named method on an instance of Class". In this case, call the invoke method on the Method object.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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)

 

Link to comment
Share on other sites

14 minutes ago, fuzzybat23 said:

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?

 

It's a local variable rather than a field, so it can't be private or static. It can be final to prevent its value from being changed, but this isn't required.

 

 

Quote

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)

 

If you were calling an instance method of ConfigManager (and ConfigManager actually had any instance methods), you'd pass an instance of ConfigManager as the obj argument. Since the method you're calling is static, just pass null.

 

The two parameters of ConfigManager.getConfiguration are modid and name, which should match the values you specified in the @Config annotation. Use an empty string for name if you didn't specify it in the annotation, since that's the annotation property's default value.

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

5 minutes ago, fuzzybat23 said:

Ok, so this then:

 

That will work because the method checks if name is either null or empty, though Forge never calls it with null as the name argument (like I said in my previous post, the default value is the empty string).

 

7 minutes ago, fuzzybat23 said:

But what is method.invoke being passed into, or should it look just like this?

 

Method#invoke returns whatever the method returned. In this case it's the Configuration object, so store it in a local variable.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

1 minute ago, fuzzybat23 said:

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

 

 

It will return a value of type Configuration, but the compiler doesn't know that. You need to cast the return value to Configuration yourself.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

2 minutes ago, fuzzybat23 said:

config = (Configuration)method.invoke(null, CSBR.MODID, null);

 

Is that about right?

 

That looks correct.

 

There's no need to have the variable declaration and assignment on separate lines, though.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

14 minutes ago, fuzzybat23 said:

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?

 

The Configuration object contains the properties and categories created by Forge from your @Config class.

 

You need it to get the Property so you can set NumberSliderEntry as its config GUI entry type (i.e. use a slider for that property in the config GUI).

 

You get the Property by calling these methods:

3 hours ago, Choonster said:
  • Call Configuration#getCategory with the full path of the property's category (separating each category name with periods) to get the ConfigCategory.

  • Call ConfigCategory#get(String) with the property's name to get the Property.

 

Edited by Choonster

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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");

 

Edited by fuzzybat23
Link to comment
Share on other sites

7 hours ago, fuzzybat23 said:

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");

 

 

The full path of the category, not the full path of the field that was used to create it.

 

The default top-level category is general and the frame category is in that, so use "general.frame".

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Link to comment
Share on other sites

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);
            }
        }
    }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share




×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.