Skip to content

Commit

Permalink
fix: do not attempt to send the Hello packet when the client does not…
Browse files Browse the repository at this point in the history
… have RCH installed
  • Loading branch information
Jamalam360 committed Oct 27, 2024
1 parent 68c55d8 commit 92a7141
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
- Update to 1.21.3
- (fix) do not attempt to send the Hello packet when the client does not have RCH installed.
- This means that RCH is now properly client-optional again, as intended.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ public static void init() {
NetworkManager.registerS2CPayloadType(HelloPacket.TYPE, HelloPacket.STREAM_CODEC);
}

PlayerEvent.PLAYER_JOIN.register((player) -> NetworkManager.sendToPlayer(player, new HelloPacket()));
PlayerEvent.PLAYER_JOIN.register((player) -> {
if (NetworkManager.canPlayerReceive(player, HelloPacket.TYPE)) {
NetworkManager.sendToPlayer(player, new HelloPacket());
}
});

InteractionEvent.RIGHT_CLICK_BLOCK.register(((player, hand, pos, face) -> RightClickHarvest.onBlockUse(player, player.level(), hand, new BlockHitResult(player.position(), face, pos, false), true)));
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
org.gradle.parallel=true
version=4.4.1+1.21.3
version=4.4.2+1.21.3
minecraft_version=1.21.3
additional_minecraft_versions=1.21.2
minimum_minecraft_version=1.21.2
Expand Down

0 comments on commit 92a7141

Please sign in to comment.