Skip to content

Commit 860e5f0

Browse files
[Patch] More patches.
1 parent f0a1316 commit 860e5f0

6 files changed

Lines changed: 78 additions & 28 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.embeddedt.modernfix.common.mixin.feature.branding;
2+
3+
import net.minecraft.client.gui.components.debug.DebugScreenEntries;
4+
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
5+
import net.minecraft.resources.ResourceLocation;
6+
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
7+
import org.spongepowered.asm.mixin.Mixin;
8+
import org.spongepowered.asm.mixin.gen.Invoker;
9+
10+
11+
@ClientOnlyMixin
12+
@Mixin(DebugScreenEntries.class)
13+
public interface DebugScreenEntriesInvoker {
14+
@Invoker("register")
15+
static ResourceLocation mfix$register(ResourceLocation name, DebugScreenEntry entry) {
16+
throw new RuntimeException("Invoker mixin didn't work?");
17+
};
18+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package org.embeddedt.modernfix.common.mixin.feature.branding;
2+
3+
import net.minecraft.client.gui.components.debug.DebugScreenEntries;
4+
import net.minecraft.client.gui.components.debug.DebugScreenEntryStatus;
5+
import net.minecraft.resources.ResourceLocation;
6+
import org.embeddedt.modernfix.annotation.ClientOnlyMixin;
7+
import org.embeddedt.modernfix.screen.ModernFixDebugScreen;
8+
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.injection.At;
10+
import org.spongepowered.asm.mixin.injection.ModifyVariable;
11+
12+
import java.util.Map;
13+
import java.util.stream.Collectors;
14+
import java.util.stream.Stream;
15+
16+
@ClientOnlyMixin
17+
@Mixin(DebugScreenEntries.class)
18+
public class DebugScreenEntriesMixin {
19+
@ModifyVariable(method = "<clinit>", at = @At(value = "STORE"), ordinal = 0)
20+
private static Map<ResourceLocation, DebugScreenEntryStatus> insertIntoDefaultProfile(Map<ResourceLocation, DebugScreenEntryStatus> map) {
21+
// Map is immutable, so we need to build a new one with the added entry
22+
var stream = map.entrySet().stream();
23+
var new_map = Map.of(ModernFixDebugScreen.MODERNFIX_ENTRY, DebugScreenEntryStatus.IN_F3).entrySet().stream();
24+
25+
return Stream.concat(stream, new_map).collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
26+
}
27+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package org.embeddedt.modernfix.screen;
2+
3+
import net.minecraft.client.gui.components.debug.DebugScreenDisplayer;
4+
import net.minecraft.client.gui.components.debug.DebugScreenEntry;
5+
import net.minecraft.resources.ResourceLocation;
6+
import net.minecraft.world.level.Level;
7+
import net.minecraft.world.level.chunk.LevelChunk;
8+
import org.embeddedt.modernfix.ModernFix;
9+
import org.embeddedt.modernfix.ModernFixClient;
10+
import org.embeddedt.modernfix.common.mixin.feature.branding.DebugScreenEntriesInvoker;
11+
import org.jetbrains.annotations.Nullable;
12+
13+
public class ModernFixDebugScreen {
14+
public static final ResourceLocation MODERNFIX_GROUP = ResourceLocation.fromNamespaceAndPath(ModernFix.MODID, "modernfix_info");
15+
public static ResourceLocation MODERNFIX_ENTRY = DebugScreenEntriesInvoker.mfix$register(
16+
MODERNFIX_GROUP,
17+
new ModernFixDebugEntry()
18+
);
19+
20+
static class ModernFixDebugEntry implements DebugScreenEntry {
21+
@Override
22+
public void display(DebugScreenDisplayer displayer, @Nullable Level level, @Nullable LevelChunk clientChunk, @Nullable LevelChunk serverChunk) {
23+
displayer.addToGroup(MODERNFIX_GROUP, ModernFixClient.INSTANCE.brandingString);
24+
}
25+
26+
@Override
27+
public boolean isAllowed(boolean reducedDebugInfo) {
28+
return true;
29+
}
30+
}
31+
}

fabric/src/main/java/org/embeddedt/modernfix/fabric/mixin/feature/branding/GuiMixin.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ mixinextras_version=0.4.1
77
mod_id=modernfix
88
minecraft_version=1.21.10
99
enabled_platforms=neoforge,fabric
10-
forge_version=21.10.38-beta
10+
forge_version=21.10.55-beta
1111
parchment_version=2025.10.12
1212
parchment_mc_version=1.21.10
1313
refined_storage_version=4392788
@@ -27,7 +27,7 @@ continuity_version=3.0.0-beta.4+1.20.2
2727
modmenu_version=15.0.0
2828
diagonal_fences_version=4558828
2929

30-
spark_version=6225208
30+
spark_version=7094485
3131

3232
use_fabric_api_at_runtime=true
3333

neoforge/src/main/java/org/embeddedt/modernfix/neoforge/init/ModernFixClientForge.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@
2424
import org.embeddedt.modernfix.ModernFixClient;
2525
import org.embeddedt.modernfix.screen.ModernFixConfigScreen;
2626

27-
import java.util.ArrayList;
28-
import java.util.List;
29-
3027
public class ModernFixClientForge {
3128
private static ModernFixClient commonMod;
3229
public static KeyMapping.Category MODERNFIX_KEYS = KeyMapping.Category.register(ResourceLocation.fromNamespaceAndPath(ModernFix.MODID, "key.modernfix"));
@@ -60,8 +57,6 @@ public void onConfigKey(ClientTickEvent.Pre event) {
6057
}
6158
}
6259

63-
private static final List<String> brandingList = new ArrayList<>();
64-
6560
@SubscribeEvent
6661
public void onDisconnect(LevelEvent.Unload event) {
6762
if(event.getLevel().isClientSide()) {

0 commit comments

Comments
 (0)