Skip to content

Commit 1afe98e

Browse files
committed
Reload command improved.
Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent ad56650 commit 1afe98e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

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

Lines changed: 4 additions & 2 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.
@@ -19,7 +19,9 @@ internal object ReloadCommand : VanillaCommandBase("reload") {
1919
override fun register(dispatcher: CommandDispatcher<CommandSource>) {
2020
super.register(dispatcher)
2121
dispatcher.register(
22-
Commands.literal(name).executes {
22+
Commands.literal(name).requires {
23+
isAllowed(it, "server.reload", 2)
24+
}.executes {
2325
it.source.sendFeedback(TranslationTextComponent("commands.reload.success"), true)
2426
it.source.server.reload().also { ConfigurationAPI.reloadAll() }.let { 0 }
2527
}

0 commit comments

Comments
 (0)