Class PlayerBuffManager

java.lang.Object
emu.grasscutter.game.player.BasePlayerManager
emu.grasscutter.game.player.PlayerBuffManager

public class PlayerBuffManager extends BasePlayerManager
  • Constructor Details

    • PlayerBuffManager

      public PlayerBuffManager(Player player)
  • Method Details

    • hasBuff

      public boolean hasBuff(int groupId)
      Returns true if the player has a buff with this group id
      Parameters:
      groupId - Buff group id
      Returns:
      True if a buff with this group id exists
    • clearBuffs

      public void clearBuffs()
      Clears all player buffs
    • addBuff

      public boolean addBuff(int buffId)
      Adds a server buff to the player.
      Parameters:
      buffId - Server buff id
      Returns:
      True if a buff was added
    • addBuff

      public boolean addBuff(int buffId, float duration)
      Adds a server buff to the player.
      Parameters:
      buffId - Server buff id
      duration - Duration of the buff in seconds. Set to 0 for an infinite buff.
      Returns:
      True if a buff was added
    • addBuff

      public boolean addBuff(int buffId, float duration, Avatar target)
      Adds a server buff to the player.
      Parameters:
      buffId - Server buff id
      duration - Duration of the buff in seconds. Set to 0 for an infinite buff.
      target - Target avatar
      Returns:
      True if a buff was added
    • removeBuff

      public boolean removeBuff(int buffGroupId)
      Removes a buff by its group id
      Parameters:
      buffGroupId - Server buff group id
      Returns:
      True if a buff was remove
    • onTick

      public void onTick()