render item frame contents with the item geometry like vanilla ItemFrameRenderer (fixed context, 8 rotations, all facings), frame block models, map contents incl. pixelpics photos, invisible frames, head skins/banner patterns from item meta

This commit is contained in:
MineTec committed 2026-11-04 16:03:34 +01:00
1 parent a743dc32c7
commit 2d56a1910c
13 files changed
+408 -96

No files matched your search

@@ -109,6 +109,11 @@ public class ImageMapRenderer extends MapRenderer {
return Math.min(0.999, noise * 0.7 + sweep * 0.3);
}
/** The blank-film map colour a photo shows while it is still being rendered. */
public static byte filmColor() {
return film();
}
private static byte film() {
if (!filmResolved) {
filmIndex = MapColorPalette.mapIndex(MapColorPalette.nearestPos(206, 202, 190));
@@ -17,6 +17,7 @@ public final class MapColorPalette {
private static byte[] indices;
private static int[] rgb;
private static double[][] lab;
private static int[] argbByIndex; // all 256 map colour bytes → ARGB (transparent slots alpha 0)
private MapColorPalette() {}
@@ -48,9 +49,24 @@ public final class MapColorPalette {
rgb[i] = rgbs.get(i);
lab[i] = labs.get(i);
}
argbByIndex = new int[256];
for (int i = 0; i < 256; i++) {
try {
Color c = MapPalette.getColor((byte) i);
argbByIndex[i] = c.getAlpha() < 255 ? 0 : (0xFF << 24) | (c.getRGB() & 0xFFFFFF);
} catch (Throwable t) {
argbByIndex[i] = 0;
}
}
initialized = true;
}
/** ARGB of a raw map colour byte as the client draws it; transparent slots are 0. */
public static int argb(byte mapColor) {
ensure();
return argbByIndex[mapColor & 0xFF];
}
public static int size() {
ensure();
return indices.length;