Remove debug commands

This commit is contained in:
Thanos Paravantis 2016-07-14 08:17:36 +03:00
parent 6082418fc7
commit 906762e9db

View File

@ -29,7 +29,6 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.ItemSpawnEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerArmorStandManipulateEvent;
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerMoveEvent;
@ -42,7 +41,6 @@ import org.bukkit.scheduler.BukkitRunnable;
import com.google.common.collect.Lists;
import mineplex.core.common.Rank;
import mineplex.core.common.util.C;
import mineplex.core.common.util.F;
import mineplex.core.common.util.UtilAction;
@ -1497,73 +1495,73 @@ public class BawkBawkBattles extends TeamGame implements IThrown
return "";
}
@EventHandler
public void debugCommands(PlayerCommandPreprocessEvent event)
{
Player player = event.getPlayer();
String message = event.getMessage();
if (Manager.GetClients().hasRank(player, Rank.SNR_MODERATOR))
{
if (message.startsWith("/restrict"))
{
String[] pieces = message.split(" ");
if (pieces.length > 1)
{
String challenge = F.combine(pieces, 1, null, false).trim();
if (_list.restrict(challenge))
{
UtilPlayer.message(player, F.main("Game", "Restricted to " + F.elem(challenge) + " challenge."));
}
else
{
UtilPlayer.message(player, F.main("Game", "Could not find any challenge by that name."));
}
}
else
{
UtilPlayer.message(player, F.main("Game", "All challenge restrictions were cleared."));
_list.unrestrict();
}
event.setCancelled(true);
}
else if (message.startsWith("/skip"))
{
if (IsLive())
{
endCurrentChallenge();
Announce(C.cAqua + C.Bold + player.getName() + " skipped this challenge.");
}
else
{
UtilPlayer.message(player, F.main("Game", "You cannot skip a challenge if the game is not started."));
}
event.setCancelled(true);
}
else if (message.startsWith("/lose"))
{
if (IsLive() && _challenge != null && IsAlive(player))
{
setLives(player, 0);
_challenge.getData().addLostPlayer(player);
_deathEffect.playDeath(player, player.getLocation());
GetScoreboard().ResetScore(player.getName());
_chickenAttack.start(player);
}
else
{
UtilPlayer.message(player, F.main("Game", "You cannot lose at this time."));
}
event.setCancelled(true);
}
}
}
// @EventHandler
// public void debugCommands(PlayerCommandPreprocessEvent event)
// {
// Player player = event.getPlayer();
// String message = event.getMessage();
//
// if (Manager.GetClients().hasRank(player, Rank.SNR_MODERATOR))
// {
// if (message.startsWith("/restrict"))
// {
// String[] pieces = message.split(" ");
//
// if (pieces.length > 1)
// {
// String challenge = F.combine(pieces, 1, null, false).trim();
//
// if (_list.restrict(challenge))
// {
// UtilPlayer.message(player, F.main("Game", "Restricted to " + F.elem(challenge) + " challenge."));
// }
// else
// {
// UtilPlayer.message(player, F.main("Game", "Could not find any challenge by that name."));
// }
// }
// else
// {
// UtilPlayer.message(player, F.main("Game", "All challenge restrictions were cleared."));
// _list.unrestrict();
// }
//
// event.setCancelled(true);
// }
// else if (message.startsWith("/skip"))
// {
// if (IsLive())
// {
// endCurrentChallenge();
//
// Announce(C.cAqua + C.Bold + player.getName() + " skipped this challenge.");
// }
// else
// {
// UtilPlayer.message(player, F.main("Game", "You cannot skip a challenge if the game is not started."));
// }
//
// event.setCancelled(true);
// }
// else if (message.startsWith("/lose"))
// {
// if (IsLive() && _challenge != null && IsAlive(player))
// {
// setLives(player, 0);
// _challenge.getData().addLostPlayer(player);
// _deathEffect.playDeath(player, player.getLocation());
// GetScoreboard().ResetScore(player.getName());
// _chickenAttack.start(player);
// }
// else
// {
// UtilPlayer.message(player, F.main("Game", "You cannot lose at this time."));
// }
//
// event.setCancelled(true);
// }
// }
// }
/*
* Helper methods