diff --git a/CHANGELOG.md b/CHANGELOG.md index 7812687aa..a1228fc48 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.2.1] - 2020-01-23 +### Fixed +- Dedicated server fails to start due to mixin not finding client-side only class + ## [2.2.0] - 2021-01-23 ### Added - Config option to disable extra hurt sounds for Kitty Slippers and Bunny Hoppers @@ -96,3 +100,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [1.0.0] - 2020-11-02 ### Added - Initial release + +[Unreleased]: https://github.com/florensie/artifacts-fabric/compare/v2.2.1...HEAD +[2.2.1]: https://github.com/florensie/artifacts-fabric/compare/v2.2.0...v2.2.1 +[2.2.0]: https://github.com/florensie/artifacts-fabric/releases/tag/v2.2.0 diff --git a/gradle.properties b/gradle.properties index 7897a8986..b0b795309 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,7 +10,7 @@ yarn_mappings=1.16.5+build.3 loader_version=0.11.1 # Mod Properties -mod_version=2.2.0+fabric +mod_version=2.2.1+fabric maven_group=artifacts archives_base_name=artifacts diff --git a/src/main/java/artifacts/mixin/mixins/item/cloudinabottle/LivingEntityMixin.java b/src/main/java/artifacts/mixin/mixins/item/cloudinabottle/LivingEntityMixin.java index 085b7c94a..160483359 100644 --- a/src/main/java/artifacts/mixin/mixins/item/cloudinabottle/LivingEntityMixin.java +++ b/src/main/java/artifacts/mixin/mixins/item/cloudinabottle/LivingEntityMixin.java @@ -4,6 +4,8 @@ import artifacts.common.item.trinket.CloudInABottleItem; import artifacts.common.trinkets.TrinketsHelper; import artifacts.mixin.extensions.LivingEntityExtensions; +import net.fabricmc.api.EnvType; +import net.fabricmc.api.Environment; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking; import net.fabricmc.fabric.api.networking.v1.PacketByteBufs; import net.minecraft.entity.Entity; @@ -64,12 +66,19 @@ public LivingEntityMixin(EntityType type, World world) { // Send double jump packet to server if we're on the client if (this.world.isClient) { - ClientPlayNetworking.send(CloudInABottleItem.C2S_DOUBLE_JUMPED_ID, PacketByteBufs.empty()); + sendDoubleJumpPacket(); } this.isDoubleJumping = false; } + // This code is extracted because the mixin fails to apply with the usage of client-side only classes + @Unique + @Environment(EnvType.CLIENT) + private static void sendDoubleJumpPacket() { + ClientPlayNetworking.send(CloudInABottleItem.C2S_DOUBLE_JUMPED_ID, PacketByteBufs.empty()); + } + @ModifyVariable(method = "handleFallDamage", ordinal = 0, at = @At("HEAD")) private float reduceFallDistance(float fallDistance) { // FIXME: this probably also works if we didn't double jump, intended?