From 148811b8270f69237b14b409049ca4ef4b7688b4 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 30 Aug 2022 15:46:23 +0200 Subject: [PATCH] Fix PersonalKitCreator Signed-off-by: Lixfel --- FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java | 4 ++++ .../de/steamwar/fightsystem/listener/PersonalKitCreator.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java index 50fcd69..4f0f60c 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/Kit.java @@ -52,6 +52,10 @@ public class Kit { protected static final Map activeKits = new HashMap<>(); + public static Kit getActiveKit(Player player) { + return activeKits.get(player); + } + static { if(!kits.exists()) { Bukkit.getLogger().log(Level.SEVERE, "Kitconfig fehlend!" + kits.getAbsolutePath()); diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java index ef57d60..c9c2dd4 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/PersonalKitCreator.java @@ -134,7 +134,7 @@ public class PersonalKitCreator implements Listener { private InventoryBackup(Player player, PersonalKit kit){ openKitCreators.put(player, this); this.player = player; - this.backup = new Kit("backup", player); + this.backup = Kit.getActiveKit(player); this.kit = kit; }