Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom player head and mob head (from creative menu) generate a warning "Owner is null" #643

Open
Athar42 opened this issue Sep 21, 2024 · 8 comments

Comments

@Athar42
Copy link

Athar42 commented Sep 21, 2024

Hi there,

With CoreProtect-Edge 23.1, I get this "error" each time I place or break a custom player head (same message, whatever the head is, tested with, at least, Iron Golem and Ghast heads) :

[18:56:29 WARN]: java.lang.NullPointerException: Cannot invoke "String.length()" because "owner" is null
[18:56:29 WARN]:        at CoreProtect-Edge-23.1.jar//net.coreprotect.paper.Paper_v1_20.getSkullOwner(Paper_v1_20.java:37)
[18:56:29 WARN]:        at CoreProtect-Edge-23.1.jar//net.coreprotect.database.logger.SkullPlaceLogger.log(SkullPlaceLogger.java:36)
[18:56:29 WARN]:        at CoreProtect-Edge-23.1.jar//net.coreprotect.consumer.process.BlockPlaceProcess.process(BlockPlaceProcess.java:20)
[18:56:29 WARN]:        at CoreProtect-Edge-23.1.jar//net.coreprotect.consumer.process.Process.processConsumer(Process.java:148)
[18:56:29 WARN]:        at CoreProtect-Edge-23.1.jar//net.coreprotect.consumer.Consumer.run(Consumer.java:133)
[18:56:29 WARN]:        at java.base/java.lang.Thread.run(Thread.java:1583)

image

Those heads are generated by a Vanilla Tweak datapack : More mob heads

Server : PaperMC version 1.21.1-build 85 (will update to build 89, but that will not change this behavior :D )
DataPack "More Mob Heads" version 2.14.0

Best regards,

@Skullians
Copy link

Looks like when the datapack generates player heads it’s not specifying an owner…
Will have to wait for a release that fixes it

@Skullians
Copy link

It’s a fairly simple fix.
I’ll take a look at making a PR.

@Athar42
Copy link
Author

Athar42 commented Sep 22, 2024

I assume the issue is there :
https://github.com/PlayPro/CoreProtect/blob/master/src/main/java/net/coreprotect/paper/Paper_v1_20.java

Funny thing is it appear that CO seems to add the owner if none are set.
Somehow, it didn't work as it's empty :D (with "setSkullOwner")

Edit : By looking at both :
https://github.com/PlayPro/CoreProtect/blob/master/src/main/java/net/coreprotect/database/logger/SkullPlaceLogger.java
and
https://github.com/PlayPro/CoreProtect/blob/master/src/main/java/net/coreprotect/database/logger/SkullBreakLogger.java

They only refer to the "getSkullOwner" function, but they check if the item as the "hasOwner" set to true :
if (skull.hasOwner()) {

Somehow, it pass this check even if the "owner" is set to "null".
Don't have more time to have a deeper look at it, but that has something to do with those 3 files :D

@Skullians
Copy link

Yeah, it’s probably some weird stuff that the datapack does.

@Vlader97
Copy link

Vlader97 commented Nov 9, 2024

Same problem on: Paper 1.20.1 build 196 with CoreProtect 22.4

This is not only done by datapacks, but also by give commands or plugins when the owner is not specified.

If the fix is simple as described here, why hasn't it been done yet?

@Athar42 Athar42 changed the title Custom player head generate a warning "Owner is null" Custom player head and mob head (from creative menu) generate a warning "Owner is null" Nov 27, 2024
@Athar42
Copy link
Author

Athar42 commented Nov 27, 2024

I did update the title as this also happen if you use the heads you can find in the creative menu.

Still an issue in CO 23.2-RC2

@Diamondback88
Copy link

Getting this issue as well in CO 23.2-RC2, never had this issue before this version actually (I believe my previous version was 23.0).

@Athar42
Copy link
Author

Athar42 commented Dec 3, 2024

Just an update, as discussing this on the official Discord too, latest error log output in the console using CO 23.2-RC2

[21:41:58 WARN]: java.lang.NullPointerException: Cannot invoke "String.length()" because "owner" is null
[21:41:58 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.paper.Paper_v1_20.getSkullOwner(Paper_v1_20.java:37)
[21:41:58 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.database.logger.SkullPlaceLogger.log(SkullPlaceLogger.java:36)
[21:41:58 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.consumer.process.BlockPlaceProcess.process(BlockPlaceProcess.java:20)
[21:41:58 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.consumer.process.Process.processConsumer(Process.java:149)
[21:41:58 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.consumer.Consumer.run(Consumer.java:133)
[21:41:58 WARN]:        at java.base/java.lang.Thread.run(Thread.java:1583)

[21:41:59 WARN]: java.lang.NullPointerException: Cannot invoke "String.length()" because "owner" is null
[21:41:59 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.paper.Paper_v1_20.getSkullOwner(Paper_v1_20.java:37)
[21:41:59 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.database.logger.SkullBreakLogger.log(SkullBreakLogger.java:34)
[21:41:59 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.consumer.process.BlockBreakProcess.process(BlockBreakProcess.java:21)
[21:41:59 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.consumer.process.Process.processConsumer(Process.java:146)
[21:41:59 WARN]:        at CoreProtect-Edge-23.2-RC2.jar//net.coreprotect.consumer.Consumer.run(Consumer.java:133)
[21:41:59 WARN]:        at java.base/java.lang.Thread.run(Thread.java:1583)

Also, my servers has been since updated to 1.21.3 (build 80 at that moment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants