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
42 stars 35 forks source link

Destroying orphaned vault #132

Closed valeredev closed 1 year ago

valeredev commented 1 year ago

Hello,

I have trouble to setup gringotts.

I can create a vault by putting a sign on a chest with [Vault], but then when i use a command like: gringotts:balance, the sign pop off and the vault is destroying.

The only specific message i have in the console is [Gringotts] Destroying orphaned vault

I am using paper 1.19.2 and this plugin list : AureliumSkills, BKCommonLib, Chunky, CMI, CMILib, Gringotts, Lands, LevelledMobs, LuckPerms, My_Worlds, Vault, WorldEdit

Thanks for your help

valeredev commented 1 year ago

I removed all the plugins except those 3 : gringotts, luckperms, vault and still have the issue

valeredev commented 1 year ago

Ok i found the issue:

i had vault_pattern: '[^\[]*\[(\w*) ?Vault\]' in my config file.

But in src/main/java/org/gestern/gringotts/AccountChest.java

You have String line0 = lines[0].toLowerCase().trim();

So even if i was writing the first line with [Vault] on my sign, respecting the case on the V, you are lower casing the sign first line everytime before comparing it with regex. So if the regex has an upper case, it will always fail.

nikosgram commented 1 year ago

That is really interesting. Thank you for providing all the steps to reproduce it. <3 I'll have a look to see if I can reproduce it and possible fix it <3