mirror of
https://github.com/TheDeus-Group/TFM-4.3-Reloaded.git
synced 2024-12-22 22:44:58 +00:00
morle 😢
This commit is contained in:
parent
b264a9ede4
commit
24fcaa081b
3 changed files with 995 additions and 1009 deletions
|
@ -1,5 +1,6 @@
|
||||||
package me.StevenLawson.TotalFreedomMod.commands;
|
package me.StevenLawson.TotalFreedomMod.commands;
|
||||||
|
|
||||||
|
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
|
||||||
import me.StevenLawson.TotalFreedomMod.admin.AdminList;
|
import me.StevenLawson.TotalFreedomMod.admin.AdminList;
|
||||||
import me.StevenLawson.TotalFreedomMod.ban.Ban;
|
import me.StevenLawson.TotalFreedomMod.ban.Ban;
|
||||||
import me.StevenLawson.TotalFreedomMod.ban.BanManager;
|
import me.StevenLawson.TotalFreedomMod.ban.BanManager;
|
||||||
|
@ -15,89 +16,102 @@ import org.bukkit.util.Vector;
|
||||||
|
|
||||||
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE)
|
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE)
|
||||||
public class Command_doom extends FreedomCommand {
|
public class Command_doom extends FreedomCommand {
|
||||||
@Override
|
|
||||||
public boolean run(final CommandSender sender, org.bukkit.entity.Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
|
|
||||||
if (args.length != 1) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Player player = getPlayer(args[0]);
|
public static void doom(final CommandSender sender, final Player player) {
|
||||||
|
final TotalFreedomMod plugin = TotalFreedomMod.plugin;
|
||||||
|
|
||||||
if (player == null) {
|
new BukkitRunnable() {
|
||||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
@Override
|
||||||
return true;
|
public void run() {
|
||||||
}
|
Utilities.adminAction(sender.getName(), "Casting oblivion over " + player.getName(),
|
||||||
|
true);
|
||||||
|
Utilities.bcastMsg(player.getName() + " will be completely obliterated!",
|
||||||
|
ChatColor.RED);
|
||||||
|
|
||||||
Utilities.adminAction(sender.getName(), "Casting oblivion over " + player.getName(), true);
|
final String ip = player.getAddress().getAddress().getHostAddress().trim();
|
||||||
Utilities.bcastMsg(player.getName() + " will be completely obliterated!", ChatColor.RED);
|
|
||||||
|
|
||||||
final String ip = player.getAddress().getAddress().getHostAddress().trim();
|
// remove from superadmin
|
||||||
|
if (AdminList.isSuperAdmin(player)) {
|
||||||
|
Utilities.adminAction(sender.getName(),
|
||||||
|
"Removing " + player.getName() + " from the superadmin list.", true);
|
||||||
|
AdminList.removeSuperadmin(player);
|
||||||
|
}
|
||||||
|
|
||||||
// remove from superadmin
|
// remove from whitelist
|
||||||
if (AdminList.isSuperAdmin(player))
|
player.setWhitelisted(false);
|
||||||
{
|
|
||||||
Utilities.adminAction(sender.getName(), "Removing " + player.getName() + " from the superadmin list.", true);
|
|
||||||
AdminList.removeSuperadmin(player);
|
|
||||||
}
|
|
||||||
|
|
||||||
// remove from whitelist
|
// deop
|
||||||
player.setWhitelisted(false);
|
player.setOp(false);
|
||||||
|
|
||||||
// deop
|
// ban IPs
|
||||||
player.setOp(false);
|
for (String playerIp : PlayerList.getEntry(player).getIps()) {
|
||||||
|
BanManager.addIpBan(new Ban(playerIp, player.getName()));
|
||||||
|
}
|
||||||
|
|
||||||
// ban IPs
|
// ban uuid
|
||||||
for (String playerIp : PlayerList.getEntry(player).getIps())
|
BanManager.addUuidBan(player);
|
||||||
{
|
|
||||||
BanManager.addIpBan(new Ban(playerIp, player.getName()));
|
|
||||||
}
|
|
||||||
|
|
||||||
// ban uuid
|
// set gamemode to survival
|
||||||
BanManager.addUuidBan(player);
|
player.setGameMode(GameMode.SURVIVAL);
|
||||||
|
|
||||||
// set gamemode to survival
|
// clear inventory
|
||||||
player.setGameMode(GameMode.SURVIVAL);
|
player.closeInventory();
|
||||||
|
player.getInventory().clear();
|
||||||
|
|
||||||
// clear inventory
|
// ignite player
|
||||||
player.closeInventory();
|
player.setFireTicks(10000);
|
||||||
player.getInventory().clear();
|
|
||||||
|
|
||||||
// ignite player
|
//removed explosion (it bypasses TFM's explosive toggle and makes a BIG hole that no one likes fixing)
|
||||||
player.setFireTicks(10000);
|
|
||||||
|
|
||||||
//removed explosion (it bypasses TFM's explosive toggle and makes a BIG hole that no one likes fixing)
|
// Shoot the player in the sky
|
||||||
|
player.setVelocity(player.getVelocity().clone().add(new Vector(0, 20, 0)));
|
||||||
|
|
||||||
// Shoot the player in the sky
|
new BukkitRunnable() {
|
||||||
player.setVelocity(player.getVelocity().clone().add(new Vector(0, 20, 0)));
|
@Override
|
||||||
|
public void run() {
|
||||||
|
// strike lightning
|
||||||
|
player.getWorld().strikeLightning(player.getLocation());
|
||||||
|
|
||||||
new BukkitRunnable()
|
// kill (if not done already)
|
||||||
{
|
player.setHealth(0.0);
|
||||||
@Override
|
}
|
||||||
public void run()
|
}.runTaskLater(plugin, 2L * 20L);
|
||||||
{
|
|
||||||
// strike lightning
|
|
||||||
player.getWorld().strikeLightning(player.getLocation());
|
|
||||||
|
|
||||||
// kill (if not done already)
|
new BukkitRunnable() {
|
||||||
player.setHealth(0.0);
|
@Override
|
||||||
}
|
public void run() {
|
||||||
}.runTaskLater(plugin, 2L * 20L);
|
// message
|
||||||
|
Utilities.adminAction(sender.getName(),
|
||||||
|
"Banning " + player.getName() + ", IP: " + Utilities.getFuzzyIp(ip),
|
||||||
|
true);
|
||||||
|
|
||||||
new BukkitRunnable()
|
//removed explosion (it bypasses TFM's explosive toggle and makes a BIG hole that no one likes fixing)
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public void run()
|
|
||||||
{
|
|
||||||
// message
|
|
||||||
Utilities.adminAction(sender.getName(), "Banning " + player.getName() + ", IP: " + Utilities.getFuzzyIp(ip), true);
|
|
||||||
|
|
||||||
//removed explosion (it bypasses TFM's explosive toggle and makes a BIG hole that no one likes fixing)
|
// kick player
|
||||||
|
player.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!");
|
||||||
|
}
|
||||||
|
}.runTaskLater(plugin, 3L * 20L);
|
||||||
|
}
|
||||||
|
}.runTask(plugin);
|
||||||
|
}
|
||||||
|
|
||||||
// kick player
|
|
||||||
player.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!");
|
|
||||||
}
|
|
||||||
}.runTaskLater(plugin, 3L * 20L);
|
|
||||||
|
|
||||||
return true;
|
@Override
|
||||||
}
|
public boolean run(final CommandSender sender, org.bukkit.entity.Player sender_p, Command cmd,
|
||||||
|
String commandLabel, String[] args, boolean senderIsConsole) {
|
||||||
|
if (args.length != 1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Player player = getPlayer(args[0]);
|
||||||
|
|
||||||
|
if (player == null) {
|
||||||
|
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
doom(sender, player);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,50 +9,49 @@ import org.bukkit.entity.Player;
|
||||||
|
|
||||||
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
|
||||||
public class Command_gcmd extends FreedomCommand {
|
public class Command_gcmd extends FreedomCommand {
|
||||||
@Override
|
|
||||||
public boolean run(CommandSender sender, org.bukkit.entity.Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) {
|
|
||||||
if (args.length < 2) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
String arguments = String.join(" ", args);
|
@Override
|
||||||
|
public boolean run(CommandSender sender, org.bukkit.entity.Player sender_p, Command cmd,
|
||||||
|
String commandLabel, String[] args, boolean senderIsConsole) {
|
||||||
|
if (args.length < 2) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (arguments.toLowerCase().contains("wildcard") || arguments.toLowerCase().contains("gcmd")) {
|
String arguments = String.join(" ", args);
|
||||||
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
final Player player = getPlayer(args[0]);
|
if (arguments.toLowerCase().contains("wildcard") || arguments.toLowerCase().contains("gcmd")
|
||||||
|
|| arguments.toLowerCase().contains("moles")) {
|
||||||
|
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
|
||||||
|
if (sender_p != null) {
|
||||||
|
Command_smite.smite(sender_p);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (player == null) {
|
final Player player = getPlayer(args[0]);
|
||||||
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
final String outCommand = StringUtils.join(args, " ", 1, args.length);
|
if (player == null) {
|
||||||
|
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (CommandBlocker.isCommandBlocked(outCommand, sender))
|
final String outCommand = StringUtils.join(args, " ", 1, args.length);
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
if (CommandBlocker.isCommandBlocked(outCommand, sender)) {
|
||||||
{
|
return true;
|
||||||
playerMsg(sender, "Sending command as " + player.getName() + ": " + outCommand);
|
}
|
||||||
if (server.dispatchCommand(player, outCommand))
|
|
||||||
{
|
|
||||||
playerMsg(sender, "Command sent.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
playerMsg(sender, "Unknown error sending command.");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (Throwable ex)
|
|
||||||
{
|
|
||||||
playerMsg(sender, "Error sending command: " + ex.getMessage());
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
try {
|
||||||
}
|
playerMsg(sender, "Sending command as " + player.getName() + ": " + outCommand);
|
||||||
|
if (server.dispatchCommand(player, outCommand)) {
|
||||||
|
playerMsg(sender, "Command sent.");
|
||||||
|
} else {
|
||||||
|
playerMsg(sender, "Unknown error sending command.");
|
||||||
|
}
|
||||||
|
} catch (Throwable ex) {
|
||||||
|
playerMsg(sender, "Error sending command: " + ex.getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue