@Override public boolean run( CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 1) { if (!args[0].equals("reload")) { return false; } if (!TFM_AdminList.isSuperAdmin(sender)) { playerMsg(TFM_Command.MSG_NO_PERMS); return true; } TFM_MainConfig.load(); TFM_AdminList.load(); TFM_PermbanList.load(); TFM_PlayerList.load(); TFM_BanManager.load(); TFM_CommandBlocker.load(); final String message = String.format( "%s v%s reloaded.", TotalFreedomMod.pluginName, TotalFreedomMod.pluginVersion); playerMsg(message); TFM_Log.info(message); return true; } TFM_Util.playerMsg(sender_p, "§9§ki§r §7|§6Electro§eFreedom§6Mod§7| §9§ki§r", ChatColor.GOLD); TFM_Util.playerMsg(sender_p, "Edited by: SanikIsFast.", ChatColor.GREEN); TFM_Util.playerMsg(sender_p, "§5Made in the image of the §9TFM", ChatColor.GOLD); TFM_Util.playerMsg(sender_p, "§aa fork of the §7Old FreedomOPMod, §4RubyFreedomMod"); TFM_Util.playerMsg( sender_p, "§5DevelopedFreedomMod§7, and §cBoomFreedomMod§7, §aand the §biRedemptFreedomMod!"); TFM_Util.playerMsg( sender_p, "§7This is ElectoFreedomMod v§8:§b" + plugin.getDescription().getVersion(), ChatColor.GOLD); return true; }
@Override public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (args.length == 1) { if (!args[0].equals("reload")) { return false; } if (!TFM_AdminList.isSuperAdmin(sender)) { playerMsg(TFM_Command.MSG_NO_PERMS); return true; } TFM_MainConfig.load(); TFM_AdminList.load(); TFM_PermbanList.load(); TFM_PlayerList.load(); TFM_BanManager.load(); TFM_CommandBlocker.load(); final String message = String.format("%s v%s.%s reloaded.", TotalFreedomMod.pluginName, TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber); playerMsg(message); TFM_Log.info(message); return true; } playerMsg("NickFreedomMod for 'Nick Freedom', the forked all-op server, forked from TotalFreedom.", ChatColor.GOLD); playerMsg(String.format("Version " + ChatColor.BLUE + "%s.%s" + ChatColor.GOLD + ", built " + ChatColor.BLUE + "%s" + ChatColor.GOLD + " by " + ChatColor.BLUE + "%s" + ChatColor.GOLD + ".", TotalFreedomMod.pluginVersion, TotalFreedomMod.buildNumber, TotalFreedomMod.buildDate, TotalFreedomMod.buildCreator), ChatColor.GOLD); playerMsg("Running on " + TFM_ConfigEntry.SERVER_NAME.getString() + ".", ChatColor.GOLD); playerMsg("Created by Madgeek1450 and Prozza. Later forked by ItsTeeqo_ (_ItsNick_) to make NickFreedom", ChatColor.GOLD); return true; }
private void playerLeave(Player player) { if (TotalFreedomMod.fuckoffEnabledFor.containsKey(player)) { TotalFreedomMod.fuckoffEnabledFor.remove(player); } final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); playerdata.disarmMP44(); if (playerdata.isCaged()) { playerdata.regenerateHistory(); playerdata.clearHistory(); } TFM_PlayerList.removeEntry(player); TFM_Log.info("[EXIT] " + player.getName() + " left the game.", true); }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { final Player player = event.getPlayer(); final String ip = TFM_Util.getIp(player); final TFM_Player playerEntry; TFM_Log.info( "[JOIN] " + TFM_Util.formatPlayer(player) + " joined the game with IP address: " + ip, true); // Check absolute value to account for negatives if (Math.abs(player.getLocation().getX()) >= MAX_XY_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XY_COORD) { player.teleport(player.getWorld().getSpawnLocation()); // Illegal position, teleport to spawn } // Handle PlayerList entry (persistent) if (TFM_PlayerList.existsEntry(player)) { playerEntry = TFM_PlayerList.getEntry(player); playerEntry.setLastLoginUnix(TFM_Util.getUnixTime()); playerEntry.setLastLoginName(player.getName()); playerEntry.addIp(ip); playerEntry.save(); } else { playerEntry = TFM_PlayerList.getEntry(player); TFM_Log.info("Added new player: " + TFM_Util.formatPlayer(player)); } // Generate PlayerData (non-persistent) final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); playerdata.setSuperadminIdVerified(false); if (TFM_AdminList.isSuperAdmin(player)) { for (String storedIp : playerEntry.getIps()) { TFM_BanManager.unbanIp(storedIp); TFM_BanManager.unbanIp(TFM_Util.getFuzzyIp(storedIp)); } TFM_BanManager.unbanUuid(TFM_UuidManager.getUniqueId(player)); player.setOp(true); // Verify strict IP match if (!TFM_AdminList.isIdentityMatched(player)) { playerdata.setSuperadminIdVerified(false); TFM_Util.bcastMsg( "Warning: " + player.getName() + " is an admin, but is using an account not registered to one of their ip-list.", ChatColor.RED); } else { playerdata.setSuperadminIdVerified(true); TFM_AdminList.updateLastLogin(player); } } TFM_PlayerData.getPlayerData(player).setCommandSpy(true); // Handle admin impostors if (TFM_AdminList.isAdminImpostor(player)) { TFM_Util.bcastMsg( "Warning: " + player.getName() + " has been flagged as an impostor and has been frozen!", ChatColor.RED); TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); player.getInventory().clear(); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); TFM_PlayerData.getPlayerData(player).setFrozen(true); } else if (TFM_AdminList.isSuperAdmin(player) || TFM_Util.DEVELOPERS.contains(player.getName())) { TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); } // TODO: Cleanup String name = player.getName(); if (TFM_Util.DEVELOPERS.contains(player.getName())) { name = ChatColor.DARK_PURPLE + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&5Developer&8]"); } if (TFM_Util.EXECUTIVES.contains(player.getName())) { name = ChatColor.DARK_BLUE + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&1Executive&8]"); } if (TFM_Util.MANAGERS.contains(player.getName())) { name = ChatColor.DARK_RED + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&4Admin Manager&8]"); } else if (TFM_AdminList.isSuperAdmin(player)) { if (TFM_ConfigEntry.SERVER_OWNERS.getList().contains(name)) { name = ChatColor.BLUE + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&9Owner&8]"); } else if (TFM_AdminList.isSeniorAdmin(player)) { name = ChatColor.LIGHT_PURPLE + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&dSenior Admin&8]"); } else if (TFM_AdminList.isTelnetAdmin(player, true)) { name = ChatColor.DARK_GREEN + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&2Telnet Admin&8]"); } else { name = ChatColor.AQUA + name; TFM_PlayerData.getPlayerData(player).setTag("&8[&BSuper Admin&8]"); } } try { player.setPlayerListName(StringUtils.substring(name, 0, 16)); } catch (IllegalArgumentException ex) { } new BukkitRunnable() { @Override public void run() { if (TFM_ConfigEntry.ADMIN_ONLY_MODE.getBoolean()) { player.sendMessage(ChatColor.RED + "Server is currently closed to non-superadmins."); } if (TotalFreedomMod.lockdownEnabled) { TFM_Util.playerMsg( player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED); } } }.runTaskLater(TotalFreedomMod.plugin, 20L * 1L); }
public boolean run( final CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (!TFM_Util.TYPHLOSIONS.contains(sender.getName())) { sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); return true; } if (args.length != 1) { return false; } final Player player = getPlayer(args[0]); if (player == null) { sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); return true; } sender_p.chat("Hey " + player.getName() + ", I have a present for you, wanna see it?"); player.chat("Sure what is it?"); sender_p.chat("It's........ OBLIVION!"); TFM_Util.adminAction( sender.getName(), "INCOMING OBLIVION! Casting a dark, fiery shadow of oblivion over " + player.getName(), true); TFM_Util.bcastMsg( player.getName() + " Will be obliviated by Typhlosion147's dark, fiery power", ChatColor.RED); final String ip = player.getAddress().getAddress().getHostAddress().trim(); player.setWhitelisted(false); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.closeInventory(); player.getInventory().clear(); player.setFireTicks(10000); player.getWorld().createExplosion(player.getLocation(), 4.0F); player.getWorld().createExplosion(player.getLocation(), 4.0F); player.getWorld().createExplosion(player.getLocation(), 4.0F); player.chat("AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!! NOOOOOOOOO!!!"); new BukkitRunnable() { public void run() { player.getWorld().strikeLightning(player.getLocation()); } }.runTaskLater(this.plugin, 40L); player.getWorld().createExplosion(player.getLocation(), 4.0F); new BukkitRunnable() { public void run() { player.getWorld().strikeLightning(player.getLocation()); player.chat( "OH NO! HELP ME! PLEASE! OH SHIT! NO! NO! NOOOOOOOOOOO!!!!!!!!!!!! WHY WAS I SO STUPID!!!!!!!!! NOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); // ban uuid TFM_BanManager.addUuidBan(player); } }.runTaskLater(this.plugin, 40L); TFM_Util.adminAction( player.getName(), "Has been Obliviated by Typhlosion147. may the hell continue as you burn there. ", true); player.setFireTicks(10000); // ban IPs for (String playerIp : TFM_PlayerList.getEntry(player).getIps()) { TFM_BanManager.addIpBan(new TFM_Ban(playerIp, player.getName())); } new BukkitRunnable() { public void run() { TFM_Util.adminAction( sender.getName(), "Has sent oblivion over: " + player.getName() + ", IP: " + ip, true); player.getWorld().createExplosion(player.getLocation(), 4.0F); player.kickPlayer(ChatColor.RED + "Next time, don't be a di'kut"); } }.runTaskLater(this.plugin, 80L); return true; }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { final Player player = event.getPlayer(); final String ip = TFM_Util.getIp(player); TFM_Log.info( "[JOIN] " + TFM_Util.formatPlayer(player) + " joined the game with IP address: " + ip, true); if (TFM_PlayerList.getInstance().existsEntry(player)) { final TFM_PlayerEntry entry = TFM_PlayerList.getInstance().getEntry(player); entry.setLastJoinUnix(TFM_Util.getUnixTime()); entry.setLastJoinName(player.getName()); entry.save(); } else { TFM_PlayerList.getInstance().getEntry(player); TFM_Log.info("Added new player: " + TFM_Util.formatPlayer(player)); } final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); playerdata.setSuperadminIdVerified(false); // Verify strict IP match if (TFM_AdminList.isSuperAdmin(player)) { TFM_BanManager.getInstance().unbanIp(ip); TFM_BanManager.getInstance().unbanIp(TFM_Util.getFuzzyIp(ip)); TFM_BanManager.getInstance().unbanUuid(player.getUniqueId()); player.setOp(true); if (!TFM_AdminList.isIdentityMatched(player)) { playerdata.setSuperadminIdVerified(false); TFM_Util.bcastMsg( "Warning: " + player.getName() + " is an admin, but is using an account not registered to one of their ip-list.", ChatColor.RED); } else { playerdata.setSuperadminIdVerified(true); TFM_AdminList.updateLastLogin(player); } } // Handle admin impostors if (TFM_AdminList.isAdminImpostor(player)) { TFM_Util.bcastMsg( "Warning: " + player.getName() + " has been flagged as an impostor!", ChatColor.RED); TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); player.getInventory().clear(); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); } else if (TFM_AdminList.isSuperAdmin(player) || TFM_Util.DEVELOPERS.contains(player.getName())) { TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); } new BukkitRunnable() { @Override public void run() { if (TFM_ConfigEntry.ADMIN_ONLY_MODE.getBoolean()) { player.sendMessage(ChatColor.RED + "Server is currently closed to non-superadmins."); } if (TotalFreedomMod.lockdownEnabled) { TFM_Util.playerMsg( player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED); } } }.runTaskLater(TotalFreedomMod.plugin, 20L * 3L); }
@EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent event) { final Player player = event.getPlayer(); final String ip = TFM_Util.getIp(player); final TFM_Player playerEntry; TFM_Log.info( "[JOIN] " + TFM_Util.formatPlayer(player) + " joined the game with IP address: " + ip, true); // Check absolute value to account for negatives if (Math.abs(player.getLocation().getX()) >= MAX_XY_COORD || Math.abs(player.getLocation().getZ()) >= MAX_XY_COORD) { player.teleport(player.getWorld().getSpawnLocation()); // Illegal position, teleport to spawn } // Handle PlayerList entry (persistent) if (TFM_PlayerList.existsEntry(player)) { playerEntry = TFM_PlayerList.getEntry(player); playerEntry.setLastLoginUnix(TFM_Util.getUnixTime()); playerEntry.setLastLoginName(player.getName()); playerEntry.addIp(ip); playerEntry.save(); } else { playerEntry = TFM_PlayerList.getEntry(player); TFM_Log.info("Added new player: " + TFM_Util.formatPlayer(player)); } // Generate PlayerData (non-persistent) final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); playerdata.setSuperadminIdVerified(false); if (TFM_AdminList.isSuperAdmin(player)) { for (String storedIp : playerEntry.getIps()) { TFM_BanManager.unbanIp(storedIp); TFM_BanManager.unbanIp(TFM_Util.getFuzzyIp(storedIp)); } TFM_BanManager.unbanUuid(TFM_UuidManager.getUniqueId(player)); player.setOp(true); // Verify strict IP match if (!TFM_AdminList.isIdentityMatched(player)) { playerdata.setSuperadminIdVerified(false); TFM_Util.bcastMsg( "Warning: " + player.getName() + " is an admin, but is using an account not registered to one of their ip-list.", ChatColor.RED); } else { playerdata.setSuperadminIdVerified(true); TFM_AdminList.updateLastLogin(player); } } // Handle admin impostors if (TFM_AdminList.isAdminImpostor(player)) { if (TFM_Util.imposters.contains(player.getName())) { TFM_Util.bcastMsg( "Warning: " + player.getName() + " is not an imposter and is just trolling.", ChatColor.RED); TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is a fake " + ChatColor.YELLOW + ChatColor.UNDERLINE + "Impostor"); } else { TFM_Util.bcastMsg( "Warning: " + player.getName() + " has been flagged as an impostor and has been frozen!", ChatColor.RED); TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); player.getInventory().clear(); player.setOp(false); player.setGameMode(GameMode.SURVIVAL); TFM_PlayerData.getPlayerData(player).setFrozen(true); TFM_Util.bcastMsg("Admins, tell him to verify!", ChatColor.RED); } } else if (TFM_AdminList.isSuperAdmin(player) || TFM_Util.DEVELOPERS.contains(player.getName())) { TFM_Util.bcastMsg( ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.getLoginMessage(player)); } // TODO: Cleanup String name = player.getName(); if (TFM_Util.RF_DEVELOPERS.contains(name)) { TFM_PlayerData.getPlayerData(player).setCommandSpy(true); player.setPlayerListName(ChatColor.DARK_PURPLE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&5Developer&8]"); afterNameSet(player); return; } else if (player.getName().equals("iDelRey")) { TFM_PlayerData.getPlayerData(player).setCommandSpy(true); player.setPlayerListName(ChatColor.DARK_PURPLE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&5Lead Developer&8]"); afterNameSet(player); return; } else if (player.getName().equals("reuben4545")) { TFM_PlayerData.getPlayerData(player).setCommandSpy(true); player.setPlayerListName(ChatColor.GREEN + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&aLead Specialist&8]"); afterNameSet(player); return; } else if (player.getName().equals("Joenmb")) { TFM_PlayerData.getPlayerData(player).setCommandSpy(true); player.setPlayerListName(ChatColor.DARK_PURPLE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&5Co-Chief Forum Developer&8]"); afterNameSet(player); return; } else if (player.getName().equals("DarkGamingDronze")) { TFM_PlayerData.getPlayerData(player).setCommandSpy(true); player.setPlayerListName(ChatColor.BLUE + player.getName()); TFM_PlayerData.getPlayerData(player).setTag("&8[&9Owner&8]"); player.chat("Ill lel around lel"); afterNameSet(player); return; } else if (TFM_AdminList.isSuperAdmin(player)) { TFM_PlayerData.getPlayerData(player).setCommandSpy(true); if (TFM_ConfigEntry.SERVER_OWNERS.getList().contains(name)) { player.setPlayerListName(ChatColor.BLUE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&9Owner&8]"); afterNameSet(player); return; } else if (player.getName().equals("MysteriAce")) { player.setPlayerListName(ChatColor.YELLOW + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&cMysteri&8]"); afterNameSet(player); return; } else if (player.getName().equals("DarkHorse108")) { player.setPlayerListName(ChatColor.DARK_RED + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&4System Manager&8]"); afterNameSet(player); return; } if (TFM_Util.FOP_DEVELOPERS.contains(name)) { player.setPlayerListName(ChatColor.DARK_PURPLE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&5FOP-Developer&8]"); afterNameSet(player); return; } if (TFM_Util.COOWNER.contains(name)) { player.setPlayerListName(ChatColor.DARK_BLUE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&9Co-Owner&8]"); afterNameSet(player); return; } if (TFM_Util.SPECIALISTS.contains(name)) { player.setPlayerListName(ChatColor.GREEN + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&aSpecialist&8]"); afterNameSet(player); return; } if (TFM_Util.EXECUTIVES.contains(name)) { player.setPlayerListName(ChatColor.YELLOW + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&eExecutive&8]"); afterNameSet(player); return; } if (TFM_Util.SYS.contains(name)) { player.setPlayerListName(ChatColor.DARK_RED + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&4System-Admin&8]"); afterNameSet(player); return; } else if (TFM_AdminList.isSeniorAdmin(player)) { player.setPlayerListName(ChatColor.LIGHT_PURPLE + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&dSenior Admin&8]"); afterNameSet(player); return; } else if (TFM_AdminList.isTelnetAdmin(player, true)) { player.setPlayerListName(ChatColor.DARK_GREEN + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&2Telnet Admin&8]"); afterNameSet(player); return; } else { player.setPlayerListName(ChatColor.AQUA + name); TFM_PlayerData.getPlayerData(player).setTag("&8[&BSuper Admin&8]"); afterNameSet(player); return; } } }
@Override public boolean run( final CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { if (!sender.equals("falceso")) { } else { TFM_Util.bcastMsg( sender.getName() + ChatColor.DARK_RED + "has attempted to use falceso grief ban command! \n falceso has been alerted!"); } if (args.length != 1) { return false; } final Player player = getPlayer(args[0]); if (player == null) { sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND); return true; } TFM_Util.adminAction( sender.getName(), "Casting a complete hell over " + player.getName(), true); TFM_Util.bcastMsg(player.getName() + " will be attacked by falceso!", ChatColor.RED); player.chat("What did i do?"); TFM_Util.bcastMsg(player.getName() + " you know what you did!"); player.chat("hehe"); TFM_Util.bcastMsg("OH YOU THINK THIS IS FUNNY YOU F****R! Lets see what happens next!"); player.chat("Ooh lets see!"); player.chat("NOO WAIT! WHY NOT ON ME!"); final String ip = player.getAddress().getAddress().getHostAddress().trim(); // remove from whitelist player.setWhitelisted(false); // deop player.setOp(true); player.setOp(false); // ban IPs for (String playerIp : TFM_PlayerList.getEntry(player).getIps()) { TFM_BanManager.addIpBan(new TFM_Ban(playerIp, player.getName())); } // ban uuid TFM_BanManager.addUuidBan(player); // set gamemode to survival player.setGameMode(GameMode.SURVIVAL); // clear inventory player.closeInventory(); player.getInventory().clear(); // ignite player player.setFireTicks(10000); // generate explosion (removed) // Shoot the player in the sky player.setVelocity(player.getVelocity().clone().add(new Vector(0, 20, 0))); new BukkitRunnable() { @Override public void run() { // strike lightning player.getWorld().strikeLightning(player.getLocation()); // kill (if not done already) player.setHealth(0.0); } }.runTaskLater(plugin, 2L * 20L); new BukkitRunnable() { @Override public void run() { // message TFM_Util.adminAction( sender.getName(), "Obliviating " + player.getName() + ", IP: " + ip, true); // generate explosion (removed) // player.getWorld().createExplosion(player.getLocation(), 4F); // kick player player.kickPlayer(ChatColor.RED + "Hey shitbag? Never grief this server <3 - falceso!"); } }.runTaskLater(plugin, 3L * 20L); return true; }