mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 22:15:45 +00:00
Adventure!
This commit is contained in:
1 parent
641d545ff9
commit
c90acb74b6
2 files changed
+11
-4
No files matched your search
@@ -7,6 +7,9 @@ import net.draycia.simplechat.SimpleChat;
|
|||||||
import net.draycia.simplechat.channels.ChatChannel;
|
import net.draycia.simplechat.channels.ChatChannel;
|
||||||
import net.draycia.simplechat.events.ChannelChatEvent;
|
import net.draycia.simplechat.events.ChannelChatEvent;
|
||||||
import net.draycia.simplechat.util.DiscordWebhook;
|
import net.draycia.simplechat.util.DiscordWebhook;
|
||||||
|
import net.kyori.adventure.audience.Audience;
|
||||||
|
import net.kyori.adventure.key.Key;
|
||||||
|
import net.kyori.adventure.sound.Sound;
|
||||||
import net.kyori.adventure.text.TextComponent;
|
import net.kyori.adventure.text.TextComponent;
|
||||||
import net.kyori.adventure.text.format.TextColor;
|
import net.kyori.adventure.text.format.TextColor;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
@@ -216,15 +219,18 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for (Player onlinePlayer : getAudience(player)) {
|
for (Player onlinePlayer : getAudience(player)) {
|
||||||
simpleChat.getAudiences().player(onlinePlayer).sendMessage(formattedMessage);
|
Audience audience = simpleChat.getAudiences().player(onlinePlayer);
|
||||||
|
|
||||||
|
audience.sendMessage(formattedMessage);
|
||||||
|
|
||||||
if (simpleChat.getConfig().getBoolean("pings.enabled")) {
|
if (simpleChat.getConfig().getBoolean("pings.enabled")) {
|
||||||
if (message.toLowerCase().contains(onlinePlayer.getName().toLowerCase())) {
|
if (message.toLowerCase().contains(onlinePlayer.getName().toLowerCase())) {
|
||||||
String sound = simpleChat.getConfig().getString("pings.sound", "ENTITY_EXPERIENCE_ORB_PICKUP");
|
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 volume = (float)simpleChat.getConfig().getDouble("pings.volume");
|
||||||
float pitch = (float)simpleChat.getConfig().getDouble("pings.pitch");
|
float pitch = (float)simpleChat.getConfig().getDouble("pings.pitch");
|
||||||
|
|
||||||
onlinePlayer.playSound(onlinePlayer.getLocation(), sound, volume, pitch);
|
audience.playSound(Sound.of(key, source, volume, pitch));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ item-link-placeholders:
|
|||||||
|
|
||||||
pings:
|
pings:
|
||||||
enabled: true
|
enabled: true
|
||||||
sound: ENTITY_EXPERIENCE_ORB_PICKUP
|
source: 'PLAYER'
|
||||||
|
sound: 'minecraft:entity.experience_orb.pickup'
|
||||||
volume: 10.0
|
volume: 10.0
|
||||||
pitch: 1.0
|
pitch: 1.0
|
||||||
Reference in new issue
Block a user