调整载具碰撞

This commit is contained in:
Atsuishio 2025-05-02 01:37:33 +08:00 committed by Light_Quanta
parent 53a1536d34
commit b944e27619
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -438,7 +438,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
public void baseCollideBlock() {
if (level() instanceof ServerLevel) {
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.5, 1).move(this.getDeltaMovement().scale(0.6));
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.5 , 1).move(this.getDeltaMovement().scale(1.2));
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(Blocks.LILY_PAD) ||
@ -452,7 +452,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
public void collideBlock() {
if (!VehicleConfig.COLLISION_DESTROY_BLOCKS.get()) return;
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.5, 1).move(this.getDeltaMovement().scale(0.6));
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.5 , 1).move(this.getDeltaMovement().scale(1.2));
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(ModTags.Blocks.SOFT_COLLISION)) {
@ -463,7 +463,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
public void collideHardBlock() {
if (!VehicleConfig.COLLISION_DESTROY_HARD_BLOCKS.get()) return;
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.5, 1).move(this.getDeltaMovement().scale(0.6));
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.5 , 1).move(this.getDeltaMovement().scale(1.2));
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
if (blockstate.is(ModTags.Blocks.HARD_COLLISION)) {
@ -475,7 +475,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements
public void collideBlockBeastly() {
if (!VehicleConfig.COLLISION_DESTROY_BLOCKS_BEASTLY.get()) return;
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.52, 1).move(this.getDeltaMovement().scale(0.6));
AABB aabb = getBoundingBox().inflate(0.25, 1, 0.25).expandTowards(0, 0.52 , 1).move(this.getDeltaMovement().scale(1.2));
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
BlockState blockstate = this.level().getBlockState(pos);
float hardness = blockstate.getBlock().defaultDestroyTime();