mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 13:07:29 +01:00
Build the cause list order correctly.
This commit is contained in:
parent
4b80c4e4e6
commit
c5b08781f7
@ -154,6 +154,16 @@ private static void expand(List<Object> list, @Nullable Object ... element) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (o instanceof TNTPrimed) {
|
||||
expand(list, ((TNTPrimed) o).getSource());
|
||||
} else if (o instanceof Projectile) {
|
||||
expand(list, ((Projectile) o).getShooter());
|
||||
} else if (o instanceof Vehicle) {
|
||||
expand(list, ((Vehicle) o).getPassenger());
|
||||
} else if (o instanceof Tameable) {
|
||||
expand(list, ((Tameable) o).getOwner());
|
||||
}
|
||||
|
||||
// Add manually tracked parent causes
|
||||
Object source = o;
|
||||
int index = list.size();
|
||||
@ -164,21 +174,7 @@ private static void expand(List<Object> list, @Nullable Object ... element) {
|
||||
}
|
||||
}
|
||||
|
||||
if (o instanceof TNTPrimed) {
|
||||
expand(list, ((TNTPrimed) o).getSource());
|
||||
list.add(o);
|
||||
} else if (o instanceof Projectile) {
|
||||
expand(list, ((Projectile) o).getShooter());
|
||||
list.add(o);
|
||||
} else if (o instanceof Vehicle) {
|
||||
expand(list, ((Vehicle) o).getPassenger());
|
||||
list.add(o);
|
||||
} else if (o instanceof Tameable) {
|
||||
expand(list, ((Tameable) o).getOwner());
|
||||
list.add(o);
|
||||
} else {
|
||||
list.add(o);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user