EssentialsX

EssentialsX

2M Downloads

Null error when giving shields with enchantments or using them in a kit

jvdoorn opened this issue ยท 3 comments

commented

Information

Full output of /ess version:

[13:01:53 INFO]: Server version: 1.13.2-R0.1-SNAPSHOT git-Paper-486 (MC: 1.13.2)
[13:01:53 INFO]: EssentialsX version: 2.16.1.153
[13:01:53 INFO]: LuckPerms version: 4.3.73
[13:01:53 INFO]: Vault version: 1.6.1
[13:01:53 INFO]: EssentialsXAntiBuild version: 2.16.1.153
[13:01:53 INFO]: EssentialsXSpawn version: 2.16.1.153

Server log: https://gist.github.com/Argetan/88a9e8bbc4bc4f21a46fb1e28e102cbf

EssentialsX config: https://gist.github.com/Argetan/33708df3b81b687fad536374e23fe826

Details

Description
When trying to give or use a shield with enchantments in a kit EssentialsX will throw a null error.

Possibly related to #2187. Giving a shield with just a name/lore works fine, only issue is when I add enchantments, othere items such as a sword don't have this issue (as far as I can tell).

Steps to reproduce
/give username shield 1 mending:1 unbreaking:5 name:Big_Round_Woodshield lore:A_large_shield_that_covers|most_of_the_body_at_any|given_time_during_combat.

Expected behavior
I expect to get a shield with the given enchantments and name/lore.

commented

I was able to replicate this bug on the following version:

[21:34:33 INFO]: CONSOLE issued server command: /ess version
[21:34:33 INFO]: Server version: 1.13.2-R0.1-SNAPSHOT git-Paper-568 (MC: 1.13.2)
[21:34:33 INFO]: EssentialsX version: 2.16.1.153

Debug output: https://hastebin.com/sipaxumogu.md

commented

It seems to me something is going wrong in these lines:

} else if (MaterialUtil.isBanner(stack.getType())) {
//WARNING - Meta for banners will be ignored after this point.
addBannerMeta(sender, false, string, ess);

I think this because looking at my error log it's calling addBannerMeta(), which I think it shouldn't do seen that it's a shield. I'll investigate further and see if I'm able to fix this issue.

commented

The fix for this has been merged. You can download the latest version from the build server.

@triagonal @argetan Thanks for investigating and contributing a fix for this.