Code Monkey home page Code Monkey logo

Comments (6)

Sytm avatar Sytm commented on August 15, 2024 1

Sorry for not answering, but spinning up a MySQL server for testing is always a bit annoying.
I have tested the edge case and it works now without any problems.

I also noticed that the released version string and the version in your plugin.yml do not match

from totaleconomy.

ericgrandt avatar ericgrandt commented on August 15, 2024

Hi @Sytm, this was done on purpose as I didn't see a need for Total Economy to handle running all the withdraw logic when the amount was zero. I'd be curious to know more about the use case you brought up and if this is indeed something we should look into supporting for the withdraw command.

Currently I don't envision Total Economy supporting frozen accounts, though if we did there'd be a way to check that state without having to use withdraw. Thanks.

from totaleconomy.

Sytm avatar Sytm commented on August 15, 2024

For some context: My plugin allows admins providing a custom formula, so they can customize the price increase for teleportations (like constant price, linear growth, exponential growth, etc). My plugin uses the Vault API to query and modify the amount of money a player has.

One user reported an issue that they cannot teleport when using a formula that evaluates to zero for the first teleport and then increases with each successive one, when using this economy plugin.

My issue here is just based on the technically correct behavior according the Vault API that it's implementations should follow (I would at least expect them to do), because some economy plugins might support freezing and have different behavior, while this one doesn't but shouldn't disallow zero withdrawals.

(You could also short circuit the execution of the deposit / withdraw methods in your Vault implementation on zero amounts with a successful result, without altering the behavior of the rest of your plugin, although that would be a somewhat dirty solution)

from totaleconomy.

ericgrandt avatar ericgrandt commented on August 15, 2024

Thanks for the context @Sytm. This makes sense. I have an idea that'll allow for the Total Economy implementation of Vault to allow zero as a value while also preventing it from other areas in the plugin where zero shouldn't be allowed (e.g. Total Economy's pay command). Best of both worlds I think. I'll let you know when that's in place. Thanks again!

And just so I remember when I'm making changes for this, this change should also be made to the deposit functionality as well.

from totaleconomy.

ericgrandt avatar ericgrandt commented on August 15, 2024

Hi @Sytm, give this new release a shot: https://modrinth.com/plugin/total-economy/version/0.12.1. Thanks

from totaleconomy.

ericgrandt avatar ericgrandt commented on August 15, 2024

Hi @Sytm, following up again to see if this is resolved. If there's no response in the next couple of days I'll close this issue to avoid it getting too stale, though feel free to reopen if it is still an issue. Thanks.

from totaleconomy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.