From 5dc63920c5f9e6dba1754b35e3224829c36d27ba Mon Sep 17 00:00:00 2001 From: Florian Rinke Date: Mon, 13 Sep 2021 20:38:05 +0200 Subject: made command client side --- src/main/java/de/torui/coflsky/CoflSky.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/main/java/de/torui/coflsky/CoflSky.java') diff --git a/src/main/java/de/torui/coflsky/CoflSky.java b/src/main/java/de/torui/coflsky/CoflSky.java index 3ef2119..045b0fc 100644 --- a/src/main/java/de/torui/coflsky/CoflSky.java +++ b/src/main/java/de/torui/coflsky/CoflSky.java @@ -5,6 +5,7 @@ import java.net.URISyntaxException; import de.torui.coflsky.websocket.WSClient; import net.minecraft.init.Blocks; +import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod.EventHandler; @@ -13,13 +14,14 @@ import net.minecraftforge.fml.common.event.FMLServerStartingEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedInEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent.PlayerLoggedOutEvent; +import net.minecraftforge.fml.relauncher.Side; @Mod(modid = CoflSky.MODID, version = CoflSky.VERSION) public class CoflSky { public static final String MODID = "CoflSky"; public static final String VERSION = "1.0"; - + public static WSClient WS; @EventHandler public void init(FMLInitializationEvent event) throws URISyntaxException { @@ -29,6 +31,7 @@ public class CoflSky //new Thread(new WSClient(new URI("ws://localhost:8080"))).start(); System.out.println(">>>Started"); + ClientCommandHandler.instance.registerCommand(new CoflSkyCommand()); MinecraftForge.EVENT_BUS.register(new EventRegistry()); } @@ -36,7 +39,10 @@ public class CoflSky @EventHandler public void init(FMLServerStartingEvent event) { - event.registerServerCommand(new CoflSkyCommand()); + + if(event.getSide() == Side.CLIENT) return; + //event.registerServerCommand(new CoflSkyCommand()); } } + \ No newline at end of file -- cgit