Reduce console spam in Minecraft 1.19.3 when manually ticking via NMS

NoSuchMethod is now a possible problem - This change makes sure that any failed reflection
access/modification is caught and further calls skipped
This commit is contained in:
Christian Koop 2022-12-26 20:25:55 +01:00
parent 4d24e0a954
commit 327c259e65
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
1 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ public class AnchorTask extends BukkitRunnable {
if (!randomTicksFailed) {
try {
NmsManager.getWorld().randomTickChunk(chunk, randomTicks);
} catch (NoSuchFieldException | IllegalAccessException ex) {
} catch (ReflectiveOperationException ex) {
this.plugin.getLogger().log(Level.SEVERE, ex,
() -> "Failed to do random ticks on this server implementation(/version) - " +
"Skipping further random ticks.");
@ -84,7 +84,7 @@ public class AnchorTask extends BukkitRunnable {
if (!spawnerTicksFailed) {
try {
NmsManager.getWorld().tickInactiveSpawners(chunk, TASK_INTERVAL);
} catch (NoSuchFieldException | IllegalAccessException ex) {
} catch (ReflectiveOperationException ex) {
this.plugin.getLogger().log(Level.SEVERE, ex,
() -> "Failed to do spawner ticks on this server implementation(/version) - " +
"Skipping further spawner ticks.");