From 592838a393ab2ce9f63734381a10b6762eb47d5b Mon Sep 17 00:00:00 2001 From: Brianna Date: Tue, 5 May 2020 12:17:53 -0400 Subject: [PATCH] Move item dropping to sync. --- .../farming/levels/modules/ModuleAutoCollect.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/songoda/epicfarming/farming/levels/modules/ModuleAutoCollect.java b/src/main/java/com/songoda/epicfarming/farming/levels/modules/ModuleAutoCollect.java index 634272d..a25d1f2 100644 --- a/src/main/java/com/songoda/epicfarming/farming/levels/modules/ModuleAutoCollect.java +++ b/src/main/java/com/songoda/epicfarming/farming/levels/modules/ModuleAutoCollect.java @@ -85,7 +85,8 @@ public class ModuleAutoCollect extends Module { entity.getLocation().getWorld().playSound(entity.getLocation(), Sound.ENTITY_CHICKEN_EGG, 1, 2); if (!isEnabled(farm)) { ticksLived.remove(entity); - entity.getLocation().getWorld().dropItemNaturally(entity.getLocation(), new ItemStack(Material.EGG)); + Bukkit.getScheduler().runTask(plugin, () -> + entity.getLocation().getWorld().dropItemNaturally(entity.getLocation(), new ItemStack(Material.EGG))); } else { doLivestockDrop(farm, new ItemStack(Material.EGG, 1)); } @@ -98,7 +99,8 @@ public class ModuleAutoCollect extends Module { Wool woolColor = new Wool(((Sheep) entity).getColor()); ItemStack wool = woolColor.toItemStack((int) Math.round(1 + (Math.random() * 3))); if (!isEnabled(farm)) { - entity.getLocation().getWorld().dropItemNaturally(entity.getLocation(), wool); + Bukkit.getScheduler().runTask(plugin, () -> + entity.getLocation().getWorld().dropItemNaturally(entity.getLocation(), wool)); } else { doLivestockDrop(farm, wool); }