Skip to content

Commit

Permalink
Fix classpath loading
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislo27 committed Jul 4, 2019
1 parent cfcfa3c commit 969ce8a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/rhmodding/treasury/model/TreasureCourse.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import kotlin.experimental.and

class TreasureCourse(file: File) {
companion object {
val COURSENAMES: List<String> = Gson().fromJson(File("coursenames.json").readText())
val COURSENAMES: List<String> = Gson().fromJson(this::class.java.classLoader.getResourceAsStream("coursenames.json").readBytes().toString(Charsets.UTF_8))
}
var id: Short
var superHard: Boolean
Expand Down
2 changes: 1 addition & 1 deletion src/main/kotlin/rhmodding/treasury/model/TreasureGroup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ enum class GoalType(val n: Byte) {

data class TreasureGame(var id: Short, var unkPercentage: Byte) {
companion object {
val GAMENAMES: List<String> = Gson().fromJson(File("gamenames.json").readText())
val GAMENAMES: List<String> = Gson().fromJson(this::class.java.classLoader.getResourceAsStream("gamenames.json").readBytes().toString(Charsets.UTF_8))
}

override fun toString(): String {
Expand Down

0 comments on commit 969ce8a

Please sign in to comment.