minecraft-src/net/minecraft/client/model/Model.java
2025-07-04 01:41:11 +03:00

28 lines
1 KiB
Java

package net.minecraft.client.model;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import java.util.function.Function;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.resources.ResourceLocation;
@Environment(EnvType.CLIENT)
public abstract class Model {
protected final Function<ResourceLocation, RenderType> renderType;
public Model(Function<ResourceLocation, RenderType> renderType) {
this.renderType = renderType;
}
public final RenderType renderType(ResourceLocation location) {
return (RenderType)this.renderType.apply(location);
}
public abstract void renderToBuffer(PoseStack poseStack, VertexConsumer buffer, int packedLight, int packedOverlay, int color);
public final void renderToBuffer(PoseStack poseStack, VertexConsumer vertexConsumer, int packedLight, int packedOverlay) {
this.renderToBuffer(poseStack, vertexConsumer, packedLight, packedOverlay, -1);
}
}