diff --git a/common/src/main/java/net/raphimc/immediatelyfast/feature/core/BatchableBufferSource.java b/common/src/main/java/net/raphimc/immediatelyfast/feature/core/BatchableBufferSource.java index d4d749b0..df4d053e 100644 --- a/common/src/main/java/net/raphimc/immediatelyfast/feature/core/BatchableBufferSource.java +++ b/common/src/main/java/net/raphimc/immediatelyfast/feature/core/BatchableBufferSource.java @@ -206,7 +206,7 @@ protected int getLayerOrder(final RenderLayer layer) { } } else if (textureId.equals(TexturedRenderLayers.ARMOR_TRIMS_ATLAS_TEXTURE)) { return 1; - } else if (layer.name.startsWith("text")) { + } else if (layer.name.startsWith("text") || layer.name.startsWith("neoforge_text") || layer.name.startsWith("forge_text")) { // Draws vanilla text over custom font layers // Fixes https://github.com/RaphiMC/ImmediatelyFast/issues/81, https://github.com/RaphiMC/ImmediatelyFast/issues/287, https://github.com/RaphiMC/ImmediatelyFast/issues/288 if (textureId.getNamespace().equals("minecraft")) { diff --git a/gradle.properties b/gradle.properties index 29e24e54..b344fb1c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ supported_minecraft_versions=1.21.2,1.21.3 yarn_mappings=1.21.3+build.2 fabric_loader_version=0.16.5 forge_version=1.21.3-53.0.11 -neoforge_version=21.3.16-beta +neoforge_version=21.3.26-beta mixin_extras_version=0.4.1 reflect_version=1.3.4 diff --git a/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinNeoForgeRenderTypes.java b/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinNeoForgeRenderTypes.java index 55066919..61884151 100644 --- a/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinNeoForgeRenderTypes.java +++ b/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinNeoForgeRenderTypes.java @@ -26,6 +26,7 @@ @Mixin(targets = "net.neoforged.neoforge.client.NeoForgeRenderTypes$Internal", priority = 500) public abstract class MixinNeoForgeRenderTypes { + // Pre NeoForge 21.3.23-beta @Inject(method = { "getText", "getTextIntensity", @@ -33,8 +34,21 @@ public abstract class MixinNeoForgeRenderTypes { "getTextIntensityPolygonOffset", "getTextSeeThrough", "getTextIntensitySeeThrough" - }, at = @At(value = "RETURN"), remap = false) // Forge doesn't allow me to target the of() call for some reason - private static void changeTranslucency(CallbackInfoReturnable cir) { + }, at = @At(value = "RETURN"), remap = false, require = 0) // Forge doesn't allow me to target the of() call for some reason + private static void changeTranslucencyOld(CallbackInfoReturnable cir) { + cir.getReturnValue().translucent = false; + } + + // Post NeoForge 21.3.23-beta + @Inject(method = { + "getTextFiltered", + "getTextIntensityFiltered", + "getTextPolygonOffsetFiltered", + "getTextIntensityPolygonOffsetFiltered", + "getTextSeeThroughFiltered", + "getTextIntensitySeeThroughFiltered" + }, at = @At(value = "RETURN"), remap = false, require = 0) // Forge doesn't allow me to target the of() call for some reason + private static void changeTranslucencyNew(CallbackInfoReturnable cir) { cir.getReturnValue().translucent = false; } diff --git a/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinRenderLayer.java b/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinRenderLayer.java new file mode 100644 index 00000000..dd1a75f5 --- /dev/null +++ b/neoforge/src/main/java/net/raphimc/immediatelyfast/neoforge/injection/mixins/core/MixinRenderLayer.java @@ -0,0 +1,40 @@ +/* + * This file is part of ImmediatelyFast - https://github.com/RaphiMC/ImmediatelyFast + * Copyright (C) 2023-2024 RK_01/RaphiMC and contributors + * + * This program 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. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package net.raphimc.immediatelyfast.neoforge.injection.mixins.core; + +import net.minecraft.client.render.RenderLayer; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; + +@Mixin(value = RenderLayer.class, priority = 500) +public abstract class MixinRenderLayer { + + @ModifyArg(method = { + "method_34834" /*TEXT*/, + "method_34833" /*TEXT_INTENSITY*/, + "method_36437" /*TEXT_POLYGON_OFFSET*/, + "method_36436" /*TEXT_INTENSITY_POLYGON_OFFSET*/, + "method_37348" /*TEXT_SEE_THROUGH*/, + "method_37347" /*TEXT_INTENSITY_SEE_THROUGH*/ + }, at = @At(value = "INVOKE", target = "Lnet/minecraft/client/render/RenderLayer;of(Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;Lnet/minecraft/client/render/VertexFormat$DrawMode;IZZLnet/minecraft/client/render/RenderLayer$MultiPhaseParameters;)Lnet/minecraft/client/render/RenderLayer$MultiPhase;"), index = 5) + private static boolean changeTranslucency(boolean value) { + return false; + } + +} diff --git a/neoforge/src/main/resources/immediatelyfast-neoforge.mixins.json b/neoforge/src/main/resources/immediatelyfast-neoforge.mixins.json index 79d2ee9d..a73441c7 100644 --- a/neoforge/src/main/resources/immediatelyfast-neoforge.mixins.json +++ b/neoforge/src/main/resources/immediatelyfast-neoforge.mixins.json @@ -6,6 +6,7 @@ "plugin": "net.raphimc.immediatelyfast.injection.ImmediatelyFastMixinPlugin", "client": [ "core.MixinNeoForgeRenderTypes", + "core.MixinRenderLayer", "hud_batching.MixinItemRenderer" ], "injectors": {