String[] teamNameSplit = race.getTeamName().split(" ");
for (String teamNamePart : teamNameSplit)
{
teamNameTotal = teamNameTotal.concat(dB + teamNamePart + " ");
}
playerInvited.addChatMessage(new ChatComponentText(dA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.inviteReceived", bG + player.getGameProfile().getName() + dA) + " " + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.toJoin", teamNameTotal, EnumColor.AQUA + "/joinrace" + dA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
}
}
break;
case S_REMOVE_RACE_PLAYER:
Integer teamInvitedTo = (Integer) this.data.get(1);
SpaceRace race = SpaceRaceManager.getSpaceRaceFromID(teamInvitedTo);
if (race != null)
{
String playerToRemove = (String) this.data.get(0);
if (!race.getPlayerNames().remove(playerToRemove))
{
player.addChatMessage(new ChatComponentText(GCCoreUtil.translateWithFormat("gui.spaceRace.chat.notFound", playerToRemove)));
}
else
{
SpaceRaceManager.onPlayerRemoval(playerToRemove, race);
}
}
break;
case S_ADD_RACE_PLAYER:
Integer teamToAddPlayer = (Integer) this.data.get(1);
SpaceRace spaceRaceToAddPlayer = SpaceRaceManager.getSpaceRaceFromID(teamToAddPlayer);
if (spaceRaceToAddPlayer != null)
{
String playerToAdd = (String) this.data.get(0);
if (!spaceRaceToAddPlayer.getPlayerNames().contains(playerToAdd))
{
SpaceRace oldRace = null;
while ((oldRace = SpaceRaceManager.getSpaceRaceFromPlayer(playerToAdd)) != null)
{
SpaceRaceManager.removeSpaceRace(oldRace);
}
spaceRaceToAddPlayer.getPlayerNames().add(playerToAdd);
SpaceRaceManager.sendSpaceRaceData(null, spaceRaceToAddPlayer);
for (String member : spaceRaceToAddPlayer.getPlayerNames())
{
EntityPlayerMP memberObj = PlayerUtil.getPlayerForUsernameVanilla(MinecraftServer.getServer(), member);
if (memberObj != null)
{
memberObj.addChatMessage(new ChatComponentText(EnumColor.DARK_AQUA + GCCoreUtil.translateWithFormat("gui.spaceRace.chat.addSuccess", EnumColor.BRIGHT_GREEN + playerToAdd + EnumColor.DARK_AQUA)).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_AQUA)));
}
}
}
else
{
player.addChatMessage(new ChatComponentText(GCCoreUtil.translate("gui.spaceRace.chat.alreadyPart")).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.DARK_RED)));
}
}
break;
case S_COMPLETE_CBODY_HANDSHAKE:
String completeList = (String) this.data.get(0);