33import io .github .techstreet .dfscript .event .SendChatEvent ;
44import io .github .techstreet .dfscript .event .TickEvent ;
55import io .github .techstreet .dfscript .event .system .EventManager ;
6+ import io .github .techstreet .dfscript .util .chat .ChatUtil ;
67import net .minecraft .client .network .ClientPlayerEntity ;
78import net .minecraft .text .Text ;
89import org .jetbrains .annotations .Nullable ;
@@ -24,7 +25,7 @@ private void chat(String message, Text preview, CallbackInfo ci) {
2425 }
2526 }
2627
27- @ Inject (method = "sendCommand" , at = @ At ("HEAD" ), cancellable = true )
28+ @ Inject (method = "sendCommand(Ljava/lang/String;)Z " , at = @ At ("HEAD" ), cancellable = true )
2829 private void command (String command , CallbackInfoReturnable <Boolean > ci ) {
2930 SendChatEvent event = new SendChatEvent ("/" +command );
3031 EventManager .getInstance ().dispatch (event );
@@ -33,8 +34,8 @@ private void command(String command, CallbackInfoReturnable<Boolean> ci) {
3334 }
3435 }
3536
36- @ Inject (method = "sendCommandInternal " , at = @ At ("HEAD" ), cancellable = true )
37- private void commandInterval (String command , @ Nullable Text preview , CallbackInfo ci ) {
37+ @ Inject (method = "sendCommand(Ljava/lang/String;Lnet/minecraft/text/Text;)V " , at = @ At ("HEAD" ), cancellable = true )
38+ private void command2 (String command , Text preview , CallbackInfo ci ) {
3839 SendChatEvent event = new SendChatEvent ("/" +command );
3940 EventManager .getInstance ().dispatch (event );
4041 if (event .isCancelled ()) {
0 commit comments