bspkrs

New Forge Configuration Stuff

Jul 15th, 2014
526
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.92 KB | None | 0 0
  1. Property class - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html
  2.  
  3. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setArrayEntryClass(java.lang.Class)
  4. ~ used to set the IArrayEntry class that will be used for an array property's array editing screen
  5. ~ could be useful for stuff like an array of strings that represent itemstacks, and so could have separate text fields for each portion of the itemstack
  6.  
  7. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setConfigEntryClass(java.lang.Class)
  8. ~ used to set the IConfigEntry class that will be used for this property's slot on the config GUI
  9. ~ this is useful if the modder wants to extend functionality of a provided entry class or implement a completely new entry class
  10. ~ could be used to do things like replace the default numeric controls with the non-default slider control https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/cpw/mods/fml/client/config/GuiConfigEntries.NumberSliderEntry.html
  11.  
  12. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setIsListLengthFixed(boolean)
  13. ~ only relevant to array properties
  14. ~ sets whether the array length is fixed or not (the fixed length is determined by the length of the default or read array, or by the setMaxListLength method if used)
  15. ~ when this method is called with a value of true the array editing gui will not show the buttons that allow adding new entry rows
  16.  
  17. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setMaxListLength(int)
  18. ~ only relevant to array properties
  19. ~ sets the max length of this array property (by default arrays do not have a max length)
  20. ~ when this method is called the stored array will be resized if it is larger than the max value, or if getIsFixedLength() == true and the list size differs from the max size defined
  21.  
  22. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setLanguageKey(java.lang.String)
  23. ~ everyone should use this so that their GUIs can be localized by users if desired and the GUIs have nice pretty names
  24. ~ the key defined here is used for both the property display name and the text of the property tooltip
  25. ~ if the key given is "mymod.config.myprop" the tooltip key expected is "mymod.config.myprop.tooltip"
  26. ~ the language translation methods use the vanilla .lang files
  27.  
  28. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setRequiresMcRestart(boolean)
  29. ~ sets the flag indicating that changing this property requires MC to be restarted to take effect
  30. ~ when users modify the value of a property that has this flag set a message will be shown upon saving (when the Done button is pressed on the top-level config GUI)
  31. ~ this flag also prevents a property from being edited while a world is currently running
  32.  
  33. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setRequiresWorldRestart(boolean)
  34. ~ sets the flag indicating that this property should not be changed while a world is currently running
  35. ~ when a world is running properties with this flag set will be disabled
  36. ~ if setRequiresMcRestart(boolean) is used it is not necessary to separately call this method
  37.  
  38. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setShowInGui(boolean)
  39. ~ sets the flag for whether or not to show this property on a config GUI (default is true)
  40. ~ Lex asked me to add this, and it is used for one or two settings in the Forge config, but most people will probably not need to use this
  41.  
  42. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setValidationPattern(java.util.regex.Pattern)
  43. ~ sets a Regex validation pattern object that will be used for String properties that allow keyboard input
  44. ~ useful for String properties that require input in a certain format in order to be parsed correctly
  45.  
  46. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Property.html#setValidValues(java.lang.String[])
  47. ~ when set for a String property the control will be a value cycling button rather than a text box
  48. ~ useful for properties that have a limited number of strings that are valid (such as choosing a display orientation or a world type)
  49.  
  50.  
  51. ConfigCategory class - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html
  52.  
  53. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html#setConfigEntryClass(java.lang.Class)
  54. ~ used to set the IConfigEntry class that will be used for this category's slot on the config GUI
  55. ~ this is useful if the modder wants to extend functionality of a provided entry class or implement a completely new entry class
  56. ~ could be used to extend the CategoryEntryClass so that the list of child screen entries can be altered (such as adding custom controls)
  57.  
  58. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html#setLanguageKey(java.lang.String)
  59. ~ everyone should use this so that their GUIs can be localized by users if desired and the GUIs have nice pretty names
  60. ~ the key defined here is used for both the category display name and the text of the category tooltip
  61. ~ if the key given is "mymod.config.myctgy" the tooltip key expected is "mymod.config.myctgy.tooltip"
  62. ~ the language translation methods use the vanilla .lang files
  63.  
  64. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html#setPropertyOrder(java.util.List)
  65. ~ used to define the order that child properties will be displayed on GUIs and written to the .cfg file
  66. ~ provides an easy way to group together properties that make sense to be near each other if sub-categories would be overkill
  67.  
  68. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html#setRequiresMcRestart(boolean)
  69. ~ basically is a faster way to flag all child properties as requiring an MC restart to take effect
  70.  
  71. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html#setRequiresWorldRestart(boolean)
  72. ~ basically is a faster way to flag all child properties as unable to be edited while a world is running
  73.  
  74. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigCategory.html#setShowInGui(boolean)
  75. ~ defaults to true
  76. ~ gives a way to hide categories that are provided as a template for users to copy and modify when using the file config
  77.  
  78.  
  79. Configuration class - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html
  80.  
  81. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#Configuration(java.io.File,%20java.lang.String)
  82. ~ Configuration objects are now able to be versioned!
  83. ~ this gives modders a way to check the version of a config file and either completely replace it or update it as needed via https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#getLoadedConfigVersion()
  84.  
  85. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#setCategoryConfigEntryClass(java.lang.String,%20java.lang.Class)
  86. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#setCategoryLanguageKey(java.lang.String,%20java.lang.String)
  87. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#setCategoryRequiresMcRestart(java.lang.String,%20boolean)
  88. - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#setCategoryRequiresWorldRestart(java.lang.String,%20boolean)
  89. ~ convenience methods for setting GUI-related fields on a category similar to https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/Configuration.html#addCustomCategoryComment(java.lang.String,%20java.lang.String)
  90.  
  91.  
  92. ConfigElement class - https://dl.dropboxusercontent.com/u/20748481/Minecraft/ForgeJD/net/minecraftforge/common/config/ConfigElement.html
  93.  
  94. - this is a completely new class that implements IConfigElement, the interface that allows the config GUI screens to read from config objects and save back to them
  95. - might be useful to just highlight it as the bridge between Forge config classes and the FML GUI stuff
Advertisement
Add Comment
Please, Sign In to add comment