diff options
author | HacktheTime <l4bg0jb7@duck.com> | 2023-07-09 22:07:10 +0200 |
---|---|---|
committer | hackthetime <l4bg0jb7@duck.com> | 2023-09-05 08:21:45 +0200 |
commit | 0baa0083e23e1b41bfaacd8ee8c38959b966a9dd (patch) | |
tree | 5310c9b2a618d6563c431c9b9276f8399e04163c /src/main | |
parent | 108ebcb6d1b6a9fe9fff1fe3fbd18e8208968f6e (diff) | |
download | BBsentials-0baa0083e23e1b41bfaacd8ee8c38959b966a9dd.tar.gz BBsentials-0baa0083e23e1b41bfaacd8ee8c38959b966a9dd.tar.bz2 BBsentials-0baa0083e23e1b41bfaacd8ee8c38959b966a9dd.zip |
Added and modified things related to the BBsentials Server
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/hype/bbsentials/client/Commands.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/main/java/de/hype/bbsentials/client/Commands.java b/src/main/java/de/hype/bbsentials/client/Commands.java index 6ec133e..305d626 100644 --- a/src/main/java/de/hype/bbsentials/client/Commands.java +++ b/src/main/java/de/hype/bbsentials/client/Commands.java @@ -10,6 +10,7 @@ import com.mojang.brigadier.context.CommandContext; import com.mojang.brigadier.exceptions.CommandSyntaxException; import de.hype.bbsentials.api.Discord; import de.hype.bbsentials.chat.Chat; +import de.hype.bbsentials.communication.BBsentialConnection; import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; @@ -35,6 +36,7 @@ import java.util.ArrayList; import java.util.List; import static de.hype.bbsentials.chat.Chat.*; +import static de.hype.bbsentials.client.BBsentials.bbserver; import static de.hype.bbsentials.client.BBsentials.getConfig; public class Commands { @@ -285,6 +287,24 @@ public class Commands { ) ) ); - }); + }); /*chchest*/ + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> { + dispatcher.register( + ClientCommandManager.literal("bbserver") + .then(ClientCommandManager.argument("Message", StringArgumentType.greedyString()) + .executes((context) -> { + String message = StringArgumentType.getString(context, "Message"); + if (message.equals("bb:reconnect")) { + BBsentials.bbserver = new BBsentialConnection(); + bbserver.connect(getConfig().getBBServerURL(),5000); + } + else { + BBsentials.bbserver.sendMessage(message); } + return 1; + }) + ) + ); + } + ); } }
\ No newline at end of file |