earthgrab: skip tridents, check if arrows are allowed to be picked up

This commit is contained in:
PhanaticD 2019-01-18 03:56:10 -05:00
parent e09ea94629
commit f67c098b0d

View file

@ -293,13 +293,14 @@ public class EarthGrab extends EarthAbility {
continue;
}
if (entity instanceof Trident) {
final Location l = entity.getLocation();
entity.remove();
entity = l.getWorld().dropItem(l, new ItemStack(Material.TRIDENT, 1));
continue;
} else if (entity instanceof Arrow) {
Arrow arrow = (Arrow) entity;
if (arrow.getPickupStatus() == Arrow.PickupStatus.ALLOWED) {
final Location l = entity.getLocation();
entity.remove();
entity = l.getWorld().dropItem(l, new ItemStack(Material.ARROW, 1));
}
} else if (!(entity instanceof Item)) {
continue;
}