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,17 +25,19 @@ 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 ) {
30+ ChatUtil .info ("sendCommand: " +command );
2931 SendChatEvent event = new SendChatEvent ("/" +command );
3032 EventManager .getInstance ().dispatch (event );
3133 if (event .isCancelled ()) {
3234 ci .cancel ();
3335 }
3436 }
3537
36- @ Inject (method = "sendCommandInternal" , at = @ At ("HEAD" ), cancellable = true )
37- private void commandInterval (String command , @ Nullable Text preview , CallbackInfo ci ) {
38+ @ Inject (method = "sendCommand(Ljava/lang/String;Lnet/minecraft/text/Text;)V" , at = @ At ("HEAD" ), cancellable = true )
39+ private void command2 (String command , Text preview , CallbackInfo ci ) {
40+ ChatUtil .info ("sendCommandInternal: " +command );
3841 SendChatEvent event = new SendChatEvent ("/" +command );
3942 EventManager .getInstance ().dispatch (event );
4043 if (event .isCancelled ()) {
0 commit comments