Skip to content

Commit

Permalink
Bump to release 1.20.2-1 (#766)
Browse files Browse the repository at this point in the history
* Better take on the previous commit
* Bump to release
  • Loading branch information
Konicai authored Nov 23, 2023
1 parent 542e2ff commit a0cd1e1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.steveice10</groupId>
<artifactId>mcprotocollib</artifactId>
<version>1.20.2-1-SNAPSHOT</version>
<version>1.20.2-1</version>
<packaging>jar</packaging>

<name>MCProtocolLib</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import lombok.NonNull;
import lombok.Setter;
import net.kyori.adventure.text.Component;
import org.jetbrains.annotations.Nullable;

@Data
@Setter(AccessLevel.NONE)
Expand All @@ -16,5 +15,5 @@ public class ServerStatusInfo {
private @NonNull PlayerInfo playerInfo;
private @NonNull Component description;
private byte[] iconPng;
private @Nullable Boolean enforcesSecureChat;
private boolean enforcesSecureChat;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
@With
@AllArgsConstructor
public class ClientboundStatusResponsePacket implements MinecraftPacket {

// vanilla behavior falls back to false if the field was not sent
private static final boolean ENFORCES_SECURE_CHAT_DEFAULT = false;

private final @NonNull ServerStatusInfo info;

public ClientboundStatusResponsePacket(ByteBuf in, MinecraftCodecHelper helper) throws IOException {
Expand All @@ -54,7 +58,7 @@ public ClientboundStatusResponsePacket(ByteBuf in, MinecraftCodecHelper helper)
icon = this.stringToIcon(obj.get("favicon").getAsString());
}

Boolean enforcesSecureChat = null;
boolean enforcesSecureChat = ENFORCES_SECURE_CHAT_DEFAULT;
if (obj.has("enforcesSecureChat")) {
enforcesSecureChat = obj.get("enforcesSecureChat").getAsBoolean();
}
Expand Down Expand Up @@ -88,9 +92,7 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) throws IOExcepti
if (this.info.getIconPng() != null) {
obj.addProperty("favicon", this.iconToString(this.info.getIconPng()));
}
if (this.info.getEnforcesSecureChat() != null) {
obj.addProperty("enforcesSecureChat", this.info.getEnforcesSecureChat());
}
obj.addProperty("enforcesSecureChat", this.info.isEnforcesSecureChat());

helper.writeString(out, obj.toString());
}
Expand Down

0 comments on commit a0cd1e1

Please sign in to comment.