Skip to content

Commit 8119636

Browse files
committed
configure-home command literal added.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent f555743 commit 8119636

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,16 @@ package com.mairwunnx.projectessentials.home.commands
55
import com.mairwunnx.projectessentials.core.api.v1.extensions.getPlayer
66
import com.mairwunnx.projectessentials.core.api.v1.extensions.isPlayerSender
77
import com.mairwunnx.projectessentials.core.api.v1.extensions.playerName
8+
import com.mairwunnx.projectessentials.home.enums.HomeSelectStrategy
89
import com.mairwunnx.projectessentials.home.homeConfiguration
10+
import com.mojang.brigadier.arguments.BoolArgumentType
911
import com.mojang.brigadier.arguments.StringArgumentType
1012
import com.mojang.brigadier.builder.LiteralArgumentBuilder
1113
import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal
1214
import net.minecraft.command.CommandSource
1315
import net.minecraft.command.Commands
1416
import net.minecraft.command.ISuggestionProvider
17+
import net.minecraftforge.server.command.EnumArgument
1518

1619
inline 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

Comments
 (0)