Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Commit e561d19

Browse files
committed
only log connections when enabled
1 parent 7688bc3 commit e561d19

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
<groupId>lol.hyper</groupId>
2525
<artifactId>bungeeblockversion</artifactId>
26-
<version>1.4.2</version>
26+
<version>1.4.3</version>
2727
<packaging>jar</packaging>
2828

2929
<name>BungeeBlockVersion</name>

src/main/java/lol/hyper/bungeeblockversion/events/JoinEvent.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public void onPreConnect(LoginEvent event) {
4242
}
4343

4444
int version = event.getConnection().getVersion();
45-
bungeeBlockVersion.logger.info("Player is connecting with protocol version: " + version);
45+
if (bungeeBlockVersion.configHandler.configuration.getBoolean("log-connection-versions")) {
46+
bungeeBlockVersion.logger.info("Player is connecting with protocol version: " + version);
47+
}
4648
if (bungeeBlockVersion.configHandler.blockedVersions.contains(version)) {
4749
event.setCancelled(true);
4850
String blockedMessage = bungeeBlockVersion.configHandler.configuration.getString("disconnect-message");

src/main/java/lol/hyper/bungeeblockversion/tools/ConfigHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public void loadConfig() {
6060
configuration =
6161
ConfigurationProvider.getProvider(YamlConfiguration.class).load(configFile);
6262
blockedVersions = configuration.getIntList("versions");
63-
int CONFIG_VERSION = 4;
63+
int CONFIG_VERSION = 5;
6464
if (configuration.getInt("config-version") != CONFIG_VERSION) {
6565
bungeeBlockVersion.logger.warning(
6666
"Your config is outdated. We will attempt to load your current config. However, things might not work!");

src/main/resources/config.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,9 @@ versions:
4141
# If you don't want to use {VERSIONS}, just remove it.
4242
disconnect-message: "<red>You cannot connect with this version! We only allow version(s) {VERSIONS}.</red>"
4343

44+
# This will say "Player is connecting with protocol version" when someone joins.
45+
# This is off by default to not spam your console, but you can enable it for debug reasons.
46+
log-connection-versions: false
47+
4448
# No touch please :)
45-
config-version: 4
49+
config-version: 5

0 commit comments

Comments
 (0)