Skip to content

Commit

Permalink
1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
gliscowo committed Mar 24, 2023
1 parent 99eb712 commit 7235a00
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 18 deletions.
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_base_version=1.19.3
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.3
loader_version=0.14.11
minecraft_base_version=1.19.4
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.18
# Mod Properties
mod_version=0.4.4
maven_group=com.glisco
archives_base_name=isometric-renders
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.75.1+1.19.3
fabric_version=0.76.0+1.19.4

# https://maven.wispforest.io/io/wispforest/worldmesher/
worldmesher_version=0.3.0+1.19.3
Expand All @@ -21,4 +21,4 @@ worldmesher_version=0.3.0+1.19.3
exo_version=0.1.5+1.19

# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.9.3+1.19.3
owo_version=0.10.3+1.19.4
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,6 @@ public static BlockPos getPosFromArgument(DefaultPosArgument argument, FabricCli
DefaultPosArgumentAccessor accessor = (DefaultPosArgumentAccessor) argument;
Vec3d pos = source.getPlayer().getPos();

return new BlockPos(accessor.isometric$getX().toAbsoluteCoordinate(pos.x), accessor.isometric$getY().toAbsoluteCoordinate(pos.y), accessor.isometric$getZ().toAbsoluteCoordinate(pos.z));
return BlockPos.ofFloored(accessor.isometric$getX().toAbsoluteCoordinate(pos.x), accessor.isometric$getY().toAbsoluteCoordinate(pos.y), accessor.isometric$getZ().toAbsoluteCoordinate(pos.z));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ private void captureTooltipDimensions(MatrixStack matrices, List<TooltipComponen
this.isometric$tooltipHeight = height;
}

@ModifyVariable(method = "renderTooltipFromComponents", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;push()V"), ordinal = 4)
@ModifyVariable(method = "renderTooltipFromComponents", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;push()V"), ordinal = 6)
private int centerXIfNeeded(int orig) {
if (!IsometricRenders.centerNextTooltip) return orig;
return orig - 12 - isometric$tooltipWidth / 2;
}

@ModifyVariable(method = "renderTooltipFromComponents", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;push()V"), ordinal = 5)
@ModifyVariable(method = "renderTooltipFromComponents", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/util/math/MatrixStack;push()V"), ordinal = 7)
private int centerYIfNeeded(int orig) {
if (!IsometricRenders.centerNextTooltip) return orig;
return orig + 8 - isometric$tooltipHeight / 2;
return orig + 12 - isometric$tooltipHeight / 2;
}

@Inject(method = "renderTooltipFromComponents", at = @At("TAIL"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.MathHelper;
Expand Down Expand Up @@ -46,13 +46,14 @@ public void emitVertices(MatrixStack matrices, VertexConsumerProvider vertexCons
final var index = row * columns + column;
if (index >= this.items.size()) continue;

client.getItemRenderer().renderItem(
this.client.getItemRenderer().renderItem(
this.items.get(index),
ModelTransformation.Mode.GUI,
ModelTransformationMode.GUI,
LightmapTextureManager.MAX_LIGHT_COORDINATE,
OverlayTexture.DEFAULT_UV,
matrices,
vertexConsumers,
this.client.world,
0
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.OverlayTexture;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.registry.Registries;
Expand Down Expand Up @@ -46,8 +46,8 @@ public void emitVertices(MatrixStack matrices, VertexConsumerProvider vertexCons
matrices.multiply(RotationAxis.POSITIVE_Y.rotationDegrees(180));
}

itemRenderer.renderItem(this.stack, ModelTransformation.Mode.FIXED, LightmapTextureManager.MAX_LIGHT_COORDINATE,
OverlayTexture.DEFAULT_UV, matrices, vertexConsumers, 0);
itemRenderer.renderItem(this.stack, ModelTransformationMode.FIXED, LightmapTextureManager.MAX_LIGHT_COORDINATE,
OverlayTexture.DEFAULT_UV, matrices, vertexConsumers, MinecraftClient.getInstance().world, 0);
matrices.pop();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static void renderSelectionBox(MatrixStack matrices, Camera camera) {
BlockPos origin = AreaSelectionHelper.pos1;

HitResult result = player.raycast(player.getAbilities().creativeMode ? 5.0F : 4.5F, 0, false);
BlockPos size = AreaSelectionHelper.pos2 != null ? AreaSelectionHelper.pos2 : (result.getType() == HitResult.Type.BLOCK ? ((BlockHitResult) result).getBlockPos() : new BlockPos(result.getPos()));
BlockPos size = AreaSelectionHelper.pos2 != null ? AreaSelectionHelper.pos2 : (result.getType() == HitResult.Type.BLOCK ? ((BlockHitResult) result).getBlockPos() : BlockPos.ofFloored(result.getPos()));
size = size.subtract(origin);

origin = origin.add(size.getX() < 0 ? 1 : 0, size.getY() < 0 ? 1 : 0, size.getZ() < 0 ? 1 : 0);
Expand All @@ -58,7 +58,7 @@ public static void select() {
final MinecraftClient client = MinecraftClient.getInstance();
final HitResult target = client.crosshairTarget;
if ((target == null)) return;
BlockPos targetPos = new BlockPos(target.getType() == HitResult.Type.BLOCK ? ((BlockHitResult) target).getBlockPos() : new BlockPos(target.getPos()));
BlockPos targetPos = new BlockPos(target.getType() == HitResult.Type.BLOCK ? ((BlockHitResult) target).getBlockPos() : BlockPos.ofFloored(target.getPos()));

if (pos1 == null) {
pos1 = targetPos;
Expand Down

0 comments on commit 7235a00

Please sign in to comment.