Merge pull request #13 from AtlasMediaGroup/Elmon11-patch-1

Make gcmd not work on admins

//MERGE COMMIT:
At least one build check passed, the failing check is irrelevant.
This commit is contained in:
Paldiu 2020-12-28 07:41:58 -05:00 committed by GitHub
commit c0ac0365eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,6 +3,7 @@ package me.totalfreedom.totalfreedommod.command;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.ChatColor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -33,6 +34,12 @@ public class Command_gcmd extends FreedomCommand
return true; return true;
} }
if (plugin.al.isAdmin(player))
{
msg(ChatColor.RED + "You can not use gcmd on admins");
return true;
}
try try
{ {
msg("Sending command as " + player.getName() + ": " + outCommand); msg("Sending command as " + player.getName() + ": " + outCommand);