mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 06:28:54 +00:00
Fix styles
This commit is contained in:
1 parent
d261116f0d
commit
fad0037c0b
2 files changed
+6
-12
No files matched your search
@@ -22,11 +22,11 @@ public class CarbonChatEvent extends CancellableCarbonEvent {
|
||||
|
||||
// Mimics vanilla chat, should be *visually* identical but without the hover stuff.
|
||||
private @NonNull PlayerComponentRenderer renderer = (sender, recipient, message) -> {
|
||||
var clickEvent = ClickEvent.suggestCommand("/msg " + sender.username());
|
||||
var hoverEvent = HoverEvent.showEntity(Key.key("player"),
|
||||
final var clickEvent = ClickEvent.suggestCommand("/msg " + sender.username());
|
||||
final var hoverEvent = HoverEvent.showEntity(Key.key("player"),
|
||||
sender.uuid(), text(sender.username()));
|
||||
|
||||
var name = sender.displayName()
|
||||
final var name = sender.displayName()
|
||||
.clickEvent(clickEvent)
|
||||
.hoverEvent(hoverEvent)
|
||||
.insertion(sender.username());
|
||||
|
||||
@@ -23,16 +23,10 @@ public final class SpongeChatListener {
|
||||
|
||||
@Listener
|
||||
public void onPlayerChat(final @NonNull PlayerChatEvent event, final @First Player sender) {
|
||||
var original = event.originalChatRouter().chat(sender, event.originalMessage());
|
||||
|
||||
|
||||
|
||||
// annoying bullshit, can't get recipients at all, can't format per-player
|
||||
// cancel event and do EVERYTHING ourselves...
|
||||
// there was discussion about this issue 6 YEARS AGO
|
||||
// there have been pending PRs to address this blatant issue for ///6 years///
|
||||
// https://github.com/SpongePowered/SpongeAPI/issues/612
|
||||
// https://github.com/SpongePowered/SpongeAPI/pull/2340
|
||||
// this event currently doesn't have a concept of recipients, it seems?
|
||||
// or they're in the stack?
|
||||
// idk, let's just do our own thing in the meantime
|
||||
event.setCancelled(true);
|
||||
|
||||
final var player = this.userManager.carbonPlayer(sender.uniqueId());
|
||||
|
||||
Reference in new issue
Block a user