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 ;
76import net .minecraft .client .network .ClientPlayerEntity ;
87import net .minecraft .text .Text ;
9- import org .jetbrains .annotations .Nullable ;
108import org .spongepowered .asm .mixin .Mixin ;
119import org .spongepowered .asm .mixin .injection .At ;
1210import org .spongepowered .asm .mixin .injection .Inject ;
@@ -27,6 +25,7 @@ private void chat(String message, Text preview, CallbackInfo ci) {
2725
2826 @ Inject (method = "sendCommand(Ljava/lang/String;)Z" , at = @ At ("HEAD" ), cancellable = true )
2927 private void command (String command , CallbackInfoReturnable <Boolean > ci ) {
28+ if (command .startsWith ("scripts" )) return ;
3029 SendChatEvent event = new SendChatEvent ("/" +command );
3130 EventManager .getInstance ().dispatch (event );
3231 if (event .isCancelled ()) {
@@ -36,6 +35,7 @@ private void command(String command, CallbackInfoReturnable<Boolean> ci) {
3635
3736 @ Inject (method = "sendCommand(Ljava/lang/String;Lnet/minecraft/text/Text;)V" , at = @ At ("HEAD" ), cancellable = true )
3837 private void command2 (String command , Text preview , CallbackInfo ci ) {
38+ if (command .startsWith ("scripts" )) return ;
3939 SendChatEvent event = new SendChatEvent ("/" +command );
4040 EventManager .getInstance ().dispatch (event );
4141 if (event .isCancelled ()) {
0 commit comments