Skip to content

Commit b9bfef8

Browse files
authored
Merge branch 'DFOnline:1.20' into Functions
2 parents 214c55a + 064862c commit b9bfef8

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
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

src/main/java/io/github/techstreet/dfscript/script/menu/ScriptMenuButton.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public String getIdentifier() {
2525
public boolean mouseClicked(double x, double y, int button) {
2626
if (getBounds().contains(x,y)) {
2727
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f,1f));
28-
//script.invoke(new ScriptMenuClickButtonEvent(identifier));
28+
script.invoke(new ScriptMenuClickButtonEvent(identifier));
2929
return true;
3030
}
3131
return false;

0 commit comments

Comments
 (0)