fixing chat and test commands.
This commit is contained in:
parent
0f8028f6e6
commit
4abad9e1c4
@ -463,11 +463,12 @@ public class TypeWars extends TeamGame
|
|||||||
if(GetState() != GameState.Live)
|
if(GetState() != GameState.Live)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!Manager.GetClients().Get(event.getPlayer()).GetRank().has(event.getPlayer(), Rank.DEVELOPER, true))
|
|
||||||
return;
|
|
||||||
|
|
||||||
if(event.getMessage().contains("/Money"))
|
if(event.getMessage().contains("/Money"))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if(!Manager.GetClients().Get(event.getPlayer()).GetRank().has(event.getPlayer(), Rank.DEVELOPER, true))
|
||||||
|
return;
|
||||||
|
|
||||||
_moneyMap.put(event.getPlayer(), 1000);
|
_moneyMap.put(event.getPlayer(), 1000);
|
||||||
UtilPlayer.message(event.getPlayer(), F.main("Money", "You got some Money"));
|
UtilPlayer.message(event.getPlayer(), F.main("Money", "You got some Money"));
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -476,6 +477,9 @@ public class TypeWars extends TeamGame
|
|||||||
|
|
||||||
if(event.getMessage().contains("/Boss"))
|
if(event.getMessage().contains("/Boss"))
|
||||||
{
|
{
|
||||||
|
if(!Manager.GetClients().Get(event.getPlayer()).GetRank().has(event.getPlayer(), Rank.DEVELOPER, true))
|
||||||
|
return;
|
||||||
|
|
||||||
if(!IsPlaying(event.getPlayer()))
|
if(!IsPlaying(event.getPlayer()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -820,32 +824,36 @@ public class TypeWars extends TeamGame
|
|||||||
if(!GetPlayers(true).contains(event.getPlayer()))
|
if(!GetPlayers(true).contains(event.getPlayer()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Minion minion = getFarestMininion(event.getPlayer(), event.getMessage());
|
try
|
||||||
|
|
||||||
Bukkit.getPluginManager().callEvent(new TypeAttemptEvent(event.getPlayer(), event.getMessage(), minion != null));
|
|
||||||
|
|
||||||
if(minion == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
MinionKillEvent minionEvent = new MinionKillEvent(event.getPlayer(), minion, KillType.TYPED);
|
|
||||||
Bukkit.getPluginManager().callEvent(minionEvent);
|
|
||||||
|
|
||||||
if(minionEvent.isCancelled())
|
|
||||||
return;
|
|
||||||
|
|
||||||
killMinion(minion, event.getPlayer());
|
|
||||||
|
|
||||||
int spawned = _minionsSpawned.get(GetTeam(event.getPlayer()));
|
|
||||||
_minionsSpawned.put(GetTeam(event.getPlayer()), spawned + 1);
|
|
||||||
|
|
||||||
if(_playerTitles.contains(event.getPlayer()))
|
|
||||||
{
|
{
|
||||||
_playerTitles.remove(event.getPlayer());
|
Minion minion = getFarestMininion(event.getPlayer(), event.getMessage());
|
||||||
UtilTextMiddle.clear(event.getPlayer());
|
|
||||||
|
Bukkit.getPluginManager().callEvent(new TypeAttemptEvent(event.getPlayer(), event.getMessage(), minion != null));
|
||||||
|
|
||||||
|
if(minion == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
MinionKillEvent minionEvent = new MinionKillEvent(event.getPlayer(), minion, KillType.TYPED);
|
||||||
|
Bukkit.getPluginManager().callEvent(minionEvent);
|
||||||
|
|
||||||
|
if(minionEvent.isCancelled())
|
||||||
|
return;
|
||||||
|
|
||||||
|
killMinion(minion, event.getPlayer());
|
||||||
|
|
||||||
|
int spawned = _minionsSpawned.get(GetTeam(event.getPlayer()));
|
||||||
|
_minionsSpawned.put(GetTeam(event.getPlayer()), spawned + 1);
|
||||||
|
|
||||||
|
if(_playerTitles.contains(event.getPlayer()))
|
||||||
|
{
|
||||||
|
_playerTitles.remove(event.getPlayer());
|
||||||
|
UtilTextMiddle.clear(event.getPlayer());
|
||||||
|
}
|
||||||
|
UtilTextMiddle.display("", C.cGreen + "+$" + minion.getMoney(), event.getPlayer());
|
||||||
|
_moneyMap.put(event.getPlayer(), _moneyMap.get(event.getPlayer()) + minion.getMoney());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
UtilTextMiddle.display("", C.cGreen + "+$" + minion.getMoney(), event.getPlayer());
|
catch (Exception ex) {}
|
||||||
_moneyMap.put(event.getPlayer(), _moneyMap.get(event.getPlayer()) + minion.getMoney());
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum KillType
|
public enum KillType
|
||||||
|
Loading…
Reference in New Issue
Block a user