-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Don't send empty alert messages
- Loading branch information
Showing
5 changed files
with
15 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
group = io.github._4drian3d | ||
version = 3.1.0 | ||
version = 3.1.1-SNAPSHOT | ||
description = A simple Velocity plugin to catch the client version |
7 changes: 7 additions & 0 deletions
7
src/main/kotlin/io/github/_4drian3d/clientcatcher/Extensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,15 @@ | ||
package io.github._4drian3d.clientcatcher | ||
|
||
import net.kyori.adventure.audience.Audience | ||
import net.kyori.adventure.text.minimessage.MiniMessage | ||
import net.kyori.adventure.text.minimessage.tag.resolver.TagResolver | ||
|
||
fun String.asMiniMessage() = MiniMessage.miniMessage().deserialize(this) | ||
fun String.asMiniMessage(vararg resolvers: TagResolver) = MiniMessage.miniMessage().deserialize(this, *resolvers) | ||
fun String.asMiniMessage(resolver: TagResolver) = MiniMessage.miniMessage().deserialize(this, resolver) | ||
|
||
fun Audience.sendMini(message: String, resolver: TagResolver) { | ||
if (message.isNotBlank()) { | ||
this.sendMessage(message.asMiniMessage(resolver)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters