Skip to content

Commit 06ba516

Browse files
committed
Undo friends action
1 parent 7574cd3 commit 06ba516

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

common/src/main/kotlin/com/lambda/friend/FriendManager.kt

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@ package com.lambda.friend
2020
import com.lambda.config.Configurable
2121
import com.lambda.config.configurations.FriendConfig
2222
import com.lambda.core.Loadable
23-
import com.lambda.util.text.buildText
24-
import com.lambda.util.text.literal
25-
import com.lambda.util.text.text
23+
import com.lambda.util.text.*
2624
import com.mojang.authlib.GameProfile
2725
import net.minecraft.client.network.OtherClientPlayerEntity
2826
import net.minecraft.text.Text
@@ -68,13 +66,23 @@ object FriendManager : Configurable(FriendConfig), Loadable {
6866
fun befriendedText(name: Text) = buildText {
6967
literal(Color.GREEN, "Added ")
7068
text(name)
71-
literal(" to your friend list")
69+
literal(" to your friend list ")
70+
clickEvent(ClickEvents.suggestCommand(";friends remove ${name.string}")) {
71+
styled(underlined = true, color = Color.LIGHT_GRAY) {
72+
literal("[Click to undo]")
73+
}
74+
}
7275
}
7376

7477
fun unfriendedText(name: String): Text = unfriendedText(Text.of(name))
7578
fun unfriendedText(name: Text) = buildText {
7679
literal(Color.RED, "Removed ")
7780
text(name)
78-
literal(" from your friend list")
81+
literal(" from your friend list ")
82+
clickEvent(ClickEvents.suggestCommand(";friends add ${name.string}")) {
83+
styled(underlined = true, color = Color.LIGHT_GRAY) {
84+
literal("[Click to undo]")
85+
}
86+
}
7987
}
8088
}

0 commit comments

Comments
 (0)