diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java index ebbc69d16..b96f2044a 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/impl/client/indigo/Indigo.java @@ -110,7 +110,7 @@ private static TriState asTriState(String property) { final boolean forceCompatibility = IndigoMixinConfigPlugin.shouldForceCompatibility(); ENSURE_VERTEX_FORMAT_COMPATIBILITY = forceCompatibility; // necessary because OF alters the BakedModel vertex format and will confuse the fallback model consumer - ALWAYS_TESSELATE_INDIGO = !forceCompatibility && asBoolean((String) properties.computeIfAbsent("always-tesselate-blocks", (a) -> "auto"), true); + ALWAYS_TESSELATE_INDIGO = !forceCompatibility && asBoolean((String) properties.computeIfAbsent("always-tesselate-blocks", (a) -> "auto"), false); AMBIENT_OCCLUSION_MODE = asEnum((String) properties.computeIfAbsent("ambient-occlusion-mode", (a) -> "hybrid"), AoConfig.HYBRID); DEBUG_COMPARE_LIGHTING = asBoolean((String) properties.computeIfAbsent("debug-compare-lighting", (a) -> "auto"), false); FIX_SMOOTH_LIGHTING_OFFSET = asBoolean((String) properties.computeIfAbsent("fix-smooth-lighting-offset", (a) -> "auto"), true); diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/BlockModelRendererMixin.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/BlockModelRendererMixin.java index 69f7bb6eb..2451cf87d 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/BlockModelRendererMixin.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/BlockModelRendererMixin.java @@ -16,6 +16,9 @@ package net.fabricmc.fabric.mixin.client.indigo.renderer; +import net.minecraft.client.render.RenderLayer; + +import net.minecraftforge.client.model.data.ModelData; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Unique; import org.spongepowered.asm.mixin.injection.At; @@ -39,8 +42,8 @@ public abstract class BlockModelRendererMixin { @Unique private final ThreadLocal fabric_contexts = ThreadLocal.withInitial(BlockRenderContext::new); - @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) { + @Inject(at = @At("HEAD"), method = "tesselateBlock(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;JILnet/minecraftforge/client/model/data/ModelData;Lnet/minecraft/client/render/RenderLayer;Z)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, ModelData modelData, RenderLayer renderType, boolean queryModelSpecificData, CallbackInfo ci) { if (!model.isVanillaAdapter()) { BlockRenderContext context = fabric_contexts.get(); context.render(blockView, model, state, pos, matrix, buffer, cull, rand, seed, overlay); diff --git a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/ChunkBuilderBuiltChunkRebuildTaskMixin.java b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/ChunkBuilderBuiltChunkRebuildTaskMixin.java index 23f06d348..016040525 100644 --- a/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/ChunkBuilderBuiltChunkRebuildTaskMixin.java +++ b/fabric-renderer-indigo/src/client/java/net/fabricmc/fabric/mixin/client/indigo/renderer/ChunkBuilderBuiltChunkRebuildTaskMixin.java @@ -113,7 +113,7 @@ private void hookChunkBuildTesselate(BlockRenderManager renderManager, BlockStat } } - renderManager.renderBlock(blockState, blockPos, blockView, matrix, bufferBuilder, checkSides, random); + renderManager.renderBatched(blockState, blockPos, blockView, matrix, bufferBuilder, checkSides, random, modelData, renderLayer, queryModelSpecificData); } /** diff --git a/fabric-rendering-fluids-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/fluid/FluidRenderHandlerRegistryImpl.java b/fabric-rendering-fluids-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/fluid/FluidRenderHandlerRegistryImpl.java index d2715db97..7ee13ed54 100644 --- a/fabric-rendering-fluids-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/fluid/FluidRenderHandlerRegistryImpl.java +++ b/fabric-rendering-fluids-v1/src/client/java/net/fabricmc/fabric/impl/client/rendering/fluid/FluidRenderHandlerRegistryImpl.java @@ -76,7 +76,15 @@ public void setBlockTransparency(Block block, boolean transparent) { @Override public boolean isBlockTransparent(Block block) { - return overlayBlocks.computeIfAbsent(block, k -> k instanceof TransparentBlock || k instanceof LeavesBlock); + if (overlayBlocks.containsKey(block)) { + return overlayBlocks.get(block); + } + return block instanceof TransparentBlock || block instanceof LeavesBlock; + } + + @Override + public boolean isBlockTransparent(BlockState state, BlockRenderView level, BlockPos pos, FluidState fluidState) { + return overlayBlocks.computeIfAbsent(state.getBlock(), block -> block.shouldDisplayFluidOverlay(state, level, pos, fluidState)); } public void onFluidRendererReload(FluidRenderer renderer, Sprite[] waterSprites, Sprite[] lavaSprites, Sprite waterOverlay) { diff --git a/gradle.properties b/gradle.properties index 4b65a91e4..38435ccf0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -67,4 +67,4 @@ loom.platform=forge forge_version=1.19.4-45.1.2 server_data_pack_format=12 pack_format=13 -forgified_version=1.1.0 +forgified_version=1.2.0