mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-03 14:38:51 +00:00
Update configurate to 4.2.0-SNAPSHOT (#342)
This commit is contained in:
1 parent
c35acc38fc
commit
ca1c546b50
7 files changed
+39
-61
No files matched your search
@@ -64,7 +64,6 @@ fun Task.standardRelocations() {
|
|||||||
relocateDependency("net.kyori.moonshine")
|
relocateDependency("net.kyori.moonshine")
|
||||||
relocateDependency("com.seiama.registry")
|
relocateDependency("com.seiama.registry")
|
||||||
relocateDependency("org.spongepowered.configurate")
|
relocateDependency("org.spongepowered.configurate")
|
||||||
relocateDependency("com.typesafe.config")
|
|
||||||
relocateDependency("com.google.thirdparty.publicsuffix")
|
relocateDependency("com.google.thirdparty.publicsuffix")
|
||||||
relocateDependency("com.zaxxer.hikari")
|
relocateDependency("com.zaxxer.hikari")
|
||||||
relocateDependency("ninja.egg82.messenger")
|
relocateDependency("ninja.egg82.messenger")
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ dependencies {
|
|||||||
api(libs.adventureSerializerConfigurate4) {
|
api(libs.adventureSerializerConfigurate4) {
|
||||||
isTransitive = false
|
isTransitive = false
|
||||||
}
|
}
|
||||||
//api(libs.typesafeConfig)
|
|
||||||
|
|
||||||
// Cloud
|
// Cloud
|
||||||
api(platform(libs.cloudBom))
|
api(platform(libs.cloudBom))
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ public class ConfigChatChannel implements ChatChannel {
|
|||||||
@Comment("""
|
@Comment("""
|
||||||
The channel's key, used to track the channel.
|
The channel's key, used to track the channel.
|
||||||
You only need to change the second part of the key. "global" by default.
|
You only need to change the second part of the key. "global" by default.
|
||||||
The value is what's used in commands, this is probably what you want to change.
|
The value is what's used in commands, this is probably what you want to change.""")
|
||||||
""")
|
|
||||||
protected @Nullable Key key = Key.key("carbon", "global");
|
protected @Nullable Key key = Key.key("carbon", "global");
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
@@ -83,8 +82,7 @@ public class ConfigChatChannel implements ChatChannel {
|
|||||||
|
|
||||||
Assuming permission = "carbon.channel.global"
|
Assuming permission = "carbon.channel.global"
|
||||||
To read messages you must have the permission carbon.channel.global.see
|
To read messages you must have the permission carbon.channel.global.see
|
||||||
To send messages you must have the permission carbon.channel.global.speak
|
To send messages you must have the permission carbon.channel.global.speak""")
|
||||||
""")
|
|
||||||
private @Nullable String permission = null;
|
private @Nullable String permission = null;
|
||||||
|
|
||||||
@Setting("format")
|
@Setting("format")
|
||||||
@@ -105,14 +103,12 @@ public class ConfigChatChannel implements ChatChannel {
|
|||||||
@Comment("""
|
@Comment("""
|
||||||
The distance players must be within to see each other's messages.
|
The distance players must be within to see each other's messages.
|
||||||
A value of '0' requires that both players are in the same world.
|
A value of '0' requires that both players are in the same world.
|
||||||
On velocity, '0' requires that both players are in the same server.
|
On velocity, '0' requires that both players are in the same server.""")
|
||||||
""")
|
|
||||||
private int radius = -1;
|
private int radius = -1;
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
If true, players will be able to see if they're not sending messages to anyone
|
If true, players will be able to see if they're not sending messages to anyone
|
||||||
because they're out of range from the radius.
|
because they're out of range from the radius.""")
|
||||||
""")
|
|
||||||
private boolean emptyRadiusRecipientsMessage = true;
|
private boolean emptyRadiusRecipientsMessage = true;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
+1
-2
@@ -67,8 +67,7 @@ public class ConfigChannelMessageSource implements IMessageSource<SourcedAudienc
|
|||||||
Per-Language chat formats.
|
Per-Language chat formats.
|
||||||
You can safely leave this section empty if you don't want to use this feature.
|
You can safely leave this section empty if you don't want to use this feature.
|
||||||
Each locale section can be configured in the same way as the above 'basic' section.
|
Each locale section can be configured in the same way as the above 'basic' section.
|
||||||
Will fall back to the 'basic' section if no format was found for the player's locale.
|
Will fall back to the 'basic' section if no format was found for the player's locale.""")
|
||||||
""")
|
|
||||||
public Map<Locale, Map<String, String>> locales = Map.of(Locale.getDefault(), Map.of());
|
public Map<Locale, Map<String, String>> locales = Map.of(Locale.getDefault(), Map.of());
|
||||||
|
|
||||||
private static final String FALLBACK_FORMAT = "<red><</red><username><red>></red> <message>";
|
private static final String FALLBACK_FORMAT = "<red><</red><username><red>></red> <message>";
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ public class DatabaseSettings {
|
|||||||
JDBC URL. Suggested defaults for each DB:
|
JDBC URL. Suggested defaults for each DB:
|
||||||
MySQL: jdbc:mysql://host:3306/DB
|
MySQL: jdbc:mysql://host:3306/DB
|
||||||
MariaDB: jdbc:mariadb://host:3306/DB
|
MariaDB: jdbc:mariadb://host:3306/DB
|
||||||
PostgreSQL: jdbc:postgresql://host:5432/database
|
PostgreSQL: jdbc:postgresql://host:5432/database""")
|
||||||
""")
|
|
||||||
private String url = "jdbc:mysql://localhost:3306/carbon";
|
private String url = "jdbc:mysql://localhost:3306/carbon";
|
||||||
|
|
||||||
@Comment("The connection username.")
|
@Comment("The connection username.")
|
||||||
|
|||||||
@@ -45,33 +45,31 @@ public class PrimaryConfig {
|
|||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
The default channel that new players will be in when they join.
|
The default channel that new players will be in when they join.
|
||||||
If the channel is not found or the player cannot use the channel, they will speak in basic non-channel chat.
|
If the channel is not found or the player cannot use the channel, they will speak in basic non-channel chat.""")
|
||||||
""")
|
|
||||||
private Key defaultChannel = Key.key("carbon", "global");
|
private Key defaultChannel = Key.key("carbon", "global");
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
The service that will be used to store and load player information.
|
The service that will be used to store and load player information.
|
||||||
One of: JSON, H2, MYSQL, PSQL
|
One of: JSON, H2, MYSQL, PSQL
|
||||||
Note: If you choose MYSQL or PSQL make sure you configure the "database-settings" section of this file!
|
Note: If you choose MYSQL or PSQL make sure you configure the "database-settings" section of this file!""")
|
||||||
""")
|
|
||||||
private StorageType storageType = StorageType.JSON;
|
private StorageType storageType = StorageType.JSON;
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
When "storage-type" is set to MYSQL or PSQL, this section configures the database connection.
|
When "storage-type" is set to MYSQL or PSQL, this section configures the database connection.
|
||||||
If JSON or H2 storage is used, this section can be ignored.
|
If JSON or H2 storage is used, this section can be ignored.""")
|
||||||
""")
|
|
||||||
private DatabaseSettings databaseSettings = new DatabaseSettings();
|
private DatabaseSettings databaseSettings = new DatabaseSettings();
|
||||||
|
|
||||||
@Comment("Various ClearChat command settings.")
|
@Comment("Settings for cross-server messaging")
|
||||||
private ClearChatSettings clearChatSettings = new ClearChatSettings();
|
private MessagingSettings messagingSettings = new MessagingSettings();
|
||||||
|
|
||||||
|
private NicknameSettings nicknameSettings = new NicknameSettings();
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
Plugin-wide custom placeholders.
|
Plugin-wide custom placeholders.
|
||||||
These will be parsed in all messages rendered and sent by Carbon.
|
These will be parsed in all messages rendered and sent by Carbon.
|
||||||
This includes chat, command feedback, and others.
|
This includes chat, command feedback, and others.
|
||||||
Make sure to close your tags so they do not bleed into other formats.
|
Make sure to close your tags so they do not bleed into other formats.
|
||||||
Only a single pass is done so custom placeholders will not work within each other.
|
Only a single pass is done so custom placeholders will not work within each other.""")
|
||||||
""")
|
|
||||||
private Map<String, String> customPlaceholders = Map.of();
|
private Map<String, String> customPlaceholders = Map.of();
|
||||||
|
|
||||||
@Comment("The suggestions shown when using the TAB key in chat.")
|
@Comment("The suggestions shown when using the TAB key in chat.")
|
||||||
@@ -86,7 +84,9 @@ public class PrimaryConfig {
|
|||||||
@Comment("Various settings related to pinging players in channels.")
|
@Comment("Various settings related to pinging players in channels.")
|
||||||
private PingSettings pingSettings = new PingSettings();
|
private PingSettings pingSettings = new PingSettings();
|
||||||
|
|
||||||
@Comment("Various sound settings for messages.")
|
private PartySettings partyChat = new PartySettings();
|
||||||
|
|
||||||
|
@Comment("Sound for receiving a direct message") // TODO migrate to a field name that makes more sense
|
||||||
private @Nullable Sound messageSound = Sound.sound(
|
private @Nullable Sound messageSound = Sound.sound(
|
||||||
Key.key("entity.experience_orb.pickup"),
|
Key.key("entity.experience_orb.pickup"),
|
||||||
Sound.Source.MASTER,
|
Sound.Source.MASTER,
|
||||||
@@ -94,9 +94,8 @@ public class PrimaryConfig {
|
|||||||
1.0F
|
1.0F
|
||||||
);
|
);
|
||||||
|
|
||||||
private MessagingSettings messagingSettings = new MessagingSettings();
|
@Comment("Settings for the clear chat command")
|
||||||
private NicknameSettings nicknameSettings = new NicknameSettings();
|
private ClearChatSettings clearChatSettings = new ClearChatSettings();
|
||||||
private PartySettings partyChat = new PartySettings();
|
|
||||||
|
|
||||||
@Comment("Settings for integrations with other plugins/mods")
|
@Comment("Settings for integrations with other plugins/mods")
|
||||||
private IntegrationConfigContainer integrations;
|
private IntegrationConfigContainer integrations;
|
||||||
@@ -104,14 +103,6 @@ public class PrimaryConfig {
|
|||||||
@Comment("Whether Carbon should check for updates using the GitHub API on startup.")
|
@Comment("Whether Carbon should check for updates using the GitHub API on startup.")
|
||||||
private boolean updateChecker = true;
|
private boolean updateChecker = true;
|
||||||
|
|
||||||
public PartySettings partyChat() {
|
|
||||||
return this.partyChat;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IntegrationConfigContainer integrations() {
|
|
||||||
return this.integrations;
|
|
||||||
}
|
|
||||||
|
|
||||||
public NicknameSettings nickname() {
|
public NicknameSettings nickname() {
|
||||||
return this.nicknameSettings;
|
return this.nicknameSettings;
|
||||||
}
|
}
|
||||||
@@ -132,17 +123,13 @@ public class PrimaryConfig {
|
|||||||
return this.databaseSettings;
|
return this.databaseSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ClearChatSettings clearChatSettings() {
|
public MessagingSettings messagingSettings() {
|
||||||
return this.clearChatSettings;
|
return this.messagingSettings;
|
||||||
}
|
|
||||||
|
|
||||||
public Map<String, String> customPlaceholders() {
|
|
||||||
return this.customPlaceholders;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String applyCustomPlaceholders(final String string) {
|
public String applyCustomPlaceholders(final String string) {
|
||||||
String placeholderResolvedMessage = string;
|
String placeholderResolvedMessage = string;
|
||||||
for (final var entry : this.customPlaceholders().entrySet()) {
|
for (final var entry : this.customPlaceholders.entrySet()) {
|
||||||
placeholderResolvedMessage = placeholderResolvedMessage.replace("<" + entry.getKey() + ">",
|
placeholderResolvedMessage = placeholderResolvedMessage.replace("<" + entry.getKey() + ">",
|
||||||
entry.getValue());
|
entry.getValue());
|
||||||
}
|
}
|
||||||
@@ -153,27 +140,19 @@ public class PrimaryConfig {
|
|||||||
return this.customChatSuggestions;
|
return this.customChatSuggestions;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> chatPlaceholders() {
|
|
||||||
return this.chatPlaceholders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String applyChatPlaceholders(final String string) {
|
public String applyChatPlaceholders(final String string) {
|
||||||
String placeholderResolvedMessage = string;
|
String placeholderResolvedMessage = string;
|
||||||
for (final var entry : this.chatPlaceholders().entrySet()) {
|
for (final var entry : this.chatPlaceholders.entrySet()) {
|
||||||
placeholderResolvedMessage = placeholderResolvedMessage.replace("<" + entry.getKey() + ">",
|
placeholderResolvedMessage = placeholderResolvedMessage.replace("<" + entry.getKey() + ">",
|
||||||
entry.getValue());
|
entry.getValue());
|
||||||
}
|
}
|
||||||
return placeholderResolvedMessage;
|
return placeholderResolvedMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, String> chatFilters() {
|
|
||||||
return this.chatFilter;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String applyChatFilters(final String string) {
|
public String applyChatFilters(final String string) {
|
||||||
String filteredMessage = string;
|
String filteredMessage = string;
|
||||||
|
|
||||||
for (final Map.Entry<String, String> entry : this.chatFilters().entrySet()) {
|
for (final Map.Entry<String, String> entry : this.chatFilter.entrySet()) {
|
||||||
filteredMessage = filteredMessage.replaceAll(entry.getKey(), entry.getValue());
|
filteredMessage = filteredMessage.replaceAll(entry.getKey(), entry.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -184,14 +163,22 @@ public class PrimaryConfig {
|
|||||||
return this.pingSettings;
|
return this.pingSettings;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MessagingSettings messagingSettings() {
|
public PartySettings partyChat() {
|
||||||
return this.messagingSettings;
|
return this.partyChat;
|
||||||
}
|
}
|
||||||
|
|
||||||
public @Nullable Sound messageSound() {
|
public @Nullable Sound messageSound() {
|
||||||
return this.messageSound;
|
return this.messageSound;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ClearChatSettings clearChatSettings() {
|
||||||
|
return this.clearChatSettings;
|
||||||
|
}
|
||||||
|
|
||||||
|
public IntegrationConfigContainer integrations() {
|
||||||
|
return this.integrations;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean updateChecker() {
|
public boolean updateChecker() {
|
||||||
return this.updateChecker;
|
return this.updateChecker;
|
||||||
}
|
}
|
||||||
@@ -226,15 +213,15 @@ public class PrimaryConfig {
|
|||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public static final class NicknameSettings {
|
public static final class NicknameSettings {
|
||||||
|
|
||||||
|
@Comment("Whether Carbon's nickname management should be used. Disable this if you wish to have another plugin manage nicknames.")
|
||||||
|
private boolean useCarbonNicknames = true;
|
||||||
|
|
||||||
@Comment("Minimum number of characters in nickname (excluding formatting).")
|
@Comment("Minimum number of characters in nickname (excluding formatting).")
|
||||||
private int minLength = 3;
|
private int minLength = 3;
|
||||||
|
|
||||||
@Comment("Maximum number of characters in nickname (excluding formatting).")
|
@Comment("Maximum number of characters in nickname (excluding formatting).")
|
||||||
private int maxLength = 16;
|
private int maxLength = 16;
|
||||||
|
|
||||||
@Comment("Whether Carbon's nickname management should be used. Disable this if you wish to have another plugin manage nicknames.")
|
|
||||||
private boolean useCarbonNicknames = true;
|
|
||||||
|
|
||||||
@Comment("Format used when displaying nicknames.")
|
@Comment("Format used when displaying nicknames.")
|
||||||
public String format = "<hover:show_text:'<gray>@</gray><username>'><gray>~</gray><nickname></hover>";
|
public String format = "<hover:show_text:'<gray>@</gray><username>'><gray>~</gray><nickname></hover>";
|
||||||
|
|
||||||
@@ -257,6 +244,7 @@ public class PrimaryConfig {
|
|||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public static final class PartySettings {
|
public static final class PartySettings {
|
||||||
|
|
||||||
|
@Comment("Whether party chat is enabled")
|
||||||
public boolean enabled = true;
|
public boolean enabled = true;
|
||||||
|
|
||||||
public int expireInvitesAfterSeconds = 45;
|
public int expireInvitesAfterSeconds = 45;
|
||||||
|
|||||||
@@ -16,8 +16,7 @@ runTask = "2.2.0"
|
|||||||
adventure = "4.14.0"
|
adventure = "4.14.0"
|
||||||
cloud = "1.8.4"
|
cloud = "1.8.4"
|
||||||
cloudSponge = "1.8.0-SNAPSHOT"
|
cloudSponge = "1.8.0-SNAPSHOT"
|
||||||
configurate = "4.1.2"
|
configurate = "4.2.0-SNAPSHOT"
|
||||||
typesafeConfig = "1.4.3"
|
|
||||||
checkerQual = "3.39.0"
|
checkerQual = "3.39.0"
|
||||||
stylecheck = "0.2.1"
|
stylecheck = "0.2.1"
|
||||||
gson = "2.1"
|
gson = "2.1"
|
||||||
@@ -94,7 +93,6 @@ cloudFabric = { group = "cloud.commandframework", name = "cloud-fabric", version
|
|||||||
configurateCore = { group = "org.spongepowered", name = "configurate-core", version.ref = "configurate" }
|
configurateCore = { group = "org.spongepowered", name = "configurate-core", version.ref = "configurate" }
|
||||||
configurateHocon = { group = "org.spongepowered", name = "configurate-hocon", version.ref = "configurate" }
|
configurateHocon = { group = "org.spongepowered", name = "configurate-hocon", version.ref = "configurate" }
|
||||||
configurateYaml = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
|
configurateYaml = { group = "org.spongepowered", name = "configurate-yaml", version.ref = "configurate" }
|
||||||
typesafeConfig = { group = "com.typesafe", name = "config", version.ref = "typesafeConfig" }
|
|
||||||
checkerQual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerQual" }
|
checkerQual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerQual" }
|
||||||
stylecheck = { group = "ca.stellardrift", name = "stylecheck", version.ref = "stylecheck" }
|
stylecheck = { group = "ca.stellardrift", name = "stylecheck", version.ref = "stylecheck" }
|
||||||
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
gson = { group = "com.google.code.gson", name = "gson", version.ref = "gson" }
|
||||||
|
|||||||
Reference in new issue
Block a user