mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Pings and cleanup
This commit is contained in:
1 parent
94e1c25ae1
commit
641d545ff9
4 files changed
+16
-6
No files matched your search
@@ -35,7 +35,7 @@ public final class SimpleChat extends JavaPlugin {
|
||||
private HashMap<UUID, ChatChannel> userChannels = new HashMap<>();
|
||||
private HashMap<UUID, ArrayList<String>> userToggles = new HashMap<>();
|
||||
private HashMap<UUID, ArrayList<UUID>> userIgnores = new HashMap<>();
|
||||
private ArrayList<UUID> shadowMutes = new ArrayList<>(); // TODO: persistence
|
||||
private ArrayList<UUID> shadowMutes = new ArrayList<>();
|
||||
|
||||
private Permission permission;
|
||||
|
||||
|
||||
@@ -217,6 +217,16 @@ public class SimpleChatChannel extends ChatChannel {
|
||||
} else {
|
||||
for (Player onlinePlayer : getAudience(player)) {
|
||||
simpleChat.getAudiences().player(onlinePlayer).sendMessage(formattedMessage);
|
||||
|
||||
if (simpleChat.getConfig().getBoolean("pings.enabled")) {
|
||||
if (message.toLowerCase().contains(onlinePlayer.getName().toLowerCase())) {
|
||||
String sound = simpleChat.getConfig().getString("pings.sound", "ENTITY_EXPERIENCE_ORB_PICKUP");
|
||||
float volume = (float)simpleChat.getConfig().getDouble("pings.volume");
|
||||
float pitch = (float)simpleChat.getConfig().getDouble("pings.pitch");
|
||||
|
||||
onlinePlayer.playSound(onlinePlayer.getLocation(), sound, volume, pitch);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -20,18 +20,14 @@ package net.draycia.simplechat.util;
|
||||
import net.kyori.adventure.platform.bukkit.MinecraftComponentSerializer;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.TextComponent;
|
||||
import net.kyori.adventure.text.event.HoverEvent;
|
||||
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public final class ItemStackUtils {
|
||||
|
||||
|
||||
@@ -58,4 +58,8 @@ item-link-placeholders:
|
||||
- '\[item\]'
|
||||
- '%item%'
|
||||
|
||||
ping-sound:
|
||||
pings:
|
||||
enabled: true
|
||||
sound: ENTITY_EXPERIENCE_ORB_PICKUP
|
||||
volume: 10.0
|
||||
pitch: 1.0
|
||||
Reference in new issue
Block a user