diff --git a/CHANGELOG.md b/CHANGELOG.md index b2b2f80..a61daee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 2.0.4 + +- Fix Barrier not knocking back hostile players + # 2.0.3 - Fix breaking change with Spell Engine diff --git a/gradle.properties b/gradle.properties index d5f2783..04bc410 100644 --- a/gradle.properties +++ b/gradle.properties @@ -12,7 +12,7 @@ fabric_api_version=0.102.0+1.21.1 # Mod maven_group=net archives_base_name=paladins -mod_version=2.0.3 +mod_version=2.0.4 minecraft_compat_version=1.21 # Dependencies diff --git a/src/main/java/net/paladins/entity/BarrierEntity.java b/src/main/java/net/paladins/entity/BarrierEntity.java index 9073816..a513e8f 100644 --- a/src/main/java/net/paladins/entity/BarrierEntity.java +++ b/src/main/java/net/paladins/entity/BarrierEntity.java @@ -5,7 +5,11 @@ import net.minecraft.entity.data.DataTracker; import net.minecraft.entity.data.TrackedData; import net.minecraft.entity.data.TrackedDataHandlerRegistry; +import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.NbtCompound; +import net.minecraft.network.packet.s2c.play.EntityVelocityUpdateS2CPacket; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; import net.minecraft.sound.SoundCategory; import net.minecraft.util.Identifier; import net.minecraft.world.World; @@ -182,6 +186,12 @@ public void tick() { } else { livingEntity.takeKnockback(PaladinsMod.tweaksConfig.value.barrier_knockback_strength, this.getX() - livingEntity.getX(), this.getZ() - livingEntity.getZ()); + if (livingEntity instanceof ServerPlayerEntity serverPlayer) { + serverPlayer.networkHandler.send( + new EntityVelocityUpdateS2CPacket(serverPlayer.getId(), serverPlayer.getVelocity()), + null + ); + } } } }