Package emu.grasscutter.game.player
Class PlayerBuffManager
java.lang.Object
emu.grasscutter.game.player.BasePlayerManager
emu.grasscutter.game.player.PlayerBuffManager
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class emu.grasscutter.game.player.BasePlayerManager
player -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddBuff(int buffId) Adds a server buff to the player.booleanaddBuff(int buffId, float duration) Adds a server buff to the player.booleanAdds a server buff to the player.voidClears all player buffsbooleanhasBuff(int groupId) Returns true if the player has a buff with this group idvoidonTick()booleanremoveBuff(int buffGroupId) Removes a buff by its group idMethods inherited from class emu.grasscutter.game.player.BasePlayerManager
getPlayer, save
-
Constructor Details
-
PlayerBuffManager
-
-
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 idduration- Duration of the buff in seconds. Set to 0 for an infinite buff.- Returns:
- True if a buff was added
-
addBuff
Adds a server buff to the player.- Parameters:
buffId- Server buff idduration- 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()
-