Ears (+ Snouts/Muzzles, Tails, Horns, Wings, and More)

Ears (+ Snouts/Muzzles, Tails, Horns, Wings, and More)

1M Downloads

[Suggestion] Option to disable overlay layers

AntyMew opened this issue ยท 3 comments

commented

Currently, making a skin look right both with and without the mod requires duplicating body parts. This looks bizarre with some body parts, especially the ears, tail, and wings. They usually end up on the overlay layers on vanilla skins anyways, so why not let them be disabled for the best of both worlds?

commented

Really? I'm having trouble finding it in the source code, pray tell where I can find it?

commented

There is a currently undocumented and inaccessible through the manipulator feature for removing sections of the skin for this exact purpose.

commented

I believe it is here:

public static AlfalfaData preprocessSkin(WritableEarsImage img) {
AlfalfaData a = Alfalfa.read(img);
Slice erase = a.data.get("erase");
if (erase != null) {
BitInputStream bis = new BitInputStream(new ByteArrayInputStream(erase.toByteArray()));
int count = 0;
try {
while (true) {
int x = bis.read(6); // 0-63
int y = bis.read(6);
int w = bis.read(5)+1; // 1-32
int h = bis.read(5)+1;
for (int xi = x; xi < x+w; xi++) {
for (int yi = y; yi < y+h; yi++) {
img.setARGB(xi, yi, 0);
}
}
count++;
}
} catch (EOFException e) {
} catch (IOException e) {
EarsLog.debug(EarsLog.Tag.COMMON_FEATURES, "Exception while parsing eraser data", e);
}
EarsLog.debug(EarsLog.Tag.COMMON_FEATURES, "Discovered and applied {} eraser rectangle{}", count, count == 1 ? "" : "s");
} else {
EarsLog.debug(EarsLog.Tag.COMMON_FEATURES, "Discovered no eraser data");
}
return a;
}

I personally have no idea how to enable the regions manually, but Una would know.