Skip to content

Commit 59d79ff

Browse files
committed
fixed SendChatEvent with commands not having a slash at the beginning
1 parent 5bffa65 commit 59d79ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/io/github/techstreet/dfscript/mixin/player/MLocalPlayer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private void chat(String message, Text preview, CallbackInfo ci) {
2626

2727
@Inject(method = "sendCommand", at = @At("HEAD"), cancellable = true)
2828
private void command(String command, CallbackInfoReturnable<Boolean> ci) {
29-
SendChatEvent event = new SendChatEvent(command);
29+
SendChatEvent event = new SendChatEvent("/"+command);
3030
EventManager.getInstance().dispatch(event);
3131
if (event.isCancelled()) {
3232
ci.cancel();
@@ -35,7 +35,7 @@ private void command(String command, CallbackInfoReturnable<Boolean> ci) {
3535

3636
@Inject(method = "sendCommandInternal", at = @At("HEAD"), cancellable = true)
3737
private void commandInterval(String command, @Nullable Text preview, CallbackInfo ci) {
38-
SendChatEvent event = new SendChatEvent(command);
38+
SendChatEvent event = new SendChatEvent("/"+command);
3939
EventManager.getInstance().dispatch(event);
4040
if (event.isCancelled()) {
4141
ci.cancel();

0 commit comments

Comments
 (0)