We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7fc18b3 commit 75cc176Copy full SHA for 75cc176
src/main/kotlin/com/lambda/friend/FriendManager.kt
@@ -43,7 +43,7 @@ object FriendManager : Configurable(FriendConfig), Loadable {
43
override val name = "friends"
44
val friends by setting("friends", emptySet<GameProfile>(), serialize = true)
45
46
- fun befriend(profile: GameProfile) = friends.add(profile)
+ fun befriend(profile: GameProfile) = if (!isFriend(profile)) friends.add(profile) else false
47
fun unfriend(profile: GameProfile): Boolean = friends.remove(profile)
48
49
fun gameProfile(name: String) = friends.firstOrNull { it.name == name }
0 commit comments