morle 😢

This commit is contained in:
Business Goose 2022-03-31 02:46:24 +01:00
parent b264a9ede4
commit 24fcaa081b
No known key found for this signature in database
GPG key ID: 77DCA801362E9645
3 changed files with 995 additions and 1009 deletions

View file

@ -1,5 +1,6 @@
package me.StevenLawson.TotalFreedomMod.commands;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import me.StevenLawson.TotalFreedomMod.admin.AdminList;
import me.StevenLawson.TotalFreedomMod.ban.Ban;
import me.StevenLawson.TotalFreedomMod.ban.BanManager;
@ -15,89 +16,102 @@ import org.bukkit.util.Vector;
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE)
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) {
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
return true;
}
new BukkitRunnable() {
@Override
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);
Utilities.bcastMsg(player.getName() + " will be completely obliterated!", ChatColor.RED);
final String ip = player.getAddress().getAddress().getHostAddress().trim();
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
if (AdminList.isSuperAdmin(player))
{
Utilities.adminAction(sender.getName(), "Removing " + player.getName() + " from the superadmin list.", true);
AdminList.removeSuperadmin(player);
}
// remove from whitelist
player.setWhitelisted(false);
// remove from whitelist
player.setWhitelisted(false);
// deop
player.setOp(false);
// deop
player.setOp(false);
// ban IPs
for (String playerIp : PlayerList.getEntry(player).getIps()) {
BanManager.addIpBan(new Ban(playerIp, player.getName()));
}
// ban IPs
for (String playerIp : PlayerList.getEntry(player).getIps())
{
BanManager.addIpBan(new Ban(playerIp, player.getName()));
}
// ban uuid
BanManager.addUuidBan(player);
// ban uuid
BanManager.addUuidBan(player);
// set gamemode to survival
player.setGameMode(GameMode.SURVIVAL);
// set gamemode to survival
player.setGameMode(GameMode.SURVIVAL);
// clear inventory
player.closeInventory();
player.getInventory().clear();
// clear inventory
player.closeInventory();
player.getInventory().clear();
// ignite player
player.setFireTicks(10000);
// ignite player
player.setFireTicks(10000);
//removed explosion (it bypasses TFM's explosive toggle and makes a BIG hole that no one likes fixing)
//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
player.setVelocity(player.getVelocity().clone().add(new Vector(0, 20, 0)));
new BukkitRunnable() {
@Override
public void run() {
// strike lightning
player.getWorld().strikeLightning(player.getLocation());
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);
// kill (if not done already)
player.setHealth(0.0);
}
}.runTaskLater(plugin, 2L * 20L);
new BukkitRunnable() {
@Override
public void run() {
// message
Utilities.adminAction(sender.getName(),
"Banning " + player.getName() + ", IP: " + Utilities.getFuzzyIp(ip),
true);
new BukkitRunnable()
{
@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)
//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;
}
}

View file

@ -9,50 +9,49 @@ import org.bukkit.entity.Player;
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
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")) {
playerMsg("What the hell are you trying to do, you stupid idiot...", ChatColor.RED);
return true;
}
String arguments = String.join(" ", args);
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) {
sender.sendMessage(FreedomCommand.PLAYER_NOT_FOUND);
return true;
}
final Player player = getPlayer(args[0]);
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))
{
return true;
}
final String outCommand = StringUtils.join(args, " ", 1, args.length);
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());
}
if (CommandBlocker.isCommandBlocked(outCommand, sender)) {
return true;
}
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;
}
}