Handle Vehicle.getPassenger() as a parent cause.

This commit is contained in:
sk89q 2014-08-12 23:15:47 -07:00
parent 989ce82c5d
commit 4379c7e989

View File

@ -22,6 +22,7 @@
import com.google.common.base.Joiner;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Vehicle;
import javax.annotation.Nullable;
import java.util.ArrayList;
@ -95,6 +96,8 @@ private static void expand(List<Object> list, @Nullable Object ... element) {
if (o instanceof Projectile) {
expand(list, ((Projectile) o).getShooter());
} else if (o instanceof Vehicle) {
expand(list, ((Vehicle) o).getPassenger());
} else {
list.add(o);
}