SteamWar/FightSystem
Archiviert
13
1

Fix modifying other inventories in PersonalKitCreator
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: Lixfel <agga-games@gmx.de>
Dieser Commit ist enthalten in:
Lixfel 2023-03-01 17:03:43 +01:00
Ursprung 4252339d0b
Commit ded764002f

Datei anzeigen

@ -37,6 +37,7 @@ import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryAction; import org.bukkit.event.inventory.InventoryAction;
import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.inventory.InventoryCloseEvent;
import org.bukkit.event.inventory.InventoryOpenEvent;
import org.bukkit.event.player.PlayerMoveEvent; import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent; import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.ItemStack;
@ -108,6 +109,15 @@ public class PersonalKitCreator implements Listener {
backup.close(); backup.close();
} }
@EventHandler
public void onOpenEvent(InventoryOpenEvent e){
InventoryBackup backup = openKitCreators.get(e.getPlayer());
if(backup == null)
return;
backup.close();
}
@EventHandler @EventHandler
public void onInventoryClose(InventoryCloseEvent e) { public void onInventoryClose(InventoryCloseEvent e) {
InventoryBackup backup = openKitCreators.get(e.getPlayer()); InventoryBackup backup = openKitCreators.get(e.getPlayer());