From 5b76af19d140c8aa13f6e61af9da2028144c92fc Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 14 May 2023 07:50:34 +0200 Subject: [PATCH] Fix 1.8-1.10 PlayerPickupItemEvent Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/listener/Permanent.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java index 4cc2f17..bfde552 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/listener/Permanent.java @@ -37,10 +37,9 @@ import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.Listener; -import org.bukkit.event.entity.EntityExplodeEvent; -import org.bukkit.event.entity.EntityPickupItemEvent; import org.bukkit.event.block.BlockDispenseEvent; import org.bukkit.event.block.BlockFromToEvent; +import org.bukkit.event.entity.EntityExplodeEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.event.entity.SpawnerSpawnEvent; @@ -49,9 +48,9 @@ import org.bukkit.event.inventory.FurnaceSmeltEvent; import org.bukkit.event.player.*; import org.bukkit.event.weather.WeatherChangeEvent; import org.bukkit.event.world.WorldLoadEvent; +import org.bukkit.inventory.ItemStack; import org.bukkit.scoreboard.NameTagVisibility; import org.bukkit.scoreboard.Team; -import org.bukkit.inventory.ItemStack; public class Permanent implements Listener { @@ -150,10 +149,10 @@ public class Permanent implements Listener { } @EventHandler - public void onDropPickup(EntityPickupItemEvent e) { - if(!(e.getEntity() instanceof Player) || !(Config.ArenaRegion.inRegion(e.getItem().getLocation()))) + public void onDropPickup(PlayerPickupItemEvent e) { + if(!(Config.ArenaRegion.inRegion(e.getItem().getLocation()))) return; - Player player = (Player) e.getEntity(); + Player player = e.getPlayer(); ItemStack stack = e.getItem().getItemStack(); if(Config.PersonalKits) {