GoldBank
GoldBank – Banks, ATMs, wallets, and more!
Development Status
I will no longer be releasing updates for this plugin. While GoldBank, being the second plugin I've ever made, holds a special place in my heart, it's time to move on. Because the truth is, it's a huge pile of messy, tangled code written by a developer just beginning to learn the ropes of Java and OO programming. I don't even remember writing a lot of the code still in the latest version, and it may hold nasty bugs that I'm not even aware of. Since I don't plan to release any further updates (well... I might release a 3.0.2 that's been sitting on Github for a while, but then that's it for real), I strongly advise against using it and instead opting for a cleaner and better-maintained economy plugin. With that being said, so long and thanks for all the fish!
Overview
I've never really seen the point of virtual economies. I prefer an economy with tangible items. So, I created this plugin. It's essentially the basis for a gold-based economy system. The basic function is the ability to create GoldBank signs, which players can then buy/claim to put their gold in. Once a week, they will receive interest. Additionally, admins can create ATM signs, which allow players to access their bank signs remotely. And furthermore, players and admins may create personalized shops which other players may use to buy and sell items. If you need to expand your inventory, this plugin can do that for you. Just craft a wallet (made with leather in a boat shape), and instantly you'll have a mini-inventory within your regular one (inventory-ception?). But be careful, because if you drop it, another player can steal it from you! Mobs have a nasty habit of losing their wallets, and will often drop gold nuggets when killed. If a player is lucky, they might receive something with a bit more value than mere nuggets.
Features
- Creates and registers a virtual inventory to a [GoldBank] sign when a player right clicks it.
- Automatically distributes interest between inventories weekly
- Signs are automatically protected from access and destruction by other players, pistons, creepers, and TNT
- Specify tiers of signs with different fees and sizes (Define fees and sizes in the config, and define tiers on the second line of each [GoldBank] sign
- Create a master sign, which everyone may claim, by setting the last line as "Master"
- Admins can create [GoldATM] signs, which allow players to access their gold inventory remotely, for a configurable fee
- Mobs drop a random number of gold nuggets, the maximum being a number defined in the config
- Mobs may drop rare golden items at a configurable rate
- Players and admins can create shop signs, which other players may buy from and sell to (see below for sign syntax)
- Players can craft wallets (crafted with leather in a boat or minecart shape), which act as portable virtual inventories
- Type "/gb reload" to reload the plugin
- Full UUID support. Note: this means that the plugin connects to Mojang's UUID API.
Bank Signs
Creation
To create a GoldBank as an admin, simply create a sign resembling this:
———————
[GoldBank]
Tier 1
(blank)
(Master)
———————
The first line is static, the second controls the tier (defined in the config), the third is blank, and the fourth, if set to "Master", will allow everyone to register and access their bank account through it, but will not change its text. A regular sign will only allow one player to register through it.
Registration
To register a bank with a GoldBank sign, a player need only right-click it. If a fee is set for the given bank tier, the player will be required to pay that fee in golden ingots in order to register.
Access
To access a GoldBank, right-click the sign to open its virtual inventory. Once the player is finished editing, the inventory will be automagically saved to disk.
Destruction
To unregister a GoldBank, a player must left-click it. This will cause the sign to revert back to an unregistered state (assuming if it is not a Master sign), and its inventory to spill onto the floor in front of the player.
ATM Signs
Usage
ATM signs are a powerful tool which allow players to access their GoldBank account from anywhere on the map. When a player right-clicks one, their bank account will open, and they are free to edit it as long as they'd like. If a fee is defined in the config for ATM signs, the player will be required to hold a sufficient amount of gold in their inventory for the sign to charge in order to use it.
Creation
Creation of ATM signs couldn't be simpler! Just create a sign and type "[GoldATM]" as the top line (case-insensitive).
Shop Signs
If AngryNerd1 creates this sign:
———————
[Diamond]
1;4
1;2
(blank)
———————
the plugin will replace it with this sign:
———————
[Diamond]
Buy 1 for 4g
Sell 1 for 2g
AngryNerd1
———————
To create an admin (infinite) sign, simply replace the last line with "Admin", and it will convert to "Admin"
Note: All lines are case-insensitive, spaces may be used in place of underscores, and the item ID may be used in placed of the item name. Additionally, shops which sell the buyer's head can be created, using PlayerHead as the item name.
Wallets
GoldBank has a wallet feature, where players may craft wallets to carry with them. They allow players to store anything, or just gold, if the server owner desires.
Creation
To create a wallet, place 5 leather in the shape of a boat in a crafting table. A wallet will appear in the result slot with the player's name branded on it.
Usage
To use a wallet, a player must place it in their hand and right-click. A virtual inventory with a config-defined number of slots will be opened, and they are free to edit it. If the config allows for it, they may add any item they wish. If not, they will be limited to forms of gold (gold tools excluded). When they are done editing, they may hit the escape key to resume gameplay.
Commands
- /gb reload - Reloads the plugin
- /gb view {player} - Opens a specified player's GoldBank inventory. Note that, if the player argument is missing, it will open the player's own GoldBank inventory.
- /wire [player] [amount] - Transfers a specified amount of gold in nuggets from your GoldBank to a specified player's. A fee may apply, which is set in the config.
Changelog
Latest Version (3.0.1)
- Fix GoldBank hanging the main thread while doing UUID lookups
Version 3.0
- Convert plugin to use UUIDs in place of usernames
- Add code to convert existing data to use UUIDs
- Minor bug fixes
Click here to view the changelogs for all versions
To-do
- Make GoldShops more user-friendly (i.e. allow players to use aliases in place of the actual item name (and damage value))
Click here to view older items
Known Bugs
- Players in very rare cases receive change in the form of an ItemStack with strange properties when using blocks to buy from a sign with a different gold type defined. This ItemStack behaves very oddly, but is effectively the same as the ItemStack that should have been received, and can be manipulated into such
- Players in creative mode may put their wallet inside their wallet, effectively destroying it (though it may be spawned back in via command)
- The /gb wallet spawn command has no default group set, so it must be manually specified even for operators
Click here to view older items
Permissions
Note: Permissions will only work if you have version 1.4 or later of the plugin
Bleeding-edge Builds
Development builds of this project can be acquired at the provided continuous integration (Jenkins) server. These builds have not been approved by the BukkitDev staff. Use them at your own risk. Additionally, these builds often undergo little to no testing, so there is no guarantee they will function properly.
Plugin Metrics
This plugin collects anonymous usage statistics. Here's a list detailing data collected, and here's a graph of and link to them:
Source Code
Vídeo Tutorial em Português (Video Tutorial in Portuguese)
http://www.youtube.com/watch?v=36mH_i62Ghc
Logo by Zombiemold
Sponsor
Special thanks to HostHorde for supporting GoldBank! Make sure to check them out!
I reeditted the script and then booted up my server to give it a test run. After killing about 6-8 mobs with no nuggets dropping I think i got it right. Thank you for your help and the sweet plugin! :D
@Windykim
An interesting suggestion, but no, I don't think that would be possible. Wait, now that I think about it, I don't really know. Right now, the plugin functions purely using Material variables, which are used to represent a specific item defined in the Bukkit API. But, I might be able to modify that to use item IDs for custom items, though I'm not entirely certain. I'll need to think about it (and maybe make a post to the development forums XD).
So, if the items aren't defined in the Bukkit API, would it be possible to do something like allowing an Admin to put an item in a virtual inventory (say, within the sign) and just use that as the source item? Perhaps I'd put [internal] as line 1 to direct the sign to get the name off the item in its virtual inventory. Lines 2, 3 and 4 would be set up as usual. The sign gets placed then the Admin can 'open' it, stick whatever item he wants in there and the sign replaces [internal] with the appropriate name and uses that as the source item (since its an Admin sign, it would be infinite) as what to dupe and give to someone using the sign.
I'm just tossing out possibilities. I'm a total n00b with this and only know enough code to be dangerous so I might be asking something that's so obviously impossible that it sounds silly so please forgive me if that's the case.
Regardless, I absolutely love GoldBank. My server is small (<20 people, all family and friends) and everyone has been mainly focused on building a town (I'm the Queen of the kingdom, lol) but people were getting a little bored. GoldBank makes everyone want to go out and hunt and now they LOVE finding a dungeon or abandoned mine with a ton of mobs. Everyone wants gold so they can create and run shops, they're all talking about what they plan to specialize in and looking for their niches to fill... its wonderful.
@HajeilSounak
You're not properly defining the list. YAML lists should look like: disable-drops-in: (new line) - world (new line) - world_nether (new line) - world_the_end
I still can't seem to get the drops to disable. Can you show me the proper way to write this part of the script to get them to stop? Currently it looks like this
disable-drops-in:world, world_nether, world_the_end
@Windykim
Yeah, I don't think the plugin would be too friendly with custom items, seeing as it loads materials direct from the Bukkit API. I'm still learning exactly how Bukkit works internally, but in theory, I think it would work if you used a modified version of Bukkit somehow. But otherwise, no, it won't work. Sorry. :/
On a side note, the issue is unrelated to GoldShops not liking items with NBT data. That issue is caused by not having an efficient way to implement it, though it is possible in theory.
I love this plugin and how easy it is to get running even for a noob to MC servers like me. We're also running diablodrops and I wanted to set up a shop sign to sell Identity Tomes, used by the mods to identify some of the magic treasure that drops. I can't seem to get that to work with GoldBank, though, even when I use the book's item ID (387, if that matters). I'm guessing GB isn't liking a custom item since I read on this forum that it also doesn't like enchanted or renamed items.
Am I right? Or am I doing something wrong?
@HajeilSounak
I am actually working on a feature which allows you to define the type of gold on the shop sign (b = blocks, i = ingots, n = nuggets), but it could take a bit, seeing as I need to rewrite half the algorithm that exchanges gold between the player and the shop. :P
@MaximRoncace
Thanks for the help. Also I just realized that 1 bar of Gold Ingot can be broken into 9 pieces of Gold Nugget. So needing a change for the currency used is unnecessary. Sorry I didn't realize that before. I'm a bit of a Minecraft noob. But I'm supper addicted now. :D Thanks again.
@HajeilSounak
To disable gold drops, just bullet the worlds that your server uses. For example, if you haven't modified the world names, it would be world, world_nether, and world_the_end.
How do I alter the script so that mobs stop dropping gold nuggets? I think it's done using the line at the end of the script that says "disable-drops-in:- your_world- your_second_world" But I can't figure out how to alter it correctly.
Can I set buying and selling to use Gold Ingot?
I would really prefer to have these options since it would make this plugin work perfectly with Grief Prevention. Other wise the gold nugget drops are going to throw off my ability to limit claim stakes. They will just end up with an infinite amount of gold to make golden shovels to stake claims with.
Disabling the drops in worlds works fantastically!
@mcnate
Uh-oh...
I found this bug already, but not until I started testing 2.4. Seeing as I was messing with the methods that handled shops, I assumed it started in 2.4, not 2.3.1. Shoot...
I'll delete 2.3.1, then upload 2.3.2 as soon as I have this patched.
Can't believe I missed this...
EDIT: Fml...
Misplaced parentheses. The cause of this was misplaced parentheses. I made an error while coding 2.3.1 with a comparison, but I didn't think it would cause any issues. Turns out it did...
When a player holds a gold nugget in hand it can buy infinite amount of items and give in the shop more intended gold than it has set to give to the shop when a person buys from it. Can you fix this please its ruining everything in my server
@SkyLandPvP
This sounds like the data value-related bug that was fixed in 2.3.1. If you are running 2.3.1, then send me a PM detailing how to replicate the bug and I'll get to fixing it. :D
As for setting up wallets, just place leather in a crafting table as though you were crafting a boat.
Hello when u spend money on a sign or nuggets u will get the item bont wont lose nuggets and also dont know and not clear on how to set up a wallet
Hi and help!
When clicking the bank sign with wallet, all items dissappear either from the wallet and the bank, or only the bank.. Any fix on this?
@Xippie
Damage values are actually supported, and specified by following the item name or ID with a colon and then the damage value. You are right about ItemMeta (enchantments, dyes, names), however, but I don't know if I'll be implementing that anytime soon, because I can't seem to figure out an efficient way to do so. If you come up with anything, let me know.
I'm not sure if this has been brought up yet, but I'd like to point out that there is no way to buy/sell items that are enchanted, dyed, renamed, or items with otherwise changed damage values.
@sean326
Okay, I see what you mean. Unfortunately, I'd prefer to keep the base currency as gold nuggets, as having to deal with decimals is far from the norm, and has the potential to get confusing. Sorry about that. :(