From 22e59471123427e7295c5172b4e72396190c08b3 Mon Sep 17 00:00:00 2001 From: Jules Date: Mon, 26 Aug 2024 12:56:00 -0700 Subject: [PATCH] Fixed an issue with player loading when guild data file is missing --- .../mmocore/manager/data/sql/MMOCoreDataSynchronizer.java | 2 +- .../mmocore/manager/data/yaml/YAMLPlayerDataHandler.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/sql/MMOCoreDataSynchronizer.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/sql/MMOCoreDataSynchronizer.java index 77408bc6..8e7c4978 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/sql/MMOCoreDataSynchronizer.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/sql/MMOCoreDataSynchronizer.java @@ -76,7 +76,7 @@ public class MMOCoreDataSynchronizer extends SQLDataSynchronizer { getData().setUnlockedItems(unlockedItems); if (!isEmpty(result.getString("guild"))) { final Guild guild = MMOCore.plugin.nativeGuildManager.getGuild(result.getString("guild")); - if (guild != null) getData().setGuild(guild.hasMember(getData().getUniqueId()) ? guild : null); + if (guild != null && guild.hasMember(getData().getUniqueId())) getData().setGuild(guild); } if (!isEmpty(result.getString("attributes"))) getData().getAttributes().load(result.getString("attributes")); if (getData().isOnline()) diff --git a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataHandler.java b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataHandler.java index dbd818a9..5e86e9c7 100644 --- a/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataHandler.java +++ b/MMOCore-API/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataHandler.java @@ -58,8 +58,8 @@ public class YAMLPlayerDataHandler extends YAMLSynchronizedDataHandler