9
0
mirror of https://github.com/Xiao-MoMi/craft-engine.git synced 2025-12-26 02:19:23 +00:00

fix: 不是哥们这原版床都有这个问题

This commit is contained in:
jhqwqmc
2025-09-10 14:40:27 +08:00
parent bcb5c0f554
commit 647e585c86

View File

@@ -52,14 +52,13 @@ public class BouncingBlockBehavior extends BukkitBlockBehavior {
Object deltaMovement = FastNMS.INSTANCE.method$Entity$getDeltaMovement(entity);
if (FastNMS.INSTANCE.field$Vec3$y(deltaMovement) < 0.0) {
double d = CoreReflections.clazz$LivingEntity.isInstance(entity) ? 1.0 : 0.8;
double y = -FastNMS.INSTANCE.field$Vec3$y(deltaMovement) * this.bounceHeight * d;
FastNMS.INSTANCE.method$Entity$setDeltaMovement(
entity,
FastNMS.INSTANCE.field$Vec3$x(deltaMovement),
y,
-FastNMS.INSTANCE.field$Vec3$y(deltaMovement) * this.bounceHeight * d,
FastNMS.INSTANCE.field$Vec3$z(deltaMovement)
);
if (this.syncPlayerSelf && y > 0.0315) { // 不知道为什么会抖
if (this.syncPlayerSelf) {
FastNMS.INSTANCE.field$Entity$hurtMarked(entity, true);
}
}