diff --git a/CHANGELOG.md b/CHANGELOG.md index 512ba28..bc7606e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. diff --git a/common/src/main/java/io/github/jamalam360/rightclickharvest/RightClickHarvest.java b/common/src/main/java/io/github/jamalam360/rightclickharvest/RightClickHarvest.java index 4b8784e..aafc005 100644 --- a/common/src/main/java/io/github/jamalam360/rightclickharvest/RightClickHarvest.java +++ b/common/src/main/java/io/github/jamalam360/rightclickharvest/RightClickHarvest.java @@ -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))); } diff --git a/gradle.properties b/gradle.properties index 65f9e99..bb51747 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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