From a443265e1d9984ea78ea6ed7e5038ef69c2a2e52 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 18 Sep 2023 22:56:20 +0200 Subject: [PATCH] Don't block chunk loading if an invalid skull is found (#4129) * Add null check in case skull texture value is null * Use variable for future result --- .../level/block/entity/SkullBlockEntityTranslator.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java index ace4d77b8..76cdbb5a4 100644 --- a/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java +++ b/core/src/main/java/org/geysermc/geyser/translator/level/block/entity/SkullBlockEntityTranslator.java @@ -107,7 +107,12 @@ public class SkullBlockEntityTranslator extends BlockEntityTranslator implements CompletableFuture texturesFuture = getTextures(owner, uuid); if (texturesFuture.isDone()) { try { - SkullCache.Skull skull = session.getSkullCache().putSkull(blockPosition, uuid, texturesFuture.get(), blockState); + String texture = texturesFuture.get(); + if (texture == null) { + session.getGeyser().getLogger().debug("Custom skull with invalid SkullOwner tag: " + blockPosition + " " + tag); + return null; + } + SkullCache.Skull skull = session.getSkullCache().putSkull(blockPosition, uuid, texture, blockState); return skull.getBlockDefinition(); } catch (InterruptedException | ExecutionException e) { session.getGeyser().getLogger().debug("Failed to acquire textures for custom skull: " + blockPosition + " " + tag);