Search in sources :

Example 1 with FPlayer

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;
}
Also used : FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer)

Example 2 with FPlayer

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));
}
Also used : FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer) BukkitRunnable(org.bukkit.scheduler.BukkitRunnable)

Example 3 with FPlayer

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;
}
Also used : FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer) FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer) Player(org.bukkit.entity.Player)

Example 4 with FPlayer

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;
}
Also used : FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer)

Example 5 with FPlayer

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;
}
Also used : FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer) FPlayer(me.totalfreedom.totalfreedommod.player.FPlayer) Player(org.bukkit.entity.Player) PotionEffect(org.bukkit.potion.PotionEffect)

Aggregations

FPlayer (me.totalfreedom.totalfreedommod.player.FPlayer)31 Player (org.bukkit.entity.Player)20 EventHandler (org.bukkit.event.EventHandler)15 Location (org.bukkit.Location)6 Vector (org.bukkit.util.Vector)3 ItemStack (org.bukkit.inventory.ItemStack)2 BukkitRunnable (org.bukkit.scheduler.BukkitRunnable)2 ArrayList (java.util.ArrayList)1 List (java.util.List)1 Admin (me.totalfreedom.totalfreedommod.admin.Admin)1 Material (org.bukkit.Material)1 Sound (org.bukkit.Sound)1 Block (org.bukkit.block.Block)1 Command (org.bukkit.command.Command)1 EntityType (org.bukkit.entity.EntityType)1 LivingEntity (org.bukkit.entity.LivingEntity)1 TNTPrimed (org.bukkit.entity.TNTPrimed)1 PotionEffect (org.bukkit.potion.PotionEffect)1