diff options
| author | Linnea Gräf <nea@nea.moe> | 2025-11-17 19:55:02 +0100 |
|---|---|---|
| committer | Linnea Gräf <nea@nea.moe> | 2025-11-17 19:55:02 +0100 |
| commit | c93a04a001b0f66b2724d46b04b6d1ed49a08d07 (patch) | |
| tree | 5869ca70acc482ef0362f27785c3d3f1cbb9ffae /src/main/kotlin/util/LoadResource.kt | |
| parent | af9893b59407c69d31ebd2ed513f0396ab4d2dc9 (diff) | |
| download | Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.gz Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.tar.bz2 Firmament-c93a04a001b0f66b2724d46b04b6d1ed49a08d07.zip | |
refactor: port to mojmaps
Diffstat (limited to 'src/main/kotlin/util/LoadResource.kt')
| -rw-r--r-- | src/main/kotlin/util/LoadResource.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/kotlin/util/LoadResource.kt b/src/main/kotlin/util/LoadResource.kt index 4bc8704..d3a7ac2 100644 --- a/src/main/kotlin/util/LoadResource.kt +++ b/src/main/kotlin/util/LoadResource.kt @@ -4,17 +4,17 @@ package moe.nea.firmament.util import java.io.InputStream import kotlin.io.path.inputStream import kotlin.jvm.optionals.getOrNull -import net.minecraft.util.Identifier +import net.minecraft.resources.ResourceLocation import moe.nea.firmament.repo.RepoDownloadManager -fun Identifier.openFirmamentResource(): InputStream { +fun ResourceLocation.openFirmamentResource(): InputStream { val resource = MC.resourceManager.getResource(this).getOrNull() if (resource == null) { if (namespace == "neurepo") return RepoDownloadManager.repoSavedLocation.resolve(path).inputStream() error("Could not read resource $this") } - return resource.inputStream + return resource.open() } |
