2025-11-24 22:52:51 +03:00

53 lines
1.5 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* com.mojang.serialization.Codec
*/
package net.minecraft.client.renderer.block.model;
import com.mojang.serialization.Codec;
import java.util.List;
import net.minecraft.client.renderer.block.model.BlockModelPart;
import net.minecraft.client.renderer.block.model.BlockStateModel;
import net.minecraft.client.renderer.block.model.Variant;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.ModelBaker;
import net.minecraft.client.resources.model.ResolvableModel;
import net.minecraft.util.RandomSource;
public class SingleVariant
implements BlockStateModel {
private final BlockModelPart model;
public SingleVariant(BlockModelPart model) {
this.model = model;
}
@Override
public void collectParts(RandomSource random, List<BlockModelPart> output) {
output.add(this.model);
}
@Override
public TextureAtlasSprite particleIcon() {
return this.model.particleIcon();
}
public record Unbaked(Variant variant) implements BlockStateModel.Unbaked
{
public static final Codec<Unbaked> CODEC = Variant.CODEC.xmap(Unbaked::new, Unbaked::variant);
@Override
public BlockStateModel bake(ModelBaker modelBakery) {
return new SingleVariant(this.variant.bake(modelBakery));
}
@Override
public void resolveDependencies(ResolvableModel.Resolver resolver) {
this.variant.resolveDependencies(resolver);
}
}
}