use of me.xmrvizzy.skyblocker.chat.ChatFilterResult in project Skyblocker by LifeIsAParadox.
the class ChatHudListenerMixin method onMessage.
@Inject(method = "onChatMessage", at = @At("HEAD"), cancellable = true)
public void onMessage(MessageType messageType, Text message, UUID senderUuid, CallbackInfo ci) {
if (!Utils.isOnSkyblock)
return;
String asString = message.getString();
ChatFilterResult result = ChatMessageListener.EVENT.invoker().onMessage(message, asString);
switch(result) {
case ACTION_BAR:
ClientPlayerEntity player = client.player;
// Couldn't have received original message if client was null
assert player != null;
player.sendMessage(message, true);
case FILTER:
ci.cancel();
}
}
Aggregations