From 22f0cc59a2d3bc7900764e3916c670075ff9d35e Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sun, 3 Nov 2024 01:24:24 +0100 Subject: 1.21.3 WIP --- src/main/kotlin/events/BakeExtraModelsEvent.kt | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/main/kotlin/events/BakeExtraModelsEvent.kt') 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, - private val addAnyModel: Consumer, + private val addAnyModel: BiConsumer, ) : 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() + companion object : FirmamentEventBus() } -- cgit