mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Update Fabric module to support 1.19.4 (#241)
This commit is contained in:
1 parent
052c3731f5
commit
6839cd0f66
16 files changed
+126
-518
No files matched your search
@@ -314,14 +314,19 @@ public class CarbonChannelRegistry implements ChannelRegistry, DefaultedRegistry
|
||||
final var chatEvent = new CarbonChatEvent(sender, Component.text(plainMessage), recipients, renderers, channel, null);
|
||||
final var result = this.carbonChat.eventHandler().emit(chatEvent);
|
||||
|
||||
if (!result.wasSuccessful()) {
|
||||
final var message = chatEvent.result().reason();
|
||||
|
||||
if (!message.equals(empty())) {
|
||||
sender.sendMessage(message);
|
||||
if (!result.wasSuccessful() || chatEvent.result().cancelled()) {
|
||||
if (!result.exceptions().isEmpty()) {
|
||||
for (final var entry : result.exceptions().entrySet()) {
|
||||
this.carbonChat.logger().error("Exception in event handler: " + entry.getKey().getClass().getName());
|
||||
entry.getValue().printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
final var failure = chatEvent.result().reason();
|
||||
|
||||
if (!failure.equals(empty())) {
|
||||
sender.sendMessage(failure);
|
||||
}
|
||||
}
|
||||
|
||||
var renderedMessage = chatEvent.message();
|
||||
|
||||
Reference in new issue
Block a user