From 10fb067de2fcd4f068fa77ace0c30ebce7b86ee2 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Tue, 26 May 2020 17:48:10 +0200 Subject: [PATCH] Fix Java 8 --- .../leveleditor/api/editor/sprites/SpriteRegister.scala | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/scala/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.scala b/src/main/scala/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.scala index 9dc343f..f641ef9 100644 --- a/src/main/scala/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.scala +++ b/src/main/scala/fr/ynerant/leveleditor/api/editor/sprites/SpriteRegister.scala @@ -11,6 +11,7 @@ import javax.imageio.ImageIO import net.liftweb.json._ import scala.collection.mutable.ListBuffer +import scala.io.Source object SpriteRegister { private var nameToCoords = Map(): Map[String, List[List[Int]]] @@ -77,7 +78,7 @@ object SpriteRegister { try { val f = new File(assetsDir.getAbsolutePath + "/" + asset + "/textures/sprites") assert(f.isDirectory || f.mkdirs) - val json = Files.readString(new File(f, "sprites.json").toPath) + val json = Source.fromFile(new File(f, "sprites.json")).mkString implicit val formats: DefaultFormats.type = DefaultFormats nameToCoords = parse(json).extract[Map[String, List[List[Int]]]] nameToCoords.keySet.foreach(key => {