Class GeckoAPI

    • Method Detail

      • getAnimatable

        public IGeckoAnimatable getAnimatable​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc)
        Description copied from class: AbstractGeckoAPI
        Get the animation configuration interface for an NPC.
        Specified by:
        getAnimatable in class AbstractGeckoAPI
        Parameters:
        npc - The NPC to get animation config for
        Returns:
        The animatable interface for this NPC
      • getAnimationList

        public String[] getAnimationList​(String animationFile)
        Description copied from class: AbstractGeckoAPI
        Get a list of all animation names in an animation file.
        Specified by:
        getAnimationList in class AbstractGeckoAPI
        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
      • getAnimation

        public IGeckoAnimation getAnimation​(String animationFile,
                                            String animationName)
        Description copied from class: AbstractGeckoAPI
        Get animation metadata from a loaded animation file.
        Specified by:
        getAnimation in class AbstractGeckoAPI
        Parameters:
        animationFile - The animation file resource location
        animationName - The animation name within the file
        Returns:
        The animation metadata, or null if not found
      • colorOfRGB

        public IGeckoColor colorOfRGB​(int r,
                                      int g,
                                      int b)
        Description copied from class: AbstractGeckoAPI
        Create a color from RGB components.
        Specified by:
        colorOfRGB in class AbstractGeckoAPI
        Parameters:
        r - Red component (0-255)
        g - Green component (0-255)
        b - Blue component (0-255)
        Returns:
        A new color
      • colorOfRGBA

        public IGeckoColor colorOfRGBA​(int r,
                                       int g,
                                       int b,
                                       int a)
        Description copied from class: AbstractGeckoAPI
        Create a color from RGBA components.
        Specified by:
        colorOfRGBA in class AbstractGeckoAPI
        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 void setModel​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc,
                             String model)
        Description copied from class: AbstractGeckoAPI
        Set the geo model resource location for an NPC.
        Specified by:
        setModel in class AbstractGeckoAPI
        Parameters:
        npc - The target NPC
        model - The model path (e.g. "geckolib3:geo/npc.geo.json")
      • setTexture

        public void setTexture​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc,
                               String texture)
        Description copied from class: AbstractGeckoAPI
        Set the texture resource location for an NPC.
        Specified by:
        setTexture in class AbstractGeckoAPI
        Parameters:
        npc - The target NPC
        texture - The texture path
      • setAnimationFile

        public void setAnimationFile​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc,
                                     String animation)
        Description copied from class: AbstractGeckoAPI
        Set the animation file resource location for an NPC.
        Specified by:
        setAnimationFile in class AbstractGeckoAPI
        Parameters:
        npc - The target NPC
        animation - The animation file path
      • setIdleAnimation

        public void setIdleAnimation​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc,
                                     String animation)
        Description copied from class: AbstractGeckoAPI
        Set the idle animation name for an NPC.
        Specified by:
        setIdleAnimation in class AbstractGeckoAPI
        Parameters:
        npc - The target NPC
        animation - The animation name from the animation file
      • syncAnimForPlayer

        public void syncAnimForPlayer​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc,
                                      IGeckoAnimationBuilder builder,
                                      IPlayer<net.minecraft.entity.player.EntityPlayerMP> player)
        Description copied from class: AbstractGeckoAPI
        Sync an animation to a specific player for an NPC.
        Specified by:
        syncAnimForPlayer in class AbstractGeckoAPI
        Parameters:
        npc - The NPC to play the animation on
        builder - The animation builder with queued animations
        player - The player to send the animation to
      • syncAnimForAll

        public void syncAnimForAll​(ICustomNpc<noppes.npcs.entity.EntityNPCInterface> npc,
                                   IGeckoAnimationBuilder builder)
        Description copied from class: AbstractGeckoAPI
        Sync an animation to all players for an NPC.
        Specified by:
        syncAnimForAll in class AbstractGeckoAPI
        Parameters:
        npc - The NPC to play the animation on
        builder - The animation builder with queued animations
      • setModel

        public void setModel​(IBlockScripted scriptedBlock,
                             String model)
        Description copied from class: AbstractGeckoAPI
        Set the geo model resource location for a scripted block.
        Specified by:
        setModel in class AbstractGeckoAPI
        Parameters:
        scriptedBlock - The target block
        model - The model path
      • setTexture

        public void setTexture​(IBlockScripted scriptedBlock,
                               String texture)
        Description copied from class: AbstractGeckoAPI
        Set the texture resource location for a scripted block.
        Specified by:
        setTexture in class AbstractGeckoAPI
        Parameters:
        scriptedBlock - The target block
        texture - The texture path
      • setAnimationFile

        public void setAnimationFile​(IBlockScripted scriptedBlock,
                                     String animation)
        Description copied from class: AbstractGeckoAPI
        Set the animation file resource location for a scripted block.
        Specified by:
        setAnimationFile in class AbstractGeckoAPI
        Parameters:
        scriptedBlock - The target block
        animation - The animation file path
      • setIdleAnimation

        public void setIdleAnimation​(IBlockScripted scriptedBlock,
                                     String animation)
        Description copied from class: AbstractGeckoAPI
        Set the idle animation name for a scripted block.
        Specified by:
        setIdleAnimation in class AbstractGeckoAPI
        Parameters:
        scriptedBlock - The target block
        animation - The animation name from the animation file
      • syncAnimForPlayer

        public void syncAnimForPlayer​(IBlockScripted scriptedBlock,
                                      IGeckoAnimationBuilder builder,
                                      IPlayer<net.minecraft.entity.player.EntityPlayerMP> player)
        Description copied from class: AbstractGeckoAPI
        Sync an animation to a specific player for a scripted block.
        Specified by:
        syncAnimForPlayer in class AbstractGeckoAPI
        Parameters:
        scriptedBlock - The block to play the animation on
        builder - The animation builder with queued animations
        player - The player to send the animation to
      • setItemModel

        public void setItemModel​(IItemCustomizable item,
                                 String model)
        Description copied from class: AbstractGeckoAPI
        Set the geo model resource location for a customizable item. Works with both Scripted Items and Linked Items.
        Specified by:
        setItemModel in class AbstractGeckoAPI
        Parameters:
        item - The item (IItemCustom or IItemLinked from event.item or API)
        model - The model path (e.g. "geckolib3:geo/mymodel.geo.json")
      • setItemTexture

        public void setItemTexture​(IItemCustomizable item,
                                   String texture)
        Description copied from class: AbstractGeckoAPI
        Set the texture resource location for a customizable item.
        Specified by:
        setItemTexture in class AbstractGeckoAPI
        Parameters:
        item - The item
        texture - The texture path (e.g. "geckolib3:textures/item/mytexture.png")
      • setItemAnimationFile

        public void setItemAnimationFile​(IItemCustomizable item,
                                         String animation)
        Description copied from class: AbstractGeckoAPI
        Set the animation file resource location for a customizable item.
        Specified by:
        setItemAnimationFile in class AbstractGeckoAPI
        Parameters:
        item - The item
        animation - The animation file path (e.g. "geckolib3:animations/mymodel.animation.json")
      • hasItemModel

        public boolean hasItemModel​(IItemCustomizable item)
        Description copied from class: AbstractGeckoAPI
        Check if a customizable item has a gecko model assigned.
        Specified by:
        hasItemModel in class AbstractGeckoAPI
        Parameters:
        item - The item to check
        Returns:
        true if the item has a custom gecko model
      • setDisplayJSON

        public void setDisplayJSON​(IItemCustomizable item,
                                   String displayFile)
        Description copied from class: AbstractGeckoAPI
        Set the display JSON file for a gecko item. The file is loaded from assets/{domain}/item_displays/ folders. This controls how the 3D model is positioned, rotated, and scaled in each render context (first person, third person, inventory, ground).

        Example: GeckoAPI.setDisplayJSON(item, "sword.json")

        Specified by:
        setDisplayJSON in class AbstractGeckoAPI
        Parameters:
        item - The item to set the display JSON on
        displayFile - The display JSON filename (e.g. "sword.json")
      • setItemDisplay

        public void setItemDisplay​(IItemCustomizable item,
                                   String context,
                                   float tx,
                                   float ty,
                                   float tz,
                                   float rx,
                                   float ry,
                                   float rz,
                                   float sx,
                                   float sy,
                                   float sz)
        Description copied from class: AbstractGeckoAPI
        Set the display transform for a specific render context on a gecko item. This controls how the 3D model is positioned, rotated, and scaled when rendered in that context.

        If no per-context transform is set, the item's existing rotation/scale/translate properties are used as fallback.

        Specified by:
        setItemDisplay in class AbstractGeckoAPI
        Parameters:
        item - The item to set the display transform on
        context - The render context: "first_person", "third_person", "inventory", or "ground"
        tx - Translation X
        ty - Translation Y
        tz - Translation Z
        rx - Rotation X (degrees)
        ry - Rotation Y (degrees)
        rz - Rotation Z (degrees)
        sx - Scale X
        sy - Scale Y
        sz - Scale Z