Skip to content

Commit

Permalink
fix curios inventory missing bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mlus-asuka committed Apr 20, 2024
1 parent d02232c commit 50648a2
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/java/vip/fubuki/playersync/sync/VanillaSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ public static void doPlayerSaveToFile(PlayerEvent.SaveToFile event) throws SQLEx
JDBCsetUp.executeUpdate("UPDATE server_info SET last_update=" + System.currentTimeMillis() + " WHERE id=" + JdbcConfig.SERVER_ID.get());
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());
}

@SubscribeEvent
Expand All @@ -182,18 +179,17 @@ public static void onServerShutdown(ServerStoppedEvent event) throws SQLExceptio
}

public static void doPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) throws SQLException, IOException {
if(!event.getEntity().getTags().contains("player_synced")) return;
String player_uuid = event.getEntity().getUUID().toString();
JDBCsetUp.executeUpdate("UPDATE player_data SET online= '0' WHERE uuid='"+player_uuid+"'");
Store(event.getEntity(),false,Dist.CLIENT.isDedicatedServer());
//Mod support
ModsSupport modsSupport = new ModsSupport();
modsSupport.onPlayerLeave(event.getEntity());
event.getEntity().removeTag("player_synced");

}

@SubscribeEvent
public static void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) {
public static void onPlayerLogout(PlayerEvent.PlayerLoggedOutEvent event) throws SQLException {
//Mod support
ModsSupport modsSupport = new ModsSupport();
modsSupport.onPlayerLeave(event.getEntity());
executorService.submit(()->{
try {
doPlayerLogout(event);
Expand Down

0 comments on commit 50648a2

Please sign in to comment.