diff --git a/gradle.properties b/gradle.properties index 50c77f9..d92ea23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ org.gradle.daemon=false # Mod mod_id=cumulus_menus mod_name=Cumulus -mod_version=0.1.1 +mod_version=0.1.0 mc_version=1.20.1 neoforge_version=47.1.70 mappings=2023.08.20-1.20.1 diff --git a/src/main/java/com/aetherteam/cumulus/api/MenuHelper.java b/src/main/java/com/aetherteam/cumulus/api/MenuHelper.java index 0e2f1c2..f60633f 100644 --- a/src/main/java/com/aetherteam/cumulus/api/MenuHelper.java +++ b/src/main/java/com/aetherteam/cumulus/api/MenuHelper.java @@ -3,6 +3,7 @@ import com.aetherteam.cumulus.CumulusConfig; import com.aetherteam.cumulus.mixin.mixins.client.accessor.SplashRendererAccessor; import com.aetherteam.cumulus.mixin.mixins.client.accessor.TitleScreenAccessor; +import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; import net.minecraft.client.gui.screens.TitleScreen; import net.minecraft.sounds.Music; @@ -56,7 +57,7 @@ public void prepareMenu(Menu menu) { * @return The {@link TitleScreen} corresponding to the applied menu. */ @Nullable - public TitleScreen applyMenu(TitleScreen oldScreen, Menu menu) { + public TitleScreen applyMenu(Menu menu) { if (CumulusConfig.CLIENT.enable_menu_api.get()) { TitleScreen screen = this.checkFallbackScreen(menu, menu.getScreen()); if (this.shouldFade()) { @@ -67,7 +68,7 @@ public TitleScreen applyMenu(TitleScreen oldScreen, Menu menu) { Menu.Background background = this.checkFallbackBackground(menu, screen, menu.getBackground()); this.applyBackgrounds(background); if (this.getLastSplash() != null) { - this.migrateSplash(this.getLastSplash(), oldScreen, screen); + this.migrateSplash(this.getLastSplash(), screen); } menu.getApply().run(); return screen; @@ -178,11 +179,10 @@ public void setLastSplash(@Nullable String lastSplash) { * @param originalSplash The original splash {@link String} to transfer to a new screen. * @param newScreen The new {@link TitleScreen} to get the splash. */ - public void migrateSplash(String originalSplash, TitleScreen oldScreen, TitleScreen newScreen) { - TitleScreenAccessor oldScreenAccessor = (TitleScreenAccessor) oldScreen; + public void migrateSplash(String originalSplash, TitleScreen newScreen) { TitleScreenAccessor newScreenAccessor = (TitleScreenAccessor) newScreen; if (newScreenAccessor.cumulus$getSplash() == null) { - newScreenAccessor.setSplash(oldScreenAccessor.cumulus$getSplash()); + newScreenAccessor.setSplash(Minecraft.getInstance().getSplashManager().getSplash()); } SplashRendererAccessor splashRendererAccessor = (SplashRendererAccessor) newScreenAccessor.cumulus$getSplash(); splashRendererAccessor.cumulus$setSplash(originalSplash); diff --git a/src/main/java/com/aetherteam/cumulus/client/event/hooks/MenuHooks.java b/src/main/java/com/aetherteam/cumulus/client/event/hooks/MenuHooks.java index af86208..11b7b23 100644 --- a/src/main/java/com/aetherteam/cumulus/client/event/hooks/MenuHooks.java +++ b/src/main/java/com/aetherteam/cumulus/client/event/hooks/MenuHooks.java @@ -78,8 +78,8 @@ public static void trackFallbacks(Screen screen) { */ @Nullable public static Screen setupCustomMenu(Screen screen, MenuHelper menuHelper) { - if (CumulusConfig.CLIENT.enable_menu_api.get() && screen instanceof TitleScreen titleScreen) { - return menuHelper.applyMenu(titleScreen, menuHelper.getActiveMenu()); + if (CumulusConfig.CLIENT.enable_menu_api.get() && screen instanceof TitleScreen) { + return menuHelper.applyMenu(menuHelper.getActiveMenu()); } return screen; } diff --git a/update.json b/update.json index 0d4bf6e..68f1fd9 100644 --- a/update.json +++ b/update.json @@ -1,6 +1,6 @@ { "homepage": "https://modrinth.com/mod/cumulus", "promos": { - "1.20.1-recommended": "1.20.1-0.1.1-neoforge" + "1.20.1-recommended": "1.20.1-0.1.0-neoforge" } } \ No newline at end of file