From 592c0ce1b000344c747633487be315c4a6a0ce35 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 16 Sep 2022 13:14:35 +0200 Subject: fixed vanilla items not being sellable to npc --- .../at/hannibal2/skyhanni/data/VanillaItemManager.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/main') diff --git a/src/main/java/at/hannibal2/skyhanni/data/VanillaItemManager.kt b/src/main/java/at/hannibal2/skyhanni/data/VanillaItemManager.kt index a61548309..f2bcd51ca 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/VanillaItemManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/VanillaItemManager.kt @@ -8,15 +8,13 @@ import java.io.FileInputStream import java.io.InputStreamReader import java.nio.charset.StandardCharsets -class VanillaItemManager { +object VanillaItemManager { private val gson = GsonBuilder().setPrettyPrinting().create() - companion object { - private val vanillaItems: MutableList = ArrayList() + private val vanillaItems: MutableList = ArrayList() - fun isVanillaItem(internalName: String): Boolean { - return vanillaItems.contains(internalName) - } + fun isVanillaItem(internalName: String): Boolean { + return vanillaItems.contains(internalName) } init { @@ -43,9 +41,9 @@ class VanillaItemManager { private fun getJsonFromFile(file: File): JsonObject? { try { - BufferedReader(InputStreamReader(FileInputStream(file), - StandardCharsets.UTF_8 - )).use { reader -> return gson.fromJson(reader, JsonObject::class.java) } + BufferedReader( + InputStreamReader(FileInputStream(file), StandardCharsets.UTF_8) + ).use { reader -> return gson.fromJson(reader, JsonObject::class.java) } } catch (e: Exception) { return null } -- cgit