diff --git a/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/CarbonSettings.java b/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/CarbonSettings.java index 47b3b898..d95f9e45 100644 --- a/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/CarbonSettings.java +++ b/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/CarbonSettings.java @@ -74,7 +74,7 @@ public class CarbonSettings { @Setting(comment = "Plays a sound and highlights the message when someone types your name") private @NonNull ChannelPings channelPings = new ChannelPings(); - @Setting(comment = "") + @Setting(comment = "Various options relating to the /whisper command") private @NonNull WhisperOptions whisperOptions = new WhisperOptions(); @Setting(comment = "Sets the player's channel to the specified channel when they join" + @@ -84,7 +84,8 @@ public class CarbonSettings { "\nFor example, channel-on-join: \"global\" sets their channel to global on join") private @Nullable String channelOnJoin = ""; - @Setting private List itemLinkPatterns = + @Setting(comment = "The list of regex patterns to show items in chat") + private List itemLinkPatterns = Collections.singletonList(Pattern.compile(Pattern.quote("[item]"))); @NonNull diff --git a/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelOptions.java b/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelOptions.java index 91781059..1f810307 100644 --- a/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelOptions.java +++ b/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelOptions.java @@ -34,37 +34,38 @@ public class ChannelOptions { @Setting(comment = "The name of the format that the plugin will fall back to when it cannot find a matching format for the player's groups.") private String defaultFormatName; - @Setting(comment = "") + @Setting(comment = "If this channel is the default channel players join in.\n" + + "Also used as a fallback in case the player's selected channel cannot be found.") private boolean isDefault = false; // primitive because missing = false - @Setting(comment = "") + @Setting(comment = "If this channel can be ignored / hidden with the /ignore command") private Boolean ignorable; // boxed because missing = use defaults - @Setting(comment = "") + @Setting(comment = "If this channel syncs to other servers (cross-server chat), requires a messaging system setup") private Boolean crossServer; - @Setting(comment = "") + @Setting(comment = "If this channel should respect the bukkit recipient list, you normally shouldn't touch this") private Boolean honorsRecipientList; - @Setting(comment = "") + @Setting(comment = "If players with the permission carbonchat.group.groupname are considered to have the group groupname") private Boolean permissionGroupMatching; - @Setting(comment = "") + @Setting(comment = "A custom (ordered) list of group priorities") private List groupOverrides; - @Setting(comment = "") + @Setting(comment = "The display name of this channel, supports minimessage. Used in command feedback") private String name = ""; - @Setting(comment = "") + @Setting(comment = "If the player's chat message starts with whatever this is set to, the player speaks in this channel instead of their selected one") private String messagePrefix = ""; - @Setting(comment = "") + @Setting(comment = "The command aliases for this channel") private List aliases = new ArrayList<>(); - @Setting(comment = "") + @Setting(comment = "If the bukkit chat event should be cancelled, you probably don't want to change this") private Boolean shouldCancelChatEvent; - @Setting(comment = "") + @Setting(comment = "If the player's format should be decided by their primary group only") private Boolean primaryGroupOnly; @Setting(comment = "") diff --git a/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelPings.java b/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelPings.java index b7837418..47823323 100644 --- a/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelPings.java +++ b/CarbonChat-API/src/main/java/net/draycia/carbon/api/config/ChannelPings.java @@ -8,14 +8,16 @@ import org.spongepowered.configurate.serialize.ConfigSerializable; @ConfigSerializable public final class ChannelPings { + @Setting private boolean enabled = true; @Setting private @NonNull String prefix = ""; @Setting private boolean caseSensitive = false; - @Setting private @NonNull Key sound = - Key.key(Key.MINECRAFT_NAMESPACE, "entity.experience_orb.pickup"); - @Setting private Sound.Source source = Sound.Source.PLAYER; - @Setting private float volume = 10.0F; - @Setting private float pitch = 1.0F; + @Setting private @NonNull Sound sound = Sound.sound( + Key.key(Key.MINECRAFT_NAMESPACE, "entity.experience_orb.pickup"), + Sound.Source.PLAYER, + 10.0F, + 1.0F + ); public boolean enabled() { return this.enabled; @@ -29,19 +31,8 @@ public final class ChannelPings { return this.caseSensitive; } - public Key sound() { + public Sound sound() { return this.sound; } - public Sound.Source source() { - return this.source; - } - - public float volume() { - return this.volume; - } - - public float pitch() { - return this.pitch; - } } diff --git a/CarbonChat-Common/src/main/java/net/draycia/carbon/common/listeners/events/PingHandler.java b/CarbonChat-Common/src/main/java/net/draycia/carbon/common/listeners/events/PingHandler.java index 4c1449b6..d2bccfa9 100644 --- a/CarbonChat-Common/src/main/java/net/draycia/carbon/common/listeners/events/PingHandler.java +++ b/CarbonChat-Common/src/main/java/net/draycia/carbon/common/listeners/events/PingHandler.java @@ -4,8 +4,6 @@ import net.draycia.carbon.api.CarbonChat; import net.draycia.carbon.api.CarbonChatProvider; import net.draycia.carbon.api.events.misc.CarbonEvents; import net.draycia.carbon.api.events.ChatComponentEvent; -import net.kyori.adventure.key.Key; -import net.kyori.adventure.sound.Sound; import net.kyori.event.PostOrders; public class PingHandler { @@ -36,12 +34,7 @@ public class PingHandler { } } - final Key key = carbonChat.carbonSettings().channelPings().sound(); - final Sound.Source source = carbonChat.carbonSettings().channelPings().source(); - final float volume = carbonChat.carbonSettings().channelPings().volume(); - final float pitch = carbonChat.carbonSettings().channelPings().pitch(); - - event.target().playSound(Sound.sound(key, source, volume, pitch)); + event.target().playSound(carbonChat.carbonSettings().channelPings().sound()); }); }