Skip to content

Commit 65d562c

Browse files
committed
Set-home command literal added.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent 2803fc3 commit 65d562c

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/home/commands/CommandLiterals.kt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,12 @@ inline val homeLiteral: LiteralArgumentBuilder<CommandSource>
2727
} else emptyList<String>()
2828
}, builder
2929
)
30-
}
31-
)
30+
}.executes { HomeCommand.process(it) }
31+
).executes { HomeCommand.process(it) }
32+
33+
inline val setHomeLiteral: LiteralArgumentBuilder<CommandSource>
34+
get() = literal<CommandSource>("set-home").then(
35+
Commands.argument(
36+
"home", StringArgumentType.string()
37+
).executes { SetHomeCommand.process(it) }
38+
).executes { SetHomeCommand.process(it) }

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import com.mairwunnx.projectessentials.home.teleportToHome
1212
import com.mojang.brigadier.context.CommandContext
1313
import net.minecraft.command.CommandSource
1414

15-
object HomeCommand : CommandBase(homeLiteral) {
15+
object HomeCommand : CommandBase(homeLiteral, false) {
1616
override val name = "home"
1717
override fun process(context: CommandContext<CommandSource>) = 0.also {
1818
fun out(status: String, vararg args: String) = MessagingAPI.sendMessage(

0 commit comments

Comments
 (0)