Skip to content

Commit a0cd1e1

Browse files
authored
Bump to release 1.20.2-1 (#766)
* Better take on the previous commit * Bump to release
1 parent 542e2ff commit a0cd1e1

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.github.steveice10</groupId>
77
<artifactId>mcprotocollib</artifactId>
8-
<version>1.20.2-1-SNAPSHOT</version>
8+
<version>1.20.2-1</version>
99
<packaging>jar</packaging>
1010

1111
<name>MCProtocolLib</name>

src/main/java/com/github/steveice10/mc/protocol/data/status/ServerStatusInfo.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import lombok.NonNull;
77
import lombok.Setter;
88
import net.kyori.adventure.text.Component;
9-
import org.jetbrains.annotations.Nullable;
109

1110
@Data
1211
@Setter(AccessLevel.NONE)
@@ -16,5 +15,5 @@ public class ServerStatusInfo {
1615
private @NonNull PlayerInfo playerInfo;
1716
private @NonNull Component description;
1817
private byte[] iconPng;
19-
private @Nullable Boolean enforcesSecureChat;
18+
private boolean enforcesSecureChat;
2019
}

src/main/java/com/github/steveice10/mc/protocol/packet/status/clientbound/ClientboundStatusResponsePacket.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
@With
2929
@AllArgsConstructor
3030
public class ClientboundStatusResponsePacket implements MinecraftPacket {
31+
32+
// vanilla behavior falls back to false if the field was not sent
33+
private static final boolean ENFORCES_SECURE_CHAT_DEFAULT = false;
34+
3135
private final @NonNull ServerStatusInfo info;
3236

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

57-
Boolean enforcesSecureChat = null;
61+
boolean enforcesSecureChat = ENFORCES_SECURE_CHAT_DEFAULT;
5862
if (obj.has("enforcesSecureChat")) {
5963
enforcesSecureChat = obj.get("enforcesSecureChat").getAsBoolean();
6064
}
@@ -88,9 +92,7 @@ public void serialize(ByteBuf out, MinecraftCodecHelper helper) throws IOExcepti
8892
if (this.info.getIconPng() != null) {
8993
obj.addProperty("favicon", this.iconToString(this.info.getIconPng()));
9094
}
91-
if (this.info.getEnforcesSecureChat() != null) {
92-
obj.addProperty("enforcesSecureChat", this.info.getEnforcesSecureChat());
93-
}
95+
obj.addProperty("enforcesSecureChat", this.info.isEnforcesSecureChat());
9496

9597
helper.writeString(out, obj.toString());
9698
}

0 commit comments

Comments
 (0)