From 576adff7aa2cb5c2c8ca6c39332b9219e50dc4ea Mon Sep 17 00:00:00 2001 From: IMS212 Date: Thu, 26 Dec 2024 15:54:45 -0800 Subject: [PATCH] Fixes --- build.gradle.kts | 2 +- .../sodium/mixin/MixinAbstractBlockRenderContext.java | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 36dcb6b346..d3805c7f58 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ val FABRIC_API_VERSION by extra { "0.110.5+1.21.4" } val PARCHMENT_VERSION by extra { null } // https://semver.org/ -val MOD_VERSION by extra { "1.8.4" } +val MOD_VERSION by extra { "1.8.5" } allprojects { apply(plugin = "java") diff --git a/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinAbstractBlockRenderContext.java b/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinAbstractBlockRenderContext.java index 65fa9c7e67..f7f5e02175 100644 --- a/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinAbstractBlockRenderContext.java +++ b/common/src/main/java/net/irisshaders/iris/compat/sodium/mixin/MixinAbstractBlockRenderContext.java @@ -11,12 +11,15 @@ import net.minecraft.core.Direction; import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.block.state.BlockState; +import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import java.util.function.Predicate; + @Mixin(AbstractBlockRenderContext.class) public class MixinAbstractBlockRenderContext { @Shadow @@ -26,15 +29,16 @@ public class MixinAbstractBlockRenderContext { protected BlockAndTintGetter level; @Inject(method = "bufferDefaultModel", at = @At(value = "INVOKE", target = "Lnet/caffeinemc/mods/sodium/client/services/PlatformModelAccess;getQuads(Lnet/minecraft/world/level/BlockAndTintGetter;Lnet/minecraft/core/BlockPos;Lnet/minecraft/client/resources/model/BakedModel;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/core/Direction;Lnet/minecraft/util/RandomSource;Lnet/minecraft/client/renderer/RenderType;Lnet/caffeinemc/mods/sodium/client/services/SodiumModelData;)Ljava/util/List;")) - private void checkDirectionNeo(BakedModel model, BlockState state, CallbackInfo ci, @Local Direction cullFace) { + private void checkDirectionNeo(BakedModel model, @Nullable BlockState state, Predicate cullTest, CallbackInfo ci, @Local Direction cullFace) { if ((Object) this instanceof BlockRenderer r && WorldRenderingSettings.INSTANCE.getBlockStateIds() != null && cullFace != null) { BlockState appearance = IrisPlatformHelpers.getInstance().getBlockAppearance(this.level, state, cullFace, this.pos); - ((BlockSensitiveBufferBuilder) ((BlockRendererAccessor) r).getBuffers()).overrideBlock(WorldRenderingSettings.INSTANCE.getBlockStateIds().getInt(appearance)); + if (appearance != state) + ((BlockSensitiveBufferBuilder) ((BlockRendererAccessor) r).getBuffers()).overrideBlock(WorldRenderingSettings.INSTANCE.getBlockStateIds().getInt(appearance)); } } @Inject(method = "bufferDefaultModel", at = @At(value = "TAIL")) - private void checkDirectionNeo(BakedModel model, BlockState state, CallbackInfo ci) { + private void checkDirectionNeo(BakedModel model, @Nullable BlockState state, Predicate cullTest, CallbackInfo ci) { if ((Object) this instanceof BlockRenderer r && WorldRenderingSettings.INSTANCE.getBlockStateIds() != null) { ((BlockSensitiveBufferBuilder) ((BlockRendererAccessor) r).getBuffers()).restoreBlock(); }