Skip to content

Commit

Permalink
Add admin-perm for Velocity-side command
Browse files Browse the repository at this point in the history
  • Loading branch information
Andre601 committed Nov 17, 2020
1 parent 1b2542e commit 539b174
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

package com.andre601.oneversionremake.velocity.commands;

import com.andre601.oneversionremake.core.CommandPermissions;
import com.andre601.oneversionremake.core.enums.ProtocolVersion;
import com.andre601.oneversionremake.velocity.VelocityCore;
import com.velocitypowered.api.command.CommandSource;
Expand All @@ -41,7 +42,7 @@ public void execute(Invocation invocation){
String[] args = invocation.arguments();

if(args.length == 0 || args[0].equalsIgnoreCase("help")){
if(!commandSource.hasPermission("oneversionremake.command.help")){
if(!commandSource.hasPermission(CommandPermissions.COMMAND_HELP) && !commandSource.hasPermission(CommandPermissions.ADMIN)){
sendMsg(commandSource, NamedTextColor.RED, "Insufficient permissions!");
return;
}
Expand All @@ -55,7 +56,7 @@ public void execute(Invocation invocation){
sendMsg(commandSource, NamedTextColor.GRAY, "Reloads the Configuration.");
}else
if(args[0].equalsIgnoreCase("reload")){
if(!commandSource.hasPermission("oneversionremake.command.reload")){
if(!commandSource.hasPermission(CommandPermissions.COMMAND_RELOAD) && !commandSource.hasPermission(CommandPermissions.ADMIN)){
sendMsg(commandSource, NamedTextColor.RED, "Insufficient permissions!");
return;
}
Expand Down

0 comments on commit 539b174

Please sign in to comment.