fix(skin): remove javafx.swing dep.
This commit is contained in:
@@ -1,16 +1,10 @@
|
||||
package moe.mickey.minecraft.skin.fx;
|
||||
|
||||
import javafx.embed.swing.SwingFXUtils;
|
||||
import javafx.scene.image.Image;
|
||||
import javafx.scene.image.PixelReader;
|
||||
import javafx.scene.image.PixelWriter;
|
||||
import javafx.scene.image.WritableImage;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
public final class SkinHelper {
|
||||
|
||||
private SkinHelper() {
|
||||
@@ -128,13 +122,4 @@ public final class SkinHelper {
|
||||
return newSkin;
|
||||
}
|
||||
|
||||
public static void saveToFile(Image image, File output) {
|
||||
BufferedImage buffer = SwingFXUtils.fromFXImage(image, null);
|
||||
try {
|
||||
ImageIO.write(buffer, "png", output);
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user