Skip to content

Commit

Permalink
Added Aoba command history.
Browse files Browse the repository at this point in the history
  • Loading branch information
coltonk9043 committed Jun 22, 2023
1 parent 8e1b421 commit 51d2e8f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/net/aoba/mixin/ChatScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@

@Mixin(ChatScreen.class)
public class ChatScreenMixin {
@Inject(at = @At("HEAD"), method = "sendMessage(Ljava/lang/String;Z)Z", cancellable = true)
//

@Inject(at = {
@At(value = "INVOKE", target = "Lnet/minecraft/client/gui/hud/ChatHud;addToMessageHistory(Ljava/lang/String;)V", ordinal = 0, shift = At.Shift.AFTER) }, method = "sendMessage(Ljava/lang/String;Z)Z", cancellable = true)
public void onSendMessage(String message, boolean addToHistory, CallbackInfoReturnable<Boolean> cir) {
if (message.startsWith(AobaClient.PREFIX)) {
Aoba.getInstance().commandManager.command(message.split(" "));
Expand Down

0 comments on commit 51d2e8f

Please sign in to comment.