final 13.0 & 13.1

13.1:
add by Commands "!asConsole" & "!onBungee"
This commit is contained in:
2022-11-03 07:57:53 +01:00
parent 667ff81357
commit 176e9724e7
24 changed files with 318 additions and 94 deletions

View File

@@ -1,14 +1,25 @@
package net.t2code.t2codelib.SPIGOT.api.commands;
import net.t2code.t2codelib.SPIGOT.system.BCommandSenderReciver;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
public class T2Ccmd {
public static void console(String cmd) {
Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd);
if (cmd.contains("!onBungee")){
BCommandSenderReciver.sendToBungee(null, cmd.replace("!onBungee", ""), true);
}else Bukkit.getServer().dispatchCommand(Bukkit.getServer().getConsoleSender(), cmd);
}
public static void player(Player player, String cmd) {
player.chat("/" + cmd);
if (cmd.contains("!asConsole")) {
if (cmd.contains("!onBungee")) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("!asConsole", "").replace("!onBungee", ""), true);
} else console(cmd.replace("!asConsole", ""));
} else {
if (cmd.contains("!onBungee")) {
BCommandSenderReciver.sendToBungee(player, cmd.replace("!onBungee", ""), false);
} else player.chat("/" + cmd);
}
}
}