Class AchievementNotifier

java.lang.Object
games.stendhal.server.core.rp.achievement.AchievementNotifier

public final class AchievementNotifier extends Object
Checks for reached achievements and marks them as reached for a player if he has fulfilled them
Author:
madmetzger
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    awardAchievementIfNotYetReached​(Player player, String achievementIdentifier)
    Award a player with an achievement that wasn't yet reached by the player (used for example in the wishing well)
    get()
    singleton accessor method
    com.google.common.collect.ImmutableList<Achievement>
    gets a list of all Achievements
    void
    initializes the achievements that are available and registers the login listener new added achievements are added to the achievements table
    boolean
    Checks if the achievement list has already been populated.
    void
    onAge​(Player player)
    check all achievements for a player that belong to the age category
    void
    onAtkChange​(Player player)
     
    void
    onDefChange​(Player player)
     
    void
    check all achievements for a player that are related to deathmatch
    void
    onFinishQuest​(Player player)
    check all achievements for a player that are relevant on finishing a quest
    void
    onItemLoot​(Player player)
    check all achievements for a player that belong to the item category
    void
    onKill​(Player player)
    checks all achievements for a player that should be checked when a player kills sth
    void
    onLevelChange​(Player player)
    checks all for level change relevant achievements for a player
    void
    onLogin​(Player player)
    Checks on login of a player which achievements the player has reached and gives a summarizing message
    void
    onObtain​(Player player)
    Check all achievements for a player that belong to the obtain category.
    void
    onProduction​(Player player)
    check all achievements for a player that belong to the production category
    void
    onRatkChange​(Player player)
     
    void
    onTrade​(Player player)
    Check all achievements for player that beling to the commerce category.
    void
    onZoneEnter​(Player player)
    check all achievements for a player that belong to the zone category

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • get

      public static AchievementNotifier get()
      singleton accessor method
      Returns:
      the AchievementNotifier
    • initialize

      public void initialize()
      initializes the achievements that are available and registers the login listener new added achievements are added to the achievements table
    • isInitialized

      public boolean isInitialized()
      Checks if the achievement list has already been populated.
    • onLevelChange

      public void onLevelChange(Player player)
      checks all for level change relevant achievements for a player
      Parameters:
      player -
    • onDefChange

      public void onDefChange(Player player)
    • onAtkChange

      public void onAtkChange(Player player)
    • onRatkChange

      public void onRatkChange(Player player)
    • onKill

      public void onKill(Player player)
      checks all achievements for a player that should be checked when a player kills sth
      Parameters:
      player -
    • onFinishQuest

      public void onFinishQuest(Player player)
      check all achievements for a player that are relevant on finishing a quest
      Parameters:
      player -
    • onFinishDeathmatch

      public void onFinishDeathmatch(Player player)
      check all achievements for a player that are related to deathmatch
      Parameters:
      player -
    • onZoneEnter

      public void onZoneEnter(Player player)
      check all achievements for a player that belong to the zone category
      Parameters:
      player -
    • onAge

      public void onAge(Player player)
      check all achievements for a player that belong to the age category
      Parameters:
      player -
    • onItemLoot

      public void onItemLoot(Player player)
      check all achievements for a player that belong to the item category
      Parameters:
      player -
    • onProduction

      public void onProduction(Player player)
      check all achievements for a player that belong to the production category
      Parameters:
      player -
    • onObtain

      public void onObtain(Player player)
      Check all achievements for a player that belong to the obtain category.
      Parameters:
      player -
    • onTrade

      public void onTrade(Player player)
      Check all achievements for player that beling to the commerce category.
      Parameters:
      player - Player to check.
    • awardAchievementIfNotYetReached

      public void awardAchievementIfNotYetReached(Player player, String achievementIdentifier)
      Award a player with an achievement that wasn't yet reached by the player (used for example in the wishing well)
      Parameters:
      player - the player object to award
      achievementIdentifier - the identifier of the achievement that should be awarded
    • onLogin

      public void onLogin(Player player)
      Checks on login of a player which achievements the player has reached and gives a summarizing message
      Parameters:
      player -
    • getAchievements

      public com.google.common.collect.ImmutableList<Achievement> getAchievements()
      gets a list of all Achievements
      Returns:
      list of achievements