Remove minion command

This commit is contained in:
Sam 2017-05-21 17:33:33 +01:00
parent 92604bf6ad
commit 176253faec
2 changed files with 26 additions and 0 deletions

View File

@ -1,17 +1,21 @@
package nautilus.game.arcade.game.games.moba.minion;
import mineplex.core.common.Rank;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import nautilus.game.arcade.events.GamePrepareCountdownCommence;
import nautilus.game.arcade.game.DebugCommand;
import nautilus.game.arcade.game.GameTeam;
import nautilus.game.arcade.game.games.moba.Moba;
import nautilus.game.arcade.game.games.moba.MobaLane;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.PigZombie;
import org.bukkit.entity.Player;
import org.bukkit.entity.Zombie;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
@ -39,6 +43,20 @@ public class MinionManager implements Listener
_host = host;
_path = new HashMap<>(3);
_waves = new HashSet<>();
host.registerDebugCommand(new DebugCommand("removeminions", Rank.DEVELOPER)
{
@Override
public void Execute(Player caller, String[] args)
{
for (MinionWave wave : _waves)
{
wave.cleanup();
}
caller.sendMessage(F.main("Debug", "Removed all minions."));
}
});
}
@EventHandler

View File

@ -163,6 +163,14 @@ public class MinionWave implements Listener
event.getDrops().clear();
}
public void cleanup()
{
for (Minion minion : _minions)
{
minion.getEntity().remove();
}
}
private Minion getMinion(Entity entity)
{
for (Minion minion : _minions)