Skip to content

Commit c4cbf47

Browse files
committed
Fixed incorrect messages when home not exists.
1 parent dc4f7ab commit c4cbf47

File tree

1 file changed

+3
-3
lines changed
  • src/main/kotlin/com/mairwunnx/projectessentials/projectessentialshome/commands

1 file changed

+3
-3
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/projectessentialshome/commands/HomeCommand.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ object HomeCommand {
6767
home.homes.forEach {
6868
if (it.home == homeName) {
6969
moveToHome(player, it)
70-
return@forEach
70+
return 0
7171
}
7272
}
73-
sendMsg("home", c.source, "home.not_found")
73+
sendMsg("home", c.source, "home.not_found", homeName)
7474
logger.info("Player ${player.name.string} try teleport to not exist home $homeName")
7575
} else {
7676
sendMsg("home", c.source, "home.restricted")
@@ -101,7 +101,7 @@ object HomeCommand {
101101
player.teleport(targetWorld, xPos, yPos, zPos, yaw, pitch)
102102
sendMsg("home", player.commandSource, "home.success", home.home)
103103
} else {
104-
sendMsg("home", player.commandSource, "home.not_found")
104+
sendMsg("home", player.commandSource, "home.not_found", home.home)
105105
logger.info("Player ${player.name.string} try teleport to not exist home ${home.home}")
106106
}
107107
}

0 commit comments

Comments
 (0)