diff --git a/src/main/java/com/therainbowville/minegasm/common/Minegasm.java b/src/main/java/com/therainbowville/minegasm/common/Minegasm.java index bf42d17..d986a54 100644 --- a/src/main/java/com/therainbowville/minegasm/common/Minegasm.java +++ b/src/main/java/com/therainbowville/minegasm/common/Minegasm.java @@ -4,9 +4,12 @@ import org.apache.logging.log4j.Logger; import com.therainbowville.minegasm.client.ClientEventHandler; +import com.therainbowville.minegasm.client.ToyController; import com.therainbowville.minegasm.config.MinegasmConfig; import net.fabricmc.api.ModInitializer; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.event.player.AttackEntityCallback; public class Minegasm implements ModInitializer { @@ -22,6 +25,13 @@ public void onInitialize() { MinegasmConfig.loadConfig(); LOGGER.info(MinegasmConfig.INSTANCE.toString()); AttackEntityCallback.EVENT.register(ClientEventHandler::onAttack); + + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> { + dispatcher.register(ClientCommandManager.literal("minegasm-reconnect").executes(o -> { + ToyController.connectDevice(); + return 0; + })); + }); } }