Interface IFaction


  • public interface IFaction
    • Method Detail

      • getId

        int getId()
        Returns:
        The faction's unique ID
      • getName

        String getName()
        Returns:
        The faction's display name
      • setName

        void setName​(String name)
        Sets the faction's display name.
        Parameters:
        name - The new name
      • setDefaultPoints

        void setDefaultPoints​(int var1)
        Sets the default faction points assigned to new players.
        Parameters:
        var1 - The default point value
      • getDefaultPoints

        int getDefaultPoints()
        Returns:
        The default faction points assigned to new players
      • setFriendlyPoints

        void setFriendlyPoints​(int p)
        Sets the point threshold at or above which a player is considered friendly.
        Parameters:
        p - The friendly point threshold
      • getFriendlyPoints

        int getFriendlyPoints()
        Returns:
        The point threshold at or above which a player is considered friendly
      • setNeutralPoints

        void setNeutralPoints​(int p)
        Sets the point threshold below which a player is considered an enemy.
        Parameters:
        p - The neutral point threshold
      • getNeutralPoints

        int getNeutralPoints()
        Returns:
        The point threshold below which a player is considered an enemy
      • setColor

        void setColor​(int c)
        Sets the faction's display color.
        Parameters:
        c - The color as an RGB integer
      • getColor

        int getColor()
        Returns:
        The faction's display color as an RGB integer
      • playerStatus

        int playerStatus​(IPlayer player)
        Returns the player's standing with this faction.
        Parameters:
        player - The player to check
        Returns:
        1 for friendly, 0 for neutral, -1 for enemy
      • isAggressiveToNpc

        boolean isAggressiveToNpc​(ICustomNpc npc)
        Checks whether this faction is hostile toward the given NPC's faction.
        Parameters:
        npc - The NPC to check against
        Returns:
        True if this faction is aggressive toward the NPC
      • getIsHidden

        boolean getIsHidden()
        Returns:
        Whether this faction is hidden from the player's faction list
      • setIsHidden

        void setIsHidden​(boolean hidden)
        Sets whether this faction is hidden from the player's faction list.
        Parameters:
        hidden - True to hide the faction
      • isPassive

        boolean isPassive()
        Returns:
        Whether NPCs in this faction are passive and will not attack
      • setIsPassive

        void setIsPassive​(boolean passive)
        Sets whether NPCs in this faction are passive.
        Parameters:
        passive - True to make faction NPCs passive
      • attackedByMobs

        boolean attackedByMobs()
        Returns:
        Whether NPCs in this faction can be attacked by hostile mobs
      • setAttackedByMobs

        void setAttackedByMobs​(boolean attacked)
        Sets whether NPCs in this faction can be attacked by hostile mobs.
        Parameters:
        attacked - True to allow mobs to attack faction NPCs
      • isEnemyFaction

        boolean isEnemyFaction​(IFaction faction)
        Checks whether the given faction is an enemy of this faction.
        Parameters:
        faction - The faction to check
        Returns:
        True if the given faction is an enemy
      • getEnemyFactions

        IFaction[] getEnemyFactions()
        Returns:
        An array of all factions that are enemies of this faction
      • addEnemyFaction

        void addEnemyFaction​(IFaction faction)
        Adds a faction as an enemy of this faction.
        Parameters:
        faction - The faction to add as an enemy
      • removeEnemyFaction

        void removeEnemyFaction​(IFaction faction)
        Removes a faction from this faction's enemy list.
        Parameters:
        faction - The faction to remove
      • save

        void save()
        Saves the faction data to the server.