nikosgram / gringotts

Gringotts is an item-based economy plugin for the Bukkit Minecraft server platform. Unlike earlier economy plugins, all currency value and money transactions are based on actual items in Minecraft, per default emeralds.
https://www.spigotmc.org/resources/gringotts.42071/
BSD 2-Clause "Simplified" License
43 stars 35 forks source link

[BUG] 1.12.6 & 1.12.5 Issues with new and 1.12.6 Issues with known players. #161

Open spikehidden opened 1 year ago

spikehidden commented 1 year ago

Describe the bug

This or a similar issue was already described in #149 So my problem is that new players cannot create a vault or to be more exact, if they are not already existent in the Gringotts.db file. Also an error is then visible in the log/console.

And since version 1.12.6 when a known player tries to create a vault the sign and so the vault gets destroyed. (Same goes for town and nation vaults while gringottsTowny is installed.) Same also happens for existing ones.

What I tried by now. - Like suggested in #149 I tried to delete the DB file which only caused the issue to happen for all players. - Creating vaults outside of restricted areas (protected by Towny or WorldGuard) - Deleting Gringotts Config Files - Probably even more that I don't know currently...

To Reproduce

New Players 1. Delete Gringotts.db 2. Start & Join the Server 3. Place a sign at a chest with `[vault]` on the first line. 4. Nothing happens for the player and an error appears on the console.
Known Players 1. Start & Join the Server 2. Place a sign at a chest with `[vault]` on the first line. 3. The vault gets created. 4. A second later the vault gets destroyed together with the sign.

Expected behavior

That vaults gets normally created for all players without getting immediately destroyed.

Screenshots

Video https://github.com/nikosgram/gringotts/assets/31257733/83cdd494-e6c3-4e9e-9242-47c20239a032

Desktop

Server Type PurPur
Server Version git-Purpur-2082 (MC: 1.20.2)* (latest)
Gringotts Version 2.12.6-SNAPSHOT & 2.12.5

Additional context

Error ``` [22:02:31 ERROR]: Could not pass event PlayerVaultCreationEvent to Gringotts v2.12.6-SNAPSHOT org.gestern.gringotts.GringottsException: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot read field "cents" because the return value of "com.avaje.ebean.ExpressionList.findUnique()" is null at org.gestern.gringotts.GringottsAccount.getTimeout(GringottsAccount.java:488) ~[gringotts.jar:?] at org.gestern.gringotts.GringottsAccount.add(GringottsAccount.java:249) ~[gringotts.jar:?] at org.gestern.gringotts.data.EBeanDAO.storeAccount(EBeanDAO.java:130) ~[gringotts.jar:?] at org.gestern.gringotts.Accounting.getAccount(Accounting.java:23) ~[gringotts.jar:?] at org.gestern.gringotts.event.VaultCreator.registerVault(VaultCreator.java:35) ~[gringotts.jar:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor10.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:git-Purpur-2082] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.2.jar:git-Purpur-2082] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.2.jar:git-Purpur-2082] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?] at org.gestern.gringotts.event.AccountListener.onSignChange(AccountListener.java:64) ~[gringotts.jar:?] at com.destroystokyo.paper.event.executor.asm.generated.GeneratedEventExecutor7.execute(Unknown Source) ~[?:?] at org.bukkit.plugin.EventExecutor$2.execute(EventExecutor.java:77) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?] at co.aikar.timings.TimedEventExecutor.execute(TimedEventExecutor.java:77) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:git-Purpur-2082] at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:70) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?] at io.papermc.paper.plugin.manager.PaperEventManager.callEvent(PaperEventManager.java:54) ~[purpur-1.20.2.jar:git-Purpur-2082] at io.papermc.paper.plugin.manager.PaperPluginManagerImpl.callEvent(PaperPluginManagerImpl.java:126) ~[purpur-1.20.2.jar:git-Purpur-2082] at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:617) ~[purpur-api-1.20.2-R0.1-SNAPSHOT.jar:?] at net.minecraft.world.level.block.entity.SignBlockEntity.setMessages(SignBlockEntity.java:242) ~[?:?] at net.minecraft.world.level.block.entity.SignBlockEntity.lambda$updateSignText$4(SignBlockEntity.java:188) ~[?:?] at net.minecraft.world.level.block.entity.SignBlockEntity.updateText(SignBlockEntity.java:202) ~[?:?] at net.minecraft.world.level.block.entity.SignBlockEntity.updateSignText(SignBlockEntity.java:187) ~[?:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.updateSignText(ServerGamePacketListenerImpl.java:3459) ~[?:?] at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleSignUpdate$26(ServerGamePacketListenerImpl.java:3440) ~[?:?] at java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718) ~[?:?] at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] at net.minecraft.server.TickTask.run(TickTask.java:18) ~[purpur-1.20.2.jar:git-Purpur-2082] 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:1351) ~[purpur-1.20.2.jar:git-Purpur-2082] at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:193) ~[purpur-1.20.2.jar:git-Purpur-2082] at net.minecraft.util.thread.BlockableEventLoop.pollTask(BlockableEventLoop.java:126) ~[?:?] at net.minecraft.server.MinecraftServer.pollTaskInternal(MinecraftServer.java:1328) ~[purpur-1.20.2.jar:git-Purpur-2082] at net.minecraft.server.MinecraftServer.pollTask(MinecraftServer.java:1321) ~[purpur-1.20.2.jar:git-Purpur-2082] at net.minecraft.util.thread.BlockableEventLoop.managedBlock(BlockableEventLoop.java:136) ~[?:?] at net.minecraft.server.MinecraftServer.waitUntilNextTick(MinecraftServer.java:1299) ~[purpur-1.20.2.jar:git-Purpur-2082] at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1187) ~[purpur-1.20.2.jar:git-Purpur-2082] at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:320) ~[purpur-1.20.2.jar:git-Purpur-2082] at java.lang.Thread.run(Thread.java:833) ~[?:?] Caused by: java.util.concurrent.ExecutionException: java.lang.NullPointerException: Cannot read field "cents" because the return value of "com.avaje.ebean.ExpressionList.findUnique()" 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:486) ~[gringotts.jar:?] ... 40 more Caused by: java.lang.NullPointerException: Cannot read field "cents" because the return value of "com.avaje.ebean.ExpressionList.findUnique()" is null at org.gestern.gringotts.data.EBeanDAO.retrieveCents(EBeanDAO.java:360) ~[gringotts.jar:?] at org.gestern.gringotts.GringottsAccount.lambda$add$1(GringottsAccount.java:154) ~[gringotts.jar:?] at org.gestern.gringotts.GringottsAccount.lambda$callSync$0(GringottsAccount.java:53) ~[gringotts.jar:?] at org.gestern.gringotts.GringottsAccount.callSync(GringottsAccount.java:60) ~[gringotts.jar:?] ... 40 more ```
Plugins #### Paper Plugins: (2): - BKCommonLib - EconomyShopGUI-Premium #### Bukkit Plugins: (67): - AppleCoreSpigot - Chunky - Citizens - CitizensGUI - ClientDetector - CrossplatForms - dDiscordBot - Denizen - Depenizen - DiscordSRV - DropEdit2 - dynmap - Dynmap-Towny - Dynmap-WorldGuard - Essentials - EssentialsChat - EssentialsGeoIP - EssentialsSpawn - ExtraContexts - FallingSnow - floodgate - GeyserHacks - Gringotts - GringottsTowny - ImageFrame - InteractionVisualizer - InteractiveChat - InteractiveChatDiscordSrvAddon - JShader - LuckPerms - MultiLang - Multiverse-Core - Multiverse-NetherPortals - Multiverse-Portals - Multiverse-SignPortals - NBTAPI - Pl-Hide-Pro - PlaceholderAPI - PowerBoard - ProtocolLib - PurpurExtras - qsaddon-discordsrv - qsaddon-discount - qsaddon-displaycontrol - qscompat-towny - qscompat-worldedit - qscompat-worldguard - qssuite-limited - QuickShop-Hikari - RocketPlaceholders - SiegeWar - spark - StreamingDrops - TCHangRail - Themis - Towny - TownyCamps - TownyCaptureSites - TownyHistories - TownyMenus - TownyResources - TownyWayPointTravel - Train_Carts - Vault - WorldEdit - WorldGuard - WorldGuard-Towny
/plugins/Gringotts/config.yml ```yaml # for details on configuration, see https://github.com/MinecraftWars/Gringotts/blob/master/doc/configuration.md # supported languages: "custom" (default, english), "de" (german), "fr" (french), and "pt-BR" (brazilian portuguese). language: de # regex that create a vault if matches with a sign # subpattern 1 denotes the type of the vault. vault_pattern: '[^\[]*\[(\w*) ?vault\]' # If this is set to true, when the user receives an amount of money # exceeding the inventory capacity, drop items that didn't fit. drop-overflowing-item: false # currency name and value config currency: # currency name to use in messages name: singular: Fuchstaler plural: Fuchstaler # number of decimal digits supported by currency value (0 for whole numbers only) digits: 2 # Display account balances with individual denomination names named-denominations: true # value of individual denominations. default: emerald: 1, emerald block: 9 denominations: - material: iron_nugget value: 1 unit-name: "&f&r" unit-name-plural: "&f&r" displayname: "&r&7&lEiserner Fuchstaler" damage: 13 custom_model_data: 10 lore: - "&f&lWert: &7&l1 Fuchstaler" - "&c&lNICHT CRAFTEN" - material: gold_nugget value: 100 unit-name: "&f&r" unit-name-plural: "&f&r" displayname: "&r&l&6Golderner Fuchstaler" damage: 4 custom_model_data: 10 lore: - "&f&lWert: &7&l100 Fuchstaler" - "&c&lNICHT CRAFTEN" - material: emerald value: 1000 unit-name: "&f&r" unit-name-plural: "&f&r" displayname: "&r&l&2Grüner Fuchstaler" damage: 11 custom_model_data: 10 lore: - "&f&lWert: &7&l1000 Fuchstaler" - "&c&lNICHT CRAFTEN" - material: copper_ingot value: 0.01 unit-name: "&f&r" unit-name-plural: "&f&r" displayname: "&r&l&cKupferner Fuchstaler" damage: 11 custom_model_data: 10 lore: - "&f&lWert: &7&l0,01 Fuchstaler" - "&c&lNICHT CRAFTEN" # tax on /money pay transactions transactiontax: flat: 0.0 rate: 0.0 # balance to start an account with (purely virtual) startingbalance: player: 500 # globally (dis)allow use of vault types usevault: container: true enderchest: true # if true, denomination items located in shulker boxes, in the above enabled inventories, will be included to the denomination finding process include-shulker-boxes: true # whether money/balance commands show vault and inventory balance separately balance: show-vault: true show-inventory: true show-enderchest: true ```
/plugins/GringottsTowny/config.yml ```yaml # supported languages: "custom" (default, english), "de" (german), "fr" (french), and "pt-BR" (brazilian portuguese). language: de # changes the required sign name for the creation of town/nation vaults # Example: [town vault] town_sign_vault_name: 'town' nation_sign_vault_name: 'nation' # Prevents players from creating a vault outside a town if set to true vaults_only_in_towns: false # Maximum number of vaults a town can own, set to -1 for infinite number of vaults max_town_vaults: -1 # Maximum number of vaults a nation can own, set to -1 for infinite number of vaults max_nation_vaults: -1 # balance to start an account with (purely virtual) town_start_balance: 1500 nation_start_balance: 15000 ```
weaves7 commented 8 months ago

Please try this test build https://github.com/weaves7/Gringotts/releases/tag/v.2.12.7-SNAPSHOT