Skip to content

Commit 75f5b59

Browse files
committed
SetSpawnCommand.kt: sendMsg replaced with sendMessage.
SetSpawnCommand.kt: deprecated api replaced on new. Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent ad9c670 commit 75f5b59

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/spawn/commands/SetSpawnCommand.kt

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ package com.mairwunnx.projectessentials.spawn.commands
22

33
import com.mairwunnx.projectessentials.cooldown.essentials.CommandsAliases
44
import com.mairwunnx.projectessentials.core.extensions.isPlayerSender
5-
import com.mairwunnx.projectessentials.core.extensions.sendMsg
6-
import com.mairwunnx.projectessentials.core.helpers.ONLY_PLAYER_CAN
7-
import com.mairwunnx.projectessentials.core.helpers.PERMISSION_LEVEL
5+
import com.mairwunnx.projectessentials.core.helpers.throwOnlyPlayerCan
6+
import com.mairwunnx.projectessentials.core.helpers.throwPermissionLevel
87
import com.mairwunnx.projectessentials.spawn.EntryPoint
98
import com.mairwunnx.projectessentials.spawn.EntryPoint.Companion.hasPermission
109
import com.mairwunnx.projectessentials.spawn.models.SpawnModelBase
10+
import com.mairwunnx.projectessentials.spawn.sendMessage
1111
import com.mojang.brigadier.CommandDispatcher
1212
import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal
1313
import com.mojang.brigadier.context.CommandContext
@@ -48,7 +48,7 @@ object SetSpawnCommand {
4848
SpawnModelBase.spawnModel.pitch = player.rotationPitch
4949
SpawnModelBase.spawnModel.worldId = player.serverWorld.worldType.id
5050
player.serverWorld.spawnPoint = BlockPos(player.posX, player.posY, player.posZ)
51-
sendMsg("spawn", c.source, "spawn.set.success")
51+
sendMessage(c.source, "set.success")
5252
logger.info("New spawn point installed by ${player.name.string} with data: ")
5353
logger.info(" - xpos: ${player.posX}")
5454
logger.info(" - ypos: ${player.posY}")
@@ -57,15 +57,11 @@ object SetSpawnCommand {
5757
logger.info(" - pitch: ${player.rotationPitch}")
5858
logger.info("Executed command \"${c.input}\" from ${player.name.string}")
5959
} else {
60-
sendMsg("spawn", c.source, "spawn.set.restricted")
61-
logger.info(
62-
PERMISSION_LEVEL
63-
.replace("%0", player.name.string)
64-
.replace("%1", "setspawn")
65-
)
60+
sendMessage(c.source, "set.restricted")
61+
throwPermissionLevel(player.name.string, "setspawn")
6662
}
6763
} else {
68-
logger.info(ONLY_PLAYER_CAN.replace("%0", "setspawn"))
64+
throwOnlyPlayerCan("setspawn")
6965
}
7066
return 0
7167
}

0 commit comments

Comments
 (0)