-
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.
- Loading branch information
1 parent
89856e4
commit 9c5684e
Showing
95 changed files
with
427 additions
and
583 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
framework-common-api/src/main/kotlin/plutoproject/framework/common/util/Empty.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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package plutoproject.framework.common.util | ||
|
||
import com.google.protobuf.Empty as EmptyClass | ||
|
||
val Empty: EmptyClass = EmptyClass.getDefaultInstance() |
2 changes: 1 addition & 1 deletion
2
...ct/framework/common/util/logger/Logger.kt → ...toproject/framework/common/util/Logger.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
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
15 changes: 15 additions & 0 deletions
15
framework-common-api/src/main/kotlin/plutoproject/framework/common/util/NumberExtensions.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package plutoproject.framework.common.util | ||
|
||
import kotlin.math.roundToInt | ||
|
||
fun Double.toTrimmedString(): String { | ||
var result = toBigDecimal().stripTrailingZeros().toPlainString() | ||
if (result.endsWith(".")) { | ||
result = result.dropLast(1) | ||
} | ||
return result | ||
} | ||
|
||
fun Double.roundTo2(): Double { | ||
return ((this * 100).roundToInt() / 100.0) | ||
} |
16 changes: 0 additions & 16 deletions
16
framework-common-api/src/main/kotlin/plutoproject/framework/common/util/chat/ColorConvert.kt
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
...ork-common-api/src/main/kotlin/plutoproject/framework/common/util/chat/ColorExtensions.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package plutoproject.framework.common.util.chat | ||
|
||
import net.kyori.adventure.text.format.TextColor | ||
import java.awt.Color | ||
|
||
fun Color.toTextColor(): TextColor { | ||
return TextColor.color(red, green, blue) | ||
} |
File renamed without changes.
84 changes: 40 additions & 44 deletions
84
...rk-common-api/src/main/kotlin/plutoproject/framework/common/util/chat/MessageConstants.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,48 +1,44 @@ | ||
package plutoproject.framework.common.util.chat | ||
|
||
import ink.pmc.advkt.component.* | ||
import plutoproject.framework.common.util.chat.palette.MOCHA_MAROON | ||
import plutoproject.framework.common.util.chat.palette.MOCHA_SUBTEXT_0 | ||
import plutoproject.framework.common.util.chat.palette.MOCHA_YELLOW | ||
|
||
const val ECONOMY_SYMBOL = "\uD83C\uDF1F" | ||
|
||
val NON_PLAYER = component { | ||
text("该命令仅限玩家使用") with MOCHA_MAROON | ||
} | ||
|
||
val EMPTY_LINE = component { } | ||
|
||
val PLUTO_PROJECT = component { | ||
miniMessage("<gradient:#c6a0f6:#f5bde6:#f0c6c6:#f4dbd6>星社 ᴘʀᴏᴊᴇᴄᴛ</gradient>") | ||
} | ||
|
||
val PLAYER_NOT_ONLINE = component { | ||
text("该玩家不在线") with MOCHA_MAROON | ||
} | ||
|
||
val NO_PERMISSION = component { | ||
text("你似乎没有权限这么做") with MOCHA_MAROON | ||
newline() | ||
text("如果你认为这是一个错误的话,请向管理组报告") with MOCHA_SUBTEXT_0 | ||
} | ||
|
||
val UNUSUAL_ISSUE = component { | ||
text("看起来你似乎遇见了一个很罕见的问题") with MOCHA_MAROON | ||
newline() | ||
text("我们建议你反馈这个问题,有助于将服务器变得更好") with MOCHA_SUBTEXT_0 | ||
} | ||
|
||
val IN_PROGRESS = component { | ||
text("正在施工中...") with MOCHA_MAROON | ||
newline() | ||
text("前面的路,以后再来探索吧!") with MOCHA_SUBTEXT_0 | ||
} | ||
|
||
val UI_CLOSE = component { | ||
text("关闭") with MOCHA_MAROON without italic() | ||
} | ||
|
||
val UI_BACK = component { | ||
text("返回") with MOCHA_YELLOW without italic() | ||
import plutoproject.framework.common.util.chat.palettes.MOCHA_MAROON | ||
import plutoproject.framework.common.util.chat.palettes.MOCHA_SUBTEXT_0 | ||
import plutoproject.framework.common.util.chat.palettes.MOCHA_YELLOW | ||
|
||
object MessageConstants { | ||
const val ECONOMY_SYMBOL = "\uD83C\uDF1F" | ||
val emptyLine = component { } | ||
val nonPlayer = component { | ||
text("该命令仅限玩家使用") with MOCHA_MAROON | ||
} | ||
val plutoProject = component { | ||
miniMessage("<gradient:#c6a0f6:#f5bde6:#f0c6c6:#f4dbd6>星社 ᴘʀᴏᴊᴇᴄᴛ</gradient>") | ||
} | ||
val playerNotOnline = component { | ||
text("该玩家不在线") with MOCHA_MAROON | ||
} | ||
val noPermission = component { | ||
text("你似乎没有权限这么做") with MOCHA_MAROON | ||
newline() | ||
text("如果你认为这是一个错误的话,请向管理组报告") with MOCHA_SUBTEXT_0 | ||
} | ||
val unusualIssue = component { | ||
text("看起来你似乎遇见了一个很罕见的问题") with MOCHA_MAROON | ||
newline() | ||
text("我们建议你反馈这个问题,有助于将服务器变得更好") with MOCHA_SUBTEXT_0 | ||
} | ||
val inProgress = component { | ||
text("正在施工中...") with MOCHA_MAROON | ||
newline() | ||
text("前面的路,以后再来探索吧!") with MOCHA_SUBTEXT_0 | ||
} | ||
|
||
object UI { | ||
val close = component { | ||
text("关闭") with MOCHA_MAROON without italic() | ||
} | ||
val back = component { | ||
text("返回") with MOCHA_YELLOW without italic() | ||
} | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...amework/common/util/chat/DoubleConvert.kt → ...work/common/util/chat/NumberExtensions.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
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
15 changes: 15 additions & 0 deletions
15
...i/src/main/kotlin/plutoproject/framework/common/util/chat/component/IterableExtensions.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package plutoproject.framework.common.util.chat.component | ||
|
||
import net.kyori.adventure.text.Component | ||
|
||
fun Iterable<Component>.replace(pattern: String, str: String): Iterable<Component> { | ||
return map { it.replace(pattern, str) } | ||
} | ||
|
||
fun Iterable<Component>.replace(pattern: String, component: Component): Iterable<Component> { | ||
return map { it.replace(pattern, component) } | ||
} | ||
|
||
fun Iterable<Component>.replace(pattern: String, any: Any?): Iterable<Component> { | ||
return map { it.replace(pattern, any) } | ||
} |
26 changes: 0 additions & 26 deletions
26
...ork-common-api/src/main/kotlin/plutoproject/framework/common/util/chat/component/Split.kt
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...amework/common/util/chat/palette/Mocha.kt → ...mework/common/util/chat/palettes/Mocha.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
8 changes: 0 additions & 8 deletions
8
...common-api/src/main/kotlin/plutoproject/framework/common/util/command/AnnotationParser.kt
This file was deleted.
Oops, something went wrong.
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
2 changes: 1 addition & 1 deletion
2
...ommand/suggestion/PrivilegedSuggestion.kt → ...mmon/util/command/PrivilegedSuggestion.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
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
2 changes: 1 addition & 1 deletion
2
...common/util/config/decoder/CharDecoder.kt → ...ommon/util/config/decoders/CharDecoder.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
2 changes: 1 addition & 1 deletion
2
...n/util/config/decoder/ComponentDecoder.kt → .../util/config/decoders/ComponentDecoder.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
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
Oops, something went wrong.