Use callback-style events throughout all versions

Removes the need for //#if statements on each and every event handler.
Instead we now always use the equivalent Callback and have one central 1.12.2
class which forwards Forge events to the callbacks.
This commit is contained in:
Jonas Herzig
2021-02-22 23:11:34 +01:00
parent 0be2082fe7
commit 633bc19650
27 changed files with 110 additions and 378 deletions

View File

@@ -170,12 +170,7 @@ public class GuiReplayOverlay extends AbstractGuiOverlay<GuiReplayOverlay> {
return this;
}
//#if MC>=10800
private
//#else
//$$ public // All event handlers need to be public in 1.7.10
//#endif
class EventHandler extends EventRegistrations {
private class EventHandler extends EventRegistrations {
{ on(KeyBindingEventCallback.EVENT, this::onKeyBindingEvent); }
private void onKeyBindingEvent() {
GameOptions gameSettings = getMinecraft().options;