From 56ba3ea84bfecd98d3cb7ebdd803fafb97dee0e0 Mon Sep 17 00:00:00 2001 From: glisco Date: Sun, 16 Jun 2024 00:28:07 +0200 Subject: [PATCH] 1.21 --- build.gradle | 8 ++++---- gradle.properties | 12 ++++++------ .../glisco/isometricrenders/IsometricRenders.java | 2 +- .../isometricrenders/mixin/MinecraftClientMixin.java | 2 +- .../isometricrenders/mixin/WorldRendererMixin.java | 9 +++------ .../property/DefaultPropertyBundle.java | 2 +- .../isometricrenders/render/AreaRenderable.java | 2 +- .../glisco/isometricrenders/screen/RenderScreen.java | 2 +- .../isometricrenders/util/IsometricChannel.java | 2 +- .../widget/PropertyCheckboxComponent.java | 7 +++++-- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build.gradle b/build.gradle index d9c55b1..02c4331 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ base { } repositories { - maven { url "https://maven.wispforest.io" } + maven { url "https://maven.wispforest.io/releases/" } } loom { @@ -46,14 +46,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 { diff --git a/gradle.properties b/gradle.properties index e7741a7..4bac936 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,9 +2,9 @@ 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.1 +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.4.7 @@ -12,13 +12,13 @@ maven_group=com.glisco archives_base_name=isometric-renders # Dependencies -fabric_version=0.98.0+1.20.6 +fabric_version=0.100.1+1.21 # https://maven.wispforest.io/io/wispforest/worldmesher/ -worldmesher_version=0.4.5+1.20.3 +worldmesher_version=0.4.6+1.21 # https://maven.wispforest.io/io/wispforest/exo/ exo_version=0.1.5+1.19 # https://maven.wispforest.io/io/wispforest/owo-lib/ -owo_version=0.12.8+1.20.5 +owo_version=0.12.10+1.21 diff --git a/src/main/java/com/glisco/isometricrenders/IsometricRenders.java b/src/main/java/com/glisco/isometricrenders/IsometricRenders.java index 53c24af..17bca5b 100644 --- a/src/main/java/com/glisco/isometricrenders/IsometricRenders.java +++ b/src/main/java/com/glisco/isometricrenders/IsometricRenders.java @@ -52,7 +52,7 @@ public void onInitializeClient() { final var ioStateId = "io-state"; final var areaSelectionHintId = "area-selection-hint"; - var hudId = new Identifier("isometric-renders", "hud"); + var hudId = Identifier.of("isometric-renders", "hud"); Hud.add(hudId, () -> Containers.verticalFlow(Sizing.content(), Sizing.content()).positioning(Positioning.absolute(20, 20))); HudRenderCallback.EVENT.register((matrixStack, tickDelta) -> { diff --git a/src/main/java/com/glisco/isometricrenders/mixin/MinecraftClientMixin.java b/src/main/java/com/glisco/isometricrenders/mixin/MinecraftClientMixin.java index 7bbf1cf..9efb51c 100644 --- a/src/main/java/com/glisco/isometricrenders/mixin/MinecraftClientMixin.java +++ b/src/main/java/com/glisco/isometricrenders/mixin/MinecraftClientMixin.java @@ -20,7 +20,7 @@ private void openScheduled(Screen screen, CallbackInfo ci) { ci.cancel(); } - @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderTickCounter;beginRenderTick(J)I")) + @Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderTickCounter$Dynamic;beginRenderTick(JZ)I")) private void onRenderStart(boolean tick, CallbackInfo ci) { ClientRenderCallback.EVENT.invoker().onRenderStart((MinecraftClient) (Object) this); } diff --git a/src/main/java/com/glisco/isometricrenders/mixin/WorldRendererMixin.java b/src/main/java/com/glisco/isometricrenders/mixin/WorldRendererMixin.java index 0c93e0d..292dda1 100644 --- a/src/main/java/com/glisco/isometricrenders/mixin/WorldRendererMixin.java +++ b/src/main/java/com/glisco/isometricrenders/mixin/WorldRendererMixin.java @@ -4,10 +4,7 @@ import com.glisco.isometricrenders.util.AreaSelectionHelper; import com.llamalad7.mixinextras.sugar.Local; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.render.Camera; -import net.minecraft.client.render.GameRenderer; -import net.minecraft.client.render.LightmapTextureManager; -import net.minecraft.client.render.WorldRenderer; +import net.minecraft.client.render.*; import net.minecraft.client.util.math.MatrixStack; import org.joml.Matrix4f; import org.objectweb.asm.Opcodes; @@ -26,7 +23,7 @@ public class WorldRendererMixin { private MinecraftClient client; @Inject(method = "render", at = @At("HEAD"), cancellable = true) - public void dontRenderInScreen(float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) { + public void dontRenderInScreen(RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci) { if (!IsometricRenders.skipWorldRender) return; IsometricRenders.skipWorldRender = false; @@ -34,7 +31,7 @@ public void dontRenderInScreen(float tickDelta, long limitTime, boolean renderBl } @Inject(method = "render", at = @At(value = "FIELD", target = "Lnet/minecraft/client/MinecraftClient;crosshairTarget:Lnet/minecraft/util/hit/HitResult;", opcode = Opcodes.GETFIELD, ordinal = 1)) - public void drawAreaSelection(float tickDelta, long limitTime, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci, @Local(ordinal = 0) MatrixStack matrices) { + public void drawAreaSelection(RenderTickCounter tickCounter, boolean renderBlockOutline, Camera camera, GameRenderer gameRenderer, LightmapTextureManager lightmapTextureManager, Matrix4f matrix4f, Matrix4f matrix4f2, CallbackInfo ci, @Local(ordinal = 0) MatrixStack matrices) { AreaSelectionHelper.renderSelectionBox(matrices, camera); } diff --git a/src/main/java/com/glisco/isometricrenders/property/DefaultPropertyBundle.java b/src/main/java/com/glisco/isometricrenders/property/DefaultPropertyBundle.java index 3682fdd..0c4a2b3 100644 --- a/src/main/java/com/glisco/isometricrenders/property/DefaultPropertyBundle.java +++ b/src/main/java/com/glisco/isometricrenders/property/DefaultPropertyBundle.java @@ -82,7 +82,7 @@ public float rotationOffset() { protected void updateAndApplyRotationOffset(Matrix4fStack modelViewStack) { if (rotationSpeed.get() != 0) { if (!this.rotationOffsetUpdated) { - rotationOffset += MinecraftClient.getInstance().getLastFrameDuration() * rotationSpeed.get() * .1f; + rotationOffset += MinecraftClient.getInstance().getRenderTickCounter().getLastFrameDuration() * rotationSpeed.get() * .1f; this.rotationOffsetUpdated = true; } modelViewStack.rotate(RotationAxis.POSITIVE_Y.rotationDegrees(rotationOffset)); diff --git a/src/main/java/com/glisco/isometricrenders/render/AreaRenderable.java b/src/main/java/com/glisco/isometricrenders/render/AreaRenderable.java index 8148484..8beae6d 100644 --- a/src/main/java/com/glisco/isometricrenders/render/AreaRenderable.java +++ b/src/main/java/com/glisco/isometricrenders/render/AreaRenderable.java @@ -73,7 +73,7 @@ public void emitVertices(MatrixStack matrices, VertexConsumerProvider vertexCons super.draw(RenderSystem.getModelViewMatrix()); - final var effectiveDelta = mesh.entitiesFrozen() ? 0 : client.getTickDelta(); + final var effectiveDelta = mesh.entitiesFrozen() ? 0 : client.getRenderTickCounter().getTickDelta(false); final var entities = mesh.renderInfo().entities(); entities.forEach((vec3d, entry) -> { if (!mesh.entitiesFrozen()) { diff --git a/src/main/java/com/glisco/isometricrenders/screen/RenderScreen.java b/src/main/java/com/glisco/isometricrenders/screen/RenderScreen.java index c8492ae..92a8109 100644 --- a/src/main/java/com/glisco/isometricrenders/screen/RenderScreen.java +++ b/src/main/java/com/glisco/isometricrenders/screen/RenderScreen.java @@ -323,7 +323,7 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) { } final var window = client.getWindow(); - final var effectiveTickDelta = playAnimations.get() ? client.getTickDelta() : 0; + final var effectiveTickDelta = playAnimations.get() ? client.getRenderTickCounter().getTickDelta(false) : 0; RenderableDispatcher.drawIntoActiveFramebuffer( this.renderable, window.getFramebufferWidth() / (float) window.getFramebufferHeight(), diff --git a/src/main/java/com/glisco/isometricrenders/util/IsometricChannel.java b/src/main/java/com/glisco/isometricrenders/util/IsometricChannel.java index 9e8196a..072415d 100644 --- a/src/main/java/com/glisco/isometricrenders/util/IsometricChannel.java +++ b/src/main/java/com/glisco/isometricrenders/util/IsometricChannel.java @@ -21,7 +21,7 @@ public IsometricChannel() { addCommand("render-item", (port, arguments) -> { if (arguments.length < 1) return Exo.join("error", "missing item id"); - final var id = new Identifier(arguments[0]); + final var id = Identifier.of(arguments[0]); final var client = MinecraftClient.getInstance(); if (Registries.ITEM.containsId(id)) { diff --git a/src/main/java/com/glisco/isometricrenders/widget/PropertyCheckboxComponent.java b/src/main/java/com/glisco/isometricrenders/widget/PropertyCheckboxComponent.java index 7845a07..d81dd42 100644 --- a/src/main/java/com/glisco/isometricrenders/widget/PropertyCheckboxComponent.java +++ b/src/main/java/com/glisco/isometricrenders/widget/PropertyCheckboxComponent.java @@ -1,17 +1,20 @@ package com.glisco.isometricrenders.widget; import com.glisco.isometricrenders.property.Property; +import io.wispforest.owo.ui.component.CheckboxComponent; import net.minecraft.client.MinecraftClient; import net.minecraft.client.gui.widget.CheckboxWidget; import net.minecraft.text.Text; -public class PropertyCheckboxComponent extends CheckboxWidget { +public class PropertyCheckboxComponent extends CheckboxComponent { private final Property property; public PropertyCheckboxComponent(Text message, Property property) { - super(0, 0, message, MinecraftClient.getInstance().textRenderer, property.get(), (checkbox, checked) -> {}); + super(message); + this.property = property; + this.checked(this.property.get()); } @Override