Class VanillaArmatures

java.lang.Object
net.ixdarklord.coolcatcanvas.internal.client.armature.vanilla.VanillaArmatures

public final class VanillaArmatures extends Object
Armatures on vanilla models (VanillaModels). While an entity is extracted, its animator and attachments move on; each time vanilla poses one of its models (the body for its layers, then each model drawn: body, armor), the clips and changes go on top, by part name. A model touched this way is put back before vanilla poses it again, as models are shared by every entity of the kind.

Axes: vanilla models are upside down and mirrored against Blockbench (X and Y flipped), so a pose's X and Y turns and positions change sign; a keyframe's own values then read the same on both, as in Bedrock.

Posing runs several times a frame for every such entity, so it does no lookups by name and allocates nothing: joints are matched to parts once per armature (ModelParts.Binding), and each model keeps one record of what was done to it (VanillaArmatures.Touch), reused every time.

  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    afterPose(net.minecraft.client.model.Model<?> model, Object state)
    After vanilla posed a model for a state: the entity's clips and changes on top.
    static @Nullable Animator
    animator(net.minecraft.world.entity.LivingEntity entity)
    The entity's animator for its vanilla model, made now if it has none: commands for a player seen only in first person (never drawn in the world) still find it.
    static List<Animator>
    The animators of the armatures an entity wears, for server commands aimed at it.
    static void
    beforePose(net.minecraft.client.model.Model<?> model)
    Before vanilla poses a model: undo what was done to it for the last entity.
    static void
    extract(net.minecraft.client.renderer.entity.LivingEntityRenderer<?,?,?> renderer, net.minecraft.world.entity.LivingEntity entity, net.minecraft.client.renderer.entity.state.LivingEntityRenderState state, float partialTick)
     
    static void
    Other animation mods known without registering: the player animation mod Better Combat uses, when loaded.
    static void
    transformRoot(net.minecraft.client.renderer.entity.state.LivingEntityRenderState state, com.mojang.blaze3d.vertex.PoseStack poseStack)
    Moves the whole model by the clips' root joint (root, or body with torso joint names): somersaults, sitting, lying down.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • init

      public static void init()
      Other animation mods known without registering: the player animation mod Better Combat uses, when loaded.
    • extract

      public static void extract(net.minecraft.client.renderer.entity.LivingEntityRenderer<?,?,?> renderer, net.minecraft.world.entity.LivingEntity entity, net.minecraft.client.renderer.entity.state.LivingEntityRenderState state, float partialTick)
    • animator

      @Nullable public static @Nullable Animator animator(net.minecraft.world.entity.LivingEntity entity)
      The entity's animator for its vanilla model, made now if it has none: commands for a player seen only in first person (never drawn in the world) still find it. Null if its kind has no VanillaModel.
    • attachments

      public static List<Animator> attachments(Object owner)
      The animators of the armatures an entity wears, for server commands aimed at it.
    • transformRoot

      public static void transformRoot(net.minecraft.client.renderer.entity.state.LivingEntityRenderState state, com.mojang.blaze3d.vertex.PoseStack poseStack)
      Moves the whole model by the clips' root joint (root, or body with torso joint names): somersaults, sitting, lying down. Called where vanilla scales the model, in its upside-down axes.
    • beforePose

      public static void beforePose(net.minecraft.client.model.Model<?> model)
      Before vanilla poses a model: undo what was done to it for the last entity.
    • afterPose

      public static void afterPose(net.minecraft.client.model.Model<?> model, Object state)
      After vanilla posed a model for a state: the entity's clips and changes on top.