From a367eb0e3ea6ad0dabe8606e01aa8f88f0b4a737 Mon Sep 17 00:00:00 2001 From: 3944Realms <81907904+3944Realms@users.noreply.github.com> Date: Fri, 6 Feb 2026 11:01:07 +0800 Subject: [PATCH 1/4] Update JdbcConfig.java --- src/main/java/vip/fubuki/playersync/config/JdbcConfig.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java b/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java index 8745c15..861887f 100644 --- a/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java +++ b/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java @@ -22,6 +22,7 @@ public class JdbcConfig { public static final ForgeConfigSpec.BooleanValue IS_CHAT_SERVER; public static final ForgeConfigSpec.ConfigValue ITEM_PLACEHOLDER_TITLE_OVERRIDE; public static final ForgeConfigSpec.ConfigValue ITEM_PLACEHOLDER_DESCRIPTION_OVERRIDE; + public static ModConfigSpec.BooleanValue KICK_WHEN_ALREADY_ONLINE; public static final ForgeConfigSpec.ConfigValue CHAT_SERVER_IP; public static final ForgeConfigSpec.IntValue CHAT_SERVER_PORT; public static final ForgeConfigSpec.BooleanValue USE_LEGACY_SERIALIZATION; @@ -44,6 +45,8 @@ public class JdbcConfig { .define("sync_advancements", true); SYNC_CHAT = COMMON_BUILDER.comment("Whether synchronize chat").define("sync_chat", false); IS_CHAT_SERVER = COMMON_BUILDER.comment("Whether recieve messages from other servers as host").define("IsChatServer",false); + KICK_WHEN_ALREADY_ONLINE = COMMON_BUILDER.comment("Whether to kick player when already online on another server") + .define("kick_when_already_online", true); CHAT_SERVER_IP = COMMON_BUILDER.define("ChatServerIP","127.0.0.1"); CHAT_SERVER_PORT = COMMON_BUILDER.defineInRange("ChatServerPort",7900,0,65535); USE_LEGACY_SERIALIZATION = COMMON_BUILDER.comment( From 1c5f3cddd41ec4146a438241d847cea7d774bda4 Mon Sep 17 00:00:00 2001 From: 3944Realms <81907904+3944Realms@users.noreply.github.com> Date: Fri, 6 Feb 2026 11:02:04 +0800 Subject: [PATCH 2/4] Add kick option for players already online --- src/main/java/vip/fubuki/playersync/sync/VanillaSync.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java b/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java index c5acb9d..6143a9f 100644 --- a/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java +++ b/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java @@ -169,7 +169,7 @@ public class VanillaSync { } // Second query: Check if player is already online on another server - if (online && lastServer != JdbcConfig.SERVER_ID.get()) { + if (JdbcConfig.KICK_WHEN_ALREADY_ONLINE.get() && online && lastServer != JdbcConfig.SERVER_ID.get()) { JDBCsetUp.QueryResult qr2 = JDBCsetUp.executeQuery("SELECT last_update,enable FROM server_info WHERE id='" + lastServer + "'"); try (ResultSet rs2 = qr2.resultSet()) { if (rs2.next()) { @@ -843,4 +843,4 @@ public class VanillaSync { CuriosCache.tryStoreCuriosToCache(player); } } -} \ No newline at end of file +} From 5632be3d3d0071d8cb5f5ac9c86cbe3388dd1b00 Mon Sep 17 00:00:00 2001 From: 3944Realms <81907904+3944Realms@users.noreply.github.com> Date: Fri, 6 Feb 2026 11:09:32 +0800 Subject: [PATCH 3/4] Change KICK_WHEN_ALREADY_ONLINE to final --- src/main/java/vip/fubuki/playersync/config/JdbcConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java b/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java index 861887f..6a472c1 100644 --- a/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java +++ b/src/main/java/vip/fubuki/playersync/config/JdbcConfig.java @@ -22,7 +22,7 @@ public class JdbcConfig { public static final ForgeConfigSpec.BooleanValue IS_CHAT_SERVER; public static final ForgeConfigSpec.ConfigValue ITEM_PLACEHOLDER_TITLE_OVERRIDE; public static final ForgeConfigSpec.ConfigValue ITEM_PLACEHOLDER_DESCRIPTION_OVERRIDE; - public static ModConfigSpec.BooleanValue KICK_WHEN_ALREADY_ONLINE; + public static final ForgeConfigSpec.BooleanValue KICK_WHEN_ALREADY_ONLINE; public static final ForgeConfigSpec.ConfigValue CHAT_SERVER_IP; public static final ForgeConfigSpec.IntValue CHAT_SERVER_PORT; public static final ForgeConfigSpec.BooleanValue USE_LEGACY_SERIALIZATION; From 86d6393c871a7de3e9adb2fc275eb65abdbec21b Mon Sep 17 00:00:00 2001 From: 3944Realms Date: Fri, 6 Feb 2026 11:21:05 +0800 Subject: [PATCH 4/4] update version --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 425c1f1..bc39a45 100644 --- a/gradle.properties +++ b/gradle.properties @@ -34,7 +34,7 @@ mod_name=PlayerSync # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. mod_license=GPL-3.0 license # The mod version. See https://semver.org/ -mod_version=2.1.4 +mod_version=2.1.5 # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # This should match the base package used for the mod sources. # See https://maven.apache.org/guides/mini/guide-naming-conventions.html