aboutsummaryrefslogtreecommitdiff
path: root/src/main/kotlin/events/BakeExtraModelsEvent.kt
blob: adaa49558b76739e122f7668f97eeb2441e457b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package moe.nea.firmament.events

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 addAnyModel: BiConsumer<ModelIdentifier, Identifier>,
) : FirmamentEvent() {

	fun addNonItemModel(modelIdentifier: ModelIdentifier, identifier: Identifier) {
		this.addAnyModel.accept(modelIdentifier, identifier)
	}

	fun addItemModel(modelIdentifier: ModelIdentifier) {
		addNonItemModel(
			modelIdentifier,
			modelIdentifier.id.withPrefixedPath(ReferencedModelsCollector.ITEM_DIRECTORY))
	}

	companion object : FirmamentEventBus<BakeExtraModelsEvent>()
}