Skip to content

Commit

Permalink
Default to no team color when receiving unknown values. Closes Geyser…
Browse files Browse the repository at this point in the history
  • Loading branch information
Steveice10 authored and Steveice10 committed Jan 11, 2018
1 parent 63e06fa commit 1728e10
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,12 @@ public void read(NetInput in) throws IOException {
this.seeFriendlyInvisibles = (flags & 0x2) != 0;
this.nameTagVisibility = MagicValues.key(NameTagVisibility.class, in.readString());
this.collisionRule = MagicValues.key(CollisionRule.class, in.readString());
this.color = MagicValues.key(TeamColor.class, in.readByte());

try {
this.color = MagicValues.key(TeamColor.class, in.readByte());
} catch(IllegalArgumentException e) {
this.color = TeamColor.NONE;
}
}

if(this.action == TeamAction.CREATE || this.action == TeamAction.ADD_PLAYER || this.action == TeamAction.REMOVE_PLAYER) {
Expand Down

0 comments on commit 1728e10

Please sign in to comment.