Skip to content

Commit

Permalink
Update to 1.19.4/Sodium 0.4.10
Browse files Browse the repository at this point in the history
  • Loading branch information
comp500 committed Mar 14, 2023
1 parent 60aaffc commit 91c9889
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 38 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ publishing {
}

// TODO: infer from fabric.mod.json?!
def supportedVersions = ["1.19.3"]
def supportedVersions = ["1.19.4"]
def verName = "Indium ${project.mod_version} for Minecraft ${project.minecraft_version}/Sodium ${project.sodium_version}"

// Check version is as expected
Expand Down
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://modmuss50.me/fabric.html
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.5
loader_version=0.14.14
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
# Mod Properties
mod_version=1.0.14
mod_version=1.0.15
maven_group=link.infra
archives_base_name=indium
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.73.0+1.19.3
sodium_version=0.4.9
fabric_version=0.75.3+1.19.4
sodium_version=0.4.10
# Publishing metadata
curseforge_id=459496
source_url=https://github.com/comp500/Indium/
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,6 @@

package link.infra.indium.mixin.renderer;

import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

import link.infra.indium.renderer.accessor.AccessItemRenderer;
import link.infra.indium.renderer.render.IndiumQuadHandler;
import link.infra.indium.renderer.render.ItemRenderContext;
Expand All @@ -32,9 +25,15 @@
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.BakedModel;
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 org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.Unique;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(ItemRenderer.class)
public abstract class MixinItemRenderer implements AccessItemRenderer {
Expand All @@ -50,8 +49,8 @@ public abstract class MixinItemRenderer implements AccessItemRenderer {
@Shadow
protected abstract void renderBakedItemModel(BakedModel model, ItemStack stack, int light, int overlay, MatrixStack matrixStack, VertexConsumer buffer);

@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/BakedModel;isBuiltin()Z"), method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformation$Mode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/client/render/model/BakedModel;)V", cancellable = true)
public void hook_renderItem(ItemStack stack, ModelTransformation.Mode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, BakedModel model, CallbackInfo ci) {
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/model/BakedModel;isBuiltin()Z"), method = "renderItem(Lnet/minecraft/item/ItemStack;Lnet/minecraft/client/render/model/json/ModelTransformationMode;ZLnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumerProvider;IILnet/minecraft/client/render/model/BakedModel;)V", cancellable = true)
public void hook_renderItem(ItemStack stack, ModelTransformationMode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay, BakedModel model, CallbackInfo ci) {
if (!((FabricBakedModel) model).isVanillaAdapter()) {
indium_contexts.get().renderModel(stack, transformMode, invert, matrixStack, vertexConsumerProvider, light, overlay, model, indium_vanillaHandler);
matrixStack.pop();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,6 @@

package link.infra.indium.renderer.render;

import java.util.List;
import java.util.function.Consumer;
import java.util.function.Supplier;

import net.minecraft.util.math.random.LocalRandom;
import net.minecraft.util.math.random.RandomSeed;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;

import link.infra.indium.renderer.IndiumRenderer;
import link.infra.indium.renderer.RenderMaterialImpl;
import link.infra.indium.renderer.helper.ColorHelper;
Expand All @@ -39,22 +30,25 @@
import net.minecraft.block.BlockState;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.color.item.ItemColors;
import net.minecraft.client.render.LightmapTextureManager;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.RenderLayers;
import net.minecraft.client.render.TexturedRenderLayers;
import net.minecraft.client.render.VertexConsumer;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.*;
import net.minecraft.client.render.item.ItemRenderer;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.render.model.json.ModelTransformation.Mode;
import net.minecraft.client.render.model.json.ModelTransformationMode;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.random.LocalRandom;
import net.minecraft.util.math.random.Random;
import net.minecraft.util.math.random.RandomSeed;
import org.jetbrains.annotations.Nullable;
import org.joml.Vector3f;

import java.util.List;
import java.util.function.Consumer;
import java.util.function.Supplier;

/**
* The render context used for item rendering.
Expand Down Expand Up @@ -83,7 +77,7 @@ public interface VanillaQuadHandler {
private final FallbackConsumer fallbackConsumer = new FallbackConsumer();

private ItemStack itemStack;
private Mode transformMode;
private ModelTransformationMode transformMode;
private MatrixStack matrixStack;
private VertexConsumerProvider vertexConsumerProvider;
private int lightmap;
Expand All @@ -99,7 +93,7 @@ public ItemRenderContext(ItemColors colorMap) {
this.colorMap = colorMap;
}

public void renderModel(ItemStack itemStack, Mode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int lightmap, int overlay, BakedModel model, VanillaQuadHandler vanillaHandler) {
public void renderModel(ItemStack itemStack, ModelTransformationMode transformMode, boolean invert, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int lightmap, int overlay, BakedModel model, VanillaQuadHandler vanillaHandler) {
this.itemStack = itemStack;
this.transformMode = transformMode;
this.matrixStack = matrixStack;
Expand Down Expand Up @@ -136,7 +130,7 @@ private void computeOutputInfo() {
isDefaultTranslucent = false;
}

if (transformMode != Mode.GUI && !transformMode.isFirstPerson()) {
if (transformMode != ModelTransformationMode.GUI && !transformMode.isFirstPerson()) {
isTranslucentDirect = false;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
],
"depends": {
"fabricloader": ">=0.8.0",
"minecraft": "~1.19.3",
"sodium": "0.4.9",
"minecraft": "~1.19.4",
"sodium": "0.4.10",
"fabric-renderer-api-v1": ">=2.1.1",
"fabric-resource-loader-v0": ">=0.4.0"
}
Expand Down

0 comments on commit 91c9889

Please sign in to comment.