Skip to content

Commit

Permalink
add safety check to packetevents legacy teams serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
vytskalt committed Oct 13, 2024
1 parent 5f093db commit 1b752a0
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ public WrapperPlayServerTeamsLegacy(String teamName, ImmutableTeamProperties<Str

@Override
public void write() {
if (serverVersion.isNewerThanOrEquals(ServerVersion.V_1_13)) {
throw new IllegalStateException("Tried to serialize legacy teams packet on 1.13+ server version");
}

writeString(teamName, 16);
writeByte(teamMode.ordinal());
writeString(properties.displayName());
Expand Down

0 comments on commit 1b752a0

Please sign in to comment.