mirror of
https://github.com/songoda/EpicAnchors.git
synced 2025-02-21 05:51:42 +01:00
Improves NMS error handling when the server version is not supported
This commit is contained in:
parent
aef95bb831
commit
7f0f2a1acb
@ -1,6 +1,7 @@
|
|||||||
package com.songoda.epicanchors.tasks;
|
package com.songoda.epicanchors.tasks;
|
||||||
|
|
||||||
import com.songoda.core.nms.NmsManager;
|
import com.craftaro.core.nms.Nms;
|
||||||
|
import com.craftaro.core.nms.UnsupportedServerVersionException;
|
||||||
import com.songoda.epicanchors.Anchor;
|
import com.songoda.epicanchors.Anchor;
|
||||||
import com.songoda.epicanchors.AnchorManager;
|
import com.songoda.epicanchors.AnchorManager;
|
||||||
import com.songoda.epicanchors.EpicAnchors;
|
import com.songoda.epicanchors.EpicAnchors;
|
||||||
@ -104,8 +105,8 @@ public class AnchorTask extends BukkitRunnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
NmsManager.getWorld().tickInactiveSpawners(chunk, TASK_INTERVAL);
|
Nms.getImplementations().getWorld().tickInactiveSpawners(chunk, TASK_INTERVAL);
|
||||||
} catch (ReflectiveOperationException ex) {
|
} catch (UnsupportedServerVersionException | ReflectiveOperationException | IncompatibleClassChangeError ex) {
|
||||||
this.plugin.getLogger().log(Level.SEVERE, ex,
|
this.plugin.getLogger().log(Level.SEVERE, ex,
|
||||||
() -> "Failed to do spawner ticks on this server implementation(/version) - " +
|
() -> "Failed to do spawner ticks on this server implementation(/version) - " +
|
||||||
"Skipping further spawner ticks.");
|
"Skipping further spawner ticks.");
|
||||||
@ -120,8 +121,8 @@ public class AnchorTask extends BukkitRunnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
NmsManager.getWorld().randomTickChunk(chunk, randomTicks);
|
Nms.getImplementations().getWorld().randomTickChunk(chunk, randomTicks);
|
||||||
} catch (ReflectiveOperationException ex) {
|
} catch (UnsupportedServerVersionException | ReflectiveOperationException | IncompatibleClassChangeError ex) {
|
||||||
this.plugin.getLogger().log(Level.SEVERE, ex,
|
this.plugin.getLogger().log(Level.SEVERE, ex,
|
||||||
() -> "Failed to do random ticks on this server implementation(/version) - " +
|
() -> "Failed to do random ticks on this server implementation(/version) - " +
|
||||||
"Skipping further random ticks.");
|
"Skipping further random ticks.");
|
||||||
|
Loading…
Reference in New Issue
Block a user