Vanilla Item IDs not always accepted in worth.yml
elliotbailey opened this issue ยท 3 comments
Information
Full output of /ess version
:
Server version: 1.14.4-R0.1-SNAPSHOT git-Paper-207 (MC: 1.14.4)
EssentialsX version: 2.17.1.0
LuckPerms version: 4.4.1
Vault version: 1.7.2-b107
EssentialsXChat version: 2.17.1.0
EssentialsXSpawn version: 2.17.1.0
Details
Description
Some items in worth.yml that use vanilla names don't work in game with /worth or /sell, the plugin responds with Error: That item cannot be sold to the server.
. The reason I'm not using essential ID aliases is because I'm planning on running the file through a script for another project.
Steps to reproduce
- Put vanilla item IDs such as coarse_dirt and oak_log instead of coarsedirt and oaklog in worth.yml
- Reload plugin/restart server
- /worth does not view the item as legitimate
Expected behavior
worth.yml file accepts all vanilla item IDs
After a bit more testing, it appears to be any item IDs with an underscore in the name are affected
Looking at the code that handles worth, both getting and setting prices strips the underscores out of material names - so it seems the ability to use vanilla item names was not the intention.
Essentials/Essentials/src/com/earth2me/essentials/Worth.java
Lines 32 to 36 in bae909b
Essentials/Essentials/src/com/earth2me/essentials/Worth.java
Lines 139 to 140 in bae909b