Coder Social home page Coder Social logo

phantomeconomy's Introduction

PhantomEconomy

A powerful, lightweight and configurable economy plugin that hooks with Vault!

This README file will most likely be expanded upon in the future :)

License: agpl v3

phantomeconomy's People

Contributors

dkbay avatar lokka30 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

phantomeconomy's Issues

Baltop updater is broken

Before I start with this issue, I want to say that I love this plugin so far and think it's heavily underrated. I couldn't find a single up-to-date economy plugin that is as highly configurable and well documented yet simple as this one.

This is the only issue I've encountered with it so far. I'm pretty sure this wasn't happening when I first installed the plugin, but it's happening now, even after deleting the folder that the plugin generates (to make sure the issue wasn't related to my configurations).

The issue is the baltop updater - when my server starts, an error is thrown in console. As well as this, /baltop doesn't display any player names and their balances; only the header and "no players left to display" message.

This is the error in console:
PhantomEconomy Error

Thank you for this plugin and I really hope you keep it updated and maintained for the foreseeable future!

NumberFormatException when executing /economy commands

[21:59:28] [Server thread/INFO]: PaulLink issued server command: /eco set PaulLink 100
[21:59:28] [Server thread/ERROR]: null
org.bukkit.command.CommandException: Unhandled exception executing command 'eco' in plugin PhantomEconomy v1.9-RELEASE
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[patched_1.15.2.jar:git-Paper-161]
	at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.15.2.jar:git-Paper-161]
	at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:752) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1825) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1633) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1038) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1031) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1015) ~[patched_1.15.2.jar:git-Paper-161]
	at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:938) ~[patched_1.15.2.jar:git-Paper-161]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_241]
Caused by: java.lang.NumberFormatException: For input string: "50,00"
	at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) ~[?:1.8.0_241]
	at sun.misc.FloatingDecimal.parseDouble(Unknown Source) ~[?:1.8.0_241]
	at java.lang.Double.parseDouble(Unknown Source) ~[?:1.8.0_241]
	at io.github.lokka30.phantomeconomy.utils.Utils.round(Utils.java:29) ~[?:?]
	at io.github.lokka30.phantomeconomy.VaultImplementer.withdrawPlayer(VaultImplementer.java:226) ~[?:?]
	at io.github.lokka30.phantomeconomy.commands.EconomyCommand.onCommand(EconomyCommand.java:136) ~[?:?]
	at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[patched_1.15.2.jar:git-Paper-161]
	... 17 more

I tried to fix it by myself, but tbh I don't know, where this error comes from, as you haven't changed anything in the related classes. Occurs with Release 1.9.

Balances should be cached in a HashMap

It'd prolly be beneficial to performance if there was an in memory variable that stored balances and other things and a queue worker that persisted the updates to the flatfiles so we don't need to access a file every time we need to do something

Towny not working

Towny lists that the town has the money in the bank but then gives an error saying to do /t withdraw -5208 or whatever the towns balance is. This started happening when I switched to this economy plugin.

Support cracked servers

Hey! i installed recently the plugin and everything was working fine until i realized something, money from my players was dissappearing, and then i realized that the plugin uses uuids to store the money, and the problem is that my server is No Premium, because im from argentina and most of the players here dont have minecraft premium, so i want to ask if you could please add so the storage also saves players names and not only uuids, because some players are loosing money.

No class found

[06:23:54] [Server thread/ERROR]: Error occurred while enabling PhantomEconomy v1.9.8-RELEASE (Is it up to date?)
java.lang.NoClassDefFoundError: org/bukkit/util/Consumer
at io.github.lokka30.phantomeconomy.PhantomEconomy.checkUpdates(PhantomEconomy.java:225) ~[?:?]
at io.github.lokka30.phantomeconomy.PhantomEconomy.onEnable(PhantomEconomy.java:88) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:340) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:405) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.loadPlugin(CraftServer.java:357) [spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.craftbukkit.v1_8_R3.CraftServer.enablePlugins(CraftServer.java:317) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.DedicatedServer.init(DedicatedServer.java:199) [spigot.jar:git-Spigot-db6de12-18fbb24]
at net.minecraft.server.v1_8_R3.MinecraftServer.run(MinecraftServer.java:525) [spigot.jar:git-Spigot-db6de12-18fbb24]
at java.base/java.lang.Thread.run(Thread.java:834) [?:?]
Caused by: java.lang.ClassNotFoundException: org.bukkit.util.Consumer
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:91) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.java:86) ~[spigot.jar:git-Spigot-db6de12-18fbb24]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588) ~[?:?]
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ~[?:?]
... 10 more

And how to get the money? like {money}?

[Feature Request] Add /paytoggle command

So basically players would be able to run /paytoggle and it would disable or enable their ability to be paid by other players. This could stop payment spams (e.g. typing "/pay 0.01" repeatedly) and could also be used by players who don't want help from other players.

Data is not kept upon restart

When the server that is running the plugin is restarted the balance does not save properly. It makes 2 (sort of) identical users and updates the balance of what is supposed to be the correct one but doesn't read that number.

Ex. (My data.json)
{
"players": {
"%id%": {"balance": 51}, <--- this updates but gets reset upon server restart.
"%id%,balance": 50
},
"file-version": 1
}

Daily Payments?

I was thinking, would it be possible to add an option, to give a daily amount of money to everyone in the server? I made a town where everyone gets an allowance everyday, and it gets quite annoying to do every single one, one at a time.

[v2] Multiline messages

Requested by Phunky on the Discord.
Messages in the config should be changed to allow multiple messages to be sent.

For example, instead of just a single message saying '123', as seen below -

first-three-numbers: '123'
  • you could make it send '1', '2' and '3' separately, as seen below:
first-three-numbers:
  - '1'
  - '2'
  - '3'

Would only need a minor change to make String storage in FileCache to a List and each message will have to loop through and send it.

Incompatibility with Towny Advanced

When trying to create a Towny town, the following error occurs.
I am not sure, from which site this plugin is being caused. Therefor I will report this error here and on Towny's site. I hope, that's okay :x

[19:54:55 WARN]: java.lang.NumberFormatException: For input string: "{enabled=true, amount=50.00}"
[19:54:55 WARN]: at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2043)
[19:54:55 WARN]: at sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)
[19:54:55 WARN]: at java.lang.Double.parseDouble(Double.java:538)
[19:54:55 WARN]: at io.github.lokka30.phantomeconomy.lightningstorage.util.ClassWrapper$DOUBLE.getDouble(ClassWrapper.java:124)
[19:54:55 WARN]: at io.github.lokka30.phantomeconomy.lightningstorage.util.ClassWrapper.getFromDef(ClassWrapper.java:27)
[19:54:55 WARN]: at io.github.lokka30.phantomeconomy.lightningstorage.internal.DataStorage.get(DataStorage.java:65)
[19:54:55 WARN]: at io.github.lokka30.phantomeconomy.VaultImplementer.createPlayerAccount(VaultImplementer.java:312)
[19:54:55 WARN]: at io.github.lokka30.phantomeconomy.VaultImplementer.createPlayerAccount(VaultImplementer.java:304)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.TownyEconomyHandler.getBalance(TownyEconomyHandler.java:258)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.object.EconomyAccount.getHoldingBalance(EconomyAccount.java:174)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.object.EconomyAccount.setBalance(EconomyAccount.java:151)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.command.TownCommand.newTown(TownCommand.java:2440)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.command.TownCommand.newTown(TownCommand.java:2394)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.command.TownyAdminCommand.parseAdminTownCommand(TownyAdminCommand.java:874)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.command.TownyAdminCommand.parseTownyAdminCommand(TownyAdminCommand.java:434)
[19:54:55 WARN]: at com.palmergames.bukkit.towny.command.TownyAdminCommand.onCommand(TownyAdminCommand.java:229)
[19:54:55 WARN]: at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
[19:54:55 WARN]: at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159)
[19:54:55 WARN]: at org.bukkit.craftbukkit.v1_15_R1.CraftServer.dispatchCommand(CraftServer.java:752)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.PlayerConnection.handleCommand(PlayerConnection.java:1825)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.PlayerConnection.a(PlayerConnection.java:1633)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:47)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.PacketPlayInChat.a(PacketPlayInChat.java:5)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.PlayerConnectionUtils.lambda$ensureMainThread$0(PlayerConnectionUtils.java:23)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.TickTask.run(SourceFile:18)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.ba(MinecraftServer.java:1038)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.executeNext(MinecraftServer.java:1031)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1015)
[19:54:55 WARN]: at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:938)
[19:54:55 WARN]: at java.lang.Thread.run(Thread.java:748)

Running on Paper 1.15.2 with PhantomEconomy 1.7 and Towny 0.96.1.2

Permissions not work

I am using vault, phantomEconomy and lucky permissions (a permissions plugin). I have the group admin and I add te permission: phantomeconomy.* to the group. I restart the server and I can't use any command except money, baltop and pay.

Bug with Messages

I've found two bugs regarding messages.yml. The first is that the string "invalid-number-zero" doesn't seem to correctly replace "%number%" with the number the player wrote. This screenshot shows an example:
1

The second is that there is an uncustomisable message that is shown when a player tries to pay another player an amount which is a string rather than a number. This screenshot shows an example where I tried to pay my alternate account "this_is_a_test":
2

Would be nice if the first bug was fixed and the message shown in the second screenshot becomes customisable. :)

add a worth system

'worth.yml' file
other plugins can hook into it if they want

buy-prices:
 - 'COBBLESTONE:1.00'
 - 'QUARTZ:250.0'

sell-prices:
 - 'DIAMOND:300'
 - 'TNT:1337.50'

Random error for baltop on first startup

I installed the plugin on my private skyblock server and I got this error on startup

[19:42:23 WARN]: java.lang.NullPointerException
[19:42:23 WARN]:        at io.github.lokka30.phantomeconomy.BaltopUpdater.update(BaltopUpdater.java:28)
[19:42:23 WARN]:        at io.github.lokka30.phantomeconomy.PhantomEconomy$1.run(PhantomEconomy.java:73)
[19:42:23 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftTask.run(CraftTask.java:84)
[19:42:23 WARN]:        at org.bukkit.craftbukkit.v1_15_R1.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:452)
[19:42:23 WARN]:        at net.minecraft.server.v1_15_R1.MinecraftServer.b(MinecraftServer.java:1185)
[19:42:23 WARN]:        at net.minecraft.server.v1_15_R1.DedicatedServer.b(DedicatedServer.java:430)
[19:42:23 WARN]:        at net.minecraft.server.v1_15_R1.MinecraftServer.a(MinecraftServer.java:1112)
[19:42:23 WARN]:        at net.minecraft.server.v1_15_R1.MinecraftServer.run(MinecraftServer.java:934)
[19:42:23 WARN]:        at java.lang.Thread.run(Unknown Source)

add /reload

I did not see the reload command for this plugin, if it does not, need to be added.

[v2] Banks!

DrWurzeli said in the ticket which he requested the feature:

Claims in GD have a unique UUID that bank accounts can be tied to. If supported by the economy plugin, that claim creates a public account that players can access with GD commands to withdraw and deposit money
(really nice for town claims where people can use it to store town funds and stuff or just people wanting to store some money in case they lose it on death).

this would also - much as in phantombank - enable the option - for all other plugins using PhantomEco - of mapping virtual accounts to players resulting in having more than 1 bank account per user. to differentiate, a flag/label could be added for virtual accounts so the eco plugin knows which accounts are virtual ones tied to UUIDs of objects and which are linked to player UUIDs.

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.