diff --git a/src/main/kotlin/io/github/lucaargolo/kibe/items/ItemCompendium.kt b/src/main/kotlin/io/github/lucaargolo/kibe/items/ItemCompendium.kt index 5dce0be..ee57ddf 100644 --- a/src/main/kotlin/io/github/lucaargolo/kibe/items/ItemCompendium.kt +++ b/src/main/kotlin/io/github/lucaargolo/kibe/items/ItemCompendium.kt @@ -29,6 +29,7 @@ import net.fabricmc.fabric.api.client.model.ModelVariantProvider import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType import net.minecraft.client.gui.screen.ingame.HandledScreen import net.minecraft.client.gui.screen.ingame.HandledScreens +import net.minecraft.client.item.ClampedModelPredicateProvider import net.minecraft.client.item.ModelPredicateProviderRegistry import net.minecraft.client.render.model.* import net.minecraft.client.texture.Sprite @@ -86,7 +87,7 @@ class ItemInfo ( val item: Item, private val bakedModel: (() -> BakedModel)?, var containers: List>, - private val modelPredicateProviders: (() -> List>?)? + private val modelPredicateProviders: (() -> List>?)? ){ fun init() { @@ -228,7 +229,7 @@ val BLACK_SLEEPING_BAG = register(Identifier(MOD_ID, "black_sleeping_bag"), Slee val MEASURING_TAPE = register(Identifier(MOD_ID, "measuring_tape"), MeasuringTape(Settings().maxCount(1)), modelPredicateProviders = { listOf(Pair(Identifier(MOD_ID, "extended"), MeasuringTapePredicateProvider())) }) -fun register(identifier: Identifier, item: Item, bakedModel: (() -> BakedModel)? = null, containers: List> = listOf(), modelPredicateProviders: (() -> List>?)? = null): Item { +fun register(identifier: Identifier, item: Item, bakedModel: (() -> BakedModel)? = null, containers: List> = listOf(), modelPredicateProviders: (() -> List>?)? = null): Item { val info = ItemInfo(identifier, item, bakedModel, containers, modelPredicateProviders) itemRegistry[item] = info return item diff --git a/src/main/kotlin/io/github/lucaargolo/kibe/items/miscellaneous/MeasuringTapePredicateProvider.kt b/src/main/kotlin/io/github/lucaargolo/kibe/items/miscellaneous/MeasuringTapePredicateProvider.kt index f8b2001..98888d9 100644 --- a/src/main/kotlin/io/github/lucaargolo/kibe/items/miscellaneous/MeasuringTapePredicateProvider.kt +++ b/src/main/kotlin/io/github/lucaargolo/kibe/items/miscellaneous/MeasuringTapePredicateProvider.kt @@ -1,11 +1,11 @@ package io.github.lucaargolo.kibe.items.miscellaneous -import net.minecraft.client.item.UnclampedModelPredicateProvider +import net.minecraft.client.item.ClampedModelPredicateProvider import net.minecraft.client.world.ClientWorld import net.minecraft.entity.LivingEntity import net.minecraft.item.ItemStack -class MeasuringTapePredicateProvider: UnclampedModelPredicateProvider { +class MeasuringTapePredicateProvider: ClampedModelPredicateProvider { override fun unclampedCall(stack: ItemStack, world: ClientWorld?, entity: LivingEntity?, seed: Int): Float { val nbt = stack.nbt ?: return 0f