3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-20 06:50:09 +01: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
Dieser Commit ist enthalten in:
chris 2023-09-18 22:56:20 +02:00 committet von GitHub
Ursprung 69f89edb91
Commit a443265e1d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -107,7 +107,12 @@ public class SkullBlockEntityTranslator extends BlockEntityTranslator implements
CompletableFuture<String> texturesFuture = getTextures(owner, uuid); CompletableFuture<String> texturesFuture = getTextures(owner, uuid);
if (texturesFuture.isDone()) { if (texturesFuture.isDone()) {
try { 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(); return skull.getBlockDefinition();
} catch (InterruptedException | ExecutionException e) { } catch (InterruptedException | ExecutionException e) {
session.getGeyser().getLogger().debug("Failed to acquire textures for custom skull: " + blockPosition + " " + tag); session.getGeyser().getLogger().debug("Failed to acquire textures for custom skull: " + blockPosition + " " + tag);