Use readBytes instead of readAllBytes in info.kt

This commit is contained in:
Username404-59 2021-04-13 12:49:03 +02:00
parent 8a1aa2680d
commit 4a470ee779
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
1 changed files with 3 additions and 2 deletions

View File

@ -51,16 +51,17 @@ object ExecObj {
((this.layout) as FlowLayout).alignment = FlowLayout.CENTER
}
}.apply {
// TODO Add text
val iconStream = ExecObj.javaClass.getResourceAsStream("/icon.png")
add(
JLabel(
ImageIcon(
Toolkit.getDefaultToolkit()
.createImage(ExecObj.javaClass.getResourceAsStream("/icon.png")?.readAllBytes())
.createImage(iconStream.readBytes())
.getScaledInstance(256, 256, Image.SCALE_SMOOTH)
)
)
)
iconStream.close()
add(
JLabel("<html>You should install this mod by dropping it into your mods folder, and not by running it.</html>").apply {
font = Font.createFont(Font.TRUETYPE_FONT, ExecObj.javaClass.getResourceAsStream("/font/NotoSans-Regular.ttf")).deriveFont(Font.BOLD, 20F)