java.lang.Object
net.neoforged.neoforge.client.entity.animation.json.AnimationParser

public final class AnimationParser extends Object
A parser for parsing JSON-based entity animation files.
  • Field Details

    • TARGET_CODEC

      private static final com.mojang.serialization.Codec<AnimationTarget> TARGET_CODEC
      invalid @snippet
      {@snippet lang = JSON :
      "minecraft:rotation" }
    • INTERPOLATION_CODEC

      private static final com.mojang.serialization.Codec<AnimationChannel.Interpolation> INTERPOLATION_CODEC
      invalid @snippet
      {@snippet lang = JSON :
      "minecraft:linear" }
    • CHANNEL_CODEC

      public static final com.mojang.serialization.MapCodec<AnimationChannel> CHANNEL_CODEC
      {
        "keyframes": [
          {
            "timestamp": 0.5,
            "target": [22.5, 0.0, 0.0],
            "interpolation": "minecraft:linear"
          }
        ],
        "target": "minecraft:rotation"
      }
      
    • NAMED_CHANNEL_CODEC

      private static final com.mojang.serialization.Codec<it.unimi.dsi.fastutil.Pair<String,AnimationChannel>> NAMED_CHANNEL_CODEC
      {
        "bone": "head",
        "keyframes": [
          {
            "timestamp": 0.5,
            "target": [22.5, 0.0, 0.0],
            "interpolation": "minecraft:linear"
          }
        ],
        "target": "minecraft:rotation"
      }
      
    • CODEC

      public static final com.mojang.serialization.Codec<AnimationDefinition> CODEC
      {
        "length": 1.125,
        "loop": true,
        "animations": [
          {
            "bone": "head",
            "keyframes": [
              {
                "timestamp": 0.5,
                "target": [22.5, 0.0, 0.0],
                "interpolation": "minecraft:linear"
              }
            ]
          }
        ]
      }
      
  • Constructor Details

    • AnimationParser

      private AnimationParser()
  • Method Details

    • keyframeCodec

      static com.mojang.serialization.Codec<Keyframe> keyframeCodec(AnimationTarget target)
      {
        "timestamp": 0.5,
        "target": [22.5, 0.0, 0.0],
        "interpolation": "minecraft:linear"
      }
      
    • keyframeTargetToUnaryOp

      private static UnaryOperator<org.joml.Vector3f> keyframeTargetToUnaryOp(AnimationKeyframeTarget target)