From 1b40bcb3a599fa73f83a80ac3e2007874a9868d2 Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Mon, 25 Feb 2019 09:23:41 -0500 Subject: [PATCH] Fix for entity armor. --- .../com/songoda/ultimatestacker/events/DeathListeners.java | 4 +++- src/main/java/com/songoda/ultimatestacker/utils/Methods.java | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/songoda/ultimatestacker/events/DeathListeners.java b/src/main/java/com/songoda/ultimatestacker/events/DeathListeners.java index 4b16e81..fb80b0c 100644 --- a/src/main/java/com/songoda/ultimatestacker/events/DeathListeners.java +++ b/src/main/java/com/songoda/ultimatestacker/events/DeathListeners.java @@ -11,6 +11,8 @@ import org.bukkit.event.entity.EntityDeathEvent; import org.bukkit.inventory.ItemStack; import org.bukkit.metadata.FixedMetadataValue; +import java.util.ArrayList; + public class DeathListeners implements Listener { private final UltimateStacker instance; @@ -21,6 +23,6 @@ public class DeathListeners implements Listener { @EventHandler public void onEntityDeath(EntityDeathEvent event) { - Methods.onDeath(event.getEntity(), event.getDrops(), event.getDroppedExp()); + Methods.onDeath(event.getEntity(), new ArrayList<>(event.getDrops()), event.getDroppedExp()); } } diff --git a/src/main/java/com/songoda/ultimatestacker/utils/Methods.java b/src/main/java/com/songoda/ultimatestacker/utils/Methods.java index afd65e5..504548d 100644 --- a/src/main/java/com/songoda/ultimatestacker/utils/Methods.java +++ b/src/main/java/com/songoda/ultimatestacker/utils/Methods.java @@ -34,6 +34,7 @@ public class Methods { UltimateStacker instance = UltimateStacker.getInstance(); EntityStackManager stackManager = instance.getEntityStackManager(); Entity newEntity = newEntity(killed); + ((LivingEntity) newEntity).getEquipment().clear(); if (Bukkit.getPluginManager().isPluginEnabled("EpicSpawners")) if (killed.hasMetadata("ES"))