mirror of
https://github.com/songoda/EpicFarming.git
synced 2024-11-06 02:50:27 +01:00
Fixed an NPE
This commit is contained in:
parent
46b07826a9
commit
0a5f9e5644
@ -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);
|
||||
}
|
||||
|
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user