aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-16 13:14:35 +0200
committerhannibal2 <24389977+hannibal00212@users.noreply.github.com>2022-09-16 13:14:35 +0200
commit592c0ce1b000344c747633487be315c4a6a0ce35 (patch)
tree37221c5e50bc2cc85dceed0f9dcfda69af45415b
parent6a3fe70fff8c617e59775c353f37a48273b7962a (diff)
downloadskyhanni-592c0ce1b000344c747633487be315c4a6a0ce35.tar.gz
skyhanni-592c0ce1b000344c747633487be315c4a6a0ce35.tar.bz2
skyhanni-592c0ce1b000344c747633487be315c4a6a0ce35.zip
fixed vanilla items not being sellable to npc
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/VanillaItemManager.kt16
1 files changed, 7 insertions, 9 deletions
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<String> = ArrayList()
+ private val vanillaItems: MutableList<String> = 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
}