Remove minion command
This commit is contained in:
parent
92604bf6ad
commit
176253faec
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user