Skip to content

Commit

Permalink
Fix forge events
Browse files Browse the repository at this point in the history
  • Loading branch information
dima-dencep committed Jun 26, 2023
1 parent 983aafb commit c11ffa5
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.github.dimadencep.mods.rrls.accessor.SplashAccessor;
import com.github.dimadencep.mods.rrls.config.ModConfig;
import me.shedaniel.autoconfig.AutoConfig;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.client.event.RenderGuiEvent;
import net.minecraftforge.client.ConfigGuiHandler;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.ScreenEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.TickEvent;
Expand All @@ -29,21 +29,21 @@ public RrlsForge() {
MinecraftForge.EVENT_BUS.register(this);

ModLoadingContext.get().registerExtensionPoint(
ConfigScreenHandler.ConfigScreenFactory.class,
() -> new ConfigScreenHandler.ConfigScreenFactory(
ConfigGuiHandler.ConfigGuiFactory.class,
() -> new ConfigGuiHandler.ConfigGuiFactory(
(mc, screen) -> AutoConfig.getConfigScreen(ModConfig.class, screen).get()
)
);
}

@SubscribeEvent
public void onRenderGui(RenderGuiEvent.Pre event) {
public void onRenderGui(RenderGameOverlayEvent.Pre event) {
if (this.client.overlay instanceof SplashAccessor accessor && accessor.isAttached())
accessor.render(event.getPoseStack(), true);
accessor.render(event.getMatrixStack(), true);
}

@SubscribeEvent
public void onScreenRender(ScreenEvent.Render event) {
public void onScreenRender(ScreenEvent.DrawScreenEvent event) {
if (this.client.overlay instanceof SplashAccessor accessor && accessor.isAttached())
accessor.render(event.getPoseStack(), false);
}
Expand Down

0 comments on commit c11ffa5

Please sign in to comment.