diff --git a/src/main/java/me/totalfreedom/totalfreedommod/EntityWiper.java b/src/main/java/me/totalfreedom/totalfreedommod/EntityWiper.java index 8e89211d..1f157717 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/EntityWiper.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/EntityWiper.java @@ -11,7 +11,6 @@ import me.totalfreedom.totalfreedommod.util.FUtil; import org.bukkit.Bukkit; import org.bukkit.Chunk; import org.bukkit.World; -import org.bukkit.block.BlockState; import org.bukkit.entity.AreaEffectCloud; import org.bukkit.entity.Boat; import org.bukkit.entity.EnderCrystal; @@ -28,10 +27,7 @@ import org.bukkit.entity.ThrownExpBottle; import org.bukkit.entity.ThrownPotion; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; -import org.bukkit.event.block.BlockBreakEvent; import org.bukkit.event.entity.ItemSpawnEvent; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; @@ -40,7 +36,7 @@ public class EntityWiper extends FreedomService public static final long ENTITY_WIPE_RATE = 5 * 20L; public static final long ITEM_DESPAWN_RATE = 20L * 20L; - public static final int CHUNK_ENTITY_MAX = 30; + public static final int CHUNK_ENTITY_MAX = 20; // private final List> wipables = new ArrayList<>(); // @@ -78,7 +74,7 @@ public class EntityWiper extends FreedomService @Override public void run() { - wipeEntities(); + wipeEntities(false); } }.runTaskTimer(plugin, ENTITY_WIPE_RATE, ENTITY_WIPE_RATE); @@ -104,19 +100,19 @@ public class EntityWiper extends FreedomService return false; } - public int wipeEntities() + public int wipeEntities(boolean force) { int removed = 0; Iterator worlds = Bukkit.getWorlds().iterator(); while (worlds.hasNext()) { - removed += wipeEntities(worlds.next()); + removed += wipeEntities(worlds.next(), force); } return removed; } - public int wipeEntities(World world) + public int wipeEntities(World world, boolean force) { int removed = 0; @@ -159,7 +155,7 @@ public class EntityWiper extends FreedomService { List cel = cem.get(c); - if (cel.size() < CHUNK_ENTITY_MAX) + if (!force && cel.size() < CHUNK_ENTITY_MAX) { continue; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_entitywipe.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_entitywipe.java index 8fab2acb..d6eaf9bb 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_entitywipe.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_entitywipe.java @@ -15,7 +15,7 @@ public class Command_entitywipe extends FreedomCommand public boolean run(CommandSender sender, Player playerSender, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) { FUtil.adminAction(sender.getName(), "Removing all server entities.", true); - msg((plugin.ew.wipeEntities()) + " entities removed."); + msg((plugin.ew.wipeEntities(true)) + " entities removed."); return true; } diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java index f7f40d63..3553c072 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_plugincontrol.java @@ -9,7 +9,7 @@ import org.bukkit.entity.Player; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginManager; -@CommandPermissions(level = Rank.SENIOR_ADMIN, source = SourceType.BOTH) +@CommandPermissions(level = Rank.TELNET_ADMIN, source = SourceType.BOTH) @CommandParameters(description = "Manage plugins", usage = "/ < > | list>", aliases = "plc") public class Command_plugincontrol extends FreedomCommand { diff --git a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_purgeall.java b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_purgeall.java index 22616675..f70c1c97 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/command/Command_purgeall.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/command/Command_purgeall.java @@ -19,7 +19,7 @@ public class Command_purgeall extends FreedomCommand FUtil.adminAction(sender.getName(), "Purging all player data", true); // Purge entities - plugin.ew.wipeEntities(); + plugin.ew.wipeEntities(true); for (Player player : server.getOnlinePlayers()) {