just stupid shit

This commit is contained in:
Super_ 2019-12-23 23:21:52 -05:00
parent 1bc06f2c1d
commit 855c01a46b
3 changed files with 19 additions and 6 deletions

View File

@ -22,11 +22,14 @@ public class Command_entitywipe extends FreedomCommand
for (World world : Bukkit.getWorlds()) for (World world : Bukkit.getWorlds())
{ {
for (Entity entity : world.getEntities()) for (Entity entity : world.getEntities())
{
if (!(entity instanceof Player))
{ {
entity.remove(); entity.remove();
removed++; removed++;
} }
} }
}
msg(removed + " entities removed."); msg(removed + " entities removed.");
return true; return true;

View File

@ -1,8 +1,6 @@
package me.totalfreedom.totalfreedommod.command; package me.totalfreedom.totalfreedommod.command;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List; import java.util.List;
import me.totalfreedom.totalfreedommod.banning.Ban; import me.totalfreedom.totalfreedommod.banning.Ban;
import me.totalfreedom.totalfreedommod.player.PlayerData; import me.totalfreedom.totalfreedommod.player.PlayerData;
@ -11,8 +9,10 @@ import me.totalfreedom.totalfreedommod.punishments.PunishmentType;
import me.totalfreedom.totalfreedommod.rank.Rank; import me.totalfreedom.totalfreedommod.rank.Rank;
import me.totalfreedom.totalfreedommod.util.FUtil; import me.totalfreedom.totalfreedommod.util.FUtil;
import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg; import static me.totalfreedom.totalfreedommod.util.FUtil.playerMsg;
import net.pravian.aero.util.Ips;
import org.apache.commons.lang.ArrayUtils; import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
@ -148,10 +148,17 @@ public class Command_gtfo extends FreedomCommand
playerMsg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", ")); playerMsg(sender, ChatColor.GRAY + username + " has been banned and IP is: " + StringUtils.join(ips, ", "));
FUtil.bcastMsg(bcast.toString()); FUtil.bcastMsg(bcast.toString());
// Kick player // Kick player and handle others on IP
if (player != null) if (player != null)
{ {
player.kickPlayer(ban.bakeKickMessage()); player.kickPlayer(ban.bakeKickMessage());
for (Player p : Bukkit.getOnlinePlayers())
{
if (Ips.getIp(p).equals(Ips.getIp(player)))
{
p.kickPlayer(ChatColor.RED + "You've been kicked because someone on your IP has been banned.");
}
}
} }
// Log ban // Log ban

View File

@ -25,10 +25,13 @@ public class Command_purgeall extends FreedomCommand
for (World world : Bukkit.getWorlds()) for (World world : Bukkit.getWorlds())
{ {
for (Entity entity : world.getEntities()) for (Entity entity : world.getEntities())
{
if (!(entity instanceof Player))
{ {
entity.remove(); entity.remove();
} }
} }
}
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {