Skip to content

Commit

Permalink
Update 1.10.1 to 1.20
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaargolo committed Jul 17, 2023
1 parent 7294d38 commit a4ba6fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -86,7 +87,7 @@ class ItemInfo (
val item: Item,
private val bakedModel: (() -> BakedModel)?,
var containers: List<ContainerInfo<*>>,
private val modelPredicateProviders: (() -> List<Pair<Identifier, UnclampedModelPredicateProvider>>?)?
private val modelPredicateProviders: (() -> List<Pair<Identifier, ClampedModelPredicateProvider>>?)?
){

fun init() {
Expand Down Expand Up @@ -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<ContainerInfo<*>> = listOf(), modelPredicateProviders: (() -> List<Pair<Identifier, UnclampedModelPredicateProvider>>?)? = null): Item {
fun register(identifier: Identifier, item: Item, bakedModel: (() -> BakedModel)? = null, containers: List<ContainerInfo<*>> = listOf(), modelPredicateProviders: (() -> List<Pair<Identifier, ClampedModelPredicateProvider>>?)? = null): Item {
val info = ItemInfo(identifier, item, bakedModel, containers, modelPredicateProviders)
itemRegistry[item] = info
return item
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit a4ba6fa

Please sign in to comment.