From 63aa998beaf277aef8888a8b65b0e52bc9f7a83f Mon Sep 17 00:00:00 2001 From: Siphalor Date: Mon, 23 Dec 2019 16:06:44 +0100 Subject: [PATCH] Update to 1.15.1 and fix mixin crash --- build.gradle | 2 +- gradle.properties | 10 +++++----- src/main/java/dynamicfps/DynamicFPSMod.java | 4 ++-- .../java/dynamicfps/mixin/GameRendererMixin.java | 13 ++++++------- .../java/dynamicfps/mixin/ThreadExecutorMixin.java | 2 +- 5 files changed, 15 insertions(+), 16 deletions(-) diff --git a/build.gradle b/build.gradle index 3d31c8e8..d0255a2f 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.2.3-SNAPSHOT' + id 'fabric-loom' version '0.2.6-SNAPSHOT' id 'maven-publish' } diff --git a/gradle.properties b/gradle.properties index 4a1ab0c1..f7085b97 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,9 +3,9 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/use - minecraft_version=19w38b - yarn_mappings=19w38b+build.9 - loader_version=0.6.2+build.166 + minecraft_version=1.15.1 + yarn_mappings=1.15.1+build.7:v2 + loader_version=0.7.2+build.175 # Mod Properties mod_version = 1.0.3 @@ -14,9 +14,9 @@ org.gradle.jvmargs=-Xmx1G # Dependencies # https://maven.fabricmc.net/net/fabricmc/fabric-api/fabric-api/ - fabric_version=0.3.4+build.236-1.15 + fabric_version=0.4.25+build.282-1.15 #developer_mode_version=1.0.14 - mod_menu_version=1.7.11-unstable.19w36a+build.3 + mod_menu_version=1.8.2+build.18 findbugs_version=3.0.2 diff --git a/src/main/java/dynamicfps/DynamicFPSMod.java b/src/main/java/dynamicfps/DynamicFPSMod.java index 6ced9ffb..5cb776c9 100644 --- a/src/main/java/dynamicfps/DynamicFPSMod.java +++ b/src/main/java/dynamicfps/DynamicFPSMod.java @@ -3,7 +3,7 @@ import net.fabricmc.api.ModInitializer; import net.minecraft.client.MinecraftClient; import net.minecraft.client.util.Window; -import net.minecraft.util.SystemUtil; +import net.minecraft.util.Util; import org.lwjgl.glfw.GLFW; import java.util.concurrent.locks.LockSupport; @@ -23,7 +23,7 @@ public static boolean checkForRender() { MinecraftClient client = MinecraftClient.getInstance(); Window window = ((WindowHolder) client).getWindow(); - long currentTime = SystemUtil.getMeasuringTimeMs(); + long currentTime = Util.getMeasuringTimeMs(); boolean isVisible = GLFW.glfwGetWindowAttrib(window.getHandle(), GLFW.GLFW_VISIBLE) != 0; boolean isFocusPaused = client.options.pauseOnLostFocus && !client.isWindowFocused(); diff --git a/src/main/java/dynamicfps/mixin/GameRendererMixin.java b/src/main/java/dynamicfps/mixin/GameRendererMixin.java index 93564bc7..e0a1af51 100644 --- a/src/main/java/dynamicfps/mixin/GameRendererMixin.java +++ b/src/main/java/dynamicfps/mixin/GameRendererMixin.java @@ -4,15 +4,14 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.screen.SplashScreen; import net.minecraft.client.render.GameRenderer; -import net.minecraft.util.SystemUtil; -import org.lwjgl.glfw.GLFW; -import org.spongepowered.asm.mixin.*; +import net.minecraft.client.util.math.MatrixStack; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import java.util.concurrent.locks.LockSupport; - @Mixin(GameRenderer.class) public class GameRendererMixin { @Shadow @@ -23,7 +22,7 @@ public class GameRendererMixin { Implements the mod's big feature. */ @Inject(at = @At("HEAD"), method = "render", cancellable = true) - private void onRender(CallbackInfo callbackInfo) { + private void onRender(float tickDelta, long limitTime, boolean tick, CallbackInfo callbackInfo) { if (!DynamicFPSMod.checkForRender()) { callbackInfo.cancel(); } @@ -33,7 +32,7 @@ private void onRender(CallbackInfo callbackInfo) { cancels world rendering under certain conditions */ @Inject(at = @At("HEAD"), method = "renderWorld", cancellable = true) - private void onRenderWorld(CallbackInfo callbackInfo) { + private void onRenderWorld(float tickDelta, long limitTime, MatrixStack matrix, CallbackInfo callbackInfo) { if (client.getOverlay() instanceof SplashScreen) { callbackInfo.cancel(); } diff --git a/src/main/java/dynamicfps/mixin/ThreadExecutorMixin.java b/src/main/java/dynamicfps/mixin/ThreadExecutorMixin.java index 70ab5329..7d4c6731 100644 --- a/src/main/java/dynamicfps/mixin/ThreadExecutorMixin.java +++ b/src/main/java/dynamicfps/mixin/ThreadExecutorMixin.java @@ -1,6 +1,6 @@ package dynamicfps.mixin; -import net.minecraft.util.ThreadExecutor; +import net.minecraft.util.thread.ThreadExecutor; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite;