File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
fabric/src/main/java/org/embeddedt/modernfix Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public void onInitializeClient() {
3131 ServerLifecycleEvents .SERVER_STARTED .register (server -> {
3232 commonMod .onServerStarted (server );
3333 });
34+ org .embeddedt .modernfix .fabric .modfixs .DecorativeBlocksFix .fix ();
3435 if (FabricLoader .getInstance ().isModLoaded ("fabric-data-generation-api-v1" )) {
3536 RuntimeDatagen .init ();
3637 }
Original file line number Diff line number Diff line change 1+ package org .embeddedt .modernfix .fabric .modfixs ;
2+
3+ import net .minecraft .client .KeyMapping ;
4+ import org .embeddedt .modernfix .util .CommonModUtil ;
5+
6+ import java .lang .reflect .Field ;
7+ import java .lang .reflect .Method ;
8+
9+ public class DecorativeBlocksFix {
10+ public static void fix () {
11+ CommonModUtil .runWithoutCrash (() -> {
12+ Class <?> decorativeBlocksSetup = Class .forName ("lilypuree.decorative_blocks.client.ClientSetup" );
13+ Field keybindField = decorativeBlocksSetup .getDeclaredField ("switchItemState" );
14+ keybindField .setAccessible (true );
15+ KeyMapping keybinding = (KeyMapping )keybindField .get (null );
16+ Class <?> keyBindHelper = Class .forName ("net.fabricmc.fabric.api.client.keybinding.v1.KeyBindingHelper" );
17+ Method keyBindRegister = keyBindHelper .getDeclaredMethod ("registerKeyBinding" , KeyMapping .class );
18+ keyBindRegister .setAccessible (true );
19+ keyBindRegister .invoke (null , keybinding );
20+ }, "registering Decorative Blocks keybind to allow configuration" );
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments