2019-06-30 12:38:36 +02:00
|
|
|
package com.minelittlepony.client;
|
|
|
|
|
2019-07-03 23:26:19 -04:00
|
|
|
import com.minelittlepony.common.event.SkinFilterCallback;
|
|
|
|
import net.minecraft.client.texture.NativeImage;
|
|
|
|
|
|
|
|
import static com.minelittlepony.common.event.SkinFilterCallback.copy;
|
2019-06-30 12:38:36 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Called to convert the legacy 64x32 skins to the new 64x64 format.
|
|
|
|
*
|
|
|
|
* Vanilla components are handle upstream, so all this really has to
|
|
|
|
* do is copy the wing across.
|
|
|
|
*
|
|
|
|
*/
|
2019-11-23 23:19:13 +02:00
|
|
|
class LegacySkinConverter implements SkinFilterCallback {
|
2019-06-30 12:38:36 +02:00
|
|
|
@Override
|
2019-07-03 23:26:19 -04:00
|
|
|
public void processImage(NativeImage image, boolean legacy) {
|
|
|
|
if (legacy) {
|
|
|
|
// ( from ) ( offset ) (size) flipX flipY
|
|
|
|
copy(image, 58, 16, 0, 16, 2, 2, true, false); // top
|
|
|
|
copy(image, 60, 16, 0, 16, 2, 2, true, false); // bottom
|
|
|
|
copy(image, 60, 18, -4, 16, 2, 14, true, false); // inside
|
|
|
|
copy(image, 58, 18, 0, 16, 2, 14, true, false); // back
|
|
|
|
copy(image, 56, 18, 4, 16, 2, 14, true, false); // outside
|
|
|
|
copy(image, 62, 18, 0, 16, 2, 14, true, false); // front
|
|
|
|
}
|
2019-06-30 12:38:36 +02:00
|
|
|
}
|
|
|
|
}
|