From 371da30f10c5e712733adb1040166d3499367e10 Mon Sep 17 00:00:00 2001 From: Eclipse Date: Thu, 23 Oct 2025 11:05:27 +0000 Subject: [PATCH] Fix: don't include null sprites in stitched textures map --- .../geysermc/rainbow/mapping/texture/StitchedTextures.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rainbow/src/main/java/org/geysermc/rainbow/mapping/texture/StitchedTextures.java b/rainbow/src/main/java/org/geysermc/rainbow/mapping/texture/StitchedTextures.java index c3e8f9c..8923a17 100644 --- a/rainbow/src/main/java/org/geysermc/rainbow/mapping/texture/StitchedTextures.java +++ b/rainbow/src/main/java/org/geysermc/rainbow/mapping/texture/StitchedTextures.java @@ -37,7 +37,11 @@ public record StitchedTextures(Map sprites, Supplier Map sprites = new HashMap<>(); for (Map.Entry 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()); }