添加地面载具撞掉仙人掌

This commit is contained in:
Atsuihsio 2025-01-30 21:42:13 +08:00
parent 066c123252
commit f1a1c728e6
2 changed files with 4 additions and 4 deletions

View file

@ -492,10 +492,10 @@ public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ICha
* 撞掉莲叶和冰块
*/
public void collideBlock() {
AABB aabb = AABB.ofSize(new Vec3(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ()), 3.6, 2.6, 3.6);
AABB aabb = getBoundingBox().inflate(0.1).move(this.getDeltaMovement().scale(0.6));
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(Blocks.LILY_PAD)) {
if (blockstate.is(Blocks.LILY_PAD) || blockstate.is(Blocks.CACTUS)) {
this.level().destroyBlock(pos, true);
}
});

View file

@ -465,10 +465,10 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
* 撞掉莲叶和冰块
*/
public void collideBlock() {
AABB aabb = AABB.ofSize(new Vec3(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ()), 3.6, 2.6, 3.6);
AABB aabb = getBoundingBox().inflate(0.1).move(this.getDeltaMovement().scale(0.6));
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(Blocks.LILY_PAD)) {
if (blockstate.is(Blocks.LILY_PAD) || blockstate.is(Blocks.CACTUS)) {
this.level().destroyBlock(pos, true);
}
});