From 41ddf333bbe20bde536e1ac0baef986b249a4f34 Mon Sep 17 00:00:00 2001 From: Foxy Date: Tue, 3 Dec 2024 22:41:25 +0100 Subject: [PATCH] Fixed crash with sodium. Bump version to 1.2.0-beta.2 --- common/build.gradle | 2 +- .../moreculling/mixin/compat/ItemRenderer_sodiumMixin.java | 4 ++-- .../src/main/java/ca/fxco/moreculling/utils/CullingUtils.java | 2 +- fabric/build.gradle | 2 +- gradle.properties | 4 ++-- neoforge/build.gradle | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 089191d..5ec8bcd 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -23,7 +23,7 @@ dependencies { compileOnly group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5' annotationProcessor group: 'io.github.llamalad7', name: 'mixinextras-common', version: '0.3.5' - implementation "maven.modrinth:sodium:${project.sodium_version}-neoforge" + compileOnly "maven.modrinth:sodium:${project.sodium_version}-neoforge" //implementation "maven.modrinth:client-tweaks:${project.clienttweaks_version}+neoforge-${project.minecraft_version}" api "me.shedaniel.cloth:cloth-config-neoforge:${project.cloth_config_version}" diff --git a/common/src/main/java/ca/fxco/moreculling/mixin/compat/ItemRenderer_sodiumMixin.java b/common/src/main/java/ca/fxco/moreculling/mixin/compat/ItemRenderer_sodiumMixin.java index 8e2b27c..4a15f33 100644 --- a/common/src/main/java/ca/fxco/moreculling/mixin/compat/ItemRenderer_sodiumMixin.java +++ b/common/src/main/java/ca/fxco/moreculling/mixin/compat/ItemRenderer_sodiumMixin.java @@ -39,7 +39,7 @@ public class ItemRenderer_sodiumMixin { opcode = 178 //Opcodes.GETSTATIC ) ) - private Direction[] moreculling$modifyDirections$Sodium() { + private static Direction[] moreculling$modifyDirections$Sodium() { return ItemRendererStates.DIRECTIONS == null ? DirectionUtils.DIRECTIONS : ItemRendererStates.DIRECTIONS; } @@ -56,7 +56,7 @@ public class ItemRenderer_sodiumMixin { "Lnet/minecraft/util/RandomSource;)Ljava/util/List;" ) ) - private List moreculling$onlySomeFaces$Sodium(BakedModel instance, BlockState blockState, + private static List moreculling$onlySomeFaces$Sodium(BakedModel instance, BlockState blockState, Direction direction, RandomSource random, Operation> original) { if (ItemRendererStates.DIRECTIONS != null) { diff --git a/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java b/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java index c86823e..3332085 100644 --- a/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java +++ b/common/src/main/java/ca/fxco/moreculling/utils/CullingUtils.java @@ -162,7 +162,7 @@ public static Optional shouldDrawFaceRandom(BlockGetter view, BlockStat public static boolean shouldCullBack(ItemFrameRenderState frame) { Direction dir = frame.direction; - BlockPos posBehind = new BlockPos((int) frame.x, (int) frame.y, (int) frame.z).relative(dir.getOpposite()); + BlockPos posBehind = new BlockPos((int) Math.floor(frame.x), (int) Math.floor(frame.y), (int) Math.floor(frame.z)).relative(dir.getOpposite()); BlockState blockState = Minecraft.getInstance().level.getBlockState(posBehind); return blockState.canOcclude() && blockState.isFaceSturdy(Minecraft.getInstance().level, posBehind, dir); } diff --git a/fabric/build.gradle b/fabric/build.gradle index 31dd239..8e66e4b 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -12,7 +12,7 @@ dependencies { modImplementation "net.fabricmc.fabric-api:fabric-api:${fabric_version}" modImplementation "maven.modrinth:modmenu:${project.modmenu_version}" - modCompileOnly "maven.modrinth:sodium:${project.sodium_version}-fabric" + modImplementation "maven.modrinth:sodium:${project.sodium_version}-fabric" // ^ Change to `modCompileOnly` to test without sodium //modImplementation "maven.modrinth:client-tweaks:${project.clienttweaks_version}+fabric-${project.minecraft_version}" //modImplementation "maven.modrinth:balm:${project.clienttweaks_version}+fabric-${project.minecraft_version}" diff --git a/gradle.properties b/gradle.properties index aa359a1..8eb4043 100755 --- a/gradle.properties +++ b/gradle.properties @@ -22,7 +22,7 @@ neoforge_loader_version_range=[21.0.0-beta,) fabric_loader_version=0.16.9 # Mod Properties -mod_version=1.2.0-beta.1 +mod_version=1.2.0-beta.2 maven_group=ca.fxco.moreculling archives_base_name=moreculling license=GPL-3.0-only @@ -38,7 +38,7 @@ modmenu_version=12.0.0-beta.1 fabric_version=0.110.5+1.21.4 # Sodium Compatibility -sodium_version=mc1.21.3-0.6.0-beta.4 +sodium_version=mc1.21.4-0.6.2 # Client tweaks Compatibility clienttweaks_version=21.3.1 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index f7c42c7..9a2f148 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -35,7 +35,7 @@ neoForge { } dependencies { - compileOnly "maven.modrinth:sodium:${project.sodium_version}-neoforge" + implementation "maven.modrinth:sodium:${project.sodium_version}-neoforge" runtimeOnly "me.shedaniel.cloth:cloth-config-neoforge:${project.cloth_config_version}" //implementation "maven.modrinth:client-tweaks:${project.clienttweaks_version}+neoforge-${project.minecraft_version}"