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

[Bug] Paying with player's inventory causes null pointer exception (feat. Towny Adv & TownyProvinces) #166

Open
iomatix opened this issue Dec 9, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@iomatix
Copy link

iomatix commented Dec 9, 2023

Describe the bug

Null pointer exception if paying for new town (Towny Adv & TownyProvinces) with player's inventory money. If money was insiade of chest everything is fine so I assume that may be gringott's error.

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.removeFromShulkerBox(GringottsAccount.java:332) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$remove$2(GringottsAccount.java:265) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$callSync$0(GringottsAccount.java:54) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.callSync(GringottsAccount.java:61) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:131) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:127) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:116) ~[gringotts.jar:?]
        at com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter.subtract(VaultEconomyAdapter.java:23) ~[Towny.jar:?]

To Reproduce (PRE)

Steps to reproduce the behavior:

  • 0a. Install newest Towny Adv + Provinces plugins all together with required plugins.
  • 0b. Install Gringott's newest release (v2.12.5) all together with required plugins.
  • 0c. Change config file to:

To Reproduce

  1. I guess the fastest way gonna be using op instead of permissions but we are using configured lucky perms.
  2. Generate regions with tpra region regenerate elyean
  3. Make sure there's no money in the vault's chests so the only money you have is in the inventory.
  4. Make sure it's enough money to buy a region.
  5. Buy the region with /t new test command
  6. Check the console logg.

Expected behavior

I assume it's trying get the money from chest instead of player's inventory
at org.gestern.gringotts.GringottsAccount.removeFromShulkerBox(GringottsAccount.java:332) ~[gringotts.jar:?]
I guess that's why paying with chest works normally but with inventory's money not.

Screenshots

[22:33:21 ERROR]: Could not pass event PreNewTownEvent to TownyProvinces v2.0.3
org.gestern.gringotts.GringottsException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:470) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:131) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:127) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:116) ~[gringotts.jar:?]
        at com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter.subtract(VaultEconomyAdapter.java:23) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.TownyEconomyHandler.subtract(TownyEconomyHandler.java:200) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.EconomyAccount.subtractMoney(EconomyAccount.java:31) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:90) ~[Towny.jar:?]
        at io.github.townyadvanced.townyprovinces.listeners.TownyListener.onNewTownAttempt(TownyListener.java:118) ~[TownyProvinces.jar:?]
        at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor728.execute(Unknown Source) ~[?:?]        at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:git-Paper-318]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[paper-1.20.2.jar:git-Paper-318]
        at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[paper-1.20.2.jar:git-Paper-318]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:615) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at com.palmergames.bukkit.util.BukkitTools.fireEvent(BukkitTools.java:383) ~[Towny.jar:?]
        at com.palmergames.bukkit.util.BukkitTools.ifCancelledThenThrow(BukkitTools.java:377) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.confirmations.ConfirmationHandler.acceptConfirmation(ConfirmationHandler.java:131) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.command.commandobjects.ConfirmCommand.execute(ConfirmCommand.java:28) ~[Towny.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:991) ~[paper-1.20.2.jar:git-Paper-318]
        at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.2.jar:git-Paper-318]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[paper-1.20.2.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:330) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:314) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2208) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$19(ServerGamePacketListenerImpl.java:2168) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1324) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1301) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1294) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1272) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1160) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-318]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096) ~[?:?]
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:468) ~[gringotts.jar:?]
        ... 44 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.removeFromShulkerBox(GringottsAccount.java:332) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$remove$2(GringottsAccount.java:265) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$callSync$0(GringottsAccount.java:54) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.callSync(GringottsAccount.java:61) ~[gringotts.jar:?]
        ... 44 more
[22:33:21 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing 'confirm' in com.palmergames.bukkit.towny.command.commandobjects.ConfirmCommand(confirm)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:165) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R2.CraftServer.dispatchCommand(CraftServer.java:991) ~[paper-1.20.2.jar:git-Paper-318]
        at org.bukkit.craftbukkit.v1_20_R2.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.2.jar:git-Paper-318]
        at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:265) ~[paper-1.20.2.jar:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:330) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:314) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2208) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$19(ServerGamePacketListenerImpl.java:2168) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1324) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1301) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1294) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1272) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1160) ~[paper-1.20.2.jar:git-Paper-318]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:315) ~[paper-1.20.2.jar:git-Paper-318]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]
Caused by: org.gestern.gringotts.GringottsException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:470) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:131) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:127) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:116) ~[gringotts.jar:?]
        at com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter.subtract(VaultEconomyAdapter.java:23) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.TownyEconomyHandler.subtract(TownyEconomyHandler.java:200) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.EconomyAccount.subtractMoney(EconomyAccount.java:31) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:90) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.confirmations.ConfirmationHandler.acceptConfirmation(ConfirmationHandler.java:152) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.command.commandobjects.ConfirmCommand.execute(ConfirmCommand.java:28) ~[Towny.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 22 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096) ~[?:?]
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:468) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:131) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:127) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:116) ~[gringotts.jar:?]
        at com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter.subtract(VaultEconomyAdapter.java:23) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.TownyEconomyHandler.subtract(TownyEconomyHandler.java:200) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.EconomyAccount.subtractMoney(EconomyAccount.java:31) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:90) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.confirmations.ConfirmationHandler.acceptConfirmation(ConfirmationHandler.java:152) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.command.commandobjects.ConfirmCommand.execute(ConfirmCommand.java:28) ~[Towny.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 22 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.removeFromShulkerBox(GringottsAccount.java:332) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$remove$2(GringottsAccount.java:265) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$callSync$0(GringottsAccount.java:54) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.callSync(GringottsAccount.java:61) ~[gringotts.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:131) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:127) ~[gringotts.jar:?]
        at org.gestern.gringotts.api.impl.VaultConnector.withdrawPlayer(VaultConnector.java:116) ~[gringotts.jar:?]
        at com.palmergames.bukkit.towny.object.economy.adapter.VaultEconomyAdapter.subtract(VaultEconomyAdapter.java:23) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.TownyEconomyHandler.subtract(TownyEconomyHandler.java:200) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.EconomyAccount.subtractMoney(EconomyAccount.java:31) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.object.economy.Account.withdraw(Account.java:90) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.confirmations.ConfirmationHandler.acceptConfirmation(ConfirmationHandler.java:152) ~[Towny.jar:?]
        at com.palmergames.bukkit.towny.command.commandobjects.ConfirmCommand.execute(ConfirmCommand.java:28) ~[Towny.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
        ... 22 more

Desktop (please complete the following information):

  • Server Type: Newest PaperMC
  • Server Version: 1.20.2
  • Gringotts Version: 2.12.5
@iomatix iomatix added the bug Something isn't working label Dec 9, 2023
@Ethansito
Copy link

Ethansito commented Feb 25, 2024

I don't think this bug is related to Towny because I am having the same problem on my test server without Towny. Using /eco and /moneyadmin to remove money from players causes a NPE if the player does not have the money in their chest.

This is causing an issue for me because I am trying to write a denizen script that removes money from a player's balance and gives them an item. The money in the player's inventory is accounted for in the player's balance, which causes them to receive the item, but the money is not removed due to the NPE. I will be unable to use Gringotts until this issue is fixed.

Server Type: Latest Paper 1.20.4
Gringotts Version 2.12.5

org.bukkit.command.CommandException: Unhandled exception executing command 'moneyadmin' in plugin Gringotts v2.12.5
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:999) ~[paper-1.20.4.jar:git-Paper-435]
        at org.bukkit.craftbukkit.v1_20_R3.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.4.jar:git-Paper-435]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:32) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.CommandQueueEntry.a(CommandQueueEntry.java:5) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:101) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:434) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:336) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:323) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2230) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$14(ServerGamePacketListenerImpl.java:2190) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1455) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1432) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1355) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1333) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1222) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-435]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: org.gestern.gringotts.GringottsException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:470) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.commands.MoneyAdminExecutor.onCommand(MoneyAdminExecutor.java:135) ~[gringotts-2.12.5.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096) ~[?:?]
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:468) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.commands.MoneyAdminExecutor.onCommand(MoneyAdminExecutor.java:135) ~[gringotts-2.12.5.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.removeFromShulkerBox(GringottsAccount.java:332) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$remove$2(GringottsAccount.java:265) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$callSync$0(GringottsAccount.java:54) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.callSync(GringottsAccount.java:61) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.commands.MoneyAdminExecutor.onCommand(MoneyAdminExecutor.java:135) ~[gringotts-2.12.5.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
[18:47:23 INFO]: ethansito issued server command: /moneyadmin remove ethansito 1
[18:47:23 ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'moneyadmin' in plugin Gringotts v2.12.5
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:155) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        at org.bukkit.craftbukkit.v1_20_R3.CraftServer.dispatchCommand(CraftServer.java:999) ~[paper-1.20.4.jar:git-Paper-435]
        at org.bukkit.craftbukkit.v1_20_R3.command.BukkitCommandWrapper.run(BukkitCommandWrapper.java:64) ~[paper-1.20.4.jar:git-Paper-435]
        at com.mojang.brigadier.context.ContextChain.runExecutable(ContextChain.java:73) ~[brigadier-1.2.9.jar:?]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:32) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.tasks.ExecuteCommand.execute(ExecuteCommand.java:19) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.UnboundEntryAction.lambda$bind$0(UnboundEntryAction.java:8) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.CommandQueueEntry.a(CommandQueueEntry.java:5) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.execution.ExecutionContext.runCommandQueue(ExecutionContext.java:101) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.commands.Commands.executeCommandInContext(Commands.java:434) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:336) ~[?:?]
        at net.minecraft.commands.Commands.performCommand(Commands.java:323) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.performChatCommand(ServerGamePacketListenerImpl.java:2230) ~[?:?]
        at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$14(ServerGamePacketListenerImpl.java:2190) ~[?:?]
        at net.minecraft.util.thread.BlockableEventLoop.lambda$submitAsync$0(BlockableEventLoop.java:59) ~[?:?]
        at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768) ~[?:?]
        at net.minecraft.server.TickTask.run(TickTask.java:18) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.util.thread.BlockableEventLoop.doRunTask(BlockableEventLoop.java:153) ~[?:?]
        at net.minecraft.util.thread.ReentrantBlockableEventLoop.doRunTask(ReentrantBlockableEventLoop.java:24) ~[?:?]
        at net.minecraft.server.MinecraftServer.doRunTask(MinecraftServer.java:1455) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:194) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?]
        at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1432) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1355) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?]
        at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1333) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1222) ~[paper-1.20.4.jar:git-Paper-435]
        at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:319) ~[paper-1.20.4.jar:git-Paper-435]
        at java.lang.Thread.run(Thread.java:1623) ~[?:?]
Caused by: org.gestern.gringotts.GringottsException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:470) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.commands.MoneyAdminExecutor.onCommand(MoneyAdminExecutor.java:135) ~[gringotts-2.12.5.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396) ~[?:?]
        at java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096) ~[?:?]
        at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:468) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.commands.MoneyAdminExecutor.onCommand(MoneyAdminExecutor.java:135) ~[gringotts-2.12.5.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more
Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.ItemStack.getType()" because "itemStack" is null
        at org.gestern.gringotts.GringottsAccount.removeFromShulkerBox(GringottsAccount.java:332) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$remove$2(GringottsAccount.java:265) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.lambda$callSync$0(GringottsAccount.java:54) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.callSync(GringottsAccount.java:61) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.GringottsAccount.remove(GringottsAccount.java:304) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.api.impl.GringottsEco$ValidAccount.remove(GringottsEco.java:659) ~[gringotts-2.12.5.jar:?]
        at org.gestern.gringotts.commands.MoneyAdminExecutor.onCommand(MoneyAdminExecutor.java:135) ~[gringotts-2.12.5.jar:?]
        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[paper-api-1.20.4-R0.1-SNAPSHOT.jar:?]
        ... 29 more

@weaves7
Copy link

weaves7 commented Mar 24, 2024

@Ethansito
Copy link

Ethansito commented May 23, 2024

Hello, sorry for taking so long to get back to you. The fix works! Thanks!

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

4 participants