forked from SteamWar/SteamWar
Revert ChatListener
This commit is contained in:
@@ -56,7 +56,6 @@ public class ChatListener extends BasicListener {
|
|||||||
|
|
||||||
@Subscribe(order = PostOrder.FIRST)
|
@Subscribe(order = PostOrder.FIRST)
|
||||||
public void fixCommands(CommandExecuteEvent e) {
|
public void fixCommands(CommandExecuteEvent e) {
|
||||||
System.out.println("fixCommands " + e);
|
|
||||||
String command = e.getCommand();
|
String command = e.getCommand();
|
||||||
if(command.startsWith("7")) {
|
if(command.startsWith("7")) {
|
||||||
command = "/" + command.substring(1);
|
command = "/" + command.substring(1);
|
||||||
@@ -73,7 +72,6 @@ public class ChatListener extends BasicListener {
|
|||||||
|
|
||||||
@Subscribe(order = PostOrder.LAST)
|
@Subscribe(order = PostOrder.LAST)
|
||||||
public void logCommands(CommandExecuteEvent e) {
|
public void logCommands(CommandExecuteEvent e) {
|
||||||
System.out.println("logCommands " + e);
|
|
||||||
String command = e.getCommand();
|
String command = e.getCommand();
|
||||||
int space = command.indexOf(' ');
|
int space = command.indexOf(' ');
|
||||||
if(VelocityCore.getProxy().getCommandManager().hasCommand(space != -1 ? command.substring(0, space) : command)) {
|
if(VelocityCore.getProxy().getCommandManager().hasCommand(space != -1 ? command.substring(0, space) : command)) {
|
||||||
@@ -88,10 +86,9 @@ public class ChatListener extends BasicListener {
|
|||||||
|
|
||||||
cmdLogger.log(Level.INFO, "%s -> executed command /%s".formatted(name, command));
|
cmdLogger.log(Level.INFO, "%s -> executed command /%s".formatted(name, command));
|
||||||
} else if (e.getCommandSource() instanceof Player player) {
|
} else if (e.getCommandSource() instanceof Player player) {
|
||||||
System.out.println("spoofChatInput " + e);
|
// System.out.println("spoofChatInput " + e);
|
||||||
// player.spoofChatInput("/" + command);
|
player.spoofChatInput("/" + command);
|
||||||
// e.setResult(CommandExecuteEvent.CommandResult.denied());
|
e.setResult(CommandExecuteEvent.CommandResult.denied());
|
||||||
e.setResult(CommandExecuteEvent.CommandResult.forwardToServer(e.getCommand()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user