diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index 9534acf..bbf33eb 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -56,5 +56,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index b52fa21..2746252 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
net.t2code
T2CodeLib
- 16.7
+ 16.7_dev-01
@@ -63,6 +63,10 @@
+
+ papermc
+ https://repo.papermc.io/repository/maven-public/
+
spigot-repo
@@ -114,6 +118,14 @@
+
+
+ com.velocitypowered
+ velocity-api
+ 3.2.0-SNAPSHOT
+ provided
+
+
org.spigotmc
@@ -227,6 +239,7 @@
20230227
compile
+
diff --git a/src/main/java/net/t2code/t2codelib/Velocity/VelocityMain.java b/src/main/java/net/t2code/t2codelib/Velocity/VelocityMain.java
new file mode 100644
index 0000000..043219f
--- /dev/null
+++ b/src/main/java/net/t2code/t2codelib/Velocity/VelocityMain.java
@@ -0,0 +1,118 @@
+package net.t2code.t2codelib.Velocity;
+
+import com.google.common.io.ByteArrayDataInput;
+import com.google.common.io.ByteStreams;
+import com.google.inject.Inject;
+import com.velocitypowered.api.command.CommandManager;
+import com.velocitypowered.api.command.CommandSource;
+import com.velocitypowered.api.event.Subscribe;
+import com.velocitypowered.api.event.connection.PluginMessageEvent;
+import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
+import com.velocitypowered.api.plugin.Plugin;
+import com.velocitypowered.api.proxy.ConsoleCommandSource;
+import com.velocitypowered.api.proxy.Player;
+import com.velocitypowered.api.proxy.ProxyServer;
+import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
+import net.t2code.t2codelib.Util;
+import org.slf4j.Logger;
+
+
+
+@Plugin(id = "t2codelib", name = "T2CodeLib", version = "16.7_dev-01", authors = {"JaTiTV"})
+public class VelocityMain {
+
+ String prefix = "[T2CodeLib]";
+
+ protected final ProxyServer server;
+ protected final Logger logger;
+ public static final MinecraftChannelIdentifier IDENTIFIER = MinecraftChannelIdentifier.from("t2c:bcmd");
+ // public static final MinecraftChannelIdentifier IDENTIFIER2 = MinecraftChannelIdentifier.from("booster:activate");
+
+ @Inject
+ public VelocityMain(ProxyServer server, Logger logger) {
+ long long_ = System.currentTimeMillis();
+ this.server = server;
+ this.logger = logger;
+
+ logger.info("============================= {} =============================", prefix);
+ logger.info("Autor: JaTiTV");
+ logger.info("Version: 16.7_dev-01");
+ logger.info("Plugin loaded successfully. - {}ms", System.currentTimeMillis() - long_);
+ logger.info("============================= {} =============================", prefix);
+
+ }
+
+
+ @Subscribe
+ public void onProxyInitialization(ProxyInitializeEvent event) {
+ server.getChannelRegistrar().register(IDENTIFIER);
+ // server.getChannelRegistrar().register(IDENTIFIER2);
+ }
+
+ @Subscribe
+ public void onPluginMessageFromPlayer(PluginMessageEvent event) {
+ if (event.getIdentifier() != IDENTIFIER) {
+ return;
+ }
+ ByteArrayDataInput stream = ByteStreams.newDataInput(event.getData());
+ String channel = stream.readUTF();
+ String input = stream.readUTF();
+ String serverID;
+ try {
+ serverID = stream.readUTF();
+ } catch (Exception i) {
+ serverID = "not Found";
+ }
+
+ if (channel.equals("T2Code-Console")) {
+ logger.info("{} [{}] T2C BCMD Command Console: {}", prefix, serverID, input);
+ dispatchCommand(input);
+ } else {
+ Player player = server.getPlayer(channel).orElse(null);
+ if (player != null) {
+ logger.info("{} [{}] T2C BCMD Command {}: {}", prefix, serverID, player, input);
+ executeCommand(player, input);
+ }
+ }
+ event.setResult(PluginMessageEvent.ForwardResult.handled());
+ }
+
+// public void sendToSpigot(String sender, String boostertype, String step, String starter, String starttime, String starteruuid) {
+// ByteArrayOutputStream stream = new ByteArrayOutputStream();
+// DataOutputStream output = new DataOutputStream(stream);
+// try {
+// output.writeUTF(boostertype);
+// output.writeUTF(step);
+// output.writeUTF(starter);
+// output.writeUTF(starttime);
+// output.writeUTF(starteruuid);
+// } catch (IOException e) {
+// java.util.logging.Logger.getLogger(e.getMessage());
+// }
+// Optional player = server.getPlayer(sender);
+// if (!player.isPresent()) {
+// return;
+// }
+// server.getAllServers().forEach((server) -> {
+// if (server != player.get().getCurrentServer().get().getServer()) {
+// server.sendPluginMessage(IDENTIFIER2, stream.toByteArray());
+// }
+// });
+// }
+
+ public void dispatchCommand(String input) {
+ // Get the console command source
+ ConsoleCommandSource console = server.getConsoleCommandSource();
+
+ // Dispatch the command
+ server.getCommandManager().executeAsync(console, input).join();
+ }
+
+ public void executeCommand(Player player, String input) {
+ CommandManager commandManager = server.getCommandManager();
+
+ // Dispatch the command
+ commandManager.executeImmediatelyAsync(player, input);
+ }
+
+}