mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Add pings on whisper receive
This commit is contained in:
1 parent
8f885474cb
commit
0370d6313f
2 files changed
+13
-1
No files matched your search
@@ -13,7 +13,9 @@ import net.draycia.simplechat.managers.CommandManager;
|
|||||||
import net.draycia.simplechat.managers.DiscordManager;
|
import net.draycia.simplechat.managers.DiscordManager;
|
||||||
import net.draycia.simplechat.managers.PluginMessageManager;
|
import net.draycia.simplechat.managers.PluginMessageManager;
|
||||||
import net.draycia.simplechat.util.ItemStackUtils;
|
import net.draycia.simplechat.util.ItemStackUtils;
|
||||||
|
import net.kyori.adventure.key.Key;
|
||||||
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
import net.kyori.adventure.platform.bukkit.BukkitAudiences;
|
||||||
|
import net.kyori.adventure.sound.Sound;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.minimessage.MiniMessage;
|
import net.kyori.adventure.text.minimessage.MiniMessage;
|
||||||
import net.milkbowl.vault.permission.Permission;
|
import net.milkbowl.vault.permission.Permission;
|
||||||
@@ -353,6 +355,15 @@ public final class SimpleChat extends JavaPlugin {
|
|||||||
getAudiences().player(target.getPlayer()).sendMessage(fromPlayerComponent);
|
getAudiences().player(target.getPlayer()).sendMessage(fromPlayerComponent);
|
||||||
|
|
||||||
setPlayerReply(target.getUniqueId(), sender.getUniqueId());
|
setPlayerReply(target.getUniqueId(), sender.getUniqueId());
|
||||||
|
|
||||||
|
if (getConfig().getBoolean("pings.on-whisper")) {
|
||||||
|
Key key = Key.of(getConfig().getString("pings.sound"));
|
||||||
|
Sound.Source source = Sound.Source.valueOf(getConfig().getString("pings.source"));
|
||||||
|
float volume = (float)getConfig().getDouble("pings.volume");
|
||||||
|
float pitch = (float)getConfig().getDouble("pings.pitch");
|
||||||
|
|
||||||
|
getAudiences().player(target.getPlayer()).playSound(Sound.of(key, source, volume, pitch));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// TODO: cross server msg support, don't forget to include /ignore support
|
// TODO: cross server msg support, don't forget to include /ignore support
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -76,7 +76,8 @@ pings:
|
|||||||
sound: 'minecraft:entity.experience_orb.pickup'
|
sound: 'minecraft:entity.experience_orb.pickup'
|
||||||
volume: 10.0
|
volume: 10.0
|
||||||
pitch: 1.0
|
pitch: 1.0
|
||||||
highlight: true # Independent of the "enabled" option!
|
highlight: true # independent of the "enabled" option!
|
||||||
|
on-whisper: true # independent of the "enabled" option!
|
||||||
|
|
||||||
listeners:
|
listeners:
|
||||||
join: true # sends join messages in discord
|
join: true # sends join messages in discord
|
||||||
|
|||||||
Reference in new issue
Block a user