Gringotts

Gringotts

53.6k Downloads

Named denominations

jastice opened this issue · 21 comments

commented

Make it possible to name individual denominations, for example pounds and pennies, or gold blocks, gold bars, gold ingots.

The names would display on the /money command in the form "23 gold blocks, 8 ingots and 3 nuggets"

Further consideration: Display the items themselves with the respective names.

commented

Implemented in 2.7 at last!

commented

How do I vote?

I'd love to see this too! I'm in the process of setting up an actual Gringott's and it'd be great to have galleons and knuts!

commented

Consider this a vote :)
I probably don't have the time currently to implement it anytime soon. But pull requests are always welcome!

commented

Oh, well then perhaps I will implement this feature!

commented

awesome!

commented

I think I'm on the right track here, but I was wondering if you could take a look at this, when you get a chance, please?

https://gist.github.com/NathanWolf/3a867c41fda724b6aa34

I have some changes I want to test, but when I run my modified snapshot build (just using Maven), I get a bunch of EBeans errors, and I'm honestly not too familiar with EBeans.

commented

this seems to be the root issue:

[07:27:10 ERROR]: ebean.properties not found

But I'm wondering why it worked before, and I hadn't configured EBeans or anything- I don't think I've changed anything related to this in your code, if I did it was definitely in error :)

commented

This is probably related to some change in craftbukkit or java 1.7 (since I had last touched Gringotts a while ago), and should be fixed in the feature_uuid branch. The fix was making the EBeanAccountChest class public. The ebeans.properties error is insignificant, but you can make it go away by creating on empty file of that name.

commented

Ah, thank you! Making that class public got me running.

It sounds like I should be testing in the feature_uuid branch- or perhaps go back to the last released build? I've got my changes in a branch right now, so it's not hard for me to shuffle things around.

commented

Either master or feature_uuid is fine as a base. I'll be merging it either way.

commented

Er, actually, I did a few updates to the build config on the uuid branch. Try to use that. Thanks!

commented

I think my problem was that I'm testing on 1.7.5 CB for compatibility with the server I want to use this on (though we want to update to 1.7.9 soon anyway)

I was able to find the commit (ish) for 2.2's release, so I'm using that- this change will be pretty small, though, so I'll keep it to a single commit and it should be an easy merge regardless!

I'm just working out the details now, but I think I'm nearly there. It's backwards compatible, but the new version of the config would look like this:

https://github.com/elBukkit/MagicPlugin/blob/master/src/main/resources/examples/potter/Gringotts/config.yml#L15

Let me know what you think, to me it's pretty clear. The denomination set to "1" will default to the base naming, though you could override it in the same way by making that value a map instead.

commented

Oh, I also added support for an "inverse_value" property when using this "expanded" denomination notation. It's a convenience for me when dealing with these (frankly, annoying) HP conversion rates that result in irrational numbers if I try to use "value". So you can use either way now, it will just convert "inverse_value" for you, I didn't do anything special to try and retain precision there :)

commented

On second look, the "inverse_value" thing may not work out, so I might just ditch it. It ends up interacting strangely with the digits-based rounding, and it just kind of messy...

I think now it doesn't actually matter since I can make my base currency whatever I want, and they all get names- so I can just base it on Knuts instead of Galleons.

Anywho, let me take this opportunity to say just how much I love this plugin! XD

This is exactly what I've been looking for for my survival server, before I even started on this HP project. I've got a physical economy set up there with Shopkeepers, and have been looking for a way to integrate with Vault-based plugins, and give my players a physical bank to keep large accounts.. it's perfect!

And with this HP set up, it's even more perfect.. we're going to have a roller coaster ride down to a physical set of vaults... it'll be great ❤️

One thing I'll be thinking about for the future, and would love to help with, is some sort of easier set up or built-in protection. I'm planning on making a Magic spell that will insta-create vaults of various capacities for a certain player - but having an option for having the vault chests be "locked" to their owners would be really nice, to avoid having to automate WG region creation.

commented

Cool, looks pretty good so far! Are you basing the base currency on the highest denomination?

Very glad to hear the plugin brings you joy ;) I'd love to see how you use it on your server.

I'm a bit hesitant to add built-in protection, but if you implement a good unobtrusive way of doing it I'm happy to work with you.

commented

Oh, thanks! I think I can add external jabber.. I'm still not quite riding the skype train.

Have a look-see, see what you think:

#104

I plan on testing this on a live server soon, though it may need testing with a wider variety of configurations.

commented

Awesome. Also, you can drop by #minecraftwars on freenode irc anytime

commented

Basically, yes- it just walks down the sorted list, so starting with the highest denomination that way.

So far, so good- I left in the "inverse_value" parameter, but I don't use it anymore. It might be useful for certain cases, but if it means you end up with a denomination less than the number of display digits, it'll round to 0 and won't do anything. (I did catch the divide-by-zero I had initially cased in this case, though!)

I'm about ready to push this, just doing some more testing. Here's what it looks like:

Gringotts

My plan is to change the format string to 0 decimals, I just have it on there for testing.

commented

Sweet. But shouldn't only the smallest denomination have decimal digits at all?

commented

I was wondering that too- I could special-case it. I guess I'm thinking you'd make it even numbers only if you're naming denominations, but it'd be nice to be flexible.

I think that's easy to do, let me see.

commented

by the way, feel free to add me on jabber at [email protected] or skype as jastice