WalletDrop - Virtual money from killing...anything that moves

WalletDrop

Remember MoneyDrop for Bukkit? Well let me introduce you to WalletDrop for Sponge. With permission from DrakeSpirit, this is a continuation of MoneyDrop with a different name.

:gift: Donations

Creating plugins for Sponge takes time and effort. If you enjoy the hard work I’ve put into to this please feel free to get my a cup of coffee. It is much appreciated.

Donate

:nut_and_bolt: REQUIRES

  • Economy Plugin

:package: FEATURES

  • Very customizable
  • Collect money represented by an ItemStack (Optional)
  • Multi-world support
  • Multi-currency support
  • Player death penalties
  • Mod support
  • Built-in API

:open_file_folder: DOWNLOADS

Release: Download Here
Development Builds Download Here

:hammer: PERMISSIONS

walletdrop.enable

:warning: Bugs

If you find a bug or are having a problem with WalletDrop, please create a ticket at GitHub

2 Likes

Hello TrenTech, will this mod work with pixelmon? (For example when you kill a pokemon you get X money)

Pixelmon doesnt works like that… u are not actually killing an entity…
If a pokemon gets incapacitied it just dissappears…
u cant damage a pokemon with a sword etc.
So… sadly it wont work for pixelmon pokemons if its not defined
and probably its not…
Edit: trainers are giving money… actually it would be inappropriate if pokemon would give money…

A few things: (Stuff I posted in StackBan also applies, but I won’t repost it here)

  • There’s no guarantee that the EconomyService will be available in GameState.POST_INITIALIZATION. For that matter, if it changes afterwards, your code will break. Just get it from the ServiceManager when you need it (or, if you insist on using a global variable, listen for ChangeServiceProviderEvent).
  • I’m curious as to why you make a wrapper for the Economy API methods in WalletDrop.java.
  • I’m also immensely curious as to what the purpose of WalletDrop.java:90-97 is.
  • Don’t just assume the format of the money. Currency has a format(BigDecimal) method, which properly formats it for use in a message.
  • In the config, why do you number all the keys? Numbers are unrelated to the function of the keys.
  • In your DataManipulator, you shouldn’t just make compareTo return 0. That implies that they are all equal. It’s really easy to just put `return getValue() - arg0.getValue();’
  • It wouldn’t take much effort for this to be multi-currency, and it’d be a really good idea.
  • I’ve updated the economy stuff recently.
  • I’m not sure what you mean by assuming currency format
  • WalletDrop.java:90-97 mostly came directly from the original MoneyDrop plugin. The if statement doesn’t make too much sense to me but it got overlooked during porting.
  • Due to the large number of keys in the config I added numbers to a select few as to order them in a more readable fashion. (Working around the alphabetical nature of HOCON). I made a post a long time ago regarding insertion order but nothing ever came of it. If you have info on this I’m interested.
  • At the time I wasn’t sure what to do with compareTo so I left the return value alone. I’ll update this in next release
  • I’d be all for adding multi-currency…once I figure all that out. help is appreciated.
  • By ‘assume currency format’ I mean assume that the currency is formatted ‘$#,###,##0.00’. Assuming that the symbol is $, the decimal places are 2, etc. Again, the Currency class has a format() method, letting the economy plugin decide what a given amount of money looks like.
  • It’s really easy to get multi-currency. Make 'em configurable. Since they’re catalog types, you can get them directly from the config (assuming you wait until the economy service is registered to do so). Just check the config whenever you’d normally call getDefaultCurrency().
  • Another thing I noticed: In certain places, you’re storing the amount of money in a double. This isn’t a good idea. It’s provided in a BigDecimal for a reason - a double can overflow, a BigDecimal can’t. The point of the economy API is to allow for most any weird economy possible. I dunno, maybe they’re roleplaying Zimbabwe, whose currency exchange rate to USD is about 4,000,000,000,000,000. BigDecimal is arbitrary-precision, too, unlike double which can lose precision information.

There an easy way to store BigDecimal without having to create my own serializer?

Would this plugin work if its a customized entity? I’m curious if this could be compatible with pixelmon and allow players to earn money through each pokemon they beat in a battle.

This works with any Entity that is registered with Sponge. Most mods should work however I cannot vouch for Pixelmon.

BigDecimal implements Serializable.

You have an example? I can’t seem to get this to work. Attempting #getSerializable returns not applicable error in IDE

help:sob:

I keep getting an error when i try to use this plugin. I’m rather new to them, so if you could help me out with a possible fix it’d be greatly appreciated.

Current version of WalletDrop isn’t Sponge API 6.x compatible

Okay thank you.

I have been testing your 6.0.0 branch though. Seems to be working nicely. :stuck_out_tongue:

1 Like

could you please update this plugin to 1.11.2 ? I really need this feature on my war server.

Follow the development build link in the OP

I‘ll test it on my server! thanks!

Your latest build require pjc to run. Where can I find pjc plugin?