Skip to content

Commit

Permalink
Merge pull request #1386 from Gu-ZT/spectral
Browse files Browse the repository at this point in the history
修改幻灵铁砧下落判定
  • Loading branch information
ZhuRuoLing authored Dec 20, 2024
2 parents cf0e964 + 5d584e0 commit 0b485f1
Showing 1 changed file with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,10 @@ public void tick() {
fallDistance -= (float) this.getDeltaMovement().y;
if (this.level().isClientSide) return;
BlockPos current = this.blockPosition();
Vec3 pos = this.position();
Vec3 belowPos = pos.subtract(0.0D, 0.335D, 0.0D);
BlockPos below = new BlockPos((int) Math.floor(belowPos.x()), (int) Math.floor(belowPos.y()), (int) Math.floor(belowPos.z()));
BlockPos pos = this.blockPosition();
BlockPos below = pos.below();
BlockState blockStateDown = this.level().getBlockState(below);
if (pos.y() < -160) {
discard();
}
if (pos.getY() < -160) this.discard();
if (!shouldIgnoreBlockInMovement(blockStateDown)) {
this.discard();
if (!isGhostEntity) {
Expand All @@ -118,11 +115,7 @@ public void tick() {
LivingEntity.class,
new AABB(current),
predicate
).forEach(it -> it.hurt(
level().damageSources().anvil(this),
Math.min(40f, fallDistance * 2)
)
);
).forEach(it -> it.hurt(level().damageSources().anvil(this), Math.min(40f, fallDistance * 2)));
NeoForge.EVENT_BUS.post(new AnvilFallOnLandEvent(level(), current, this, fallDistance));
}
this.setDeltaMovement(this.getDeltaMovement().scale(0.98));
Expand Down

0 comments on commit 0b485f1

Please sign in to comment.