Skip to content

Commit

Permalink
1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed Jun 15, 2024
1 parent 007c1bb commit 85f086f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ base {

repositories {
maven { url "https://maven.terraformersmc.com/releases/" }
maven { url "https://maven.wispforest.io/" }
maven { url "https://maven.wispforest.io/releases/" }
}

dependencies {
Expand All @@ -40,14 +40,14 @@ processResources {
}

tasks.withType(JavaCompile).configureEach {
it.options.release = 17
it.options.release = 21
}

java {
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop/
minecraft_base_version=1.20.5
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.3
minecraft_base_version=1.21
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11
# Mod Properties
mod_version=0.1.3
maven_group=io.wispforest
archives_base_name=ok-boomer
# Dependencies
# check this on https://fabricmc.net/develop/
fabric_version=0.99.0+1.20.6
fabric_version=0.100.1+1.21

# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.12.8+1.20.5
owo_version=0.12.10+1.21

# https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/
modmenu_version=10.0.0-beta.1
modmenu_version=11.0.0-rc.2
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.render.RenderTickCounter;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.math.RotationAxis;
import org.joml.Vector4f;
Expand Down Expand Up @@ -52,11 +53,11 @@ private double injectBoomer(double fov) {
method = "render",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/client/MinecraftClient;getLastFrameDuration()F",
target = "Lnet/minecraft/client/render/RenderTickCounter;getLastDuration()F",
ordinal = 1
)
)
private void injectScreenBoomer(float tickDelta, long startTime, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int mouseX, @Local(ordinal = 1) int mouseY) {
private void injectScreenBoomer(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local(ordinal = 0) int mouseX, @Local(ordinal = 1) int mouseY) {
if (OkBoomer.currentlyScreenBooming != this.boom$screenBoomEnabled) {
if (this.boom$screenBoomEnabled) {
OkBoomer.screenBoom = 1;
Expand Down Expand Up @@ -89,8 +90,8 @@ private void injectScreenBoomer(float tickDelta, long startTime, boolean tick, C

if (OkBoomer.CONFIG.boomTransition()) {
this.boom$lastScreenBoom += .45 * (OkBoomer.screenBoom - this.boom$lastScreenBoom) * boom$interpolator();
this.boom$lastMouseX += .65 * (mouseX - this.boom$lastMouseX) * MinecraftClient.getInstance().getLastFrameDuration();
this.boom$lastMouseY += .65 * (mouseY - this.boom$lastMouseY) * MinecraftClient.getInstance().getLastFrameDuration();
this.boom$lastMouseX += .65 * (mouseX - this.boom$lastMouseX) * tickCounter.getLastFrameDuration();
this.boom$lastMouseY += .65 * (mouseY - this.boom$lastMouseY) * tickCounter.getLastFrameDuration();

this.boom$lastScreenBoom = boom$nudge(this.boom$lastScreenBoom, 1);
this.boom$lastMouseX = boom$nudge(this.boom$lastMouseX, mouseX);
Expand All @@ -110,7 +111,7 @@ private void injectScreenBoomer(float tickDelta, long startTime, boolean tick, C
shift = At.Shift.AFTER
)
)
private void bottomText(float tickDelta, long startTime, boolean tick, CallbackInfo ci, @Local DrawContext drawContext) {
private void bottomText(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci, @Local DrawContext drawContext) {
drawContext.draw();

if (OkBoomer.CONFIG.iDoNotEndorseTomfoolery()) return;
Expand Down Expand Up @@ -174,7 +175,7 @@ private void transformMouse(Args args) {
shift = At.Shift.AFTER
)
)
private void uninjectScreenBoomer(float tickDelta, long startTime, boolean tick, CallbackInfo ci) {
private void uninjectScreenBoomer(RenderTickCounter tickCounter, boolean tick, CallbackInfo ci) {
RenderSystem.getModelViewStack().popMatrix();
RenderSystem.applyModelViewMatrix();
}
Expand All @@ -184,7 +185,7 @@ private void uninjectScreenBoomer(float tickDelta, long startTime, boolean tick,
}

private static float boom$interpolator() {
return MinecraftClient.getInstance().getLastFrameDuration() * OkBoomer.CONFIG.boomTransitionSpeed();
return MinecraftClient.getInstance().getRenderTickCounter().getLastFrameDuration() * OkBoomer.CONFIG.boomTransitionSpeed();
}

}

0 comments on commit 85f086f

Please sign in to comment.