Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pluder Event error due to AccountObserver error. #916

Closed
GoodrichDev opened this issue Jul 20, 2024 · 5 comments
Closed

Pluder Event error due to AccountObserver error. #916

GoodrichDev opened this issue Jul 20, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@GoodrichDev
Copy link

Describe the bug
When a player attempts to plunder a town, the will not be able to plunder due a console error. There is no messaging but a console log is provided.

[02:21:45 ERROR]: Could not pass event TownyBuildEvent to SiegeWar v2.12.1
java.lang.NullPointerException: Cannot invoke "com.palmergames.bukkit.towny.object.economy.AccountObserver.withdrew(com.palmergames.bukkit.towny.object.economy.Account, double, String)" because "observer" is null
        at Towny-0.100.3.7.jar/com.palmergames.bukkit.towny.object.economy.Account.notifyObserversWithdraw(Account.java:269) ~[Towny-0.100.3.7.jar:?]
        at Towny-0.100.3.7.jar/com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:96) ~[Towny-0.100.3.7.jar:?]
        at Towny-0.100.3.7.jar/com.palmergames.bukkit.towny.object.economy.Account.payTo(Account.java:149) ~[Towny-0.100.3.7.jar:?]
        at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.PlunderTown.createPlunderForNation(PlunderTown.java:207) ~[SiegeWar-2.12.1.jar:?]
        at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.PlunderTown.plunderTown(PlunderTown.java:106) ~[SiegeWar-2.12.1.jar:?]
        at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.PlunderTown.processPlunderTownRequest(PlunderTown.java:45) ~[SiegeWar-2.12.1.jar:?]
        at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.PlaceBlock.evaluatePlaceChest(PlaceBlock.java:355) ~[SiegeWar-2.12.1.jar:?]
        at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.playeractions.PlaceBlock.evaluateSiegeWarPlaceBlockRequest(PlaceBlock.java:79) ~[SiegeWar-2.12.1.jar:?]
        at SiegeWar-2.12.1.jar/com.gmail.goosius.siegewar.listeners.SiegeWarActionListener.onBlockBuild(SiegeWarActionListener.java:40) ~[SiegeWar-2.12.1.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor298.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.7.jar/com.palmergames.bukkit.util.BukkitTools.fireEvent(BukkitTools.java:373) ~[Towny-0.100.3.7.jar:?]
        at Towny-0.100.3.7.jar/com.palmergames.bukkit.towny.event.executors.TownyActionEventExecutor.isAllowedAction(TownyActionEventExecutor.java:80) ~[Towny-0.100.3.7.jar:?]
        at Towny-0.100.3.7.jar/com.palmergames.bukkit.towny.event.executors.TownyActionEventExecutor.canBuild(TownyActionEventExecutor.java:204) ~[Towny-0.100.3.7.jar:?]
        at Towny-0.100.3.7.jar/com.palmergames.bukkit.towny.listeners.TownyBlockListener.onBlockPlace(TownyBlockListener.java:89) ~[Towny-0.100.3.7.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor96.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 org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:448) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.world.item.ItemStack.useOn(ItemStack.java:467) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:602) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1979) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:44) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:11) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:57) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$2(PacketUtils.java:85) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at io.papermc.paper.threadedregions.EntityScheduler.executeTick(EntityScheduler.java:173) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1688) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:404) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:525) ~[folia-1.20.6.jar:1.20.6-5-d797082]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

To Reproduce
Steps to reproduce the behavior:

  1. Enable Towny towny-server account in the towny configuration.
  2. Verify you have an actual account and balance in towny-server
  3. Set plunder_paid_over_time: 'true' in the siege war configuration.
  4. Attempt to plunder a town.
plunder:
        amount_per_plot: '4.0'
        plunder_paid_over_time: 'true'
        number_of_payments: '6'

Expected behavior
The Plunder is paid over time instead of disabled.

Screenshots
If applicable, add screenshots to help explain your problem.

Versions (please complete the following information):

@GoodrichDev GoodrichDev added the bug Something isn't working label Jul 20, 2024
@LlmDl
Copy link
Member

LlmDl commented Jul 20, 2024

So the error itself is saying you dont have an account observer, which is used to monitor transactions for the money.csv log and the /t bankhistory book. Are you sure that the town losing money had an actual account already?

@GoodrichDev
Copy link
Author

This was discussed in the Discord and it was determined there might be an issue with balances and other options being reworked in Towny. Therefore SiegeWar might need to be rebuilt with a newer version of Towny.

@LlmDl
Copy link
Member

LlmDl commented Aug 26, 2024

So can this get closed? You're SW is no longer up to date.

@GoodrichDev
Copy link
Author

Hi @LlmDl,

I have tested this on 2.13.0 and plunder over time still has an error. I have also used Towny 0.100.3.13

[02:20:05 ERROR]: Could not pass event TownyBuildEvent to SiegeWar v2.13.0
java.lang.NullPointerException: Cannot invoke "com.palmergames.bukkit.towny.object.economy.AccountObserver.withdrew(com.palmergames.bukkit.towny.object.economy.Account, double, String)" because "observer" is null
        at towny-0.100.3.13.jar/com.palmergames.bukkit.towny.object.economy.Account.notifyObserversWithdraw(Account.java:269) ~[towny-0.100.3.13.jar:?]
        at towny-0.100.3.13.jar/com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:96) ~[towny-0.100.3.13.jar:?]
        at towny-0.100.3.13.jar/com.palmergames.bukkit.towny.object.economy.Account.payTo(Account.java:149) ~[towny-0.100.3.13.jar:?]
        at SiegeWar-2.13.0.jar/com.gmail.goosius.siegewar.playeractions.PlunderTown.createPlunderForNation(PlunderTown.java:207) ~[SiegeWar-2.13.0.jar:?]
        at SiegeWar-2.13.0.jar/com.gmail.goosius.siegewar.playeractions.PlunderTown.plunderTown(PlunderTown.java:106) ~[SiegeWar-2.13.0.jar:?]
        at SiegeWar-2.13.0.jar/com.gmail.goosius.siegewar.playeractions.PlunderTown.processPlunderTownRequest(PlunderTown.java:45) ~[SiegeWar-2.13.0.jar:?]
        at SiegeWar-2.13.0.jar/com.gmail.goosius.siegewar.playeractions.PlaceBlock.evaluatePlaceChest(PlaceBlock.java:361) ~[SiegeWar-2.13.0.jar:?]
        at SiegeWar-2.13.0.jar/com.gmail.goosius.siegewar.playeractions.PlaceBlock.evaluateSiegeWarPlaceBlockRequest(PlaceBlock.java:81) ~[SiegeWar-2.13.0.jar:?]
        at SiegeWar-2.13.0.jar/com.gmail.goosius.siegewar.listeners.SiegeWarActionListener.onBlockBuild(SiegeWarActionListener.java:40) ~[SiegeWar-2.13.0.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor324.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:1.21.1-DEV-bfa3106]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at towny-0.100.3.13.jar/com.palmergames.bukkit.util.BukkitTools.fireEvent(BukkitTools.java:373) ~[towny-0.100.3.13.jar:?]
        at towny-0.100.3.13.jar/com.palmergames.bukkit.towny.event.executors.TownyActionEventExecutor.isAllowedAction(TownyActionEventExecutor.java:80) ~[towny-0.100.3.13.jar:?]
        at towny-0.100.3.13.jar/com.palmergames.bukkit.towny.event.executors.TownyActionEventExecutor.canBuild(TownyActionEventExecutor.java:204) ~[towny-0.100.3.13.jar:?]
        at towny-0.100.3.13.jar/com.palmergames.bukkit.towny.listeners.TownyBlockListener.onBlockPlace(TownyBlockListener.java:89) ~[towny-0.100.3.13.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor86.execute(Unknown Source) ~[?:?]
        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:80) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:1.21.1-DEV-bfa3106]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:131) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:628) ~[paper-mojangapi-1.21.1-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.event.CraftEventFactory.callBlockPlaceEvent(CraftEventFactory.java:459) ~[?:?]
        at net.minecraft.world.item.ItemStack.useOn(ItemStack.java:488) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at net.minecraft.server.level.ServerPlayerGameMode.useItemOn(ServerPlayerGameMode.java:604) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.handleUseItemOn(ServerGamePacketListenerImpl.java:1990) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:44) ~[?:?]
        at net.minecraft.network.protocol.game.ServerboundUseItemOnPacket.handle(ServerboundUseItemOnPacket.java:11) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$1(PacketUtils.java:58) ~[?:?]
        at net.minecraft.network.protocol.PacketUtils.lambda$ensureRunningOnSameThread$2(PacketUtils.java:86) ~[?:?]
        at io.papermc.paper.threadedregions.EntityScheduler.executeTick(EntityScheduler.java:173) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1711) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at io.papermc.paper.threadedregions.TickRegions$ConcreteRegionTickHandle.tickRegion(TickRegions.java:407) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at io.papermc.paper.threadedregions.TickRegionScheduler$RegionScheduleHandle.runTick(TickRegionScheduler.java:406) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at ca.spottedleaf.concurrentutil.scheduler.SchedulerThreadPool$TickThreadRunner.run(SchedulerThreadPool.java:540) ~[folia-1.21.1.jar:1.21.1-DEV-bfa3106]
        at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]

@LlmDl
Copy link
Member

LlmDl commented Oct 8, 2024

Fixed on Towny's end of things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants