mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 22:15:08 +00:00
Rename bukkit module to paper
This commit is contained in:
1 parent
a7a9dddf89
commit
5661cc293f
24 files changed
+156
-143
No files matched your search
@@ -36,7 +36,8 @@ public final class ConfigChannelSettings {
|
||||
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.
|
||||
""")
|
||||
private @Nullable Key key = Key.key("carbon", "basic");
|
||||
private @Nullable
|
||||
final Key key = Key.key("carbon", "basic");
|
||||
|
||||
@Comment("""
|
||||
The permission required to use the channel.
|
||||
@@ -44,19 +45,25 @@ public final class ConfigChannelSettings {
|
||||
To send messages you must have the permission carbon.channel.basic.speak
|
||||
If you want to give both, grant carbon.channel.basic or carbon.channel.basic.*
|
||||
""")
|
||||
private @Nullable String permission = "carbon.channel.basic";
|
||||
private @Nullable
|
||||
final String permission = "carbon.channel.basic";
|
||||
|
||||
@Setting("format")
|
||||
@Comment("The chat formats for this channel.")
|
||||
private @Nullable ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
||||
private @Nullable
|
||||
final ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
||||
|
||||
@Comment("Messages will be sent in this channel if they start with this prefix.")
|
||||
private @Nullable String quickPrefix = "";
|
||||
private @Nullable
|
||||
final String quickPrefix = "";
|
||||
|
||||
private @Nullable Boolean shouldRegisterCommands = true;
|
||||
private @Nullable
|
||||
final Boolean shouldRegisterCommands = true;
|
||||
|
||||
private @Nullable String commandName = null;
|
||||
private @Nullable
|
||||
final String commandName = null;
|
||||
|
||||
private @Nullable List<String> commandAliases = Collections.emptyList();
|
||||
private @Nullable
|
||||
final List<String> commandAliases = Collections.emptyList();
|
||||
|
||||
}
|
||||
@@ -75,7 +75,8 @@ public final class ConfigChatChannel implements ChatChannel {
|
||||
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.
|
||||
""")
|
||||
private @Nullable Key key = Key.key("carbon", "global");
|
||||
private @Nullable
|
||||
final Key key = Key.key("carbon", "global");
|
||||
|
||||
@Comment("""
|
||||
The permission required to use the /channel <channelname> and /<channelname> commands.
|
||||
@@ -84,20 +85,26 @@ public final class ConfigChatChannel implements ChatChannel {
|
||||
To read messages you must have the permission carbon.channel.global.see
|
||||
To send messages you must have the permission carbon.channel.global.speak
|
||||
""")
|
||||
private @Nullable String permission = "carbon.channel.global";
|
||||
private @Nullable
|
||||
final String permission = "carbon.channel.global";
|
||||
|
||||
@Setting("format")
|
||||
@Comment("The chat formats for this channel.")
|
||||
private @Nullable ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
||||
private @Nullable
|
||||
final ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
||||
|
||||
@Comment("Messages will be sent in this channel if they start with this prefix.")
|
||||
private @Nullable String quickPrefix = "";
|
||||
private @Nullable
|
||||
final String quickPrefix = "";
|
||||
|
||||
private @Nullable Boolean shouldRegisterCommands = true;
|
||||
private @Nullable
|
||||
final Boolean shouldRegisterCommands = true;
|
||||
|
||||
private @Nullable String commandName = null;
|
||||
private @Nullable
|
||||
final String commandName = null;
|
||||
|
||||
private @Nullable List<String> commandAliases = Collections.emptyList();
|
||||
private @Nullable
|
||||
final List<String> commandAliases = Collections.emptyList();
|
||||
|
||||
private transient @Nullable ConfigChannelMessages carbonMessages = null;
|
||||
|
||||
@@ -106,9 +113,9 @@ public final class ConfigChatChannel implements ChatChannel {
|
||||
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.
|
||||
""")
|
||||
private int radius = -1;
|
||||
private final int radius = -1;
|
||||
|
||||
private transient @Nullable ConfigChannelMessages messageService = null;
|
||||
private final transient @Nullable ConfigChannelMessages messageService = null;
|
||||
|
||||
@Override
|
||||
public @Nullable String quickPrefix() {
|
||||
@@ -152,7 +159,7 @@ public final class ConfigChatChannel implements ChatChannel {
|
||||
);
|
||||
}
|
||||
|
||||
private transient Map<String, TagResolver> DEFAULT_TAGS = Map.ofEntries(
|
||||
private final transient Map<String, TagResolver> DEFAULT_TAGS = Map.ofEntries(
|
||||
Map.entry("hover", StandardTags.hoverEvent()),
|
||||
Map.entry("click", StandardTags.clickEvent()),
|
||||
Map.entry("color", StandardTags.color()),
|
||||
|
||||
@@ -35,13 +35,13 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
||||
public class ClearChatSettings {
|
||||
|
||||
@Comment("The message that will be sent to each player.")
|
||||
private String message = "";
|
||||
private final String message = "";
|
||||
|
||||
@Comment("The number of times the message will be sent to each player.")
|
||||
private int iterations = 50;
|
||||
private final int iterations = 50;
|
||||
|
||||
@Comment("The message to be sent after chat is cleared.")
|
||||
private String broadcast = "<gold>Chat has been cleared by </gold><green><display_name><green><gold>.";
|
||||
private final String broadcast = "<gold>Chat has been cleared by </gold><green><display_name><green><gold>.";
|
||||
|
||||
private @MonotonicNonNull Component messageComponent = null;
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
||||
public class DatabaseSettings {
|
||||
|
||||
@Comment("JDBC URL")
|
||||
private String url = "jdbc:mysql://localhost:3306/carbon";
|
||||
private final String url = "jdbc:mysql://localhost:3306/carbon";
|
||||
|
||||
@Comment("")
|
||||
private String username = "username";
|
||||
private final String username = "username";
|
||||
|
||||
@Comment("")
|
||||
private String password = "password";
|
||||
private final String password = "password";
|
||||
|
||||
public String url() {
|
||||
return this.url;
|
||||
|
||||
@@ -30,28 +30,28 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
||||
@ConfigSerializable
|
||||
public class MessagingSettings {
|
||||
|
||||
private boolean enabled = false;
|
||||
private final boolean enabled = false;
|
||||
|
||||
@Comment("Options: RABBITMQ, NATS, REDIS")
|
||||
private MessagingManager.@NonNull BrokerType brokerType = MessagingManager.BrokerType.NONE;
|
||||
private final MessagingManager.@NonNull BrokerType brokerType = MessagingManager.BrokerType.NONE;
|
||||
|
||||
@Comment("")
|
||||
private String url = "127.0.0.1";
|
||||
private final String url = "127.0.0.1";
|
||||
|
||||
@Comment("")
|
||||
private int port = 5672; // RabbitMQ 5672, NATS 4222, Redis 6379
|
||||
private final int port = 5672; // RabbitMQ 5672, NATS 4222, Redis 6379
|
||||
|
||||
@Comment("RabbitMQ VHost")
|
||||
private String vhost = "/"; // RabbitMQ only
|
||||
private final String vhost = "/"; // RabbitMQ only
|
||||
|
||||
@Comment("NATS credentials file")
|
||||
private String credentialsFile = ""; // NATS only
|
||||
private final String credentialsFile = ""; // NATS only
|
||||
|
||||
@Comment("RabbitMQ username")
|
||||
private String username = "username"; // RabbitMQ only
|
||||
private final String username = "username"; // RabbitMQ only
|
||||
|
||||
@Comment("RabbitMQ and Redis password")
|
||||
private String password = "password"; // RabbitMQ and Redis only
|
||||
private final String password = "password"; // RabbitMQ and Redis only
|
||||
|
||||
public boolean enabled() {
|
||||
return this.enabled;
|
||||
|
||||
@@ -30,15 +30,15 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
||||
public class PingSettings {
|
||||
|
||||
@Comment("The color your name will be when another player mentions you.")
|
||||
private TextColor highlightTextColor = NamedTextColor.YELLOW;
|
||||
private final TextColor highlightTextColor = NamedTextColor.YELLOW;
|
||||
|
||||
private String prefix = "@";
|
||||
private final String prefix = "@";
|
||||
|
||||
private boolean playSound = false;
|
||||
private Key name = Key.key("block.anvil.use");
|
||||
private Sound.Source source = Sound.Source.MASTER;
|
||||
private float volume = 1.0f; // 0.0 -> infinity
|
||||
private float pitch = 1.0f; // 0.0 -> 2.0
|
||||
private final boolean playSound = false;
|
||||
private final Key name = Key.key("block.anvil.use");
|
||||
private final Sound.Source source = Sound.Source.MASTER;
|
||||
private final float volume = 1.0f; // 0.0 -> infinity
|
||||
private final float pitch = 1.0f; // 0.0 -> 2.0
|
||||
|
||||
public TextColor highlightTextColor() {
|
||||
return this.highlightTextColor;
|
||||
|
||||
@@ -32,22 +32,22 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
||||
public class PrimaryConfig {
|
||||
|
||||
@Comment("The default locale for plugin messages.")
|
||||
private Locale defaultLocale = Locale.US;
|
||||
private final Locale defaultLocale = Locale.US;
|
||||
|
||||
@Comment("""
|
||||
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.
|
||||
""")
|
||||
private Key defaultChannel = Key.key("carbon", "global");
|
||||
private final Key defaultChannel = Key.key("carbon", "global");
|
||||
|
||||
@Comment("The service that will be used to store and load player information.")
|
||||
private StorageType storageType = StorageType.JSON;
|
||||
private final StorageType storageType = StorageType.JSON;
|
||||
|
||||
@Comment("")
|
||||
private DatabaseSettings databaseSettings = new DatabaseSettings();
|
||||
private final DatabaseSettings databaseSettings = new DatabaseSettings();
|
||||
|
||||
@Comment("Various ClearChat command settings.")
|
||||
private ClearChatSettings clearChatSettings = new ClearChatSettings();
|
||||
private final ClearChatSettings clearChatSettings = new ClearChatSettings();
|
||||
|
||||
@Comment("""
|
||||
Plugin-wide custom placeholders.
|
||||
@@ -56,12 +56,12 @@ public class PrimaryConfig {
|
||||
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.
|
||||
""")
|
||||
private Map<String, String> customPlaceholders = Map.of();
|
||||
private final Map<String, String> customPlaceholders = Map.of();
|
||||
|
||||
@Comment("Various settings related to pinging players in channels.")
|
||||
private PingSettings pingSettings = new PingSettings();
|
||||
private final PingSettings pingSettings = new PingSettings();
|
||||
|
||||
private MessagingSettings messagingSettings = new MessagingSettings();
|
||||
private final MessagingSettings messagingSettings = new MessagingSettings();
|
||||
|
||||
public Locale defaultLocale() {
|
||||
return this.defaultLocale;
|
||||
|
||||
@@ -188,7 +188,7 @@ public class MessagingManager {
|
||||
this.messagingService = builder.build();
|
||||
}
|
||||
case NONE -> throw new IllegalStateException("MessagingManager initialized with no messaging broker selected!");
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public enum BrokerType {
|
||||
|
||||
Reference in new issue
Block a user