use of gg.moonflower.pollen.core.client.entitlement.RenderableCosmetic in project pollen by MoonflowerTeam.
the class PollenCosmeticLayer method render.
@Override
public void render(PoseStack matrixStack, MultiBufferSource buffer, int packedLight, T entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch) {
if (GeometryTextureManager.isReloading() || GeometryModelManager.isReloading())
return;
EntitlementManager.getEntitlements(entity.getUUID()).forEach(entitlement -> {
if (entitlement instanceof RenderableCosmetic) {
RenderableCosmetic cosmetic = (RenderableCosmetic) entitlement;
if (!cosmetic.isEnabled())
return;
ResourceLocation modelName = cosmetic.getModelKey();
if (modelName == null)
return;
GeometryModel model = GeometryModelManager.getModel(modelName);
ResourceLocation textureKey = cosmetic.getTextureKey();
if (model == GeometryModel.EMPTY || textureKey == null)
return;
GeometryModelRenderer.copyModelAngles(this.getParentModel(), model);
GeometryModelRenderer.render(model, textureKey, buffer, matrixStack, packedLight, OverlayTexture.NO_OVERLAY, cosmetic.getRed(), cosmetic.getGreen(), cosmetic.getBlue(), cosmetic.getAlpha());
}
});
}
Aggregations