From f7b51a3a28be874f1ce02c214062e371a2a2b0b3 Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Mon, 29 Mar 2021 20:21:26 +0200 Subject: [PATCH] Fix issues loading backpacks --- .../at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java | 2 +- .../Minepacks/Bukkit/Database/MinepacksPlayerData.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java index 7f6d3d7..53586d2 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/Database.java @@ -162,7 +162,7 @@ private void loadPlayer(final @NotNull MinepacksPlayerData player) public void loadBackpack(final @NotNull MinepacksPlayerData player) { player.setBackpackLoadingRequested(true); - backend.loadPlayer(player); + backend.loadBackpack(player); } @EventHandler diff --git a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java index 77c0389..a97e452 100644 --- a/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java +++ b/Minepacks/src/at/pcgamingfreaks/Minepacks/Bukkit/Database/MinepacksPlayerData.java @@ -77,6 +77,7 @@ public void setBackpack(final @NotNull Backpack backpack) { this.backpack = backpack; backpackLoadedQueue.forEach(backpackCallback -> backpackCallback.onResult(backpack)); + backpackLoadedQueue.clear(); } public void setLoaded(final @NotNull Object databaseKey, final long cooldown) @@ -84,6 +85,7 @@ public void setLoaded(final @NotNull Object databaseKey, final long cooldown) this.databaseKey = databaseKey; this.cooldown = cooldown; playerLoadedQueue.forEach(loadedCallback -> loadedCallback.onResult(this)); + playerLoadedQueue.clear(); } public void setCooldownData(final long cooldown)