diff --git a/gradle.properties b/gradle.properties index 074e04a..fea5683 100644 --- a/gradle.properties +++ b/gradle.properties @@ -17,7 +17,7 @@ authors=ModFest contributors=Prospector, Sisby folk, acikek license=MIT # Mod Version -baseVersion=0.5.2 +baseVersion=0.5.3 # Branch Metadata branch=1.21 tagBranch=1.21 diff --git a/src/main/java/net/modfest/ballotbox/mixin/client/GameMenuScreenMixin.java b/src/main/java/net/modfest/ballotbox/mixin/client/GameMenuScreenMixin.java index 95114aa..2c059c0 100644 --- a/src/main/java/net/modfest/ballotbox/mixin/client/GameMenuScreenMixin.java +++ b/src/main/java/net/modfest/ballotbox/mixin/client/GameMenuScreenMixin.java @@ -13,6 +13,7 @@ import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.GridWidget; import net.minecraft.client.gui.widget.Widget; +import net.minecraft.sound.MusicType; import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.modfest.ballotbox.BallotBox; @@ -49,8 +50,9 @@ private static Widget replaceReportBugs(GridWidget.Adder instance, Widget widget private Widget replacePlayerReporting(GridWidget.Adder instance, Widget widget, Operation original) { if (!BallotBox.CONFIG.replace_reporting_credits.value()) return original.call(instance, widget); return instance.add(ButtonWidget.builder(Text.of(BallotBox.CONFIG.credits_text.value()), b -> { - MinecraftClient.getInstance().getMusicTracker().stop(); MinecraftClient.getInstance().setScreen(new CreditsScreen(false, () -> MinecraftClient.getInstance().setScreen((GameMenuScreen) (Object) this))); + MinecraftClient.getInstance().getMusicTracker().stop(); + MinecraftClient.getInstance().getMusicTracker().play(MusicType.CREDITS); }).width(98).build()); } diff --git a/src/main/java/net/modfest/ballotbox/mixin/client/TitleScreenMixin.java b/src/main/java/net/modfest/ballotbox/mixin/client/TitleScreenMixin.java index 4fbbef1..4993cf4 100644 --- a/src/main/java/net/modfest/ballotbox/mixin/client/TitleScreenMixin.java +++ b/src/main/java/net/modfest/ballotbox/mixin/client/TitleScreenMixin.java @@ -8,6 +8,7 @@ import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.TitleScreen; import net.minecraft.client.gui.widget.ButtonWidget; +import net.minecraft.sound.MusicType; import net.minecraft.text.Text; import net.modfest.ballotbox.BallotBox; import org.spongepowered.asm.mixin.Mixin; @@ -23,8 +24,9 @@ protected TitleScreenMixin(Text title) { private Element replaceRealms(TitleScreen instance, Element element, Operation original, int y, int spacingY) { if (!BallotBox.CONFIG.replace_realms_credits.value()) return original.call(instance, element); return addDrawableChild(ButtonWidget.builder(Text.of(BallotBox.CONFIG.credits_text.value()), b -> { - MinecraftClient.getInstance().getMusicTracker().stop(); MinecraftClient.getInstance().setScreen(new CreditsScreen(false, () -> MinecraftClient.getInstance().setScreen((TitleScreen) (Object) this))); + MinecraftClient.getInstance().getMusicTracker().stop(); + MinecraftClient.getInstance().getMusicTracker().play(MusicType.CREDITS); }) .dimensions(this.width / 2 - 100, y + spacingY * 2, 200, 20) .build()