From 68ae6ee70105105969bbc7a0e0feed8dac9e1dc8 Mon Sep 17 00:00:00 2001 From: Gabriele C Date: Fri, 20 Nov 2015 23:59:25 +0100 Subject: [PATCH] remove useless inventory store event --- .../xephi/authme/cache/limbo/LimboCache.java | 15 ------ .../authme/events/StoreInventoryEvent.java | 54 ------------------- 2 files changed, 69 deletions(-) delete mode 100644 src/main/java/fr/xephi/authme/events/StoreInventoryEvent.java diff --git a/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java b/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java index 9a7e02d0a..354d4c72b 100644 --- a/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java +++ b/src/main/java/fr/xephi/authme/cache/limbo/LimboCache.java @@ -12,7 +12,6 @@ import fr.xephi.authme.ConsoleLogger; import fr.xephi.authme.cache.backup.DataFileCache; import fr.xephi.authme.cache.backup.JsonCache; import fr.xephi.authme.events.ResetInventoryEvent; -import fr.xephi.authme.events.StoreInventoryEvent; import fr.xephi.authme.settings.Settings; public class LimboCache { @@ -37,13 +36,6 @@ public class LimboCache { boolean flying = false; if (playerData.doesCacheExist(player)) { - final StoreInventoryEvent event = new StoreInventoryEvent(player, playerData); - Bukkit.getServer().getPluginManager().callEvent(event); - if (!event.isCancelled() && event.getInventory() != null && event.getArmor() != null) { - player.getInventory().setContents(event.getInventory()); - player.getInventory().setArmorContents(event.getArmor()); - } - DataFileCache cache = playerData.readCache(player); if (cache != null) { playerGroup = cache.getGroup(); @@ -51,13 +43,6 @@ public class LimboCache { flying = cache.isFlying(); } } else { - StoreInventoryEvent event = new StoreInventoryEvent(player); - Bukkit.getServer().getPluginManager().callEvent(event); - if (!event.isCancelled() && event.getInventory() != null && event.getArmor() != null) { - player.getInventory().setContents(event.getInventory()); - player.getInventory().setArmorContents(event.getArmor()); - } - operator = player.isOp(); flying = player.isFlying(); if (plugin.vaultGroupManagement != null) { diff --git a/src/main/java/fr/xephi/authme/events/StoreInventoryEvent.java b/src/main/java/fr/xephi/authme/events/StoreInventoryEvent.java deleted file mode 100644 index 9bfc8696b..000000000 --- a/src/main/java/fr/xephi/authme/events/StoreInventoryEvent.java +++ /dev/null @@ -1,54 +0,0 @@ -package fr.xephi.authme.events; - -import org.bukkit.entity.Player; -import org.bukkit.inventory.ItemStack; - -import fr.xephi.authme.cache.backup.JsonCache; - -/** - * This event is call just before write inventory content to cache - * - * @author Xephi59 - */ -public class StoreInventoryEvent extends CustomEvent { - - private ItemStack[] inventory; - private ItemStack[] armor; - private Player player; - - public StoreInventoryEvent(Player player) { - this.player = player; - this.inventory = player.getInventory().getContents(); - this.armor = player.getInventory().getArmorContents(); - } - - public StoreInventoryEvent(Player player, JsonCache jsonCache) { - this.player = player; - this.inventory = player.getInventory().getContents(); - this.armor = player.getInventory().getArmorContents(); - } - - public ItemStack[] getInventory() { - return this.inventory; - } - - public void setInventory(ItemStack[] inventory) { - this.inventory = inventory; - } - - public ItemStack[] getArmor() { - return this.armor; - } - - public void setArmor(ItemStack[] armor) { - this.armor = armor; - } - - public Player getPlayer() { - return this.player; - } - - public void setPlayer(Player player) { - this.player = player; - } -}