Open rich1051414 opened 11 years ago
Other mods can hook into the API that my mod provides so that they can move their HUD elements as well. https://github.com/maxpowa/AdvancedHUD/tree/master/advancedhud/api
Also, using events would be silly because events can be cancelled. For example, lets say "Compact Display HUD" uses events, but cancels them to stop vanilla rendering. This mod would be completely broken in that case.
You could atleast call the events. Requesting all mods to write custom versions to support your mod is silly. You should strive to make it compatible out of the box.
rich1051414 does make a point. Since 1.7 its been increasingly easier to make mods compatible with others. I.e. using dynamic ids. If you would like help I'd be glad to. I have my own mod that doesn't do a super huge amount of stuff but I do understand the basics of events.
The way I see it there are three types of HUD Items (4 if you include the cross-hairs):
In order to set this up, the code would have to recognize which type each HUDItem was and, if you wanted out-of-the-box compatibility recognize other new bars, and recognize that a resource packs can change the type.
Forge added events to the in game gui so replacing it is not necessary. Replacing it prevents all other mods that properly hook the gui from working.
https://github.com/maxpowa/AdvancedHUD/blame/master/advancedhud/TickHandler.java#L24
The RenderGameOverlay event has an eventtype variable included, so you can cancel the elements you need to, and leave the rest.