mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 09:15:38 +00:00
293ea04c56
* rename everything containing staff back to admin (as requested by ryan i've renamed commands like slconfig to saconfig but left "slconfig" as an alias) * format almost every file correctly * a few other improvements
45 lines
1.3 KiB
Java
45 lines
1.3 KiB
Java
package me.totalfreedom.totalfreedommod.command;
|
|
|
|
import me.totalfreedom.totalfreedommod.player.FPlayer;
|
|
import me.totalfreedom.totalfreedommod.rank.Rank;
|
|
import org.bukkit.ChatColor;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandSender;
|
|
import org.bukkit.entity.Player;
|
|
|
|
@CommandPermissions(level = Rank.ADMIN, source = SourceType.BOTH)
|
|
@CommandParameters(description = "Show the last command the specified player 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;
|
|
}
|
|
} |