diff --git a/README.md b/README.md index 9c9590f..046b555 100644 --- a/README.md +++ b/README.md @@ -3,3 +3,5 @@ This is a Minecraft forge mod using Mysql backend to make player data synchroniz Such as equipment,inventory,effects,experience,food level.Any other mods support is also possible. Support version now: 1.19 +Current support Mod: +curios diff --git a/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java b/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java index b4385c2..beb1577 100644 --- a/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java +++ b/src/main/java/vip/fubuki/playersync/sync/VanillaSync.java @@ -97,6 +97,7 @@ public class VanillaSync { //Mod support ModsSupport modsSupport = new ModsSupport(); modsSupport.onPlayerJoin(serverPlayer); + serverPlayer.addTag("player_synced"); } resultSet.close(); } @@ -110,10 +111,12 @@ public class VanillaSync { public void OnPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, IOException { String player_uuid = event.getEntity().getUUID().toString(); JDBCsetUp.executeUpdate("UPDATE player_data SET online=false WHERE uuid='"+player_uuid+"'"); + if(!event.getEntity().getTags().contains("player_synced")) return; Store(event.getEntity(),false,Dist.CLIENT.isDedicatedServer()); //Mod support ModsSupport modsSupport = new ModsSupport(); modsSupport.onPlayerLeave(event.getEntity()); + event.getEntity().removeTag("player_synced"); } public void Store(Player player, boolean init,boolean isServer) throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, IOException { diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 00dd702..41c4688 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -63,8 +63,4 @@ make multiserver players' data sync # This version range declares a minimum of the current minecraft version up to but not including the next major version versionRange="[1.19.2,1.20)" ordering="NONE" - side="BOTH" -[[dependencies.playersync]] - modId="mysql_jdbc" - mandatory=true - versionRange="[8.0.27,)" \ No newline at end of file + side="BOTH" \ No newline at end of file