mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 14:38:49 +00:00
More options
This commit is contained in:
1 parent
1959148fb4
commit
95cfa7db52
6 files changed
+34
-13
No files matched your search
@@ -51,8 +51,11 @@ public class AllianceChatChannel extends SimpleChatChannel {
|
|||||||
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
||||||
messageFormat = MiniMessageSerializer.serialize(component);
|
messageFormat = MiniMessageSerializer.serialize(component);
|
||||||
|
|
||||||
// Continue parsing the format
|
// First pass for placeholders, to support placeholders in placeholders
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">");
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">",
|
||||||
|
"phase", Long.toString(System.currentTimeMillis() % 25), "server", getSimpleChat().getConfig().getString("server-name", "Server"));
|
||||||
|
|
||||||
|
// Finally, parse remaining placeholders and parse format
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
||||||
|
|
||||||
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
||||||
|
|||||||
@@ -52,8 +52,11 @@ public class NationChatChannel extends SimpleChatChannel {
|
|||||||
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
||||||
messageFormat = MiniMessageSerializer.serialize(component);
|
messageFormat = MiniMessageSerializer.serialize(component);
|
||||||
|
|
||||||
// Continue parsing the format
|
// First pass for placeholders, to support placeholders in placeholders
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">");
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">",
|
||||||
|
"phase", Long.toString(System.currentTimeMillis() % 25), "server", getSimpleChat().getConfig().getString("server-name", "Server"));
|
||||||
|
|
||||||
|
// Finally, parse remaining placeholders and parse format
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
||||||
|
|
||||||
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
||||||
|
|||||||
@@ -49,8 +49,11 @@ public class PartyChatChannel extends SimpleChatChannel {
|
|||||||
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
||||||
messageFormat = MiniMessageSerializer.serialize(component);
|
messageFormat = MiniMessageSerializer.serialize(component);
|
||||||
|
|
||||||
// Continue parsing the format
|
// First pass for placeholders, to support placeholders in placeholders
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">");
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">",
|
||||||
|
"phase", Long.toString(System.currentTimeMillis() % 25), "server", getSimpleChat().getConfig().getString("server-name", "Server"));
|
||||||
|
|
||||||
|
// Finally, parse remaining placeholders and parse format
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
||||||
|
|
||||||
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
||||||
|
|||||||
@@ -144,8 +144,11 @@ public class SimpleChatChannel extends ChatChannel {
|
|||||||
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
||||||
messageFormat = MiniMessageSerializer.serialize(component);
|
messageFormat = MiniMessageSerializer.serialize(component);
|
||||||
|
|
||||||
// Continue parsing the format
|
// First pass for placeholders, to support placeholders in placeholders
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + color.toString() + ">", "phase", Long.toString(System.currentTimeMillis() % 25));
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + color.toString() + ">",
|
||||||
|
"phase", Long.toString(System.currentTimeMillis() % 25), "server", simpleChat.getConfig().getString("server-name", "Server"));
|
||||||
|
|
||||||
|
// Finally, parse remaining placeholders and parse format
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
||||||
|
|
||||||
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
||||||
|
|||||||
@@ -52,8 +52,11 @@ public class TownChatChannel extends SimpleChatChannel {
|
|||||||
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
Component component = LegacyComponentSerializer.legacy('&').deserialize(messageFormat);
|
||||||
messageFormat = MiniMessageSerializer.serialize(component);
|
messageFormat = MiniMessageSerializer.serialize(component);
|
||||||
|
|
||||||
// Continue parsing the format
|
// First pass for placeholders, to support placeholders in placeholders
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">");
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "color", "<" + getColor().toString() + ">",
|
||||||
|
"phase", Long.toString(System.currentTimeMillis() % 25), "server", getSimpleChat().getConfig().getString("server-name", "Server"));
|
||||||
|
|
||||||
|
// Finally, parse remaining placeholders and parse format
|
||||||
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
messageFormat = MiniMessageParser.handlePlaceholders(messageFormat, "message", event.getMessage());
|
||||||
|
|
||||||
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
Component formattedMessage = MiniMessageParser.parseFormat(messageFormat);
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
# https://github.com/MiniDigger/MiniMessage/blob/feature/adventure/DOCS.md
|
# https://github.com/MiniDigger/MiniMessage/blob/feature/adventure/DOCS.md
|
||||||
|
# IMPORTANT: Use the <pre> tag around ALL user inputs.
|
||||||
|
# All <message> placeholders should be prefixed with <pre> and suffixed with </pre>
|
||||||
|
# Failure to do so may and likely will result in users being able to inject formatting in messages.
|
||||||
|
|
||||||
channels:
|
channels:
|
||||||
global:
|
global:
|
||||||
@@ -7,17 +10,20 @@ channels:
|
|||||||
toggle-on-message: '<gray>You can now see <color><channel> <gray>chat!'
|
toggle-on-message: '<gray>You can now see <color><channel> <gray>chat!'
|
||||||
toggle-off-message: '<gray>You can no longer see <color><channel> <gray>chat!'
|
toggle-off-message: '<gray>You can no longer see <color><channel> <gray>chat!'
|
||||||
formats:
|
formats:
|
||||||
discord-to-mc: '<gray>[<blue>Discord<gray>] <username><white>: <message>' # Placeholders: username, displayname, channel, server, message, primaryrole
|
discord-to-mc: '<gray>[<blue>Discord<gray>] <username><white>: <pre><message>' # Placeholders: username, displayname, channel, server, message, primaryrole
|
||||||
staff: '<gray>{[%deluxetags_tag%<gray>]} %player_displayname% <gray>» <white><message>'
|
staff: '<gray>{[%deluxetags_tag%<gray>]} %player_displayname% <gray>» <white><pre><message>'
|
||||||
default: '<gray>[%deluxetags_tag%<gray>] %player_displayname%<gray>: <white><message>'
|
default: '<gray>[%deluxetags_tag%<gray>] %player_displayname%<gray>: <white><pre><message>'
|
||||||
webhook: 'URL_HERE' # Comment out / remove to disable webhook
|
webhook: 'URL_HERE' # Comment out / remove to disable webhook
|
||||||
color: WHITE # Removing this option defaults to 'WHITE'
|
color: WHITE # Removing this option defaults to 'WHITE'
|
||||||
default: true # Removing this option defaults to 'false'
|
default: true # Removing this option defaults to 'false'
|
||||||
ignorable: true # Removing this option defaults to 'true'
|
ignorable: true # Removing this option defaults to 'true'
|
||||||
distance: -1 # Set to -1, comment out, or remove to disable distance checking
|
distance: -1 # Set to -1, comment out, or remove to disable distance checking
|
||||||
|
forward-format: true # Removing this option defaults to 'true'. Forces all other servers to use this server's formatting for this channel.
|
||||||
|
|
||||||
bot-token: -1
|
bot-token: -1
|
||||||
|
|
||||||
language:
|
language:
|
||||||
ignoring-user: '<green>You are now ignoring <gold><player><green>!'
|
ignoring-user: '<green>You are now ignoring <gold><player><green>!'
|
||||||
not-ignoring-user: '<green>You are no longer ignoring <gold><player><green>!'
|
not-ignoring-user: '<green>You are no longer ignoring <gold><player><green>!'
|
||||||
|
|
||||||
|
server-name: 'Server'
|
||||||
Reference in new issue
Block a user