From 982a3aab21db02ab61c70bed2e0f87c13db698b9 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Fri, 4 Jan 2019 00:27:01 -0600 Subject: [PATCH] Handle old 64x32 skins while still handling new ones --- DynmapCore/src/main/java/org/dynmap/PlayerFaces.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/DynmapCore/src/main/java/org/dynmap/PlayerFaces.java b/DynmapCore/src/main/java/org/dynmap/PlayerFaces.java index 5b4e72da..736d66da 100644 --- a/DynmapCore/src/main/java/org/dynmap/PlayerFaces.java +++ b/DynmapCore/src/main/java/org/dynmap/PlayerFaces.java @@ -62,10 +62,13 @@ public class PlayerFaces { { int[] l1 = new int[w * h]; int[] l2 = new int[w * h]; + int imgh = srcimg.getHeight(); // Read layer 1 - srcimg.getRGB(layer1x, layer1y, w, h, l1, 0, w); + if (imgh >= (layer1y+h)) + srcimg.getRGB(layer1x, layer1y, w, h, l1, 0, w); // Read layer 2 - srcimg.getRGB(layer2x, layer2y, w, h, l2, 0, w); + if (imgh >= (layer2y+h)) + srcimg.getRGB(layer2x, layer2y, w, h, l2, 0, w); // Apply layer1 to layer 1 boolean transp = false; int v = l2[0]; @@ -137,7 +140,7 @@ public class PlayerFaces { if(img == null) { /* No image to process? Quit */ return; } - if((img.getWidth() < 64) || (img.getHeight() < 64)) { + if((img.getWidth() < 64) || (img.getHeight() < 32)) { img.flush(); return; }