mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
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
This commit is contained in:
parent
69f89edb91
commit
a443265e1d
1 changed files with 6 additions and 1 deletions
|
@ -107,7 +107,12 @@ public class SkullBlockEntityTranslator extends BlockEntityTranslator implements
|
|||
CompletableFuture<String> 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);
|
||||
|
|
Loading…
Reference in a new issue