Skip to content

Commit 9c9d393

Browse files
committed
Fixed rendering issues with FTB Chunks minimap
Fixes #318
1 parent 9fae07f commit 9c9d393

File tree

5 files changed

+46
-2
lines changed

5 files changed

+46
-2
lines changed

common/src/main/java/net/raphimc/immediatelyfast/injection/ImmediatelyFastMixinPlugin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) {
8080
return false;
8181
} else if (packageName.startsWith("hud_batching.compat.sodiumextras") && PlatformCode.getModVersion("sodiumextras").isEmpty()) { // https://github.com/RaphiMC/ImmediatelyFast/issues/319
8282
return false;
83+
} else if (packageName.startsWith("hud_batching.compat.ftbchunks") && PlatformCode.getModVersion("ftbchunks").isEmpty()) { // https://github.com/RaphiMC/ImmediatelyFast/issues/318
84+
return false;
8385
}
8486

8587
return true;

common/src/main/java/net/raphimc/immediatelyfast/injection/mixins/hud_batching/compat/journeymap/MixinMixinJourneyMap_MiniMap.java renamed to common/src/main/java/net/raphimc/immediatelyfast/injection/mixins/hud_batching/compat/journeymap/MixinJourneyMap_MiniMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
@SuppressWarnings("UnresolvedMixinReference")
3030
@Mixin(targets = "journeymap.client.ui.minimap.MiniMap", remap = false)
3131
@Pseudo
32-
public abstract class MixinMixinJourneyMap_MiniMap {
32+
public abstract class MixinJourneyMap_MiniMap {
3333

3434
@Inject(method = "drawMap", at = @At("HEAD"))
3535
private void forceDrawBatch(CallbackInfo ci, @Local(argsOnly = true) DrawContext drawContext) {

common/src/main/resources/immediatelyfast-common.mixins.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"hud_batching.compat.MixinBufferRenderer",
2626
"hud_batching.compat.MixinDebugHud",
2727
"hud_batching.compat.MixinDrawContext",
28-
"hud_batching.compat.journeymap.MixinMixinJourneyMap_MiniMap",
28+
"hud_batching.compat.journeymap.MixinJourneyMap_MiniMap",
2929
"hud_batching.consumer.MixinDrawContext",
3030
"map_atlas_generation.MixinMapRenderer",
3131
"map_atlas_generation.MixinMapRenderer_MapTexture",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.ftbchunks;
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 = "dev.ftb.mods.ftbchunks.client.FTBChunksClient", remap = false)
31+
@Pseudo
32+
public abstract class MixinFTBChunks_FTBChunksClient {
33+
34+
@Inject(method = "renderHud", at = @At("HEAD"))
35+
private void forceDrawBatch(CallbackInfo ci, @Local(argsOnly = true) DrawContext drawContext) {
36+
if (ImmediatelyFast.runtimeConfig.hud_batching) {
37+
drawContext.draw();
38+
}
39+
}
40+
41+
}

neoforge/src/main/resources/immediatelyfast-neoforge.mixins.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"core.MixinNeoForgeRenderTypes",
99
"hud_batching.MixinGuiLayerManager",
1010
"hud_batching.compat.appleskin.MixinAppleSkin_HUDOverlayHandler",
11+
"hud_batching.compat.ftbchunks.MixinFTBChunks_FTBChunksClient",
1112
"hud_batching.compat.sodiumextras.MixinSodiumExtras_DebugOverlayEvent",
1213
"screen_batching.MixinClientHooks"
1314
],

0 commit comments

Comments
 (0)