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

Bukkit profile creation doesn't work on 1.20.2 #9769

Closed
ghost opened this issue Sep 28, 2023 · 6 comments
Closed

Bukkit profile creation doesn't work on 1.20.2 #9769

ghost opened this issue Sep 28, 2023 · 6 comments
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to.

Comments

@ghost
Copy link

ghost commented Sep 28, 2023

Expected behavior

PlayerProfile profile = Bukkit.createProfile(uuid); should work

Observed/Actual behavior

java.lang.NullPointerException: Profile name must not be null
at java.util.Objects.requireNonNull(Objects.java:235) ~[?:?]
at com.mojang.authlib.GameProfile.(GameProfile.java:31) ~[authlib-5.0.47.jar:?]
at com.destroystokyo.paper.profile.CraftPlayerProfile.(CraftPlayerProfile.java:39) ~[paper-1.20.2.jar:git-Paper-"fe54a13"]
at org.bukkit.craftbukkit.v1_20_R2.CraftServer.createProfile(CraftServer.java:3086) ~[paper-1.20.2.jar:git-Paper-"fe54a13"]
at org.bukkit.craftbukkit.v1_20_R2.CraftServer.createProfile(CraftServer.java:3073) ~[paper-1.20.2.jar:git-Paper-"fe54a13"]
at org.bukkit.Bukkit.createProfile(Bukkit.java:2513) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]

Steps/models to reproduce

1.20.2 server, call Bukkit.createProfile(uuid)

Plugin and Datapack List

N/A just a custom plugin to call Bukkit.createProfile(UUID)

Paper version

paper 1.20.2 #203

Other

Another weird thing, calling YamlConfiguration configuration = YamlConfiguration.loadConfiguration(file);
on a yaml file with presumably a skull itemstack (I can't test because yaml exceptions aren't thrown, they are just spit into console for some reason) does this:

java.lang.NullPointerException: Profile name must not be null
at java.util.Objects.requireNonNull(Objects.java:235) ~[?:?]
at com.mojang.authlib.GameProfile.(GameProfile.java:31) ~[authlib-5.0.47.jar:?]
at com.destroystokyo.paper.profile.CraftPlayerProfile.(CraftPlayerProfile.java:39) ~[paper-1.20.2.jar:git-Paper-"fe54a13"]
at com.destroystokyo.paper.profile.CraftPlayerProfile.deserialize(CraftPlayerProfile.java:312) ~[paper-1.20.2.jar:git-Paper-"fe54a13"]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeViaMethod(ConfigurationSerialization.java:85) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserialize(ConfigurationSerialization.java:127) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.serialization.ConfigurationSerialization.deserializeObject(ConfigurationSerialization.java:207) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:58) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:576) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:210) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:552) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:597) ~[snakeyaml-2.2.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:49) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping2ndStep(BaseConstructor.java:576) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor.constructMapping2ndStep(SafeConstructor.java:210) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructMapping(BaseConstructor.java:552) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.SafeConstructor$ConstructYamlMap.construct(SafeConstructor.java:597) ~[snakeyaml-2.2.jar:?]
at org.bukkit.configuration.file.YamlConstructor$ConstructCustomObject.construct(YamlConstructor.java:49) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObjectNoCheck(BaseConstructor.java:264) ~[snakeyaml-2.2.jar:?]
at org.yaml.snakeyaml.constructor.BaseConstructor.constructObject(BaseConstructor.java:247) ~[snakeyaml-2.2.jar:?]
at org.bukkit.configuration.file.YamlConstructor.construct(YamlConstructor.java:37) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:163) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:161) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.fromNodeTree(YamlConfiguration.java:161) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.loadFromString(YamlConfiguration.java:120) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:160) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.FileConfiguration.load(FileConfiguration.java:128) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]
at org.bukkit.configuration.file.YamlConfiguration.loadConfiguration(YamlConfiguration.java:309) ~[paper-api-1.20.2-R0.1-SNAPSHOT.jar:?]

@ghost ghost added status: needs triage type: bug Something doesn't work as it was intended to. labels Sep 28, 2023
@Brokkonaut
Copy link
Contributor

I can confirm this issue

@Malfrador Malfrador added status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. and removed status: needs triage labels Sep 28, 2023
@ghost
Copy link
Author

ghost commented Oct 4, 2023

Any updates? This bug makes my server unable to update to 1.20.2, since we use yaml serialized itemstacks.

@Malfrador
Copy link
Member

Malfrador commented Oct 4, 2023

This should be resolved once #9770 is merged.

Note that storing ItemStacks with null in profile names is something that has been warned against for several years, as those profiles are considered invalid by Mojang and stuff blowing up now isn't really a surprise.

@Brokkonaut
Copy link
Contributor

Note that storing ItemStacks with null in profile names is something that has been warned against for several years

Where are things like this documented? I never had any warnings in the console and could not find anything in the javadocs.

@electronicboy
Copy link
Member

There is a level of this API wrapped internal implementation detail and so we often never really documented such aspects, half completed, mangled, profiles have always caused varying issues within the space of craftbukkit and mojang, The behavior around this stuff has always been kinda janky in varying ways, it was just generally predictable in how it would behave so most people often just ignored that given that the API wasn't exactly as integrated as it could be to make the full extent of potential situations more visible

@ghost
Copy link
Author

ghost commented Oct 5, 2023

Fixed!

@ghost ghost closed this as completed Oct 5, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: bug Something doesn't work as it was intended to.
Projects
Status: Done
Development

No branches or pull requests

3 participants