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 8bb6cc5..716b031 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 @@ -115,7 +115,7 @@ public class ModuleAutoCollect extends Module { doLivestockDrop(farm, wool); } Bukkit.getScheduler().runTask(plugin, () -> - Methods.animate(farm.getLocation(), CompatibleMaterial.getMaterial(wool))); + Methods.animate(farm.getLocation(), wool)); } ticksLived.put(entity, 0); } diff --git a/src/main/java/com/songoda/epicfarming/utils/Methods.java b/src/main/java/com/songoda/epicfarming/utils/Methods.java index c3e1bb9..05879da 100644 --- a/src/main/java/com/songoda/epicfarming/utils/Methods.java +++ b/src/main/java/com/songoda/epicfarming/utils/Methods.java @@ -31,12 +31,16 @@ public class Methods { return name; } - public static void animate(Location location, CompatibleMaterial mat) { + public static void animate(Location location, CompatibleMaterial material) { + animate(location, material.getItem()); + } + + public static void animate(Location location, ItemStack item) { if (!Settings.ANIMATE.getBoolean()) return; Block block = location.getBlock(); if (block.getRelative(0, 1, 0).getType() != Material.AIR) return; - Item i = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5), mat.getItem()); + Item i = block.getWorld().dropItem(block.getLocation().add(0.5, 1, 0.5), item); // Support for EpicHoppers suction. i.setMetadata("grabbed", new FixedMetadataValue(EpicFarming.getInstance(), "true"));