Describe the bug
Whenever someone places a surrender banner, after the siege session is over, an async error occurs.
To Reproduce
Steps to reproduce the behavior:
Start a siege
Have a defender or attacker surrender.
After session ends, see error.
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Towny: 0.100.3.12
SiegeWar: 2.12.1 (this does not seem to be related to the NPE for getSiegeWinner)
Spigot/Paper: Folia 1.20.6
Files
[04:30:30 INFO]: [SiegeWar] §bThe current Battle Session has ended. Normal PVP protections have been restored. The following teams won their battles:
[04:30:30 INFO]: [SiegeWar] §b * Attackers @ Aiacciu (+1860)
[04:30:30 INFO]: [SiegeWar] §bCONQUEST SIEGE at SantAntoco > Attacker Abandon Confirmed! The town has been saved!
[04:30:30 ERROR]: Thread Folia Async Scheduler Thread #1408 failed main thread check: Cannot read world asynchronously
java.lang.Throwable: null
at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:57) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlock.getNMS(CraftBlock.java:80) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:247) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:239) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlock.getState(CraftBlock.java:349) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.utils.SiegeWarLoreUtil.applySiegeEndLoreToBannerState(SiegeWarLoreUtil.java:385) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.listeners.SiegeWarLoreListener.onSiegeEnd(SiegeWarLoreListener.java:48) ~[SiegeWar-2.12.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor418.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-5-d797082]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.utils.SiegeWarSiegeCompletionUtil.setCommonSiegeCompletionValues(SiegeWarSiegeCompletionUtil.java:42) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.timeractions.DefenderWin.defenderWin(DefenderWin.java:23) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.AbandonAttack.abandonAttack(AbandonAttack.java:55) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.tasks.SiegeWarTimerTaskController.evaluateTimedSiegeOutcome(SiegeWarTimerTaskController.java:62) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.tasks.SiegeWarTimerTaskController.evaluateTimedSiegeOutcomes(SiegeWarTimerTaskController.java:32) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.listeners.SiegeWarTownyEventListener.onShortTime(SiegeWarTownyEventListener.java:144) ~[SiegeWar-2.12.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor381.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-5-d797082]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.util.BukkitTools.fireEvent(BukkitTools.java:373) ~[Towny-0.100.3.12.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.towny.tasks.ShortTimerTask.run(ShortTimerTask.java:33) ~[Towny-0.100.3.12.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.towny.scheduling.TaskScheduler.lambda$runAsyncRepeating$11(TaskScheduler.java:122) ~[Towny-0.100.3.12.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.towny.scheduling.impl.FoliaTaskScheduler.lambda$runAsyncRepeating$8(FoliaTaskScheduler.java:145) ~[Towny-0.100.3.12.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler$AsyncScheduledTask.run(FoliaAsyncScheduler.java:217) ~[folia-1.20.6.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
[04:30:30 ERROR]: Could not pass event SiegeEndEvent to SiegeWar v2.12.1
java.lang.IllegalStateException: Cannot read world asynchronously
at io.papermc.paper.util.TickThread.ensureTickThread(TickThread.java:58) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlock.getNMS(CraftBlock.java:80) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:247) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlockStates.getBlockState(CraftBlockStates.java:239) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.craftbukkit.block.CraftBlock.getState(CraftBlock.java:349) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.utils.SiegeWarLoreUtil.applySiegeEndLoreToBannerState(SiegeWarLoreUtil.java:385) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.listeners.SiegeWarLoreListener.onSiegeEnd(SiegeWarLoreListener.java:48) ~[SiegeWar-2.12.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor418.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-5-d797082]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.utils.SiegeWarSiegeCompletionUtil.setCommonSiegeCompletionValues(SiegeWarSiegeCompletionUtil.java:42) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.timeractions.DefenderWin.defenderWin(DefenderWin.java:23) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.AbandonAttack.abandonAttack(AbandonAttack.java:55) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.tasks.SiegeWarTimerTaskController.evaluateTimedSiegeOutcome(SiegeWarTimerTaskController.java:62) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.tasks.SiegeWarTimerTaskController.evaluateTimedSiegeOutcomes(SiegeWarTimerTaskController.java:32) ~[SiegeWar-2.12.1.jar:?]
at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.listeners.SiegeWarTownyEventListener.onShortTime(SiegeWarTownyEventListener.java:144) ~[SiegeWar-2.12.1.jar:?]
at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor381.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:1.20.6-5-d797082]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.20.6.jar:1.20.6-5-d797082]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[folia-api-1.20.6-R0.1-SNAPSHOT.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.util.BukkitTools.fireEvent(BukkitTools.java:373) ~[Towny-0.100.3.12.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.towny.tasks.ShortTimerTask.run(ShortTimerTask.java:33) ~[Towny-0.100.3.12.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.towny.scheduling.TaskScheduler.lambda$runAsyncRepeating$11(TaskScheduler.java:122) ~[Towny-0.100.3.12.jar:?]
at Towny-0.100.3.12.jar/com.palmergames.bukkit.towny.scheduling.impl.FoliaTaskScheduler.lambda$runAsyncRepeating$8(FoliaTaskScheduler.java:145) ~[Towny-0.100.3.12.jar:?]
at io.papermc.paper.threadedregions.scheduler.FoliaAsyncScheduler$AsyncScheduledTask.run(FoliaAsyncScheduler.java:217) ~[folia-1.20.6.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Describe the bug Whenever someone places a surrender banner, after the siege session is over, an async error occurs.
To Reproduce Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
Files