@@ -5,13 +5,16 @@ package com.mairwunnx.projectessentials.home.commands
55import com.mairwunnx.projectessentials.core.api.v1.extensions.getPlayer
66import com.mairwunnx.projectessentials.core.api.v1.extensions.isPlayerSender
77import com.mairwunnx.projectessentials.core.api.v1.extensions.playerName
8+ import com.mairwunnx.projectessentials.home.enums.HomeSelectStrategy
89import com.mairwunnx.projectessentials.home.homeConfiguration
10+ import com.mojang.brigadier.arguments.BoolArgumentType
911import com.mojang.brigadier.arguments.StringArgumentType
1012import com.mojang.brigadier.builder.LiteralArgumentBuilder
1113import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal
1214import net.minecraft.command.CommandSource
1315import net.minecraft.command.Commands
1416import net.minecraft.command.ISuggestionProvider
17+ import net.minecraftforge.server.command.EnumArgument
1518
1619inline val homeLiteral: LiteralArgumentBuilder <CommandSource >
1720 get() = literal<CommandSource >(" home" ).then(
@@ -53,3 +56,42 @@ inline val delHomeLiteral: LiteralArgumentBuilder<CommandSource>
5356 )
5457 }.executes { DelHomeCommand .process(it) }
5558 ).executes { DelHomeCommand .process(it) }
59+
60+ inline val configureHomeLiteral: LiteralArgumentBuilder <CommandSource >
61+ get() = literal<CommandSource >(" configure-home" )
62+ .then(
63+ Commands .literal(" respawn-at-home-after-death" ).then(
64+ Commands .literal(" set" ).then(
65+ Commands .argument(" value" , BoolArgumentType .bool()).executes {
66+ ConfigureHomeCommand .respawnAtHomeAfterDeath(it)
67+ }
68+ )
69+ )
70+ ).then(
71+ Commands .literal(" play-sound-on-teleport" ).then(
72+ Commands .literal(" set" ).then(
73+ Commands .argument(" value" , BoolArgumentType .bool()).executes {
74+ ConfigureHomeCommand .playSoundOnTeleport(it)
75+ }
76+ )
77+ )
78+ ).then(
79+ Commands .literal(" show-effect-on-teleport" ).then(
80+ Commands .literal(" set" ).then(
81+ Commands .argument(" value" , BoolArgumentType .bool()).executes {
82+ ConfigureHomeCommand .showEffectOnTeleport(it)
83+ }
84+ )
85+ )
86+ ).then(
87+ Commands .literal(" respawn-home-select-strategy" ).then(
88+ Commands .literal(" set" ).then(
89+ Commands .argument(
90+ " value" ,
91+ EnumArgument .enumArgument(HomeSelectStrategy ::class .java)
92+ ).executes {
93+ ConfigureHomeCommand .respawnHomeSelectStrategy(it)
94+ }
95+ )
96+ )
97+ )
0 commit comments