Skip to content

Commit b9ec38e

Browse files
committed
Code cleanup.
1 parent d5287eb commit b9ec38e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ import net.minecraft.entity.player.ServerPlayerEntity
1818
import net.minecraft.world.dimension.DimensionType
1919
import org.apache.logging.log4j.LogManager
2020

21+
@Suppress("DuplicatedCode")
2122
object HomeCommand {
22-
private val aliases = arrayOf(
23-
"home", "ehome"
24-
)
23+
private val aliases = arrayOf("home", "ehome")
2524
private val logger = LogManager.getLogger()
2625

2726
fun register(dispatcher: CommandDispatcher<CommandSource>) {
@@ -71,7 +70,8 @@ object HomeCommand {
7170
return@forEach
7271
}
7372
}
74-
// sendMsg home not found
73+
sendMsg("home", c.source, "home.not_found")
74+
logger.info("Player ${player.name.string} try teleport to not exist home $homeName")
7575
} else {
7676
sendMsg("home", c.source, "home.restricted")
7777
logger.info(
@@ -99,8 +99,10 @@ object HomeCommand {
9999
)
100100
if (player.world.worldInfo.worldName == clientWorld) {
101101
player.teleport(targetWorld, xPos, yPos, zPos, yaw, pitch)
102+
sendMsg("home", player.commandSource, "home.success")
102103
} else {
103-
// sendMsg home not found
104+
sendMsg("home", player.commandSource, "home.not_found")
105+
logger.info("Player ${player.name.string} try teleport to not exist home ${home.home}")
104106
}
105107
}
106108
}

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ import net.minecraft.command.CommandSource
1616
import net.minecraft.command.Commands
1717
import org.apache.logging.log4j.LogManager
1818

19+
@Suppress("DuplicatedCode")
1920
object SetHomeCommand {
20-
private val aliases = arrayOf(
21-
"sethome", "esethome"
22-
)
21+
private val aliases = arrayOf("sethome", "esethome")
2322
private val logger = LogManager.getLogger()
2423

2524
fun register(dispatcher: CommandDispatcher<CommandSource>) {

0 commit comments

Comments
 (0)