37 lines
1.1 KiB
Java
37 lines
1.1 KiB
Java
package net.minecraft.client.model;
|
|
|
|
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;
|
|
import net.minecraft.world.entity.Entity;
|
|
|
|
@Environment(EnvType.CLIENT)
|
|
public abstract class EntityModel<T extends Entity> extends Model {
|
|
public float attackTime;
|
|
public boolean riding;
|
|
public boolean young = true;
|
|
|
|
protected EntityModel() {
|
|
this(RenderType::entityCutoutNoCull);
|
|
}
|
|
|
|
protected EntityModel(Function<ResourceLocation, RenderType> renderType) {
|
|
super(renderType);
|
|
}
|
|
|
|
/**
|
|
* Sets this entity's model rotation angles
|
|
*/
|
|
public abstract void setupAnim(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch);
|
|
|
|
public void prepareMobModel(T entity, float limbSwing, float limbSwingAmount, float partialTick) {
|
|
}
|
|
|
|
public void copyPropertiesTo(EntityModel<T> otherModel) {
|
|
otherModel.attackTime = this.attackTime;
|
|
otherModel.riding = this.riding;
|
|
otherModel.young = this.young;
|
|
}
|
|
}
|