Fix NPE when completing skull lookups without a real owner (Fixes #6052)

This looks like mojang introduced an NPE however it was previously being
supressed by the future used by the server, we'll just stick to the legacy
behavior of retainining the existing profile of earlier versions
This commit is contained in:
Shane Freeder 2021-07-01 00:10:28 +01:00
parent aa1d49efd6
commit 2143a948be

View File

@ -15,6 +15,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
- SkullBlockEntity.profileCache.getAsync(owner.getName(), (gameprofile1) -> { - SkullBlockEntity.profileCache.getAsync(owner.getName(), (gameprofile1) -> {
+ // Paper start + // Paper start
+ SkullBlockEntity.profileCache.getAsync(owner.getName(), (gameprofile) -> { + SkullBlockEntity.profileCache.getAsync(owner.getName(), (gameprofile) -> {
+ if (gameprofile == null) {
+ net.minecraft.server.MinecraftServer.getServer().scheduleOnMain(() -> callback.accept(owner));
+ return;
+ }
+ Runnable runnable = () -> { + Runnable runnable = () -> {
+ GameProfile gameprofile1 = gameprofile; + GameProfile gameprofile1 = gameprofile;
Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null); Property property = (Property) Iterables.getFirst(gameprofile1.getProperties().get("textures"), (Object) null);