Fix some really silly things

This commit is contained in:
Sam 2017-06-15 01:58:48 +01:00
parent 2a0796472b
commit cfe8840d7a

View File

@ -10,6 +10,7 @@ import mineplex.core.common.util.UtilAlg;
import mineplex.core.common.util.UtilServer;
import mineplex.core.common.util.UtilTime;
import mineplex.core.disguise.disguises.DisguiseBase;
import mineplex.core.disguise.disguises.DisguisePlayer;
import mineplex.core.leaderboard.Leaderboard;
import mineplex.core.leaderboard.LeaderboardManager;
import mineplex.core.leaderboard.LeaderboardRepository.LeaderboardSQLType;
@ -187,10 +188,6 @@ public class Moba extends TeamGame
case Live:
writeLive(player, scoreboard);
break;
case End:
case WinRoom:
writeEnd(player, scoreboard);
break;
}
})
.setPrefix((perspective, subject) ->
@ -416,15 +413,6 @@ public class Moba extends TeamGame
scoreboard.write(UtilTime.MakeStr(System.currentTimeMillis() - GetStateTime()));
}
private void writeEnd(Player player, GameScoreboard scoreboard)
{
scoreboard.writeNewLine();
scoreboard.write("Game Over");
scoreboard.writeNewLine();
}
@EventHandler(priority = EventPriority.LOWEST)
public void prepare(GameStateChangeEvent event)
{
@ -499,7 +487,7 @@ public class Moba extends TeamGame
{
for (Player player : otherTeam.GetPlayers(true))
{
AddGems(player, 10, "Participation", true, true);
AddGems(player, 10, "Participation", false, false);
}
if (team.equals(otherTeam))
@ -509,7 +497,7 @@ public class Moba extends TeamGame
for (Player player : otherTeam.GetPlayers(true))
{
AddGems(player, 20, "Winning", true, true);
AddGems(player, 20, "Winning", false, false);
}
AnnounceEnd(otherTeam);
@ -575,7 +563,7 @@ public class Moba extends TeamGame
@EventHandler
public void end(GameStateChangeEvent event)
{
if (event.GetState() != GameState.End)
if (event.GetState() != GameState.End && event.GetState() != GameState.Dead)
{
return;
}
@ -584,7 +572,7 @@ public class Moba extends TeamGame
{
DisguiseBase disguise = Manager.GetDisguise().getActiveDisguise(player);
if (disguise != null)
if (disguise != null && disguise instanceof DisguisePlayer)
{
Manager.GetDisguise().undisguise(disguise);
}