aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/events/BakeExtraModelsEvent.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/kotlin/events/BakeExtraModelsEvent.kt')
-rw-r--r--src/main/kotlin/events/BakeExtraModelsEvent.kt25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main/kotlin/events/BakeExtraModelsEvent.kt b/src/main/kotlin/events/BakeExtraModelsEvent.kt
index f75bedc..adaa495 100644
--- a/src/main/kotlin/events/BakeExtraModelsEvent.kt
+++ b/src/main/kotlin/events/BakeExtraModelsEvent.kt
@@ -1,21 +1,24 @@
-
package moe.nea.firmament.events
-import java.util.function.Consumer
+import java.util.function.BiConsumer
+import net.minecraft.client.render.model.ReferencedModelsCollector
import net.minecraft.client.util.ModelIdentifier
+import net.minecraft.util.Identifier
+// TODO: Rename this event, since it is not really directly baking models anymore
class BakeExtraModelsEvent(
- private val addItemModel: Consumer<ModelIdentifier>,
- private val addAnyModel: Consumer<ModelIdentifier>,
+ private val addAnyModel: BiConsumer<ModelIdentifier, Identifier>,
) : FirmamentEvent() {
- fun addNonItemModel(modelIdentifier: ModelIdentifier) {
- this.addAnyModel.accept(modelIdentifier)
- }
+ fun addNonItemModel(modelIdentifier: ModelIdentifier, identifier: Identifier) {
+ this.addAnyModel.accept(modelIdentifier, identifier)
+ }
- fun addItemModel(modelIdentifier: ModelIdentifier) {
- this.addItemModel.accept(modelIdentifier)
- }
+ fun addItemModel(modelIdentifier: ModelIdentifier) {
+ addNonItemModel(
+ modelIdentifier,
+ modelIdentifier.id.withPrefixedPath(ReferencedModelsCollector.ITEM_DIRECTORY))
+ }
- companion object : FirmamentEventBus<BakeExtraModelsEvent>()
+ companion object : FirmamentEventBus<BakeExtraModelsEvent>()
}