Merge remote-tracking branch 'origin/main' into 1.18

This commit is contained in:
embeddedt 2023-03-11 11:13:27 -05:00
commit 3ba5b4296a
No known key found for this signature in database
GPG Key ID: A69433EC199B5613

View File

@ -6,6 +6,7 @@ import net.minecraft.client.renderer.texture.Stitcher;
import net.minecraft.client.renderer.texture.StitcherException;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Mth;
import org.embeddedt.modernfix.ModernFix;
import org.lwjgl.stb.STBRPContext;
import org.lwjgl.stb.STBRPNode;
import org.lwjgl.stb.STBRPRect;
@ -180,6 +181,10 @@ public class StbStitcher {
// Ensure that everything is properly packed!
if (!rect.was_packed()) {
ModernFix.LOGGER.error("Stitcher ran out of space with target atlas size " + longestWidth + "x" + longestHeight + ":");
for(Stitcher.Holder h : holders) {
ModernFix.LOGGER.error(" - " + h.spriteInfo.name() + ", " + h.spriteInfo.width() + "x" + h.spriteInfo.height());
}
throw new StitcherException(holder.spriteInfo,
Stream.of(holders).map(arg -> arg.spriteInfo).collect(ImmutableList.toImmutableList()));
}