Skip to content

Instantly share code, notes, and snippets.

@MSourceCoded
Created November 23, 2014 05:43
Show Gist options
  • Save MSourceCoded/b58a21149e93f0a21131 to your computer and use it in GitHub Desktop.
Save MSourceCoded/b58a21149e93f0a21131 to your computer and use it in GitHub Desktop.
The overhead for injecting my own GuiFactories is fairly small. 1-2 methods tops, getting the private field and adding a value to the hashmap inside. This is done once, at runtime.
However, forge uses reflection to create a GuiConfig each time you hit the button. You pass it a class name, it will crawl the constructors and instantiate it itself. This is done in an Instanced method (IModGuiFactory), but expects a Static value (class name). Letting us pass an instance would be much, much more efficient, as well as being miles more flexible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment