@@ -18,10 +18,9 @@ import net.minecraft.entity.player.ServerPlayerEntity
1818import net.minecraft.world.dimension.DimensionType
1919import org.apache.logging.log4j.LogManager
2020
21+ @Suppress(" DuplicatedCode" )
2122object 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}
0 commit comments