Skip to content

Commit

Permalink
feat: reconnect command
Browse files Browse the repository at this point in the history
  • Loading branch information
vinceh121 committed Aug 17, 2022
1 parent f1211eb commit 5d231d4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/com/therainbowville/minegasm/common/Minegasm.java
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}));
});
}

}

0 comments on commit 5d231d4

Please sign in to comment.