Skip to content

Commit b23ff99

Browse files
committed
configure-warps command literal added.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent 7c68cb1 commit b23ff99

1 file changed

Lines changed: 43 additions & 3 deletions

File tree

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

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,17 @@ import com.mairwunnx.projectessentials.core.api.v1.extensions.isPlayerSender
55
import com.mairwunnx.projectessentials.core.api.v1.extensions.playerName
66
import com.mairwunnx.projectessentials.core.api.v1.permissions.hasPermission
77
import com.mairwunnx.projectessentials.warps.warpsConfiguration
8+
import com.mojang.brigadier.arguments.BoolArgumentType
9+
import com.mojang.brigadier.arguments.IntegerArgumentType
810
import com.mojang.brigadier.arguments.StringArgumentType
911
import com.mojang.brigadier.builder.LiteralArgumentBuilder
12+
import com.mojang.brigadier.builder.LiteralArgumentBuilder.literal
1013
import net.minecraft.command.CommandSource
1114
import net.minecraft.command.Commands
1215
import net.minecraft.command.ISuggestionProvider
1316

1417
inline val warpLiteral: LiteralArgumentBuilder<CommandSource>
15-
get() = LiteralArgumentBuilder.literal<CommandSource>("warp").then(
18+
get() = literal<CommandSource>("warp").then(
1619
Commands.argument(
1720
"warp", StringArgumentType.string()
1821
).suggests { _, builder ->
@@ -23,14 +26,14 @@ inline val warpLiteral: LiteralArgumentBuilder<CommandSource>
2326
)
2427

2528
inline val setWarpLiteral: LiteralArgumentBuilder<CommandSource>
26-
get() = LiteralArgumentBuilder.literal<CommandSource>("set-warp").then(
29+
get() = literal<CommandSource>("set-warp").then(
2730
Commands.argument(
2831
"warp", StringArgumentType.string()
2932
).executes { SetWarpCommand.process(it) }
3033
)
3134

3235
inline val delWarpLiteral: LiteralArgumentBuilder<CommandSource>
33-
get() = LiteralArgumentBuilder.literal<CommandSource>("del-warp").then(
36+
get() = literal<CommandSource>("del-warp").then(
3437
Commands.argument(
3538
"warp", StringArgumentType.string()
3639
).suggests { ctx, builder ->
@@ -49,3 +52,40 @@ inline val delWarpLiteral: LiteralArgumentBuilder<CommandSource>
4952
)
5053
}.executes { DelWarpCommand.process(it) }
5154
)
55+
56+
inline val configureWarpsLiteral: LiteralArgumentBuilder<CommandSource>
57+
get() = literal<CommandSource>("configure-warps")
58+
.then(
59+
Commands.literal("play-sound-on-teleport").then(
60+
Commands.literal("set").then(
61+
Commands.argument("value", BoolArgumentType.bool()).executes {
62+
ConfigureWarpsCommand.playSoundOnTeleport(it)
63+
}
64+
)
65+
)
66+
).then(
67+
Commands.literal("show-effect-on-teleport").then(
68+
Commands.literal("set").then(
69+
Commands.argument("value", BoolArgumentType.bool()).executes {
70+
ConfigureWarpsCommand.showEffectOnTeleport(it)
71+
}
72+
)
73+
)
74+
).then(
75+
Commands.literal("add-resistance-effect").then(
76+
Commands.literal("set").then(
77+
Commands.argument("value", BoolArgumentType.bool()).executes {
78+
ConfigureWarpsCommand.addResistanceEffect(it)
79+
}
80+
)
81+
)
82+
).then(
83+
Commands.literal("resistance-effect-duration").then(
84+
Commands.literal("set").then(
85+
Commands.argument("value", IntegerArgumentType.integer(1)).executes {
86+
ConfigureWarpsCommand.resistanceEffectDuration(it)
87+
}
88+
)
89+
)
90+
)
91+

0 commit comments

Comments
 (0)