added message debug
This commit is contained in:
@@ -11,18 +11,20 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
@Mixin(ClientPlayerEntity.class)
|
@Mixin(ClientPlayerEntity.class)
|
||||||
public class ClientPlayerEntityMixin {
|
public abstract class ClientPlayerEntityMixin {
|
||||||
|
|
||||||
@Inject(method = "sendChatMessage", at = @At("HEAD"), cancellable = true)
|
@Inject(method = "sendChatMessage", at = @At("HEAD"), cancellable = true)
|
||||||
private void onSendChatMessage(String message, CallbackInfo ci) {
|
private void onSendChatMessage(String message, CallbackInfo ci) {
|
||||||
if(!message.startsWith("/"))return;
|
System.out.println("MESSAGE: " + message);
|
||||||
|
|
||||||
StringReader reader = new StringReader(message);
|
if(message.startsWith("/")) {
|
||||||
reader.skip();
|
StringReader reader = new StringReader(message);
|
||||||
|
reader.skip();
|
||||||
|
|
||||||
if(ClientCommands.isClientSideCommand(message.substring(1).split(Pattern.quote(" ")))) {
|
if(ClientCommands.isClientSideCommand(message.substring(1).split(Pattern.quote(" ")))) {
|
||||||
ClientCommands.executeCommand(reader);
|
ClientCommands.executeCommand(reader);
|
||||||
ci.cancel();
|
ci.cancel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user