|
| 1 | +/* |
| 2 | + * This file is part of ImmediatelyFast - https://github.com/RaphiMC/ImmediatelyFast |
| 3 | + * Copyright (C) 2023-2025 RK_01/RaphiMC and contributors |
| 4 | + * |
| 5 | + * This program is free software; you can redistribute it and/or |
| 6 | + * modify it under the terms of the GNU Lesser General Public |
| 7 | + * License as published by the Free Software Foundation; either |
| 8 | + * version 3 of the License, or (at your option) any later version. |
| 9 | + * |
| 10 | + * This program is distributed in the hope that it will be useful, |
| 11 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | + * GNU General Public License for more details. |
| 14 | + * |
| 15 | + * You should have received a copy of the GNU General Public License |
| 16 | + * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 17 | + */ |
| 18 | +package net.raphimc.immediatelyfast.neoforge.injection.mixins.hud_batching.compat.sodiumextras; |
| 19 | + |
| 20 | +import com.llamalad7.mixinextras.sugar.Local; |
| 21 | +import net.minecraft.client.gui.DrawContext; |
| 22 | +import net.raphimc.immediatelyfast.ImmediatelyFast; |
| 23 | +import org.spongepowered.asm.mixin.Mixin; |
| 24 | +import org.spongepowered.asm.mixin.Pseudo; |
| 25 | +import org.spongepowered.asm.mixin.injection.At; |
| 26 | +import org.spongepowered.asm.mixin.injection.Inject; |
| 27 | +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
| 28 | + |
| 29 | +@SuppressWarnings("UnresolvedMixinReference") |
| 30 | +@Mixin(targets = "toni.sodiumextras.foundation.fps.DebugOverlayEvent", remap = false) |
| 31 | +@Pseudo |
| 32 | +public abstract class MixinSodiumExtras_DebugOverlayEvent { |
| 33 | + |
| 34 | + @Inject(method = "renderFPSChar", at = @At("RETURN")) |
| 35 | + private static void forceDrawBatch(CallbackInfo ci, @Local(argsOnly = true) DrawContext drawContext) { |
| 36 | + if (ImmediatelyFast.runtimeConfig.hud_batching) { |
| 37 | + drawContext.draw(); |
| 38 | + } |
| 39 | + } |
| 40 | + |
| 41 | +} |
0 commit comments