diff --git a/gradle.properties b/gradle.properties index 4a73767..074e04a 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.1 +baseVersion=0.5.2 # 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 ba87887..95114aa 100644 --- a/src/main/java/net/modfest/ballotbox/mixin/client/GameMenuScreenMixin.java +++ b/src/main/java/net/modfest/ballotbox/mixin/client/GameMenuScreenMixin.java @@ -48,7 +48,10 @@ private static Widget replaceReportBugs(GridWidget.Adder instance, Widget widget @WrapOperation(method = "initWidgets", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/widget/GridWidget$Adder;add(Lnet/minecraft/client/gui/widget/Widget;)Lnet/minecraft/client/gui/widget/Widget;", ordinal = 6)) 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().setScreen(new CreditsScreen(false, () -> MinecraftClient.getInstance().setScreen((GameMenuScreen) (Object) this)))).width(98).build()); + 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))); + }).width(98).build()); } @Inject(method = "render", at = @At("TAIL")) 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 07f6c04..4fbbef1 100644 --- a/src/main/java/net/modfest/ballotbox/mixin/client/TitleScreenMixin.java +++ b/src/main/java/net/modfest/ballotbox/mixin/client/TitleScreenMixin.java @@ -22,7 +22,10 @@ protected TitleScreenMixin(Text title) { @WrapOperation(method = "initWidgetsNormal", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screen/TitleScreen;addDrawableChild(Lnet/minecraft/client/gui/Element;)Lnet/minecraft/client/gui/Element;", ordinal = 2)) 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().setScreen(new CreditsScreen(false, () -> MinecraftClient.getInstance().setScreen((TitleScreen) (Object) this)))) + 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))); + }) .dimensions(this.width / 2 - 100, y + spacingY * 2, 200, 20) .build() );