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

[Bug/Suggestion] Config GUI Entries and the Annotation-based Config System


Recommended Posts

There's currently no way to specify custom config GUI entries for properties created through the annotation-based config system without reflecting the Configuration instance from ConfigManager and calling Property#setConfigEntryClass manually.

 

Could an annotation be added that allows a custom Property.Type or IConfigEntry class to be specified for the generated Property?

 

On a related note, it's currently not possible to use GuiConfigEntries.BooleanEntryGuiConfigEntries.CycleValueEntry or GuiConfigEntries.ChatColorEntry with Property#setConfigEntryClass because their constructors aren't public. Attempting to do so throws a NoSuchMethodException for the constructor when the config GUI is opened. It's also not possible to extend these and add a public constructor, since the constructors are private or package-private.

 

Edit: Reported this on GitHub here.

Edited by Choonster
  • Like 1

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 post
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.

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.



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • I have custom mappings. I have a repository with them. I tryed to attach them: ... minecraft { mappings channel: 'custom', version: 'com.github.GoogeTan:TheMappings:Tag' accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg') runs { client { workingDirectory project.file('run') property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' property 'forge.logging.console.level', 'debug' ... But it shouts: A problem occurred configuring root project 'PhoenixProject'. > Supplied String module notation 'net.minecraftforge:forge:1.15.2-31.2.47_mapped_custom_com.github.GoogeTan:TheMappings:Tag_at_904f7754f2116b78834cf8ff88239b5b038624fc' is invalid. Example notations: 'org.gradle:gradle-core:2.2', 'org.mockito:mockito-core:1.9.5:javadoc'. What i sould do?
    • I found a pretty thing: `IModLocator#findPath` It's look as good solve to get actual location of "service" files for each mod
    • Have you been able to generate them properly ? I'm struggling on that bit
    • The thing is that your chunk generator is generated deep inside the data pack loading - before there is even a world (check where DimensionGeneratorSettings.CODEC is used - this is what ultimately will instantiate your chunk generator). fillFromNoise will (as far as I can tell) always be called on a WorldGenRegion (don't rely on this, mods might do bad things). IWorld has a method getLevel which will return you the ServerWorld - but not all implementations will provide you something useful here (all vanilla implementations, WorldGenRegion and ServerWorld, do, but again, don't rely on this). So, you can get at the ServerWorld by calling getLevel. Now what? Well, you have achieved nothing, because you cannot use this world in a useful way. You are running on a world generation thread and ServerWorld is not threadsafe. Do not be tempted to ignore this, you will crash the game or cause strange behavior at some point. It will probably work fine for a long time. Then crash or do something stupid once - and then behave again. You could try and create some kind of thread-safe storage that your generator can then use. How do you populate it? You cannot use WorldEvent.Load because the game actually does a whole bunch of "setting up" (e.g. setting the spawn position) before that fires - which loads chunks. What you have to do instead is use AttachCapabilitiesEvent<World> which fires right from the ServerWorld constructor. In there, get your WorldSavedData and put it in a thread safe map with weak keys (Weak keys because otherwise your map will prevent worlds from being unloaded; Guava's MapMaker does this for you: MapMaker().weakKeys().makeMap()). Then you can access this map from your chunk generator using the ServerWorld you get from the IWorld. Note that whatever data you access in the WorldSavedData must still be threadsafe (for example you can't use an ArrayList). This is untested - but should work.
  • Topics

  • Who's Online (See full list)

×
×
  • Create New...

Important Information

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