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,28 +16,24 @@ import org.bukkit.util.Vector;
@CommandPermissions(level = AdminLevel.SENIOR, source = SourceType.ONLY_CONSOLE)
public class Command_doom extends FreedomCommand {
public static void doom(final CommandSender sender, final Player player) {
final TotalFreedomMod plugin = TotalFreedomMod.plugin;
new BukkitRunnable() {
@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;
}
Utilities.adminAction(sender.getName(), "Casting oblivion over " + player.getName(), true);
Utilities.bcastMsg(player.getName() + " will be completely obliterated!", ChatColor.RED);
public void run() {
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();
// remove from superadmin
if (AdminList.isSuperAdmin(player))
{
Utilities.adminAction(sender.getName(), "Removing " + player.getName() + " from the superadmin list.", true);
if (AdminList.isSuperAdmin(player)) {
Utilities.adminAction(sender.getName(),
"Removing " + player.getName() + " from the superadmin list.", true);
AdminList.removeSuperadmin(player);
}
@ -47,8 +44,7 @@ public class Command_doom extends FreedomCommand {
player.setOp(false);
// ban IPs
for (String playerIp : PlayerList.getEntry(player).getIps())
{
for (String playerIp : PlayerList.getEntry(player).getIps()) {
BanManager.addIpBan(new Ban(playerIp, player.getName()));
}
@ -70,11 +66,9 @@ public class Command_doom extends FreedomCommand {
// Shoot the player in the sky
player.setVelocity(player.getVelocity().clone().add(new Vector(0, 20, 0)));
new BukkitRunnable()
{
new BukkitRunnable() {
@Override
public void run()
{
public void run() {
// strike lightning
player.getWorld().strikeLightning(player.getLocation());
@ -83,13 +77,13 @@ public class Command_doom extends FreedomCommand {
}
}.runTaskLater(plugin, 2L * 20L);
new BukkitRunnable()
{
new BukkitRunnable() {
@Override
public void run()
{
public void run() {
// message
Utilities.adminAction(sender.getName(), "Banning " + player.getName() + ", IP: " + Utilities.getFuzzyIp(ip), true);
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)
@ -97,6 +91,26 @@ public class Command_doom extends FreedomCommand {
player.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!");
}
}.runTaskLater(plugin, 3L * 20L);
}
}.runTask(plugin);
}
@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,16 +9,22 @@ 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) {
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);
if (arguments.toLowerCase().contains("wildcard") || arguments.toLowerCase().contains("gcmd")) {
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;
}
@ -31,25 +37,18 @@ public class Command_gcmd extends FreedomCommand {
final String outCommand = StringUtils.join(args, " ", 1, args.length);
if (CommandBlocker.isCommandBlocked(outCommand, sender))
{
if (CommandBlocker.isCommandBlocked(outCommand, sender)) {
return true;
}
try
{
try {
playerMsg(sender, "Sending command as " + player.getName() + ": " + outCommand);
if (server.dispatchCommand(player, outCommand))
{
if (server.dispatchCommand(player, outCommand)) {
playerMsg(sender, "Command sent.");
}
else
{
} else {
playerMsg(sender, "Unknown error sending command.");
}
}
catch (Throwable ex)
{
} catch (Throwable ex) {
playerMsg(sender, "Error sending command: " + ex.getMessage());
}