Skip to content

Commit

Permalink
Added some placeholder code for survive,core and time goals, within t…
Browse files Browse the repository at this point in the history
…eam|goal messages
  • Loading branch information
entropitor committed Apr 13, 2013
1 parent 78c5497 commit 3fb6ba8
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions net/minecraft/src/AutoReferee.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,26 @@ public void handleCustomPayload(Packet250CustomPayload par1Packet250CustomPayloa
}
} else if ("goal".equals(command[2])) {
// team object events
String[] blockInfo = (command[3].substring(1)).split(",");
int blockId = Integer.parseInt(blockInfo[0]);
int blockData = 0;
if(blockInfo.length >= 2)
blockData = Integer.parseInt(blockInfo[1]);

if (command[3].startsWith("+")) {
// player object retrieval
addObjectiveForTeam(teamName, blockId, blockData);
} else if (command[3].startsWith("-")) {
// player object loss
removeObjectiveForTeam(teamName, blockId, blockData);
if("surive".equalsIgnoreCase(command[3])){
//TODO add survive goal stuff
}else if("core".equalsIgnoreCase(command[3])){
//TODO add core goal stuff
}else if("time".equalsIgnoreCase(command[3])){
//TODO add time goal stuff
}else{//else it's just a blockid and blockdata.
String[] blockInfo = (command[3].substring(1)).split(",");
int blockId = Integer.parseInt(blockInfo[0]);
int blockData = 0;
if(blockInfo.length >= 2)
blockData = Integer.parseInt(blockInfo[1]);

if (command[3].startsWith("+")) {
// player object retrieval
addObjectiveForTeam(teamName, blockId, blockData);
} else if (command[3].startsWith("-")) {
// player object loss
removeObjectiveForTeam(teamName, blockId, blockData);
}
}
} else if ("state".equals(command[2])) {
// team objective state event
Expand Down

0 comments on commit 3fb6ba8

Please sign in to comment.