diff --git a/build.gradle b/build.gradle index 6d45445..23fc362 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.11-SNAPSHOT' + id 'fabric-loom' version '0.12-SNAPSHOT' id 'maven-publish' id 'org.ajoberstar.grgit' version '4.1.0' @@ -43,7 +43,7 @@ dependencies { // PSA: Some older mods, compiled on Loom 0.2.1, might have outdated Maven POMs. // You may need to force-disable transitiveness on them. - modImplementation "maven.modrinth:sodium:mc1.18.2-0.4.1" + modImplementation "maven.modrinth:sodium:mc1.19-0.4.2" // Transitive dependency of Sodium implementation("org.joml:joml:1.10.2") diff --git a/gradle.properties b/gradle.properties index 0ae117f..deba50a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,13 +2,13 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://modmuss50.me/fabric.html -minecraft_version=1.18.2 -yarn_mappings=1.18.2+build.3 -loader_version=0.13.3 +minecraft_version=1.19 +yarn_mappings=1.19+build.1 +loader_version=0.14.6 # Mod Properties -mod_version=1.0.3 +mod_version=1.0.4 maven_group=link.infra archives_base_name=indium # Dependencies # check this on https://modmuss50.me/fabric.html -fabric_version=0.51.1+1.18.2 +fabric_version=0.55.2+1.19 diff --git a/src/main/java/link/infra/indium/mixin/renderer/MixinBlockModelRenderer.java b/src/main/java/link/infra/indium/mixin/renderer/MixinBlockModelRenderer.java index 575bd4f..00e5d0e 100644 --- a/src/main/java/link/infra/indium/mixin/renderer/MixinBlockModelRenderer.java +++ b/src/main/java/link/infra/indium/mixin/renderer/MixinBlockModelRenderer.java @@ -17,8 +17,9 @@ package link.infra.indium.mixin.renderer; import java.util.BitSet; -import java.util.Random; + +import net.minecraft.util.math.random.Random; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Unique; @@ -49,12 +50,14 @@ public abstract class MixinBlockModelRenderer implements AccessBlockModelRendere @Shadow protected abstract void getQuadDimensions(BlockRenderView blockView, BlockState blockState, BlockPos blockPos, int[] vertexData, Direction face, float[] aoData, BitSet controlBits); - @Inject(at = @At("HEAD"), method = "render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLjava/util/Random;JI)Z", cancellable = true) - private void hookRender(BlockRenderView blockView, BakedModel model, BlockState state, BlockPos pos, MatrixStack matrix, VertexConsumer buffer, boolean checkSides, Random rand, long seed, int overlay, CallbackInfoReturnable ci) { + @Inject(at = @At("HEAD"), method = "render(Lnet/minecraft/world/BlockRenderView;Lnet/minecraft/client/render/model/BakedModel;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/client/render/VertexConsumer;ZLnet/minecraft/util/math/random/Random;JI)V", cancellable = true) + private void hookRender(BlockRenderView blockView, BakedModel model, BlockState state, BlockPos pos, MatrixStack matrix, VertexConsumer buffer, boolean cull, Random rand, long seed, int overlay, CallbackInfo ci) { if (!((FabricBakedModel) model).isVanillaAdapter()) { BlockRenderContext context = indium_contexts.get(); // Note that we do not support face-culling here (so checkSides is ignored) - ci.setReturnValue(context.render(blockView, model, state, pos, matrix, buffer, rand, seed, overlay)); + + context.render(blockView, model, state, pos, matrix, buffer, rand, seed, overlay); + ci.cancel(); } } diff --git a/src/main/java/link/infra/indium/renderer/render/BaseFallbackConsumer.java b/src/main/java/link/infra/indium/renderer/render/BaseFallbackConsumer.java index 51be038..cbd14ae 100644 --- a/src/main/java/link/infra/indium/renderer/render/BaseFallbackConsumer.java +++ b/src/main/java/link/infra/indium/renderer/render/BaseFallbackConsumer.java @@ -28,9 +28,10 @@ import net.minecraft.client.render.model.BakedModel; import net.minecraft.client.render.model.BakedQuad; import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; import java.util.List; -import java.util.Random; + import java.util.function.Consumer; import java.util.function.Supplier; diff --git a/src/main/java/link/infra/indium/renderer/render/BlockRenderContext.java b/src/main/java/link/infra/indium/renderer/render/BlockRenderContext.java index f8e06a9..a193625 100644 --- a/src/main/java/link/infra/indium/renderer/render/BlockRenderContext.java +++ b/src/main/java/link/infra/indium/renderer/render/BlockRenderContext.java @@ -16,7 +16,7 @@ package link.infra.indium.renderer.render; -import java.util.Random; + import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; @@ -33,6 +33,7 @@ import net.minecraft.util.math.Matrix3f; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.random.Random; import net.minecraft.world.BlockRenderView; import net.fabricmc.fabric.api.renderer.v1.mesh.Mesh; diff --git a/src/main/java/link/infra/indium/renderer/render/BlockRenderInfo.java b/src/main/java/link/infra/indium/renderer/render/BlockRenderInfo.java index 4109c10..ec2df92 100644 --- a/src/main/java/link/infra/indium/renderer/render/BlockRenderInfo.java +++ b/src/main/java/link/infra/indium/renderer/render/BlockRenderInfo.java @@ -25,9 +25,10 @@ import net.minecraft.client.render.RenderLayers; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; +import net.minecraft.util.math.random.Random; import net.minecraft.world.BlockRenderView; -import java.util.Random; + import java.util.function.Supplier; /** @@ -40,7 +41,7 @@ public class BlockRenderInfo { private final BlockColors blockColorMap = MinecraftClient.getInstance().getBlockColors(); protected BlockOcclusionCache blockOcclusionCache; - public final Random random = new Random(); + public final Random random = Random.create(); public BlockRenderView blockView; public BlockPos blockPos; public BlockState blockState; diff --git a/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java b/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java index 174874d..b0166b9 100644 --- a/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java +++ b/src/main/java/link/infra/indium/renderer/render/ItemRenderContext.java @@ -42,9 +42,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3f; +import net.minecraft.util.math.random.Random; import java.util.List; -import java.util.Random; + import java.util.function.Consumer; import java.util.function.Supplier; @@ -62,7 +63,7 @@ public interface VanillaQuadHandler { } private final ItemColors colorMap; - private final Random random = new Random(); + private final Random random = Random.create(); private final Vec3f normalVec = new Vec3f(); private final Supplier randomSupplier = () -> { diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index d9c2141..adef932 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -28,8 +28,8 @@ ], "depends": { "fabricloader": ">=0.8.0", - "minecraft": "~1.18.2", - "sodium": "0.4.1", + "minecraft": "~1.19", + "sodium": "0.4.2", "fabric-renderer-api-v1": ">=0.3.0", "fabric-resource-loader-v0": ">=0.4.0" }