[SPIGOT-4984] EnchantmentOffer.getCost() documentation/wording is misleading Created: 25/May/19 Updated: 14/Jun/19 Resolved: 14/Jun/19 |
|
Status: | Resolved |
Project: | Spigot |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Bug | Priority: | Minor |
Reporter: | Kuinox | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | documentation |
Attachments: |
![]() |
Version: | 1.14.1-R0.1-SNAPSHOT |
Guidelines Read: | Yes |
Description |
Hey, I was searching the minimum level required of an enchantment offer, but it was actually the getter "getCost" documented as Gets the cost in experience levels the player has to pay to enchant his item with this enchantment. The value returned is the level required to do the enchantment (what i want), the cost should be 1/2/3 meanwhile it return 6/11/30 |
Comments |
Comment by Black Hole [ 26/May/19 ] |
Correct. |
Comment by md_5 [ 26/May/19 ] |
So the number on the left is the cost, but the number on the right is the minimum number of experience you must have to unlock that enchant? |
Comment by Kuinox [ 25/May/19 ] |
There is the same "bug" on EnchantItemEvent.getExpLevelCost(). |
Comment by Kuinox [ 25/May/19 ] |
I had no issue with the real cost of the enchantment, but i was searching for the minimum level indicated. |
Comment by Black Hole [ 25/May/19 ] |
Some years ago the value shown on the right was the level costs. So maybe JavaDoc could be updated to reflect that. For the levels shown to the left you could just assume that the entries are always 1, 2, 3. Minecraft assumes that too, there is no field in the protocol to send different levels to the client. |