use of io.github.ocelot.molangcompiler.api.bridge.MolangVariableProvider in project pollen by MoonflowerTeam.
the class AnimatedGeometryEntityModel method setupAnim.
@Override
public void setupAnim(T entity, float limbSwing, float limbSwingAmount, float animationTicks, float netHeadYaw, float headPitch) {
GeometryModel model = this.getModel();
model.resetTransformation();
if (model instanceof AnimatedModel && this.animations.length > 0) {
ProfilerFiller profiler = Minecraft.getInstance().getProfiler();
profiler.push("createMolangRuntime");
MolangRuntime.Builder builder = this.createRuntime(entity, limbSwing, limbSwingAmount, netHeadYaw, headPitch);
if (entity instanceof MolangVariableProvider)
builder.setVariables((MolangVariableProvider) entity);
if (this.variableProvider != null)
builder.setVariables(this.variableProvider);
profiler.popPush("applyMolangAnimation");
((AnimatedModel) model).applyAnimations(animationTicks / 20F, builder, this.getAnimations());
profiler.pop();
}
}
Aggregations