Class FpAnimationResources

java.lang.Object
com.github.razorplay01.fp_pal.firstperson.FpAnimationResources
All Implemented Interfaces:
net.minecraft.server.packs.resources.PreparableReloadListener, net.minecraft.server.packs.resources.ResourceManagerReloadListener

public class FpAnimationResources extends Object implements net.minecraft.server.packs.resources.ResourceManagerReloadListener
Cache class for holding loaded Animations for first-person rendering. Loads from assets/modid/fp_animations/*.json
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    net.minecraft.server.packs.resources.PreparableReloadListener.PreparationBarrier, net.minecraft.server.packs.resources.PreparableReloadListener.SharedState, net.minecraft.server.packs.resources.PreparableReloadListener.StateKey<T>
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.Identifier
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.zigythebird.playeranimcore.animation.Animation
    getAnimation(net.minecraft.resources.Identifier id)
    Get an animation from the registry.
    static Optional<com.zigythebird.playeranimcore.animation.Animation>
    getAnimationOptional(net.minecraft.resources.Identifier identifier)
    Get Optional animation from registry.
    static Map<net.minecraft.resources.Identifier, com.zigythebird.playeranimcore.animation.Animation>
     
    static Map<String, com.zigythebird.playeranimcore.animation.Animation>
    Returns the animations of a specific mod/namespace.
    static net.minecraft.resources.Identifier
    getModelId(net.minecraft.resources.Identifier animationId)
     
    static boolean
    hasAnimation(net.minecraft.resources.Identifier id)
     
    void
    onResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager manager)
    Load animations using ResourceManager from fp_animations/ folder.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener

    getName, prepareSharedState

    Methods inherited from interface net.minecraft.server.packs.resources.ResourceManagerReloadListener

    reload
  • Field Details

    • KEY

      public static final net.minecraft.resources.Identifier KEY
  • Constructor Details

    • FpAnimationResources

      public FpAnimationResources()
  • Method Details

    • getAnimation

      @Nullable public static com.zigythebird.playeranimcore.animation.Animation getAnimation(net.minecraft.resources.Identifier id)
      Get an animation from the registry.
    • getAnimationOptional

      @NotNull public static Optional<com.zigythebird.playeranimcore.animation.Animation> getAnimationOptional(@NotNull net.minecraft.resources.Identifier identifier)
      Get Optional animation from registry.
    • getAnimations

      public static Map<net.minecraft.resources.Identifier, com.zigythebird.playeranimcore.animation.Animation> getAnimations()
      Returns:
      an unmodifiable map of all the animations.
    • getModAnimations

      @NotNull public static Map<String, com.zigythebird.playeranimcore.animation.Animation> getModAnimations(@NotNull String modid)
      Returns the animations of a specific mod/namespace.
    • hasAnimation

      public static boolean hasAnimation(net.minecraft.resources.Identifier id)
      Returns:
      Returns true if that animation is available.
    • getModelId

      @Nullable public static net.minecraft.resources.Identifier getModelId(net.minecraft.resources.Identifier animationId)
      Returns:
      the model id inferred from the .animation.json file that declared this animation, or null if the animation is unknown.
    • onResourceManagerReload

      public void onResourceManagerReload(net.minecraft.server.packs.resources.ResourceManager manager)
      Load animations using ResourceManager from fp_animations/ folder.
      Specified by:
      onResourceManagerReload in interface net.minecraft.server.packs.resources.ResourceManagerReloadListener