use of me.totalfreedom.totalfreedommod.player.FPlayer in project TotalFreedomMod by TotalFreedom.
the class Command_fuckoff method run.
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
if (args.length < 1) {
return false;
}
FPlayer player = plugin.pl.getPlayer(playerSender);
if (!args[0].equals("on")) {
player.disableFuckoff();
} else {
double radius = 25.0;
if (args.length >= 2) {
try {
radius = Math.max(5.0, Math.min(50, Double.parseDouble(args[1])));
} catch (NumberFormatException ex) {
}
}
player.setFuckoff(radius);
}
msg("Fuckoff " + (player.isFuckOff() ? ("enabled. Radius: " + player.getFuckoffRadius() + ".") : "disabled."));
return true;
}
use of me.totalfreedom.totalfreedommod.player.FPlayer in project TotalFreedomMod by TotalFreedom.
the class Command_lockup method startLockup.
private void startLockup(final Player player) {
final FPlayer playerdata = plugin.pl.getPlayer(player);
cancelLockup(playerdata);
playerdata.setLockupScheduleId(new BukkitRunnable() {
@Override
public void run() {
if (player.isOnline()) {
player.openInventory(player.getInventory());
} else {
cancelLockup(playerdata);
}
}
}.runTaskTimer(plugin, 0L, 5L));
}
use of me.totalfreedom.totalfreedommod.player.FPlayer in project TotalFreedomMod by TotalFreedom.
the class Command_lastcmd method run.
@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;
}
use of me.totalfreedom.totalfreedommod.player.FPlayer in project TotalFreedomMod by TotalFreedom.
the class Command_adminchat method run.
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
if (args.length == 0) {
if (senderIsConsole) {
msg("Only in-game players can toggle AdminChat.");
return true;
}
FPlayer userinfo = plugin.pl.getPlayer(playerSender);
userinfo.setAdminChat(!userinfo.inAdminChat());
msg("Toggled Admin Chat " + (userinfo.inAdminChat() ? "on" : "off") + ".");
} else {
plugin.cm.adminChat(sender, StringUtils.join(args, " "));
}
return true;
}
use of me.totalfreedom.totalfreedommod.player.FPlayer in project TotalFreedomMod by TotalFreedom.
the class Command_purgeall method run.
@Override
public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
FUtil.adminAction(sender.getName(), "Purging all player data", true);
// Purge entities
plugin.ew.wipeEntities(true);
for (Player player : server.getOnlinePlayers()) {
FPlayer fPlayer = plugin.pl.getPlayer(player);
// Unmute all players
if (fPlayer.isMuted()) {
fPlayer.setMuted(false);
}
// Unblock all commands
if (fPlayer.allCommandsBlocked()) {
fPlayer.setCommandsBlocked(false);
}
// Stop orbiting
if (fPlayer.isOrbiting()) {
fPlayer.stopOrbiting();
}
// Unfreeze
if (fPlayer.getFreezeData().isFrozen()) {
fPlayer.getFreezeData().setFrozen(false);
}
// Purge potion effects
for (PotionEffect potion_effect : player.getActivePotionEffects()) {
player.removePotionEffect(potion_effect.getType());
}
// Uncage
if (fPlayer.getCageData().isCaged()) {
fPlayer.getCageData().setCaged(false);
}
}
// Unfreeze all players
plugin.fm.setGlobalFreeze(false);
// Remove all mobs
Command_mobpurge.purgeMobs();
return true;
}
Aggregations