mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-15 17:05:09 +01:00
- MidnightConfig screens can be viewed from a new screen in the minecraft options - Code cleanup - Examples & Documentation - New Methods - Upgrade to 21w19a and Java 16 MidnightConfig v1.0.0: - The config screen no longer shows the entries of all instances of MidnightConfig - Compatible with servers! - Scrollable! - Comment support! - Fresh new design
36 lines
1.3 KiB
Java
Executable File
36 lines
1.3 KiB
Java
Executable File
package eu.midnightdust.hats.tater;
|
|
|
|
import net.minecraft.client.model.*;
|
|
import net.minecraft.client.render.VertexConsumer;
|
|
import net.minecraft.client.render.entity.model.SinglePartEntityModel;
|
|
import net.minecraft.client.util.math.MatrixStack;
|
|
import net.minecraft.entity.LivingEntity;
|
|
|
|
public class TinyPotatoModel <T extends LivingEntity> extends SinglePartEntityModel<T> {
|
|
private final ModelPart tater;
|
|
public TinyPotatoModel(ModelPart root) {
|
|
tater = root;
|
|
tater.setPivot(0.0F, -8.0F, 0.0F);
|
|
}
|
|
|
|
public static ModelData getModelData() {
|
|
ModelData modelData = new ModelData();
|
|
ModelPartData modelPartData = modelData.getRoot();
|
|
modelPartData.addChild("tater", ModelPartBuilder.create().uv(0, 0).cuboid(-2.0F, -6.0F, -2.0F, 4.0F, 6.0F, 4.0F), ModelTransform.NONE);
|
|
|
|
return modelData;
|
|
}
|
|
public ModelPart getPart() {
|
|
return this.tater;
|
|
}
|
|
|
|
@Override
|
|
public void setAngles(T entity, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch){
|
|
//previously the render function, render code was moved to a method below
|
|
}
|
|
@Override
|
|
public void render(MatrixStack matrixStack, VertexConsumer buffer, int packedLight, int packedOverlay, float red, float green, float blue, float alpha){
|
|
|
|
tater.render(matrixStack, buffer, packedLight, packedOverlay);
|
|
}
|
|
} |