diff --git a/common.gradle b/common.gradle index 3586d60f..60e748f3 100644 --- a/common.gradle +++ b/common.gradle @@ -34,7 +34,7 @@ static String curseForgeOrOther(version, curseForge, other) { // list of (dependencyNotation -> should use modImplementation) def mod_dependencies = [ - ["fi.dy.masa.malilib:${project.malilib_version}", true], + [mcVersion == 12101 ? "com.github.sakura-ryoko:malilib:${project.malilib_version}" : "fi.dy.masa.malilib:${project.malilib_version}", true], [curseForgeOrOther(project.tweakeroo_file_id , 'curse.maven:tweakeroo-297344' , 'com.github.sakura-ryoko:tweakeroo' ), true], [curseForgeOrOther(project.itemscroller_file_id, 'curse.maven:item-scroller-242064', 'com.github.sakura-ryoko:itemscroller'), true], [curseForgeOrOther(project.minihud_file_id , 'curse.maven:minihud-244260' , 'com.github.sakura-ryoko:minihud' ), true], @@ -205,6 +205,7 @@ processResources { "version": fullModVersion, "minecraft_dependency": project.minecraft_dependency, "malilib_dependency": project.malilib_dependency, + "minihud_conflict": project.getProperties().getOrDefault("minihud_conflict", "<0.0.0"), ] expand valueMap } diff --git a/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mod_tweaks/serverDataSyncer/minihud/RenderHandlerMixin.java b/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mod_tweaks/serverDataSyncer/minihud/RenderHandlerMixin.java index 446c1f1d..e7c0f617 100644 --- a/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mod_tweaks/serverDataSyncer/minihud/RenderHandlerMixin.java +++ b/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mod_tweaks/serverDataSyncer/minihud/RenderHandlerMixin.java @@ -37,6 +37,11 @@ import org.spongepowered.asm.mixin.injection.Slice; //#endif +//#if MC >= 12101 +//$$ import com.llamalad7.mixinextras.lib.apache.commons.tuple.Pair; +//$$ import net.minecraft.nbt.NbtCompound; +//#endif + @Restriction(require = @Condition(ModIds.minihud)) @Mixin(RenderHandler.class) public abstract class RenderHandlerMixin @@ -54,22 +59,37 @@ public abstract class RenderHandlerMixin ), at = @At( value = "INVOKE", + //#if MC >= 12101 + //$$ target = "Lfi/dy/masa/minihud/event/RenderHandler;getTargetedBlockEntity(Lnet/minecraft/world/World;Lnet/minecraft/client/MinecraftClient;)Lcom/llamalad7/mixinextras/lib/apache/commons/tuple/Pair;", + //#else target = "Lfi/dy/masa/minihud/event/RenderHandler;getTargetedBlockEntity(Lnet/minecraft/world/World;Lnet/minecraft/client/MinecraftClient;)Lnet/minecraft/block/entity/BlockEntity;", + //#endif ordinal = 0, remap = true ), remap = false ) + //#if MC >= 12101 + //$$ private Pair serverDataSyncer4BeehiveBeeCount(Pair original) + //#else private BlockEntity serverDataSyncer4BeehiveBeeCount(BlockEntity blockEntity) + //#endif { if (TweakerMoreConfigs.SERVER_DATA_SYNCER.getBooleanValue()) { + //#if MC >= 12101 + //$$ BlockEntity blockEntity = original.getLeft(); + //#endif if (blockEntity instanceof BeehiveBlockEntity && !MinecraftClient.getInstance().isIntegratedServerRunning()) { ServerDataSyncer.getInstance().syncBlockEntity(blockEntity); } } + //#if MC >= 12101 + //$$ return original; + //#else return blockEntity; + //#endif } //#endif } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index c0a59e77..954a70f6 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -32,6 +32,9 @@ "tweakermore.mixins.json" ], + "breaks": { + "minihud": "${minihud_conflict}" + }, "depends": { "fabricloader": ">=0.11.4", "minecraft": "${minecraft_dependency}", diff --git a/versions/1.21.1/gradle.properties b/versions/1.21.1/gradle.properties index f8d79693..26d29b4a 100644 --- a/versions/1.21.1/gradle.properties +++ b/versions/1.21.1/gradle.properties @@ -6,6 +6,7 @@ # Fabric Mod Metadata minecraft_dependency = 1.21.x malilib_dependency = >=0.18.0 + minihud_conflict = <0.32.51 # Build Information # The target mc versions for the mod during mod publishing, separated with \n @@ -16,7 +17,7 @@ # https://masa.dy.fi/maven/fi/dy/masa/malilib/ # https://jitpack.io/#sakura-ryoko/malilib - malilib_version = malilib-fabric-1.21.1:0.21.0 + malilib_version = 1.21-0.21.1 # https://legacy.curseforge.com/minecraft/mc-mods/tweakeroo/files # tweakeroo-fabric-1.21.1-0.21.50.jar @@ -31,8 +32,8 @@ litematica_file_id = 5647809 # https://legacy.curseforge.com/minecraft/mc-mods/minihud/files - # minihud-fabric-1.21.1-0.32.50.jar - minihud_file_id = 5647790 + # minihud-fabric-1.21-0.32.51.jar + minihud_file_id = 1.21-0.32.51 # https://maven.terraformersmc.com/releases/com/terraformersmc/modmenu/ mod_menu_version = 11.0.1