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 dea2e86 commit 56ba3ea
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 24 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ base {
}

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

loom {
Expand Down Expand Up @@ -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 {
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
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
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
Original file line number Diff line number Diff line change
Expand Up @@ -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) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,15 +23,15 @@ 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;
ci.cancel();
}

@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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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<Boolean> property;

public PropertyCheckboxComponent(Text message, Property<Boolean> property) {
super(0, 0, message, MinecraftClient.getInstance().textRenderer, property.get(), (checkbox, checked) -> {});
super(message);

this.property = property;
this.checked(this.property.get());
}

@Override
Expand Down

0 comments on commit 56ba3ea

Please sign in to comment.