Package com.goodbird.npcgecko.api
Class AbstractGeckoAPI
- java.lang.Object
-
- com.goodbird.npcgecko.api.AbstractGeckoAPI
-
-
Constructor Summary
Constructors Constructor Description AbstractGeckoAPI()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract IGeckoColorcolorOfRGB(int r, int g, int b)Create a color from RGB components.abstract IGeckoColorcolorOfRGBA(int r, int g, int b, int a)Create a color from RGBA components.abstract IGeckoAnimationBuildercreateAnimationBuilder()Create a new animation builder for constructing animation sequences.abstract IGeckoAnimationBuildercreateAnimBuilder()Create a new animation builder for constructing animation sequences.abstract IGeckoAnimatablegetAnimatable(IBlockScripted scriptedBlock)Get the animation configuration interface for a scripted block.abstract IGeckoAnimatablegetAnimatable(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc)Get the animation configuration interface for an NPC.abstract IGeckoAnimationgetAnimation(String animationFile, String animationName)Get animation metadata from a loaded animation file.abstract String[]getAnimationFileList()Get a list of all loaded animation file resource locations.abstract String[]getAnimationList(String animationFile)Get a list of all animation names in an animation file.static AbstractGeckoAPIInstance()static booleanIsAvailable()abstract voidsetAnimationFile(IBlockScripted scriptedBlock, String animation)Set the animation file resource location for a scripted block.abstract voidsetAnimationFile(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String animation)Set the animation file resource location for an NPC.abstract voidsetIdleAnimation(IBlockScripted scriptedBlock, String animation)Set the idle animation name for a scripted block.abstract voidsetIdleAnimation(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String animation)Set the idle animation name for an NPC.abstract voidsetModel(IBlockScripted scriptedBlock, String model)Set the geo model resource location for a scripted block.abstract voidsetModel(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String model)Set the geo model resource location for an NPC.abstract voidsetTexture(IBlockScripted scriptedBlock, String texture)Set the texture resource location for a scripted block.abstract voidsetTexture(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String texture)Set the texture resource location for an NPC.abstract voidsyncAnimForAll(IBlockScripted scriptedBlock, IGeckoAnimationBuilder builder)Sync an animation to all players for a scripted block.abstract voidsyncAnimForAll(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, IGeckoAnimationBuilder builder)Sync an animation to all players for an NPC.abstract voidsyncAnimForPlayer(IBlockScripted scriptedBlock, IGeckoAnimationBuilder builder, IPlayer<net.minecraft.entity.player.EntityPlayerMP> player)Sync an animation to a specific player for a scripted block.abstract voidsyncAnimForPlayer(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, IGeckoAnimationBuilder builder, IPlayer<net.minecraft.entity.player.EntityPlayerMP> player)Sync an animation to a specific player for an NPC.
-
-
-
Method Detail
-
IsAvailable
public static boolean IsAvailable()
-
Instance
public static AbstractGeckoAPI Instance()
-
createAnimBuilder
public abstract IGeckoAnimationBuilder createAnimBuilder()
Create a new animation builder for constructing animation sequences.- Returns:
- A new animation builder
-
createAnimationBuilder
public abstract IGeckoAnimationBuilder createAnimationBuilder()
Create a new animation builder for constructing animation sequences.- Returns:
- A new animation builder
-
getAnimatable
public abstract IGeckoAnimatable getAnimatable(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc)
Get the animation configuration interface for an NPC.- Parameters:
npc- The NPC to get animation config for- Returns:
- The animatable interface for this NPC
-
getAnimatable
public abstract IGeckoAnimatable getAnimatable(IBlockScripted scriptedBlock)
Get the animation configuration interface for a scripted block.- Parameters:
scriptedBlock- The block to get animation config for- Returns:
- The animatable interface for this block
-
getAnimationList
public abstract String[] getAnimationList(String animationFile)
Get a list of all animation names in an animation file.- Parameters:
animationFile- The animation file resource location (e.g. "npcgecko:animations/geo_npc.animation.json")- Returns:
- Array of animation names, or empty array if file not found
-
getAnimationFileList
public abstract String[] getAnimationFileList()
Get a list of all loaded animation file resource locations.- Returns:
- Array of animation file paths
-
getAnimation
public abstract IGeckoAnimation getAnimation(String animationFile, String animationName)
Get animation metadata from a loaded animation file.- Parameters:
animationFile- The animation file resource locationanimationName- The animation name within the file- Returns:
- The animation metadata, or null if not found
-
colorOfRGB
public abstract IGeckoColor colorOfRGB(int r, int g, int b)
Create a color from RGB components.- Parameters:
r- Red component (0-255)g- Green component (0-255)b- Blue component (0-255)- Returns:
- A new color
-
colorOfRGBA
public abstract IGeckoColor colorOfRGBA(int r, int g, int b, int a)
Create a color from RGBA components.- Parameters:
r- Red component (0-255)g- Green component (0-255)b- Blue component (0-255)a- Alpha component (0-255)- Returns:
- A new color
-
setModel
public abstract void setModel(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String model)
Set the geo model resource location for an NPC.- Parameters:
npc- The target NPCmodel- The model path (e.g. "geckolib3:geo/npc.geo.json")
-
setTexture
public abstract void setTexture(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String texture)
Set the texture resource location for an NPC.- Parameters:
npc- The target NPCtexture- The texture path
-
setAnimationFile
public abstract void setAnimationFile(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String animation)
Set the animation file resource location for an NPC.- Parameters:
npc- The target NPCanimation- The animation file path
-
setIdleAnimation
public abstract void setIdleAnimation(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, String animation)
Set the idle animation name for an NPC.- Parameters:
npc- The target NPCanimation- The animation name from the animation file
-
syncAnimForPlayer
public abstract void syncAnimForPlayer(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, IGeckoAnimationBuilder builder, IPlayer<net.minecraft.entity.player.EntityPlayerMP> player)
Sync an animation to a specific player for an NPC.- Parameters:
npc- The NPC to play the animation onbuilder- The animation builder with queued animationsplayer- The player to send the animation to
-
syncAnimForAll
public abstract void syncAnimForAll(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc, IGeckoAnimationBuilder builder)
Sync an animation to all players for an NPC.- Parameters:
npc- The NPC to play the animation onbuilder- The animation builder with queued animations
-
setModel
public abstract void setModel(IBlockScripted scriptedBlock, String model)
Set the geo model resource location for a scripted block.- Parameters:
scriptedBlock- The target blockmodel- The model path
-
setTexture
public abstract void setTexture(IBlockScripted scriptedBlock, String texture)
Set the texture resource location for a scripted block.- Parameters:
scriptedBlock- The target blocktexture- The texture path
-
setAnimationFile
public abstract void setAnimationFile(IBlockScripted scriptedBlock, String animation)
Set the animation file resource location for a scripted block.- Parameters:
scriptedBlock- The target blockanimation- The animation file path
-
setIdleAnimation
public abstract void setIdleAnimation(IBlockScripted scriptedBlock, String animation)
Set the idle animation name for a scripted block.- Parameters:
scriptedBlock- The target blockanimation- The animation name from the animation file
-
syncAnimForPlayer
public abstract void syncAnimForPlayer(IBlockScripted scriptedBlock, IGeckoAnimationBuilder builder, IPlayer<net.minecraft.entity.player.EntityPlayerMP> player)
Sync an animation to a specific player for a scripted block.- Parameters:
scriptedBlock- The block to play the animation onbuilder- The animation builder with queued animationsplayer- The player to send the animation to
-
syncAnimForAll
public abstract void syncAnimForAll(IBlockScripted scriptedBlock, IGeckoAnimationBuilder builder)
Sync an animation to all players for a scripted block.- Parameters:
scriptedBlock- The block to play the animation onbuilder- The animation builder with queued animations
-
-