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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic com.zigythebird.playeranimcore.animation.AnimationgetAnimation(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> getModAnimations(String modid) Returns the animations of a specific mod/namespace.static net.minecraft.resources.IdentifiergetModelId(net.minecraft.resources.Identifier animationId) static booleanhasAnimation(net.minecraft.resources.Identifier id) voidonResourceManagerReload(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, waitMethods inherited from interface net.minecraft.server.packs.resources.PreparableReloadListener
getName, prepareSharedStateMethods 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
-
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.jsonfile that declared this animation, ornullif 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:
onResourceManagerReloadin interfacenet.minecraft.server.packs.resources.ResourceManagerReloadListener
-