added the permission
This commit is contained in:
parent
6e24ca0dfc
commit
db3f6c7b2b
@ -1,4 +1,5 @@
|
|||||||
package me.feusalamander.vmessage;
|
package me.feusalamander.vmessage;
|
||||||
|
import com.velocitypowered.api.command.CommandSource;
|
||||||
import com.velocitypowered.api.command.SimpleCommand;
|
import com.velocitypowered.api.command.SimpleCommand;
|
||||||
import net.kyori.adventure.text.Component;
|
import net.kyori.adventure.text.Component;
|
||||||
import net.kyori.adventure.text.format.TextColor;
|
import net.kyori.adventure.text.format.TextColor;
|
||||||
@ -17,15 +18,20 @@ public final class ReloadCommand implements SimpleCommand {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(final Invocation invocation) {
|
public void execute(final Invocation invocation) {
|
||||||
|
CommandSource source = invocation.source();
|
||||||
String[] args = invocation.arguments();
|
String[] args = invocation.arguments();
|
||||||
if(args.length == 0){
|
if(args.length == 0){
|
||||||
invocation.source().sendMessage(Component.text("§cUsage: /vmessage reload"));
|
source.sendMessage(Component.text("§cUsage: /vmessage reload"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String s = args[0];
|
String s = args[0];
|
||||||
if(s.equalsIgnoreCase("reload")){
|
if(s.equalsIgnoreCase("reload")){
|
||||||
|
if(!source.hasPermission("*")){
|
||||||
|
source.sendMessage(Component.text("§cYou don't have the permission to do that"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
config.reload();
|
config.reload();
|
||||||
invocation.source().sendMessage(Component.text("The Vmessage's config has been succefully reloaded"));
|
source.sendMessage(Component.text("The Vmessage's config has been succefully reloaded"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user