Fix issue that may be caused by trying to get a block in unloaded chunk

This commit is contained in:
SeanOMik 2021-09-20 22:41:45 -04:00
parent 0183ab0109
commit 9935ac68da
No known key found for this signature in database
GPG Key ID: CA09E5BE1F32728A
1 changed files with 24 additions and 22 deletions

View File

@ -91,6 +91,7 @@ public class HopperTask extends BukkitRunnable {
public void run() {
for (Map.Entry<UUID, List<ESSystem>> systemEntry : Reference.ES_SYSTEMS.entrySet()) {
for (ESSystem system : systemEntry.getValue()) {
if (system.getLocation().isWorldLoaded()) {
Block systemBlock = system.getLocation().getBlock();
// Get all relative hoppers touching the system.
@ -124,6 +125,7 @@ public class HopperTask extends BukkitRunnable {
}
}
}
}
@Override
public synchronized void cancel() throws IllegalStateException {