Package com.goodbird.npcgecko.api
Interface IGeckoAnimationBuilder
-
public interface IGeckoAnimationBuilderBuilder interface for constructing animation sequences. Follows the builder pattern where all methods return this builder for chaining.Create an instance via
AbstractGeckoAPI.createAnimationBuilder().Usage example:
var builder = gecko.createAnimationBuilder(); builder.playOnce("animation.npc.attack").loop("animation.npc.idle"); gecko.syncAnimForAll(npc, builder);- See Also:
AbstractGeckoAPI.createAnimationBuilder(),AbstractGeckoAPI.syncAnimForAll(noppes.npcs.api.entity.ICustomNpc<noppes.npcs.entity.EntityNPCInterface>, com.goodbird.npcgecko.api.IGeckoAnimationBuilder),AbstractGeckoAPI.syncAnimForPlayer(noppes.npcs.api.entity.ICustomNpc<noppes.npcs.entity.EntityNPCInterface>, com.goodbird.npcgecko.api.IGeckoAnimationBuilder, noppes.npcs.api.entity.IPlayer<net.minecraft.entity.player.EntityPlayerMP>)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IGeckoAnimationBuilderaddAnimation(String animationName)Add an animation to the queue using the default loop behavior defined in the animation file.IGeckoAnimationBuilderaddRepeatingAnimation(String animationName, int timesToRepeat)Add an animation to the queue that repeats a specified number of times.IGeckoAnimationBuilderclearAnimations()Clear all animations currently queued in this builder.IGeckoAnimationBuilderloop(String animationName)Add an animation that loops indefinitely until replaced by another animation.IGeckoAnimationBuilderplayAndHold(String animationName)Add an animation that plays once and holds on the last frame.IGeckoAnimationBuilderplayOnce(String animationName)Add an animation that plays once, then advances to the next in the queue.
-
-
-
Method Detail
-
playOnce
IGeckoAnimationBuilder playOnce(String animationName)
Add an animation that plays once, then advances to the next in the queue.- Parameters:
animationName- the animation name as defined in the Blockbench animation file- Returns:
- this builder for chaining
-
loop
IGeckoAnimationBuilder loop(String animationName)
Add an animation that loops indefinitely until replaced by another animation.- Parameters:
animationName- the animation name as defined in the Blockbench animation file- Returns:
- this builder for chaining
-
playAndHold
IGeckoAnimationBuilder playAndHold(String animationName)
Add an animation that plays once and holds on the last frame.- Parameters:
animationName- the animation name as defined in the Blockbench animation file- Returns:
- this builder for chaining
-
addAnimation
IGeckoAnimationBuilder addAnimation(String animationName)
Add an animation to the queue using the default loop behavior defined in the animation file.- Parameters:
animationName- the animation name as defined in the Blockbench animation file- Returns:
- this builder for chaining
-
addRepeatingAnimation
IGeckoAnimationBuilder addRepeatingAnimation(String animationName, int timesToRepeat)
Add an animation to the queue that repeats a specified number of times.- Parameters:
animationName- the animation name as defined in the Blockbench animation filetimesToRepeat- how many times to repeat the animation- Returns:
- this builder for chaining
-
clearAnimations
IGeckoAnimationBuilder clearAnimations()
Clear all animations currently queued in this builder.- Returns:
- this builder for chaining
-
-