RankVouchers incompatibility
AtomixCM opened this issue ยท 4 comments
Hello,
I use a plugin called RankVouchers along with Shopkeepers to provide players with rewards that can be redeemed.
For instance, because you can't run a command when a player trades an item in, I give the player a rank voucher which they could then redeem for the reward (on my server, they can redeem the voucher for tokens).
However, these vouchers become un-redeemable when received from a shopkeeper. For some reason, the vouchers work fine when I use the command that grants vouchers, but not when the voucher item is given through the shopkeeper plugin.
Would you be able to double check what data is being saved for the items when they get granted through shopkeepers? I have a feeling there is some sort of information about the item that is getting removed that is, inturn, not allowing players to redeem the voucher as normal.
Another possible fix to this would be for the ability to have the shopkeeper run a command for a reward when a player trades in the correct items. I understand this would change the plugin drastically.
Looking forward to your response. Thank you for your consideration!
Do you mean this plugin? https://www.spigotmc.org/resources/rankvouchers-26k-downloads-now-open-sourced.24148/
Can you provide a voucher setup for reproduction? Also make sure you are running on the latest spigot 1.13 version when testing this.
I tried the voucher below, which seems to work fine across shopkeeper reloads (which triggers item serialization/deserialization to/from the save file).
item.type: 'PAPER'
item.data: 2
meta.name: '&aTest Voucher'
meta.lore:
- '&bLore 1'
- '&cLore 2'
meta.flags:
- 'HIDE_UNBREAKABLE'
meta.unbreakable: true
meta.enchants:
- 'DAMAGE_ALL;2'
redeem-rewards:
something:
reward:
- '[Message] &aVoucher works!'
chance: 100
I can think of a few potential issues though:
- The glow effect / custom enchantments: Getting this working is quite a hack (doesn't seem to even work on 1.13 yet on the current plugin version). If you are testing with glow effect on 1.12.2, then it might be very well be that this is causing issues. Potential issues with this: If RankVouchers is not enabled (when it hasn't registered its custom glow enchantment yet), and Shopkeepers loads items from save data, the items will probably silently and possibly even persistently lose this 'glow enchantment' (spigot ignores all 'unknown' enchantments during item deserialization). Causing the item to no longer be recognized by the Voucher plugin. So if this is the issue here it would mean that not only Shopkeepers and RankVoucher would always have to be run together at all times (.. prone to issues) , but also that the voucher plugin always gets enabled first (this can theoretically be handled inside the voucher or the Shopkeepers plugin.. if this really helps at all / is an option at all).
- Durability values might cause issues on 1.13 due to conversions/removal in 1.13, and differences in handling inside 1.13 compatible and not-yet-updated plugins.
- Enchantment order might be important. Not completely sure on that though right now.
Edit: If the issue ends up being somehow related to item serialization/deserialization, then this might even be something that has to be fixed inside Spigot itself.
I am running Spigot 1.8. The server is to remain 1.8 for some time.
I can provide you with the setup of the voucher (and yes, that is the right one).
I will see if enabling glow to false fixes the issue.
Thanks!
# Documentation: https://pluginwiki.com/rankvouchers
item:
type: ENCHANTED_BOOK
data: 0
meta:
name: '&e+1000 Tokens'
lore:
- '&7Right Click to Redeem'
enchants:
flags:
glow: true
unbreakable: false
redeem-rewards:
average:
reward:
- '[Console] tm add %player% 1000'
chance: 100
setting:
permission: false
limit: 0
world:
- MineWorldv2
- Atomix
- world_the_end
- world
- plotworld1
- world_nether
Alright, good to know!
I will close this ticket as 'declined' since there is not much I can do about this incompatibility.. Maybe this might be something for Spigot to look into (support custom enchantments officially somehow; keep the data even for unknown enchantments and resolve them dynamically somehow; provide a 'dummy' glow enchantment themselves; ..) or something for the Voucher plugin to fix (for example by ignoring the glow enchantment during item comparison.. though, the item will still lose the glow effect when traded by a Shopkeeper).