mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 14:38:49 +00:00
Cross server whispering bug fixes
This commit is contained in:
1 parent
16d98d35cc
commit
2fb43df8ad
4 files changed
+34
-18
No files matched your search
@@ -171,28 +171,30 @@ public class SimpleChatUser implements ChatUser, ForwardingAudience {
|
||||
Component fromPlayerComponent = MiniMessage.get().parse(fromPlayerFormat, "message", message,
|
||||
"sender", sender.asOfflinePlayer().getName());
|
||||
|
||||
sender.sendMessage(toPlayerComponent);
|
||||
|
||||
if (sender.isShadowMuted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isOnline()) {
|
||||
this.sendMessage(fromPlayerComponent);
|
||||
if (sender.isOnline()) {
|
||||
sender.sendMessage(toPlayerComponent);
|
||||
|
||||
sender.setReplyTarget(this);
|
||||
this.setReplyTarget(sender);
|
||||
if (sender.isShadowMuted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (simpleChat.getConfig().getBoolean("pings.on-whisper")) {
|
||||
Key key = Key.of(simpleChat.getConfig().getString("pings.sound"));
|
||||
Sound.Source source = Sound.Source.valueOf(simpleChat.getConfig().getString("pings.source"));
|
||||
float volume = (float)simpleChat.getConfig().getDouble("pings.volume");
|
||||
float pitch = (float)simpleChat.getConfig().getDouble("pings.pitch");
|
||||
this.sendMessage(fromPlayerComponent);
|
||||
|
||||
this.playSound(Sound.of(key, source, volume, pitch));
|
||||
sender.setReplyTarget(this);
|
||||
this.setReplyTarget(sender);
|
||||
|
||||
if (simpleChat.getConfig().getBoolean("pings.on-whisper")) {
|
||||
Key key = Key.of(simpleChat.getConfig().getString("pings.sound"));
|
||||
Sound.Source source = Sound.Source.valueOf(simpleChat.getConfig().getString("pings.source"));
|
||||
float volume = (float)simpleChat.getConfig().getDouble("pings.volume");
|
||||
float pitch = (float)simpleChat.getConfig().getDouble("pings.pitch");
|
||||
|
||||
this.playSound(Sound.of(key, source, volume, pitch));
|
||||
}
|
||||
}
|
||||
} else if (sender.isOnline()) {
|
||||
simpleChat.getPluginMessageManager().sendComponentToPlayer(sender.asPlayer(), this, fromPlayerComponent);
|
||||
simpleChat.getPluginMessageManager().sendComponentToPlayer(sender, this, toPlayerComponent, fromPlayerComponent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user