use of net.sistr.littlemaidmodelloader.maidmodel.ModelMultiBase in project LittleMaidModelLoader-Fabric by SistrScarlet.
the class MultiModelRenderer method render.
@Override
public void render(T livingEntity, float entityYaw, float partialTicks, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light) {
Profiler profiler = MinecraftClient.getInstance().getProfiler();
profiler.push("littlemaidmodelloader:mm");
livingEntity.getModel(IHasMultiModel.Layer.SKIN, IHasMultiModel.Part.HEAD).filter(model -> model instanceof ModelMultiBase).ifPresent(model -> syncCaps(livingEntity, (ModelMultiBase) model, partialTicks));
for (IHasMultiModel.Part part : IHasMultiModel.Part.values()) {
livingEntity.getModel(IHasMultiModel.Layer.INNER, part).filter(model -> model instanceof ModelMultiBase).ifPresent(model -> syncCaps(livingEntity, (ModelMultiBase) model, partialTicks));
livingEntity.getModel(IHasMultiModel.Layer.OUTER, part).filter(model -> model instanceof ModelMultiBase).ifPresent(model -> syncCaps(livingEntity, (ModelMultiBase) model, partialTicks));
}
super.render(livingEntity, entityYaw, partialTicks, matrixStack, vertexConsumerProvider, light);
profiler.pop();
}
use of net.sistr.littlemaidmodelloader.maidmodel.ModelMultiBase in project LittleMaidModelLoader-Fabric by SistrScarlet.
the class LMModelManager method addModel.
public void addModel(String modelName, Class<? extends ModelMultiBase> modelClass) {
try {
Constructor<? extends ModelMultiBase> constructor = modelClass.getConstructor(float.class);
ModelMultiBase skin = constructor.newInstance(0.0F);
float[] size = skin.getArmorModelsSize();
ModelMultiBase inner = constructor.newInstance(size[0]);
ModelMultiBase outer = constructor.newInstance(size[1]);
models.put(modelName.toLowerCase(), new ModelHolder(skin, inner, outer));
} catch (Exception e) {
LOGGER.debug("インスタンス化に失敗しました。抽象クラスまたは非対応のモデルである可能性があります。 : " + modelClass);
e.printStackTrace();
return;
}
if (LMMLConfig.isDebugMode())
LOGGER.debug("Loaded Model : " + modelClass);
}
Aggregations