@@ -2,12 +2,12 @@ package com.mairwunnx.projectessentials.warps.commands
22
33import com.mairwunnx.projectessentials.cooldown.essentials.CommandsAliases
44import 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
87import com.mairwunnx.projectessentials.warps.EntryPoint
98import com.mairwunnx.projectessentials.warps.EntryPoint.Companion.hasPermission
109import com.mairwunnx.projectessentials.warps.models.WarpModelUtils
10+ import com.mairwunnx.projectessentials.warps.sendMessage
1111import com.mojang.brigadier.CommandDispatcher
1212import com.mojang.brigadier.arguments.StringArgumentType
1313import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal
@@ -52,7 +52,7 @@ object DelWarpCommand {
5252 val warpName = StringArgumentType .getString(c, " warp name" )
5353 WarpModelUtils .warpModel.warps.forEach {
5454 if (it.name == warpName && it.owner != player.name.string) {
55- sendMsg( " warps " , c.source, " warp. remove_not_access" )
55+ sendMessage( c.source, " remove_not_access" )
5656 return 0
5757 }
5858 }
@@ -61,23 +61,19 @@ object DelWarpCommand {
6161 }
6262 WarpModelUtils .warpModel.warps.remove(warp).let { result ->
6363 if (result) {
64- sendMsg( " warps " , c.source, " warp. remove.success" , warpName)
64+ sendMessage( c.source, " remove.success" , warpName)
6565 logger.info(" Executed command \" /delwarp\" from ${player.name.string} " )
6666 return 0
6767 } else {
68- sendMsg( " warps " , c.source, " warp. not_found" , warpName)
68+ sendMessage( c.source, " not_found" , warpName)
6969 }
7070 }
7171 } else {
72- sendMsg(" warps" , c.source, " warp.remove.restricted" )
73- logger.info(
74- PERMISSION_LEVEL
75- .replace(" %0" , player.name.string)
76- .replace(" %1" , " delwarp" )
77- )
72+ sendMessage(c.source, " remove.restricted" )
73+ throwPermissionLevel(player.name.string, " delwarp" )
7874 }
7975 } else {
80- logger.info( ONLY_PLAYER_CAN .replace( " %0 " , " delwarp" ) )
76+ throwOnlyPlayerCan( " delwarp" )
8177 }
8278 return 0
8379 }
0 commit comments