From 92a7858d6545066f8dee35c5843da168494b8441 Mon Sep 17 00:00:00 2001 From: Fallen_Breath Date: Wed, 13 Nov 2024 03:10:16 +0800 Subject: [PATCH] some enableCountInjections fixes --- common.gradle | 2 +- .../bossBarMaxEntry/BossBarHudMixin.java | 4 +++ .../mixins/util/qol/MinecraftClientMixin.java | 2 +- .../mixins/util/qol/MinecraftClientMixin.java | 1 + .../mixins/util/qol/MinecraftClientMixin.java | 30 +++++++++++++++++++ 5 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 versions/1.20.4/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java diff --git a/common.gradle b/common.gradle index 3586d60f..55b2958d 100644 --- a/common.gradle +++ b/common.gradle @@ -35,7 +35,7 @@ static String curseForgeOrOther(version, curseForge, other) { // list of (dependencyNotation -> should use modImplementation) def mod_dependencies = [ ["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.tweakeroo_file_id , 'curse.maven:tweakeroo-297344' , 'com.github.sakura-ryoko:tweakeroo' ), false], [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], diff --git a/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mc_tweaks/bossBarMaxEntry/BossBarHudMixin.java b/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mc_tweaks/bossBarMaxEntry/BossBarHudMixin.java index d8ea3cab..c7f3bc96 100644 --- a/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mc_tweaks/bossBarMaxEntry/BossBarHudMixin.java +++ b/src/main/java/me/fallenbreath/tweakermore/mixins/tweaks/mc_tweaks/bossBarMaxEntry/BossBarHudMixin.java @@ -56,7 +56,11 @@ private Iterator tweakerMore_bossBarMaxEntry_checkLimitation(Iter method = "render", at = @At( value = "INVOKE", + //#if MC >= 12001 + //$$ target = "Lnet/minecraft/client/gui/DrawContext;getScaledWindowHeight()I" + //#else target = "Lnet/minecraft/client/util/Window;getScaledHeight()I" + //#endif ), require = 0 ) diff --git a/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java b/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java index 5e467718..95e9ddf9 100644 --- a/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java +++ b/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java @@ -26,5 +26,5 @@ @Mixin(DummyClass.class) public abstract class MinecraftClientMixin { - // mc 1.16+ only + // impl in mc [1.16, 1.20.4) } diff --git a/versions/1.16.5/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java b/versions/1.16.5/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java index 9e649781..ef4c76f2 100644 --- a/versions/1.16.5/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java +++ b/versions/1.16.5/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java @@ -29,6 +29,7 @@ import org.spongepowered.asm.mixin.injection.Coerce; import org.spongepowered.asm.mixin.injection.Redirect; +// impl in mc [1.16, 1.20.4) @Restriction(require = @Condition(type = Condition.Type.TESTER, tester = DevelopmentEnvironmentTester.class)) @Mixin(MinecraftClient.class) public abstract class MinecraftClientMixin diff --git a/versions/1.20.4/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java b/versions/1.20.4/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java new file mode 100644 index 00000000..72767b49 --- /dev/null +++ b/versions/1.20.4/src/main/java/me/fallenbreath/tweakermore/mixins/util/qol/MinecraftClientMixin.java @@ -0,0 +1,30 @@ +/* + * This file is part of the TweakerMore project, licensed under the + * GNU Lesser General Public License v3.0 + * + * Copyright (C) 2024 Fallen_Breath and contributors + * + * TweakerMore is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * TweakerMore is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with TweakerMore. If not, see . + */ + +package me.fallenbreath.tweakermore.mixins.util.qol; + +import me.fallenbreath.tweakermore.util.mixin.DummyClass; +import org.spongepowered.asm.mixin.Mixin; + +@Mixin(DummyClass.class) +public abstract class MinecraftClientMixin +{ + // impl in mc [1.16, 1.20.4) +}