Skip to content

Commit

Permalink
Fix #58
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Jan 21, 2024
1 parent 0ac6176 commit 4fa3be2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.ConnectScreen;
import net.minecraft.client.gui.screens.Overlay;
import net.minecraft.client.gui.screens.ProgressScreen;
import net.minecraft.client.gui.screens.Screen;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
Expand Down Expand Up @@ -74,7 +75,12 @@ private void tickEvent(CallbackInfo ci) {

@Inject(method = "setScreen", at = @At("HEAD"))
private void clearCurrentlyConnecting(Screen guiScreen, CallbackInfo ci) {
if (!(guiScreen instanceof ConnectScreen) && !(guiScreen instanceof JoiningWorldHostScreen) && WorldHost.protoClient != null) {
if (
!(guiScreen instanceof ConnectScreen) &&
!(guiScreen instanceof JoiningWorldHostScreen) &&
!(guiScreen instanceof ProgressScreen) &&
WorldHost.protoClient != null
) {
WorldHost.protoClient.setAttemptingToJoin(null);
}
}
Expand Down
2 changes: 1 addition & 1 deletion version.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ base.archivesName.set(rootProject.name)
// to MMmmPP
val mcVersion by extra(mcVersionString.split(".").map { it.toInt() }
.let {
it[0] * 1_00_00 + it[1] * 1_00 + (if (it.size == 2 || it[2] == 0) 0 else it[2])
it[0] * 1_00_00 + it[1] * 1_00 + it.getOrElse(2) { 0 }
})

println("MC_VERSION: $mcVersionString $mcVersion")
Expand Down

0 comments on commit 4fa3be2

Please sign in to comment.