// Path: src/main/java/de/johni0702/minecraft/gui/utils/EventRegistrations.java
// public class EventRegistrations {
//     //#if MC<=11302
//     //$$ static { new EventsAdapter().register(); }
//     //#endif
// 
//     private List<EventRegistration<?>> registrations = new ArrayList<>();
// 
//     public <T> EventRegistrations on(EventRegistration<T> registration) {
//         registrations.add(registration);
//         return this;
//     }
// 
//     public <T> EventRegistrations on(Event<T> event, T listener) {
//         return on(EventRegistration.create(event, listener));
//     }
// 
//     public void register() {
//         //#if MC<=11302
//         //$$ MinecraftForge.EVENT_BUS.register(this);
//         //#endif
//         //#if MC<10809
//         //$$ FMLCommonHandler.instance().bus().register(this);
//         //#endif
//         for (EventRegistration<?> registration : registrations) {
//             registration.register();
//         }
//     }
// 
//     public void unregister() {
//         //#if MC<=11302
//         //$$ MinecraftForge.EVENT_BUS.unregister(this);
//         //#endif
//         //#if MC<10809
//         //$$ FMLCommonHandler.instance().bus().unregister(this);
//         //#endif
//         for (EventRegistration<?> registration : registrations) {
//             registration.unregister();
//         }
//     }
// }
// 
// Path: versions/1.14.4/src/main/java/de/johni0702/minecraft/gui/versions/MatrixStack.java
// public class MatrixStack {
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/InitScreenCallback.java
// public interface InitScreenCallback {
//     Event<InitScreenCallback> EVENT = Event.create((listeners) ->
//             (screen, buttons) -> {
//                 for (InitScreenCallback listener : listeners) {
//                     listener.initScreen(screen, buttons);
//                 }
//             }
//     );
// 
//     void initScreen(Screen screen, Collection<AbstractButtonWidget> buttons);
// 
//     interface Pre {
//         Event<InitScreenCallback.Pre> EVENT = Event.create((listeners) ->
//                 (screen) -> {
//                     for (InitScreenCallback.Pre listener : listeners) {
//                         listener.preInitScreen(screen);
//                     }
//                 }
//         );
// 
//         void preInitScreen(Screen screen);
//     }
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/OpenGuiScreenCallback.java
// public interface OpenGuiScreenCallback {
//     Event<OpenGuiScreenCallback> EVENT = Event.create((listeners) ->
//             (screen) -> {
//                 for (OpenGuiScreenCallback listener : listeners) {
//                     listener.openGuiScreen(screen);
//                 }
//             }
//     );
// 
//     void openGuiScreen(Screen screen);
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/PostRenderScreenCallback.java
// public interface PostRenderScreenCallback {
//     Event<PostRenderScreenCallback> EVENT = Event.create((listeners) ->
//             (stack, partialTicks) -> {
//                 for (PostRenderScreenCallback listener : listeners) {
//                     listener.postRenderScreen(stack, partialTicks);
//                 }
//             }
//     );
// 
//     void postRenderScreen(MatrixStack stack, float partialTicks);
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/PreTickCallback.java
// public interface PreTickCallback {
//     Event<PreTickCallback> EVENT = Event.create((listeners) ->
//             () -> {
//                 for (PreTickCallback listener : listeners) {
//                     listener.preTick();
//                 }
//             }
//     );
// 
//     void preTick();
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/RenderHudCallback.java
// public interface RenderHudCallback {
//     Event<RenderHudCallback> EVENT = Event.create((listeners) ->
//             (stack, partialTicks) -> {
//                 for (RenderHudCallback listener : listeners) {
//                     listener.renderHud(stack, partialTicks);
//                 }
//             }
//     );
// 
//     void renderHud(MatrixStack stack, float partialTicks);
// }


import de.johni0702.minecraft.gui.utils.EventRegistrations;
import de.johni0702.minecraft.gui.versions.MatrixStack;
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
import de.johni0702.minecraft.gui.versions.callbacks.OpenGuiScreenCallback;
import de.johni0702.minecraft.gui.versions.callbacks.PostRenderScreenCallback;
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
import de.johni0702.minecraft.gui.versions.callbacks.RenderHudCallback;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import java.util.List;
package de.johni0702.minecraft.gui.versions.forge;



public class EventsAdapter extends EventRegistrations {
    public static GuiScreen getScreen(GuiScreenEvent event) {
        //#if MC>=10904
        return event.getGui();
        //#else
        //$$ return event.gui;
        //#endif
    }

    public static List<GuiButton> getButtonList(GuiScreenEvent.InitGuiEvent event) {
        //#if MC>=10904
        return event.getButtonList();
        //#else
        //$$ return event.buttonList;
        //#endif
    }

    @SubscribeEvent
    public void preGuiInit(GuiScreenEvent.InitGuiEvent.Pre event) {
        InitScreenCallback.Pre.EVENT.invoker().preInitScreen(getScreen(event));
    }

    @SubscribeEvent
// Path: src/main/java/de/johni0702/minecraft/gui/utils/EventRegistrations.java
// public class EventRegistrations {
//     //#if MC<=11302
//     //$$ static { new EventsAdapter().register(); }
//     //#endif
// 
//     private List<EventRegistration<?>> registrations = new ArrayList<>();
// 
//     public <T> EventRegistrations on(EventRegistration<T> registration) {
//         registrations.add(registration);
//         return this;
//     }
// 
//     public <T> EventRegistrations on(Event<T> event, T listener) {
//         return on(EventRegistration.create(event, listener));
//     }
// 
//     public void register() {
//         //#if MC<=11302
//         //$$ MinecraftForge.EVENT_BUS.register(this);
//         //#endif
//         //#if MC<10809
//         //$$ FMLCommonHandler.instance().bus().register(this);
//         //#endif
//         for (EventRegistration<?> registration : registrations) {
//             registration.register();
//         }
//     }
// 
//     public void unregister() {
//         //#if MC<=11302
//         //$$ MinecraftForge.EVENT_BUS.unregister(this);
//         //#endif
//         //#if MC<10809
//         //$$ FMLCommonHandler.instance().bus().unregister(this);
//         //#endif
//         for (EventRegistration<?> registration : registrations) {
//             registration.unregister();
//         }
//     }
// }
// 
// Path: versions/1.14.4/src/main/java/de/johni0702/minecraft/gui/versions/MatrixStack.java
// public class MatrixStack {
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/InitScreenCallback.java
// public interface InitScreenCallback {
//     Event<InitScreenCallback> EVENT = Event.create((listeners) ->
//             (screen, buttons) -> {
//                 for (InitScreenCallback listener : listeners) {
//                     listener.initScreen(screen, buttons);
//                 }
//             }
//     );
// 
//     void initScreen(Screen screen, Collection<AbstractButtonWidget> buttons);
// 
//     interface Pre {
//         Event<InitScreenCallback.Pre> EVENT = Event.create((listeners) ->
//                 (screen) -> {
//                     for (InitScreenCallback.Pre listener : listeners) {
//                         listener.preInitScreen(screen);
//                     }
//                 }
//         );
// 
//         void preInitScreen(Screen screen);
//     }
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/OpenGuiScreenCallback.java
// public interface OpenGuiScreenCallback {
//     Event<OpenGuiScreenCallback> EVENT = Event.create((listeners) ->
//             (screen) -> {
//                 for (OpenGuiScreenCallback listener : listeners) {
//                     listener.openGuiScreen(screen);
//                 }
//             }
//     );
// 
//     void openGuiScreen(Screen screen);
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/PostRenderScreenCallback.java
// public interface PostRenderScreenCallback {
//     Event<PostRenderScreenCallback> EVENT = Event.create((listeners) ->
//             (stack, partialTicks) -> {
//                 for (PostRenderScreenCallback listener : listeners) {
//                     listener.postRenderScreen(stack, partialTicks);
//                 }
//             }
//     );
// 
//     void postRenderScreen(MatrixStack stack, float partialTicks);
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/PreTickCallback.java
// public interface PreTickCallback {
//     Event<PreTickCallback> EVENT = Event.create((listeners) ->
//             () -> {
//                 for (PreTickCallback listener : listeners) {
//                     listener.preTick();
//                 }
//             }
//     );
// 
//     void preTick();
// }
// 
// Path: src/main/java/de/johni0702/minecraft/gui/versions/callbacks/RenderHudCallback.java
// public interface RenderHudCallback {
//     Event<RenderHudCallback> EVENT = Event.create((listeners) ->
//             (stack, partialTicks) -> {
//                 for (RenderHudCallback listener : listeners) {
//                     listener.renderHud(stack, partialTicks);
//                 }
//             }
//     );
// 
//     void renderHud(MatrixStack stack, float partialTicks);
// }


// Path: versions/1.12/src/main/java/de/johni0702/minecraft/gui/versions/forge/EventsAdapter.java
import de.johni0702.minecraft.gui.utils.EventRegistrations;
import de.johni0702.minecraft.gui.versions.MatrixStack;
import de.johni0702.minecraft.gui.versions.callbacks.InitScreenCallback;
import de.johni0702.minecraft.gui.versions.callbacks.OpenGuiScreenCallback;
import de.johni0702.minecraft.gui.versions.callbacks.PostRenderScreenCallback;
import de.johni0702.minecraft.gui.versions.callbacks.PreTickCallback;
import de.johni0702.minecraft.gui.versions.callbacks.RenderHudCallback;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraftforge.client.event.GuiOpenEvent;
import net.minecraftforge.client.event.GuiScreenEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
import java.util.List;

package de.johni0702.minecraft.gui.versions.forge;



public class EventsAdapter extends EventRegistrations {
    public static GuiScreen getScreen(GuiScreenEvent event) {
        //#if MC>=10904
        return event.getGui();
        //#else
        //$$ return event.gui;
        //#endif
    }

    public static List<GuiButton> getButtonList(GuiScreenEvent.InitGuiEvent event) {
        //#if MC>=10904
        return event.getButtonList();
        //#else
        //$$ return event.buttonList;
        //#endif
    }

    @SubscribeEvent
    public void preGuiInit(GuiScreenEvent.InitGuiEvent.Pre event) {
        InitScreenCallback.Pre.EVENT.invoker().preInitScreen(getScreen(event));
    }

    @SubscribeEvent
    public void onGuiInit(GuiScreenEvent.InitGuiEvent.Post event) {