Skip to content

Commit

Permalink
Merge pull request #3 from Siphalor/master
Browse files Browse the repository at this point in the history
Update to 1.15.1 and fix mixin crash
  • Loading branch information
juliand665 authored Dec 24, 2019
2 parents 1b22a8a + 63aa998 commit 2bfa417
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.2.3-SNAPSHOT'
id 'fabric-loom' version '0.2.6-SNAPSHOT'
id 'maven-publish'
}

Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
4 changes: 2 additions & 2 deletions src/main/java/dynamicfps/DynamicFPSMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down
13 changes: 6 additions & 7 deletions src/main/java/dynamicfps/mixin/GameRendererMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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();
}
Expand All @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/dynamicfps/mixin/ThreadExecutorMixin.java
Original file line number Diff line number Diff line change
@@ -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;

Expand Down

0 comments on commit 2bfa417

Please sign in to comment.