Geolykt / EnchantmentsPlus

Enchantments+, a Bukkit Custom Enchantments Plugin based on Zenchantments targetted at production grade servers
GNU General Public License v3.0
38 stars 15 forks source link

Can't use book to enchant in survival #24

Closed grandpaslab closed 3 years ago

grandpaslab commented 3 years ago

We've installed EnchantmentsPlus on our 1.16.1 server, and we've found that we can't use a book to enchant any item in survival mode. Works fine in creative. Are we doing something wrong, or is it broken?

Geolykt commented 3 years ago

Could be a permission issue, could be something else. I believe that it is likely something to do with incompatible tools.

Geolykt commented 3 years ago

Could you provide your configurations? It helps me to reproduce your issue. Additionally I would like to know if you are using CB (please don't), Spigot or Paper

grandpaslab commented 3 years ago

configs: https://drive.google.com/drive/folders/1Y2rkJrrPimmqexcCafLvjDJPNr9C1j9k?usp=sharing

We're using Spigot.

Geolykt commented 3 years ago

If I'm not fully wrong there's currently a bug with our code within spigot which is "fixed" under paper (or at least was a month ago). Fixing it would require some non-standard things, although isn't impossible

Geolykt commented 3 years ago

However your issue is based on the config and can be fixed by adding - "ENCHANTED_BOOK" to tools.axe, tools.pickaxe, etc. in the magicCompat.yml. It's an oversight from me that I did a few versions ago, which is why it's a bit borked.

So it would look something like


[...]
    - "DIAMOND_SWORD"
    - "NETHERITE_SWORD" # 1.16 and beyond
    - "FISHING_ROD"
    - "BOW"
    - "SHEARS"
    - "FLINT_AND_STEEL"
    - "ENCHANTED_BOOK"
  axe:
    - "WOODEN_AXE"
    - "STONE_AXE"
    - "IRON_AXE"
    - "GOLDEN_AXE"
    - "DIAMOND_AXE"
    - "NETHERITE_AXE" # 1.16 and beyond
    - "ENCHANTED_BOOK"
  pickaxe:
    - "WOODEN_PICKAXE"
    - "STONE_PICKAXE"
    - "IRON_PICKAXE"
    - "GOLDEN_PICKAXE"
    - "DIAMOND_PICKAXE"
    - "NETHERITE_PICKAXE" # 1.16 and beyond
    - "ENCHANTED_BOOK"
[...]
grandpaslab commented 3 years ago

updated config: https://drive.google.com/file/d/1nRIgtwpBVhFhBN8ZRrDCeaOXiEirlUca/view?usp=sharing

Still not working. Is anything required other than changing the config and restarting the server?

Screenshot. Looks like it's going to work, but clicking the button does nothing.

Geolykt commented 3 years ago

That's the spigot part of the bug

grandpaslab commented 3 years ago

Ah, OK. Can you update your readme? Would've saved me a couple days if the readme said Paper was required.

Geolykt commented 3 years ago

Paper isn't required at all

grandpaslab commented 3 years ago

OK, but the readme says "The current version of this plugin is fully compatible with Spigot version 1.16.1, 1.16.2 and 1.16.3" and it's not.

kyematzen commented 3 years ago

I'll take a look at this later and see if we can get this resolved.

Edited: I've done some testing and may have found a fix but it's still experimental, I will update this as testing goes on. Don't have an exact ETA for when I will have it completed but will have a pull request explaining where the fix could be implemented.

kyematzen commented 3 years ago

It's been a while since I last updated or forked the project.

I've been heavily researching into what the issue is inside of the plugin. I can only really come up with the idea that NBT could be factoring into an issue.

Geolykt commented 3 years ago

I'll might test which version of spigot introduced the issue today (because as far as I know this hasn't been always like that) - hopefully this will get us more information on this. Edit: It highly appears to be a bug on our side that was introduced sometime between when the bug was first reported (so probably late 2.1.x I believe) and the initial release of the fork since that is the version I first tested, I'll try to do a binary search on all the commits next, but that will take time. Edit nr. 2.: It was introduced somewhere between v1.2.4-beta.0 (exclusive) and v2.0.0. I will now try to go through every commit (only 10 to test, heh) and see which specific commit introduced it, hopefully that will give us better information on why this happens Edit Nr. 3: The first commit that introduces such an issue was 869980e73c43df05a44f5a99de25147e78b5b16b, simply reverting it will not be possible as the file in suspicion was rewritten in 2.1.x and was just a mess in that era, but I'll do my best to find what really has gone wrong here.

Geolykt commented 3 years ago

~No longer marked as wontfix as this issue has regressed to also affect Paper~

~This regression occurred somewhere between the 2.2.3 and 3.0.0 release of the plugin after troubleshooting and is not Paper's fault ... good news I guess? However I believe that they might be two separate issues~ The regression has been fixed, but I will try to fix this issue on spigot for one last time once and for all