mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-04 06:28:53 +00:00
Undo excessive final keywords
This commit is contained in:
1 parent
5661cc293f
commit
988a5da77c
8 files changed
+47
-58
No files matched your search
@@ -36,8 +36,7 @@ public final class ConfigChannelSettings {
|
|||||||
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.
|
||||||
""")
|
""")
|
||||||
private @Nullable
|
private @Nullable Key key = Key.key("carbon", "basic");
|
||||||
final Key key = Key.key("carbon", "basic");
|
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
The permission required to use the channel.
|
The permission required to use the channel.
|
||||||
@@ -45,25 +44,19 @@ public final class ConfigChannelSettings {
|
|||||||
To send messages you must have the permission carbon.channel.basic.speak
|
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.*
|
If you want to give both, grant carbon.channel.basic or carbon.channel.basic.*
|
||||||
""")
|
""")
|
||||||
private @Nullable
|
private @Nullable String permission = "carbon.channel.basic";
|
||||||
final String permission = "carbon.channel.basic";
|
|
||||||
|
|
||||||
@Setting("format")
|
@Setting("format")
|
||||||
@Comment("The chat formats for this channel.")
|
@Comment("The chat formats for this channel.")
|
||||||
private @Nullable
|
private @Nullable ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
||||||
final ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
|
||||||
|
|
||||||
@Comment("Messages will be sent in this channel if they start with this prefix.")
|
@Comment("Messages will be sent in this channel if they start with this prefix.")
|
||||||
private @Nullable
|
private @Nullable String quickPrefix = "";
|
||||||
final String quickPrefix = "";
|
|
||||||
|
|
||||||
private @Nullable
|
private @Nullable Boolean shouldRegisterCommands = true;
|
||||||
final Boolean shouldRegisterCommands = true;
|
|
||||||
|
|
||||||
private @Nullable
|
private @Nullable String commandName = null;
|
||||||
final String commandName = null;
|
|
||||||
|
|
||||||
private @Nullable
|
private @Nullable List<String> commandAliases = Collections.emptyList();
|
||||||
final List<String> commandAliases = Collections.emptyList();
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -75,8 +75,7 @@ public final class ConfigChatChannel implements ChatChannel {
|
|||||||
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.
|
||||||
""")
|
""")
|
||||||
private @Nullable
|
private @Nullable Key key = Key.key("carbon", "global");
|
||||||
final Key key = Key.key("carbon", "global");
|
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
The permission required to use the /channel <channelname> and /<channelname> commands.
|
The permission required to use the /channel <channelname> and /<channelname> commands.
|
||||||
@@ -85,26 +84,23 @@ public final class ConfigChatChannel implements ChatChannel {
|
|||||||
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
|
private @Nullable String permission = "carbon.channel.global";
|
||||||
final String permission = "carbon.channel.global";
|
|
||||||
|
|
||||||
@Setting("format")
|
@Setting("format")
|
||||||
@Comment("The chat formats for this channel.")
|
@Comment("The chat formats for this channel.")
|
||||||
private @Nullable
|
private @Nullable ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
||||||
final ConfigChannelMessageSource messageSource = new ConfigChannelMessageSource();
|
|
||||||
|
|
||||||
@Comment("Messages will be sent in this channel if they start with this prefix.")
|
@Comment("Messages will be sent in this channel if they start with this prefix.")
|
||||||
private @Nullable
|
private @Nullable String quickPrefix = "";
|
||||||
final String quickPrefix = "";
|
|
||||||
|
|
||||||
private @Nullable
|
private @Nullable
|
||||||
final Boolean shouldRegisterCommands = true;
|
Boolean shouldRegisterCommands = true;
|
||||||
|
|
||||||
private @Nullable
|
private @Nullable
|
||||||
final String commandName = null;
|
String commandName = null;
|
||||||
|
|
||||||
private @Nullable
|
private @Nullable
|
||||||
final List<String> commandAliases = Collections.emptyList();
|
List<String> commandAliases = Collections.emptyList();
|
||||||
|
|
||||||
private transient @Nullable ConfigChannelMessages carbonMessages = null;
|
private transient @Nullable ConfigChannelMessages carbonMessages = null;
|
||||||
|
|
||||||
@@ -113,9 +109,9 @@ public final class ConfigChatChannel implements ChatChannel {
|
|||||||
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 final int radius = -1;
|
private int radius = -1;
|
||||||
|
|
||||||
private final transient @Nullable ConfigChannelMessages messageService = null;
|
private transient @Nullable ConfigChannelMessages messageService = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public @Nullable String quickPrefix() {
|
public @Nullable String quickPrefix() {
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ public class ConfigChannelMessageSource implements IMessageSource<SourcedAudienc
|
|||||||
admin="<white>[</white>Prefix<white>]</white> <display_name><white>: <message></white>"
|
admin="<white>[</white>Prefix<white>]</white> <display_name><white>: <message></white>"
|
||||||
}
|
}
|
||||||
""")
|
""")
|
||||||
private final Map<String, String> defaults = Map.of(
|
private Map<String, String> defaults = Map.of(
|
||||||
"default_format", "<display_name>: <message>",
|
"default_format", "<display_name>: <message>",
|
||||||
"console", "[<channel>] <username> - <uuid>: <message>"
|
"console", "[<channel>] <username> - <uuid>: <message>"
|
||||||
);
|
);
|
||||||
@@ -64,7 +64,7 @@ public class ConfigChannelMessageSource implements IMessageSource<SourcedAudienc
|
|||||||
You can safely delete this section if you don't want to use this feature.
|
You can safely delete this section if you don't want to use this feature.
|
||||||
Will fall back to the defaults section if no format was found for the player.
|
Will fall back to the defaults section if no format was found for the player.
|
||||||
""")
|
""")
|
||||||
private final Map<Locale, Map<String, String>> locales = Map.of(
|
private Map<Locale, Map<String, String>> locales = Map.of(
|
||||||
Locale.US, Map.of("default_format", "<display_name>: <message>")
|
Locale.US, Map.of("default_format", "<display_name>: <message>")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
|||||||
public class ClearChatSettings {
|
public class ClearChatSettings {
|
||||||
|
|
||||||
@Comment("The message that will be sent to each player.")
|
@Comment("The message that will be sent to each player.")
|
||||||
private final String message = "";
|
private String message = "";
|
||||||
|
|
||||||
@Comment("The number of times the message will be sent to each player.")
|
@Comment("The number of times the message will be sent to each player.")
|
||||||
private final int iterations = 50;
|
private int iterations = 50;
|
||||||
|
|
||||||
@Comment("The message to be sent after chat is cleared.")
|
@Comment("The message to be sent after chat is cleared.")
|
||||||
private final String broadcast = "<gold>Chat has been cleared by </gold><green><display_name><green><gold>.";
|
private String broadcast = "<gold>Chat has been cleared by </gold><green><display_name><green><gold>.";
|
||||||
|
|
||||||
private @MonotonicNonNull Component messageComponent = null;
|
private @MonotonicNonNull Component messageComponent = null;
|
||||||
|
|
||||||
|
|||||||
@@ -29,13 +29,13 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
|||||||
public class DatabaseSettings {
|
public class DatabaseSettings {
|
||||||
|
|
||||||
@Comment("JDBC URL")
|
@Comment("JDBC URL")
|
||||||
private final String url = "jdbc:mysql://localhost:3306/carbon";
|
private String url = "jdbc:mysql://localhost:3306/carbon";
|
||||||
|
|
||||||
@Comment("")
|
@Comment("")
|
||||||
private final String username = "username";
|
private String username = "username";
|
||||||
|
|
||||||
@Comment("")
|
@Comment("")
|
||||||
private final String password = "password";
|
private String password = "password";
|
||||||
|
|
||||||
public String url() {
|
public String url() {
|
||||||
return this.url;
|
return this.url;
|
||||||
|
|||||||
@@ -30,28 +30,28 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
|||||||
@ConfigSerializable
|
@ConfigSerializable
|
||||||
public class MessagingSettings {
|
public class MessagingSettings {
|
||||||
|
|
||||||
private final boolean enabled = false;
|
private boolean enabled = false;
|
||||||
|
|
||||||
@Comment("Options: RABBITMQ, NATS, REDIS")
|
@Comment("Options: RABBITMQ, NATS, REDIS")
|
||||||
private final MessagingManager.@NonNull BrokerType brokerType = MessagingManager.BrokerType.NONE;
|
private MessagingManager.@NonNull BrokerType brokerType = MessagingManager.BrokerType.NONE;
|
||||||
|
|
||||||
@Comment("")
|
@Comment("")
|
||||||
private final String url = "127.0.0.1";
|
private String url = "127.0.0.1";
|
||||||
|
|
||||||
@Comment("")
|
@Comment("")
|
||||||
private final int port = 5672; // RabbitMQ 5672, NATS 4222, Redis 6379
|
private int port = 5672; // RabbitMQ 5672, NATS 4222, Redis 6379
|
||||||
|
|
||||||
@Comment("RabbitMQ VHost")
|
@Comment("RabbitMQ VHost")
|
||||||
private final String vhost = "/"; // RabbitMQ only
|
private String vhost = "/"; // RabbitMQ only
|
||||||
|
|
||||||
@Comment("NATS credentials file")
|
@Comment("NATS credentials file")
|
||||||
private final String credentialsFile = ""; // NATS only
|
private String credentialsFile = ""; // NATS only
|
||||||
|
|
||||||
@Comment("RabbitMQ username")
|
@Comment("RabbitMQ username")
|
||||||
private final String username = "username"; // RabbitMQ only
|
private String username = "username"; // RabbitMQ only
|
||||||
|
|
||||||
@Comment("RabbitMQ and Redis password")
|
@Comment("RabbitMQ and Redis password")
|
||||||
private final String password = "password"; // RabbitMQ and Redis only
|
private String password = "password"; // RabbitMQ and Redis only
|
||||||
|
|
||||||
public boolean enabled() {
|
public boolean enabled() {
|
||||||
return this.enabled;
|
return this.enabled;
|
||||||
|
|||||||
@@ -30,15 +30,15 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
|||||||
public class PingSettings {
|
public class PingSettings {
|
||||||
|
|
||||||
@Comment("The color your name will be when another player mentions you.")
|
@Comment("The color your name will be when another player mentions you.")
|
||||||
private final TextColor highlightTextColor = NamedTextColor.YELLOW;
|
private TextColor highlightTextColor = NamedTextColor.YELLOW;
|
||||||
|
|
||||||
private final String prefix = "@";
|
private String prefix = "@";
|
||||||
|
|
||||||
private final boolean playSound = false;
|
private boolean playSound = false;
|
||||||
private final Key name = Key.key("block.anvil.use");
|
private Key name = Key.key("block.anvil.use");
|
||||||
private final Sound.Source source = Sound.Source.MASTER;
|
private Sound.Source source = Sound.Source.MASTER;
|
||||||
private final float volume = 1.0f; // 0.0 -> infinity
|
private float volume = 1.0f; // 0.0 -> infinity
|
||||||
private final float pitch = 1.0f; // 0.0 -> 2.0
|
private float pitch = 1.0f; // 0.0 -> 2.0
|
||||||
|
|
||||||
public TextColor highlightTextColor() {
|
public TextColor highlightTextColor() {
|
||||||
return this.highlightTextColor;
|
return this.highlightTextColor;
|
||||||
|
|||||||
@@ -32,22 +32,22 @@ import org.spongepowered.configurate.objectmapping.meta.Comment;
|
|||||||
public class PrimaryConfig {
|
public class PrimaryConfig {
|
||||||
|
|
||||||
@Comment("The default locale for plugin messages.")
|
@Comment("The default locale for plugin messages.")
|
||||||
private final Locale defaultLocale = Locale.US;
|
private Locale defaultLocale = Locale.US;
|
||||||
|
|
||||||
@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 final Key defaultChannel = Key.key("carbon", "global");
|
private Key defaultChannel = Key.key("carbon", "global");
|
||||||
|
|
||||||
@Comment("The service that will be used to store and load player information.")
|
@Comment("The service that will be used to store and load player information.")
|
||||||
private final StorageType storageType = StorageType.JSON;
|
private StorageType storageType = StorageType.JSON;
|
||||||
|
|
||||||
@Comment("")
|
@Comment("")
|
||||||
private final DatabaseSettings databaseSettings = new DatabaseSettings();
|
private DatabaseSettings databaseSettings = new DatabaseSettings();
|
||||||
|
|
||||||
@Comment("Various ClearChat command settings.")
|
@Comment("Various ClearChat command settings.")
|
||||||
private final ClearChatSettings clearChatSettings = new ClearChatSettings();
|
private ClearChatSettings clearChatSettings = new ClearChatSettings();
|
||||||
|
|
||||||
@Comment("""
|
@Comment("""
|
||||||
Plugin-wide custom placeholders.
|
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.
|
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 final Map<String, String> customPlaceholders = Map.of();
|
private Map<String, String> customPlaceholders = Map.of();
|
||||||
|
|
||||||
@Comment("Various settings related to pinging players in channels.")
|
@Comment("Various settings related to pinging players in channels.")
|
||||||
private final PingSettings pingSettings = new PingSettings();
|
private PingSettings pingSettings = new PingSettings();
|
||||||
|
|
||||||
private final MessagingSettings messagingSettings = new MessagingSettings();
|
private MessagingSettings messagingSettings = new MessagingSettings();
|
||||||
|
|
||||||
public Locale defaultLocale() {
|
public Locale defaultLocale() {
|
||||||
return this.defaultLocale;
|
return this.defaultLocale;
|
||||||
|
|||||||
Reference in new issue
Block a user