Skip to content

Commit

Permalink
Merge branch 'DFOnline:1.20' into Functions
Browse files Browse the repository at this point in the history
  • Loading branch information
XTerPL authored Dec 18, 2023
2 parents 214c55a + 064862c commit b9bfef8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ private void chat(String content, CallbackInfo ci) {
}
}

@Inject(method = "sendCommand(Ljava/lang/String;)Z", at = @At("HEAD"), cancellable = true)
private void command(String command, CallbackInfoReturnable<Boolean> ci) {
@Inject(method = "sendChatCommand", at = @At("HEAD"), cancellable = true)
private void command(String command, CallbackInfo ci) {
if(command.startsWith("scripts")) return;
SendChatEvent event = new SendChatEvent("/"+command);
EventManager.getInstance().dispatch(event);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

public enum ScriptEventType {

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public String getIdentifier() {
public boolean mouseClicked(double x, double y, int button) {
if (getBounds().contains(x,y)) {
DFScript.MC.getSoundManager().play(PositionedSoundInstance.ambient(SoundEvents.UI_BUTTON_CLICK.value(), 1f,1f));
//script.invoke(new ScriptMenuClickButtonEvent(identifier));
script.invoke(new ScriptMenuClickButtonEvent(identifier));
return true;
}
return false;
Expand Down

0 comments on commit b9bfef8

Please sign in to comment.