From 7682534f6fd139b75f24c79b76098fe05f0fa0fe Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sat, 11 May 2024 03:28:05 +0200 Subject: Add custom global textures --- .../nea/firmament/events/BakeExtraModelsEvent.kt | 21 +++++++++++++++++++++ .../moe/nea/firmament/events/ClientStartedEvent.kt | 11 +++++++++++ .../firmament/events/EarlyResourceReloadEvent.kt | 15 +++++++++++++++ .../events/FinalizeResourceManagerEvent.kt | 15 +++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 src/main/kotlin/moe/nea/firmament/events/BakeExtraModelsEvent.kt create mode 100644 src/main/kotlin/moe/nea/firmament/events/ClientStartedEvent.kt create mode 100644 src/main/kotlin/moe/nea/firmament/events/EarlyResourceReloadEvent.kt create mode 100644 src/main/kotlin/moe/nea/firmament/events/FinalizeResourceManagerEvent.kt (limited to 'src/main/kotlin/moe/nea/firmament/events') diff --git a/src/main/kotlin/moe/nea/firmament/events/BakeExtraModelsEvent.kt b/src/main/kotlin/moe/nea/firmament/events/BakeExtraModelsEvent.kt new file mode 100644 index 0000000..7b74166 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/events/BakeExtraModelsEvent.kt @@ -0,0 +1,21 @@ +/* + * SPDX-FileCopyrightText: 2024 Linnea Gräf + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.events + +import java.util.function.Consumer +import net.minecraft.client.util.ModelIdentifier + +class BakeExtraModelsEvent( + private val addModel: Consumer, +) : FirmamentEvent() { + + fun addModel(modelIdentifier: ModelIdentifier) { + this.addModel.accept(modelIdentifier) + } + + companion object : FirmamentEventBus() +} diff --git a/src/main/kotlin/moe/nea/firmament/events/ClientStartedEvent.kt b/src/main/kotlin/moe/nea/firmament/events/ClientStartedEvent.kt new file mode 100644 index 0000000..151e12d --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/events/ClientStartedEvent.kt @@ -0,0 +1,11 @@ +/* + * SPDX-FileCopyrightText: 2024 Linnea Gräf + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.events + +class ClientStartedEvent : FirmamentEvent() { + companion object : FirmamentEventBus() +} diff --git a/src/main/kotlin/moe/nea/firmament/events/EarlyResourceReloadEvent.kt b/src/main/kotlin/moe/nea/firmament/events/EarlyResourceReloadEvent.kt new file mode 100644 index 0000000..9013aa4 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/events/EarlyResourceReloadEvent.kt @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: 2024 Linnea Gräf + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.events + +import java.util.concurrent.Executor +import net.minecraft.resource.ResourceManager + +data class EarlyResourceReloadEvent(val resourceManager: ResourceManager, val preparationExecutor: Executor) : + FirmamentEvent() { + companion object : FirmamentEventBus() +} diff --git a/src/main/kotlin/moe/nea/firmament/events/FinalizeResourceManagerEvent.kt b/src/main/kotlin/moe/nea/firmament/events/FinalizeResourceManagerEvent.kt new file mode 100644 index 0000000..36b2498 --- /dev/null +++ b/src/main/kotlin/moe/nea/firmament/events/FinalizeResourceManagerEvent.kt @@ -0,0 +1,15 @@ +/* + * SPDX-FileCopyrightText: 2024 Linnea Gräf + * + * SPDX-License-Identifier: GPL-3.0-or-later + */ + +package moe.nea.firmament.events + +import net.minecraft.resource.ReloadableResourceManagerImpl + +data class FinalizeResourceManagerEvent( + val resourceManager: ReloadableResourceManagerImpl, +) : FirmamentEvent() { + companion object : FirmamentEventBus() +} -- cgit