Skip to content

Commit f18f512

Browse files
committed
Reimplement command fixes in 1.19.4
1 parent b057afd commit f18f512

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/io/github/techstreet/dfscript/mixin/game/MClientPlayNetworkHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ private void chat(String content, CallbackInfo ci) {
9595
}
9696
}
9797

98-
@Inject(method = "sendCommand(Ljava/lang/String;)Z", at = @At("HEAD"), cancellable = true)
99-
private void command(String command, CallbackInfoReturnable<Boolean> ci) {
98+
@Inject(method = "sendChatCommand", at = @At("HEAD"), cancellable = true)
99+
private void command(String command, CallbackInfo ci) {
100100
if(command.startsWith("scripts")) return;
101101
SendChatEvent event = new SendChatEvent("/"+command);
102102
EventManager.getInstance().dispatch(event);

src/main/java/io/github/techstreet/dfscript/script/event/ScriptEventType.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
public enum ScriptEventType {
1616

17-
SEND_CHAT(SendChatEvent.class,"OnSendChat", "Executed when a player sends a chat message.", Items.BOOK),
17+
SEND_CHAT(SendChatEvent.class,"OnSendChat", "Executed when a player sends a chat message or command.", Items.BOOK),
1818

1919
KEY_PRESS(KeyPressEvent.class, "OnKeyPress", "Executed when a player presses a key.", Items.STONE_BUTTON),
2020

0 commit comments

Comments
 (0)