SignShop v4

SignShop v4

992k Downloads

Shops that buy or sell items for a price containing fractionals do not work

silen72 opened this issue ยท 6 comments

commented

A detailed description of the problem you are having

In short:
Shops that buy or sell items for a price not containing fractionals do work.
Shops that buy or sell items for a price containing fractionals do not work. Instead they produce the error message 'overstocked'.

We have multiple shops on our server, all show the same behaviour. Most of them sell single items and stacks of items as well as buy single items and stacks of items. One of them coincidently sells for a non-fractional price and buys for a fractional. The two signs selling for a non-fractional do work, the others do not (see screenshot).
We also have a warehouse where everybody can store and take material free of charge (buy and sell for 0.00). All those shops work as well.
All other shops do not work.

grafik

Server type and version: paper-1.20.4-459
SignShop version: SignShop-4.0.0
Vault version: Vault v1.7.3-b131
Economy plugin name and version: gringotts-2.12.5
I have omitted the startup log on purpose because it does not contain errors.

commented

This is probably related: nikosgram/gringotts#172

commented
commented

When a transaction is executed Signshop asks the economy plugin if the currency exchange can happen, does the player have the money and can the shop owner accept the money? If the economy says the player doesn't have money then the player gets a "you don't have enough money message". If the economy plugin says the shop owner cannot accept the money then the shop owner is considered "overstocked". The "overstocked" message is also used if the shop chest cannot hold anymore items.

When using Gringotts you have to use whole numbers since Gringotts is item based. You cannot pay or receive .25 emeralds since Minecraft does not have partial items. When Signshop asks if the player has .25 emeralds Gringotts replies yes since technically they do. But when Signshop asks if the shop owner can hold .25 more emeralds Gringotts replies with "no" since that is not possible with a physical currency.

This is all intended Signshop behavior so this will not be addressed. You will either have to switch to a non physical currency plugin or use whole numbers.

I will leave this ticket open since I may look into splitting the messages to be more clear.

commented

Hi @weaves7, thank you very much for the quick answer! Unfortunately it is not that easy because all our shops have worked for years and only recently stopped doing so. And Gringotts is (or was, at least) very well able to handle fractional money albeit being item based. Not only have we used this for the shops but also for the jobs (JobsReborn). There also is a config setting for decimal digits in Gringotts config.yml:

# number of decimal digits supported by currency value (0 for whole numbers only)
digits: 2

But I agree, this seems to be more of an issue with Gringotts than with Signshop - that's why I opened an issue there too ;-)

commented

Indeed, your build of Gringotts fixes both the issue with Gringotts and this issue. Thank you very much, I really appreciate your help!

commented

Future Signshop releases will have the messages split to be more clear as well as debugging info for economy responses.