54 lines
1.9 KiB
Java
54 lines
1.9 KiB
Java
/*
|
|
* Decompiled with CFR 0.152.
|
|
*
|
|
* Could not load the following classes:
|
|
* com.mojang.serialization.MapCodec
|
|
* org.jspecify.annotations.Nullable
|
|
*/
|
|
package net.minecraft.client.renderer.item;
|
|
|
|
import com.mojang.serialization.MapCodec;
|
|
import net.minecraft.client.multiplayer.ClientLevel;
|
|
import net.minecraft.client.renderer.item.ItemModel;
|
|
import net.minecraft.client.renderer.item.ItemModelResolver;
|
|
import net.minecraft.client.renderer.item.ItemStackRenderState;
|
|
import net.minecraft.client.resources.model.ResolvableModel;
|
|
import net.minecraft.world.entity.ItemOwner;
|
|
import net.minecraft.world.item.BundleItem;
|
|
import net.minecraft.world.item.ItemDisplayContext;
|
|
import net.minecraft.world.item.ItemStack;
|
|
import org.jspecify.annotations.Nullable;
|
|
|
|
public class BundleSelectedItemSpecialRenderer
|
|
implements ItemModel {
|
|
private static final ItemModel INSTANCE = new BundleSelectedItemSpecialRenderer();
|
|
|
|
@Override
|
|
public void update(ItemStackRenderState output, ItemStack item, ItemModelResolver resolver, ItemDisplayContext displayContext, @Nullable ClientLevel level, @Nullable ItemOwner owner, int seed) {
|
|
output.appendModelIdentityElement(this);
|
|
ItemStack selectedItemStack = BundleItem.getSelectedItemStack(item);
|
|
if (!selectedItemStack.isEmpty()) {
|
|
resolver.appendItemLayers(output, selectedItemStack, displayContext, level, owner, seed);
|
|
}
|
|
}
|
|
|
|
public record Unbaked() implements ItemModel.Unbaked
|
|
{
|
|
public static final MapCodec<Unbaked> MAP_CODEC = MapCodec.unit((Object)new Unbaked());
|
|
|
|
public MapCodec<Unbaked> type() {
|
|
return MAP_CODEC;
|
|
}
|
|
|
|
@Override
|
|
public ItemModel bake(ItemModel.BakingContext context) {
|
|
return INSTANCE;
|
|
}
|
|
|
|
@Override
|
|
public void resolveDependencies(ResolvableModel.Resolver resolver) {
|
|
}
|
|
}
|
|
}
|
|
|