Make this more readable with the base colors

This commit is contained in:
KennyTV 2020-06-30 12:41:09 +02:00
parent 478e663506
commit 63d3dcb31b
No known key found for this signature in database
GPG Key ID: 6BE3B555EBC5982B

View File

@ -235,31 +235,31 @@ public class BlockItemPackets1_16 extends nl.matsv.viabackwards.api.rewriters.It
wrapper.passthrough(Type.BYTE); // Z
byte[] data = wrapper.passthrough(Type.BYTE_ARRAY_PRIMITIVE);
for (int i = 0; i < data.length; i++) {
int color = data[i] & 0xFF;
int color = (data[i] & 0xFF) / 4;
int newColor = -1;
switch (color) {
case 208:
newColor = 112;
case 52:
newColor = 28;
break;
case 212:
newColor = 152;
case 53:
newColor = 38;
break;
case 216:
newColor = 140;
case 54:
newColor = 35;
break;
case 220:
newColor = 128;
case 55:
newColor = 32;
break;
case 224:
case 232:
newColor = 92;
case 56:
case 58:
newColor = 23;
break;
case 228:
newColor = 96;
case 57:
newColor = 24;
break;
}
if (newColor != -1) {
data[i] = (byte) newColor;
data[i] = (byte) (newColor * 4);
}
}
});