Let's hide yet another error.

This commit is contained in:
Brianna 2020-09-09 13:15:23 -05:00
parent 1cbc70bf89
commit 5656a4885a
1 changed files with 9 additions and 1 deletions

View File

@ -70,10 +70,18 @@ public class StackingTask extends BukkitRunnable {
// Loop through each world.
for (World world : Bukkit.getWorlds()) {
// If world is disabled then continue to the next world.
if (isWorldDisabled(world)) continue;
// Get the loaded entities from the current world and reverse them.
List<Entity> entities = new ArrayList<>(world.getEntities());
List<Entity> entities;
try {
entities = new ArrayList<>(world.getEntities());
} catch (Exception ignored) {
continue;
// Sometimes accessing this method asynchronously throws an error. This is super rare and
// as such doesn't really affect the plugin so we're just going to ignore this failure.
}
Collections.reverse(entities);
// Loop through the entities.