Skip to content

Commit 958e06e

Browse files
committed
Messaging.kt implemented.
Signed-off-by: Pavel Erokhin (MairwunNx) <[email protected]>
1 parent 7dc8436 commit 958e06e

File tree

1 file changed

+23
-0
lines changed
  • src/main/kotlin/com/mairwunnx/projectessentials/home

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.mairwunnx.projectessentials.home
2+
3+
import com.mairwunnx.projectessentials.core.configuration.localization.LocalizationConfigurationUtils
4+
import com.mairwunnx.projectessentials.core.extensions.sendMsg
5+
import com.mairwunnx.projectessentials.core.localization.sendMsgV2
6+
import net.minecraft.command.CommandSource
7+
8+
internal fun sendMessage(
9+
source: CommandSource,
10+
message: String,
11+
vararg args: String
12+
) {
13+
if (LocalizationConfigurationUtils.getConfig().enabled) {
14+
sendMsgV2(
15+
source.asPlayer(),
16+
"project_essentials_home.home.$message", *args
17+
)
18+
} else {
19+
sendMsg(
20+
"home", source, "home.$message", *args
21+
)
22+
}
23+
}

0 commit comments

Comments
 (0)