BedrockEconomy
BedrockEconomy copied to clipboard
Please remove getPlayerBalance API
Is your feature request related to a problem? Please describe.
getPlayerBalance
is constantly abused for incorrect code where they check for whether the player has enough balance through getPlayerBalance
and call subtractFromPlayerBalance
without actually checking whether the latter is successful.
Describe the solution you'd like Remove the method. It is good for nothing other than abuse.
People who want to display the balance should use an API dedicated for displaying, such as InfoAPI. getPlayerBalance
is good for nothing.
Here is a quick grep of released plugins where getPlayerBalance
is used. https://poggit.pmmp.io/grepPlugins/2022-04-30-37b8173cc7ca2e50.html
- @DaDevGuy /EconomyRename: incorrect use as described in OP
- ZiteDesigns/EnchantShop: just a var_dump
- BeeAZ-pm-pl/SeasonShop: they don't know how to do async
- FlxiBoy1313/Perks: they don't know how to do async
- @Shock95x /AuctionHouse: incorrect use as described in OP, but still handles purchase error as unknown error
- muqsit/ChestShop: for display use only
- NovaStark1234/SellStick: they don't know how to do async
- udachin26/BedrockEconomy-udachin26: used for display only
- @MulqiGaming64 /EconomyEnchant: incorrect use as described in OP
- RevandDev/BuyHealFeed: just a var_dump
- AlexPads/ShopUI-FormAPI-Working: FINALLY someone who uses it correctly! Used for display only
hm
Currently it is used for the balance
and the global cache in v4.0.0. I've marked it as internal with comments that describe its usage.