Skip to content

Commit 479b2f6

Browse files
committed
EnchantCommand.kt improved.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent b435daf commit 479b2f6

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

  • src/main/kotlin/com/mairwunnx/projectessentials/core/impl/vanilla/commands

src/main/kotlin/com/mairwunnx/projectessentials/core/impl/vanilla/commands/EnchantCommand.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* ! This command implementation by Mojang Game Studios!
2+
* ! This command implementation by Mojang Studios!
33
*
44
* Decompiled with idea source code was converted to kotlin code.
55
* But with additions such as permissions checking and etc.
@@ -33,8 +33,12 @@ internal object EnchantCommand : VanillaCommandBase("enchant") {
3333
override fun register(dispatcher: CommandDispatcher<CommandSource>) {
3434
super.register(dispatcher).also {
3535
dispatcher.register(
36-
Commands.literal(name).requires { it.hasPermissionLevel(2) }.then(
37-
Commands.argument("targets", EntityArgument.entities()).then(
36+
Commands.literal(name).requires {
37+
isAllowed(it, "enchant", 2)
38+
}.then(
39+
Commands.argument("targets", EntityArgument.entities()).requires {
40+
isAllowed(it, "enchant.other", 3)
41+
}.then(
3842
Commands.argument(
3943
"enchantment", EnchantmentArgument.enchantment()
4044
).executes {

0 commit comments

Comments
 (0)