Skip to content

Commit

Permalink
Make render layers work on other entities than just humanoid ones
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucraft committed Jan 19, 2025
1 parent 1c75763 commit f117ac1
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,12 @@ public PackRenderLayer(SkinTypedValue<ModelTypes.Model> model, SkinTypedValue<Dy
public void render(DataContext context, PoseStack poseStack, MultiBufferSource bufferSource, EntityModel<Entity> parentModel, int packedLight, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
var entity = context.getEntity();
if (IPackRenderLayer.conditionsFulfilled(entity, this.conditions, this.thirdPersonConditions) && this.modelLookup.get(entity).fitsEntity(entity, parentModel)) {
EntityModel<?> entityModel = this.model.get(entity).getModel(context, this.modelLookup.get(entity));
EntityModel entityModel = this.model.get(entity).getModel(context, this.modelLookup.get(entity));

if (entityModel instanceof HumanoidModel entityHumanoidModel && parentModel instanceof HumanoidModel parentHumanoid) {
IPackRenderLayer.copyModelProperties(entity, parentHumanoid, entityHumanoidModel);
} else {
entityModel.setupAnim(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch);
}

if (entityModel instanceof ExtraAnimatedModel extra) {
Expand Down

0 comments on commit f117ac1

Please sign in to comment.