Hey everyone. We have a few "Redeemable" items such as Vault Vouchers and Stable Vouchers. One issue that has plagued them is accidental use when a player intended to keep it instead to sell the voucher or send to someone. Today we have resolved this issue by making the vouchers require confirmation before redeeming! We have also updated the new Permanent Derelict protection vouchers to also be self-redeemable and use this new confirmation system, so you no longer need to work with staff to redeem. This system was designed so we can very easily add confirmation prompt to any usable item we create in the future See: https://gist.github.com/aikar/b3c7c5556f1d8a5d52e9 https://gist.github.com/aikar/e86af3575ba3cef709d3
Just tested with a vault voucher, pretty cool Will the chest ui be added for more things like residences flags or multiple vault pages?
Will this be implemented for i-day chests? This is awesome, though, I've always been totally paranoid that I would accidentally use a Vault Voucher. XD
Oops! I knew I was missing something. I was first wanting to create this for the I Day chest, but simply did not have enough time. I will add it to them soon.
On a slightly different note, here's a little bit of contrast. When I looked at the code, I had no idea whatsoever what it meant. I asked my brother to come take a look at it. In 2 minutes, he told me exactly what it did even better than you did in the OP
It is quite a bit of lines sure, but in java, so much of the code is "generated" for you by the IDE. Most of the time writing code in java is not spent typing the code, but figuring out the logic you want it to do. Writing the code for this confirm chest system, while its only 86 lines, it still took 2+ hours in total for figuring out how to design it, thinking of pitfalls, testing, and fixing bugs (like I accidentally had the first paper slot associated with confirming too). Typing add(Material.Foo).onClick(new <Control+Space> pops up new Predicate<Player>, which I then hi-light and hit alt enter and it then expand it to Code: .onClick(new Predicate<Player>() { @Override public boolean apply(@Nullable Player input) { } }) So, multiple lines done in seconds.