mirror of
https://github.com/GeyserMC/Rainbow.git
synced 2025-12-19 14:59:16 +00:00
Fix: don't include null sprites in stitched textures map
This commit is contained in:
@@ -37,7 +37,11 @@ public record StitchedTextures(Map<String, TextureAtlasSprite> sprites, Supplier
|
|||||||
|
|
||||||
Map<String, TextureAtlasSprite> sprites = new HashMap<>();
|
Map<String, TextureAtlasSprite> sprites = new HashMap<>();
|
||||||
for (Map.Entry<String, Material> material : materials.entrySet()) {
|
for (Map.Entry<String, Material> material : materials.entrySet()) {
|
||||||
sprites.put(material.getKey(), preparations.getSprite(material.getValue().texture()));
|
TextureAtlasSprite sprite = preparations.getSprite(material.getValue().texture());
|
||||||
|
// Sprite could be null when this material wasn't stitched, which happens when the texture simply doesn't exist within the loaded resourcepacks
|
||||||
|
if (sprite != null) {
|
||||||
|
sprites.put(material.getKey(), sprite);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new StitchedTextures(Map.copyOf(sprites), () -> stitchTextureAtlas(preparations), preparations.width(), preparations.height());
|
return new StitchedTextures(Map.copyOf(sprites), () -> stitchTextureAtlas(preparations), preparations.width(), preparations.height());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user