mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2025-07-04 21:36:41 +00:00
Many changes for TFM 5.0
Refractoring Reworked /saconfig Reworked part of the command system Removed unused config sections Refractored part of the config Fixed bugs with admin list Actually allow CONSOLE to have senior perms
This commit is contained in:
@ -0,0 +1,45 @@
|
||||
package me.totalfreedom.totalfreedommod.command;
|
||||
|
||||
import me.totalfreedom.totalfreedommod.rank.PlayerRank;
|
||||
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@CommandPermissions(level = PlayerRank.SUPER_ADMIN, source = SourceType.BOTH)
|
||||
@CommandParameters(description = "Show the last command that someone used.", usage = "/<command> <player>")
|
||||
public class Command_lastcmd extends FreedomCommand
|
||||
{
|
||||
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
if (args.length == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final Player player = getPlayer(args[0]);
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
msg(FreedomCommand.PLAYER_NOT_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
final FPlayer playerdata = plugin.pl.getPlayer(player);
|
||||
|
||||
if (playerdata != null)
|
||||
{
|
||||
String lastCommand = playerdata.getLastCommand();
|
||||
if (lastCommand.isEmpty())
|
||||
{
|
||||
lastCommand = "(none)";
|
||||
}
|
||||
msg(player.getName() + " - Last Command: " + lastCommand, ChatColor.GRAY);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user