diff --git a/build.gradle b/build.gradle index 74aa270..1ece050 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'com.github.johnrengelman.shadow' version '8.1.1' - id 'fabric-loom' version '1.7-SNAPSHOT' + id 'fabric-loom' version '1.8-SNAPSHOT' id "com.modrinth.minotaur" version "2.+" } diff --git a/gradle.properties b/gradle.properties index 9933603..724f610 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,10 +1,10 @@ org.gradle.jvmargs=-Xmx2G -minecraft_version=1.21.3 -loader_version=0.16.7 +minecraft_version=1.21.4 +loader_version=0.16.9 #parchment_version=2024.05.01 # TODO: update when available -fabric_version=0.106.1+1.21.3 -modmenu_version=12.0.0-beta.1 +fabric_version=0.110.5+1.21.4 +modmenu_version=13.0.0-beta.1 configurate_version=4.1.2 maven_group=org.purpurmc.purpur.client diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9355b41..df97d72 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/src/main/java/org/purpurmc/purpur/client/PurpurClient.java b/src/main/java/org/purpurmc/purpur/client/PurpurClient.java index 6a0fa6f..aa2fd40 100644 --- a/src/main/java/org/purpurmc/purpur/client/PurpurClient.java +++ b/src/main/java/org/purpurmc/purpur/client/PurpurClient.java @@ -54,7 +54,6 @@ public void onInitializeClient() { ClientConfigurationNetworking.send(new ServerboundPurpurClientHelloPayload()); }); - if (getConfig().useWindowTitle) { Minecraft.getInstance().execute(this::updateTitle); } diff --git a/src/main/java/org/purpurmc/purpur/client/gui/SplashTexture.java b/src/main/java/org/purpurmc/purpur/client/gui/SplashTexture.java index c6525b8..74f1e05 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/SplashTexture.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/SplashTexture.java @@ -5,6 +5,7 @@ import java.io.IOException; import java.io.InputStream; import net.minecraft.client.renderer.texture.SimpleTexture; +import net.minecraft.client.renderer.texture.TextureContents; import net.minecraft.client.resources.metadata.texture.TextureMetadataSection; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.packs.resources.ResourceManager; @@ -17,13 +18,9 @@ public SplashTexture() { } @Override - protected TextureImage getTextureImage(ResourceManager resourceManager) { - TextureImage data; - try (InputStream in = PurpurClient.class.getResourceAsStream("/assets/purpurclient/textures/splash.png")) { - data = new TextureImage(new TextureMetadataSection(true, true), NativeImage.read(in)); - } catch (IOException e) { - return new TextureImage(e); + public TextureContents loadContents(ResourceManager resourceManager) throws IOException { + try (InputStream inputStream = PurpurClient.class.getResourceAsStream("/assets/purpurclient/textures/splash.png")) { + return new TextureContents(NativeImage.read(inputStream), new TextureMetadataSection(true, true)); } - return data; } } diff --git a/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java b/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java index 6b24b02..a656501 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/screen/MobScreen.java @@ -261,14 +261,18 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, double del // mouse was already down from previous screen, ignore return false; } - if (button == 0) { - this.previewYaw -= (float) (mouseX - this.mouseDownX); - this.previewPitch -= (float) (mouseY - this.mouseDownY); - clampYawPitch(); - } else if (button == 1) { - this.previewX += (mouseX - this.mouseDownX); - this.previewY += (mouseY - this.mouseDownY); + if (mouseDownX != 0 && mouseDownY != 0) { + // only move if the mouse wasn't just dragged + if (button == 0) { + this.previewYaw -= (float) (mouseX - this.mouseDownX); + this.previewPitch -= (float) (mouseY - this.mouseDownY); + clampYawPitch(); + } else if (button == 1) { + this.previewX += mouseX - this.mouseDownX; + this.previewY += mouseY - this.mouseDownY; + } } + this.mouseDownX = mouseX; this.mouseDownY = mouseY; return false; diff --git a/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java b/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java index 4f24a8a..0f643df 100644 --- a/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java +++ b/src/main/java/org/purpurmc/purpur/client/gui/screen/widget/DoubleButton.java @@ -11,6 +11,7 @@ import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.util.Mth; +import org.jetbrains.annotations.NotNull; import org.purpurmc.purpur.client.config.options.DoubleOption; public class DoubleButton extends AbstractWidget implements Tickable { @@ -127,7 +128,7 @@ public void updateWidgetNarration(NarrationElementOutput builder) { } @Override - public Component getMessage() { + public @NotNull Component getMessage() { return this.option.text(); } diff --git a/src/main/java/org/purpurmc/purpur/client/mixin/MixinLoadingOverlay.java b/src/main/java/org/purpurmc/purpur/client/mixin/MixinLoadingOverlay.java index 5613efe..8398f83 100644 --- a/src/main/java/org/purpurmc/purpur/client/mixin/MixinLoadingOverlay.java +++ b/src/main/java/org/purpurmc/purpur/client/mixin/MixinLoadingOverlay.java @@ -1,12 +1,12 @@ package org.purpurmc.purpur.client.mixin; -import com.mojang.blaze3d.systems.RenderSystem; import com.mojang.blaze3d.vertex.DefaultVertexFormat; import com.mojang.blaze3d.vertex.VertexFormat; import net.minecraft.client.renderer.RenderStateShard; import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.resources.ResourceLocation; -import net.minecraft.util.ARGB; + import net.minecraft.util.TriState; import org.purpurmc.purpur.client.PurpurClient; import org.purpurmc.purpur.client.gui.SplashTexture; @@ -69,8 +69,8 @@ public abstract class MixinLoadingOverlay { ); @Inject(method = "registerTextures", at = @At("HEAD")) - private static void registerTextures(Minecraft client, CallbackInfo ci) { - client.getTextureManager().register(SplashTexture.SPLASH, new SplashTexture()); + private static void registerTextures(TextureManager textureManager, CallbackInfo ci) { + textureManager.registerAndLoad(SplashTexture.SPLASH, new SplashTexture()); } @Inject(method = "render", at = @At("HEAD"), cancellable = true)