From a6ae8b34605e79e8be8d8c2d1020bbdbc19732ae Mon Sep 17 00:00:00 2001 From: robinbraemer Date: Tue, 5 Nov 2024 09:02:57 +0100 Subject: [PATCH] fix: Double slash commands (closes #414) --- pkg/edition/java/proxy/handle_cmd.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/edition/java/proxy/handle_cmd.go b/pkg/edition/java/proxy/handle_cmd.go index c23ee99f..eb06c297 100644 --- a/pkg/edition/java/proxy/handle_cmd.go +++ b/pkg/edition/java/proxy/handle_cmd.go @@ -3,13 +3,14 @@ package proxy import ( "context" "errors" - "go.minekube.com/gate/pkg/internal/future" - "strings" "time" + "go.minekube.com/gate/pkg/internal/future" + "go.minekube.com/brigodier" "go.minekube.com/common/minecraft/color" "go.minekube.com/common/minecraft/component" + "go.minekube.com/gate/pkg/command" "go.minekube.com/gate/pkg/edition/java/proto/packet/chat" "go.minekube.com/gate/pkg/edition/java/proto/version" @@ -43,7 +44,7 @@ func (c *chatHandler) queueCommandResult( lastSeenMessages *chat.LastSeenMessages, packetCreator func(event *CommandExecuteEvent, lastSeenMessages *chat.LastSeenMessages) proto.Packet, ) { - cmd := strings.TrimPrefix(message, "/") + cmd := message e := &CommandExecuteEvent{ source: c.player, commandline: cmd,