添加更多能撞掉的方块
This commit is contained in:
parent
f1a1c728e6
commit
e2f28c7787
5 changed files with 105 additions and 82 deletions
|
@ -101,7 +101,7 @@ public class ModItemTagProvider extends ItemTagsProvider {
|
||||||
this.tag(ModTags.Items.MILITARY_ARMOR).add(ModItems.RU_CHEST_6B43.get(), ModItems.US_CHEST_IOTV.get());
|
this.tag(ModTags.Items.MILITARY_ARMOR).add(ModItems.RU_CHEST_6B43.get(), ModItems.US_CHEST_IOTV.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TagKey<Item> forgeTag(String name) {
|
public static TagKey<Item> forgeTag(String name) {
|
||||||
return ItemTags.create(new ResourceLocation("forge", name));
|
return ItemTags.create(new ResourceLocation("forge", name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,6 @@ import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Explosion;
|
import net.minecraft.world.level.Explosion;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
@ -348,6 +347,10 @@ public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ICha
|
||||||
}
|
}
|
||||||
|
|
||||||
collideBlock();
|
collideBlock();
|
||||||
|
if (this.getDeltaMovement().length() > 0.15) {
|
||||||
|
collideHardBlock();
|
||||||
|
}
|
||||||
|
|
||||||
gunnerAngle();
|
gunnerAngle();
|
||||||
lowHealthWarning();
|
lowHealthWarning();
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
|
@ -487,20 +490,6 @@ public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ICha
|
||||||
return -Mth.lerp(pPartialTick, turretYRotO - this.yRotO, getTurretYRot() - this.getYRot());
|
return -Mth.lerp(pPartialTick, turretYRotO - this.yRotO, getTurretYRot() - this.getYRot());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 撞掉莲叶和冰块
|
|
||||||
*/
|
|
||||||
public void collideBlock() {
|
|
||||||
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) || blockstate.is(Blocks.CACTUS)) {
|
|
||||||
this.level().destroyBlock(pos, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void travel() {
|
public void travel() {
|
||||||
Entity passenger0 = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
|
Entity passenger0 = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
|
||||||
|
|
|
@ -36,7 +36,6 @@ import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.item.ItemStack;
|
import net.minecraft.world.item.ItemStack;
|
||||||
import net.minecraft.world.level.Explosion;
|
import net.minecraft.world.level.Explosion;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
import net.minecraft.world.level.block.Blocks;
|
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.phys.AABB;
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
@ -308,6 +307,11 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
|
||||||
}
|
}
|
||||||
|
|
||||||
collideBlock();
|
collideBlock();
|
||||||
|
if (this.getDeltaMovement().length() > 0.2) {
|
||||||
|
collideHardBlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
gunnerAngle();
|
gunnerAngle();
|
||||||
lowHealthWarning();
|
lowHealthWarning();
|
||||||
|
|
||||||
|
@ -460,20 +464,6 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC
|
||||||
return -Mth.lerp(pPartialTick, turretYRotO - this.yRotO, getTurretYRot() - this.getYRot());
|
return -Mth.lerp(pPartialTick, turretYRotO - this.yRotO, getTurretYRot() - this.getYRot());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 撞掉莲叶和冰块
|
|
||||||
*/
|
|
||||||
public void collideBlock() {
|
|
||||||
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) || blockstate.is(Blocks.CACTUS)) {
|
|
||||||
this.level().destroyBlock(pos, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void travel() {
|
public void travel() {
|
||||||
Entity passenger0 = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
|
Entity passenger0 = this.getPassengers().isEmpty() ? null : this.getPassengers().get(0);
|
||||||
|
|
|
@ -7,13 +7,16 @@ import com.atsuishio.superbwarfare.entity.projectile.LaserEntity;
|
||||||
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
|
import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity;
|
||||||
import com.atsuishio.superbwarfare.init.ModDamageTypes;
|
import com.atsuishio.superbwarfare.init.ModDamageTypes;
|
||||||
import com.atsuishio.superbwarfare.init.ModSounds;
|
import com.atsuishio.superbwarfare.init.ModSounds;
|
||||||
|
import net.minecraft.core.BlockPos;
|
||||||
import net.minecraft.core.Direction;
|
import net.minecraft.core.Direction;
|
||||||
import net.minecraft.nbt.CompoundTag;
|
import net.minecraft.nbt.CompoundTag;
|
||||||
import net.minecraft.network.syncher.EntityDataAccessor;
|
import net.minecraft.network.syncher.EntityDataAccessor;
|
||||||
import net.minecraft.network.syncher.EntityDataSerializers;
|
import net.minecraft.network.syncher.EntityDataSerializers;
|
||||||
import net.minecraft.network.syncher.SynchedEntityData;
|
import net.minecraft.network.syncher.SynchedEntityData;
|
||||||
|
import net.minecraft.server.level.ServerLevel;
|
||||||
import net.minecraft.sounds.SoundEvent;
|
import net.minecraft.sounds.SoundEvent;
|
||||||
import net.minecraft.sounds.SoundEvents;
|
import net.minecraft.sounds.SoundEvents;
|
||||||
|
import net.minecraft.tags.BlockTags;
|
||||||
import net.minecraft.util.Mth;
|
import net.minecraft.util.Mth;
|
||||||
import net.minecraft.world.entity.AreaEffectCloud;
|
import net.minecraft.world.entity.AreaEffectCloud;
|
||||||
import net.minecraft.world.entity.Entity;
|
import net.minecraft.world.entity.Entity;
|
||||||
|
@ -23,8 +26,12 @@ import net.minecraft.world.entity.item.ItemEntity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraft.world.entity.projectile.Projectile;
|
import net.minecraft.world.entity.projectile.Projectile;
|
||||||
import net.minecraft.world.level.Level;
|
import net.minecraft.world.level.Level;
|
||||||
|
import net.minecraft.world.level.block.Blocks;
|
||||||
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
import net.minecraft.world.level.entity.EntityTypeTest;
|
import net.minecraft.world.level.entity.EntityTypeTest;
|
||||||
|
import net.minecraft.world.phys.AABB;
|
||||||
import net.minecraft.world.phys.Vec3;
|
import net.minecraft.world.phys.Vec3;
|
||||||
|
import net.minecraftforge.common.Tags;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.joml.Math;
|
import org.joml.Math;
|
||||||
import org.joml.Vector3f;
|
import org.joml.Vector3f;
|
||||||
|
@ -79,34 +86,69 @@ public class MobileVehicleEntity extends EnergyVehicleEntity {
|
||||||
this.refreshDimensions();
|
this.refreshDimensions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void collideBlock() {
|
||||||
|
if (level() instanceof ServerLevel) {
|
||||||
|
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) || blockstate.is(Blocks.CACTUS)
|
||||||
|
|| blockstate.is(BlockTags.LEAVES) || blockstate.is(BlockTags.FENCES)
|
||||||
|
|| blockstate.is(BlockTags.FENCE_GATES) || blockstate.is(BlockTags.DOORS)
|
||||||
|
|| blockstate.is(BlockTags.TRAPDOORS) || blockstate.is(Blocks.BAMBOO)
|
||||||
|
|| blockstate.is(Tags.Blocks.GLASS) || blockstate.is(Tags.Blocks.GLASS_PANES)
|
||||||
|
|| blockstate.is(Blocks.MELON) || blockstate.is(Blocks.PUMPKIN)
|
||||||
|
|| blockstate.is(Blocks.HAY_BLOCK) || blockstate.is(Blocks.BELL)
|
||||||
|
|| blockstate.is(BlockTags.WALLS) || blockstate.is(Blocks.CHAIN)) {
|
||||||
|
this.level().destroyBlock(pos, true);
|
||||||
|
this.setDeltaMovement(this.getDeltaMovement().scale(0.96));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void collideHardBlock() {
|
||||||
|
if (level() instanceof ServerLevel) {
|
||||||
|
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(BlockTags.LOGS) || blockstate.is(BlockTags.PLANKS)) {
|
||||||
|
this.level().destroyBlock(pos, true);
|
||||||
|
this.setDeltaMovement(this.getDeltaMovement().scale(0.6));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void move(@NotNull MoverType movementType, @NotNull Vec3 movement) {
|
public void move(@NotNull MoverType movementType, @NotNull Vec3 movement) {
|
||||||
super.move(movementType, movement);
|
super.move(movementType, movement);
|
||||||
if (lastTickSpeed < 0.3 || collisionCoolDown > 0) return;
|
if (level() instanceof ServerLevel) {
|
||||||
|
if (lastTickSpeed < 0.3 || collisionCoolDown > 0) return;
|
||||||
|
|
||||||
if ((verticalCollision)) {
|
if ((verticalCollision)) {
|
||||||
if (this instanceof IHelicopterEntity) {
|
if (this instanceof IHelicopterEntity) {
|
||||||
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (20 * ((lastTickSpeed - 0.3) * (lastTickSpeed - 0.3))));
|
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (20 * ((lastTickSpeed - 0.3) * (lastTickSpeed - 0.3))));
|
||||||
this.bounceVertical(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
|
this.bounceVertical(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
|
||||||
} else if (Mth.abs((float) lastTickVerticalSpeed) > 0.6) {
|
} else if (Mth.abs((float) lastTickVerticalSpeed) > 0.6) {
|
||||||
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (48 * ((Mth.abs((float) lastTickVerticalSpeed) - 0.6) * (lastTickSpeed - 0.4) * (lastTickSpeed - 0.4))));
|
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (48 * ((Mth.abs((float) lastTickVerticalSpeed) - 0.6) * (lastTickSpeed - 0.4) * (lastTickSpeed - 0.4))));
|
||||||
|
if (!this.level().isClientSide) {
|
||||||
|
this.level().playSound(null, this, ModSounds.VEHICLE_STRIKE.get(), this.getSoundSource(), 1, 1);
|
||||||
|
}
|
||||||
|
this.bounceVertical(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.horizontalCollision) {
|
||||||
|
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (36 * ((lastTickSpeed - 0.4) * (lastTickSpeed - 0.4))));
|
||||||
|
this.bounceHorizontal(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
|
||||||
if (!this.level().isClientSide) {
|
if (!this.level().isClientSide) {
|
||||||
this.level().playSound(null, this, ModSounds.VEHICLE_STRIKE.get(), this.getSoundSource(), 1, 1);
|
this.level().playSound(null, this, ModSounds.VEHICLE_STRIKE.get(), this.getSoundSource(), 1, 1);
|
||||||
}
|
}
|
||||||
this.bounceVertical(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
|
collisionCoolDown = 4;
|
||||||
|
crash = true;
|
||||||
|
this.entityData.set(POWER, 0.4f * entityData.get(POWER));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.horizontalCollision) {
|
|
||||||
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (36 * ((lastTickSpeed - 0.4) * (lastTickSpeed - 0.4))));
|
|
||||||
this.bounceHorizontal(Direction.getNearest(this.getDeltaMovement().x(), this.getDeltaMovement().y(), this.getDeltaMovement().z()).getOpposite());
|
|
||||||
if (!this.level().isClientSide) {
|
|
||||||
this.level().playSound(null, this, ModSounds.VEHICLE_STRIKE.get(), this.getSoundSource(), 1, 1);
|
|
||||||
}
|
|
||||||
collisionCoolDown = 4;
|
|
||||||
crash = true;
|
|
||||||
this.entityData.set(POWER, 0.4f * entityData.get(POWER));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void bounceHorizontal(Direction direction) {
|
public void bounceHorizontal(Direction direction) {
|
||||||
|
@ -160,40 +202,42 @@ public class MobileVehicleEntity extends EnergyVehicleEntity {
|
||||||
* @param velocity 动量
|
* @param velocity 动量
|
||||||
*/
|
*/
|
||||||
public void crushEntities(Vec3 velocity) {
|
public void crushEntities(Vec3 velocity) {
|
||||||
if (!this.canCrushEntities()) return;
|
if (level() instanceof ServerLevel) {
|
||||||
if (velocity.horizontalDistance() < 0.25) return;
|
if (!this.canCrushEntities()) return;
|
||||||
if (isRemoved()) return;
|
if (velocity.horizontalDistance() < 0.25) return;
|
||||||
var frontBox = getBoundingBox().move(velocity.scale(0.6));
|
if (isRemoved()) return;
|
||||||
var velAdd = velocity.add(0, 0, 0).scale(0.9);
|
var frontBox = getBoundingBox().move(velocity.scale(0.6));
|
||||||
|
var velAdd = velocity.add(0, 0, 0).scale(0.9);
|
||||||
|
|
||||||
var entities = level().getEntities(EntityTypeTest.forClass(Entity.class), frontBox,
|
var entities = level().getEntities(EntityTypeTest.forClass(Entity.class), frontBox,
|
||||||
entity -> entity != this && entity != getFirstPassenger() && entity.getVehicle() == null)
|
entity -> entity != this && entity != getFirstPassenger() && entity.getVehicle() == null)
|
||||||
.stream().filter(entity -> entity.isAlive()
|
.stream().filter(entity -> entity.isAlive()
|
||||||
&& !(entity instanceof ItemEntity || entity instanceof Projectile || entity instanceof ProjectileEntity || entity instanceof LaserEntity || entity instanceof FlareDecoyEntity || entity instanceof AreaEffectCloud || entity instanceof C4Entity)
|
&& !(entity instanceof ItemEntity || entity instanceof Projectile || entity instanceof ProjectileEntity || entity instanceof LaserEntity || entity instanceof FlareDecoyEntity || entity instanceof AreaEffectCloud || entity instanceof C4Entity)
|
||||||
&& !(entity instanceof Player player && (player.isSpectator() || player.isCreative()))
|
&& !(entity instanceof Player player && (player.isSpectator() || player.isCreative()))
|
||||||
&& !entity.getType().getDescriptionId().equals("entity.create.super_glue"))
|
&& !entity.getType().getDescriptionId().equals("entity.create.super_glue"))
|
||||||
.toList();
|
.toList();
|
||||||
|
|
||||||
for (var entity : entities) {
|
for (var entity : entities) {
|
||||||
double entitySize = entity.getBbWidth() * entity.getBbHeight();
|
double entitySize = entity.getBbWidth() * entity.getBbHeight();
|
||||||
double thisSize = this.getBbWidth() * this.getBbHeight();
|
double thisSize = this.getBbWidth() * this.getBbHeight();
|
||||||
double f = Math.min(entitySize / thisSize, 2);
|
double f = Math.min(entitySize / thisSize, 2);
|
||||||
double f1 = Math.min(thisSize / entitySize, 4);
|
double f1 = Math.min(thisSize / entitySize, 4);
|
||||||
|
|
||||||
if (velocity.length() > 0.3 && getBoundingBox().distanceToSqr(entity.getBoundingBox().getCenter()) < 1) {
|
if (velocity.length() > 0.3 && getBoundingBox().distanceToSqr(entity.getBoundingBox().getCenter()) < 1) {
|
||||||
if (!this.level().isClientSide) {
|
if (!this.level().isClientSide) {
|
||||||
this.level().playSound(null, this, ModSounds.VEHICLE_STRIKE.get(), this.getSoundSource(), 1, 1);
|
this.level().playSound(null, this, ModSounds.VEHICLE_STRIKE.get(), this.getSoundSource(), 1, 1);
|
||||||
|
}
|
||||||
|
if (!(entity instanceof TargetEntity)) {
|
||||||
|
this.push(-f * velAdd.x, -f * velAdd.y, -f * velAdd.z);
|
||||||
|
}
|
||||||
|
entity.push(f1 * velAdd.x, f1 * velAdd.y, f1 * velAdd.z);
|
||||||
|
entity.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (thisSize * 20 * ((velocity.length() - 0.3) * (velocity.length() - 0.3))));
|
||||||
|
if (entities instanceof VehicleEntity) {
|
||||||
|
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), entity, entity.getFirstPassenger() == null ? entity : entity.getFirstPassenger()), (float) (entitySize * 10 * ((velocity.length() - 0.3) * (velocity.length() - 0.3))));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
entity.push(0.3 * f1 * velAdd.x, 0.3 * f1 * velAdd.y, 0.3 * f1 * velAdd.z);
|
||||||
}
|
}
|
||||||
if (!(entity instanceof TargetEntity)) {
|
|
||||||
this.push(-f * velAdd.x, -f * velAdd.y, -f * velAdd.z);
|
|
||||||
}
|
|
||||||
entity.push(f1 * velAdd.x, f1 * velAdd.y, f1 * velAdd.z);
|
|
||||||
entity.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), this, this.getFirstPassenger() == null ? this : this.getFirstPassenger()), (float) (thisSize * 20 * ((velocity.length() - 0.3) * (velocity.length() - 0.3))));
|
|
||||||
if (entities instanceof VehicleEntity) {
|
|
||||||
this.hurt(ModDamageTypes.causeVehicleStrikeDamage(this.level().registryAccess(), entity, entity.getFirstPassenger() == null ? entity : entity.getFirstPassenger()), (float) (entitySize * 10 * ((velocity.length() - 0.3) * (velocity.length() - 0.3))));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
entity.push(0.3 * f1 * velAdd.x, 0.3 * f1 * velAdd.y, 0.3 * f1 * velAdd.z);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -244,7 +244,7 @@ public class SpeedboatEntity extends ContainerMobileEntity implements GeoEntity,
|
||||||
sendParticle(serverLevel, ParticleTypes.BUBBLE_COLUMN_UP, this.getX() - 4.5 * this.getLookAngle().x, this.getY() - 0.25, this.getZ() - 4.5 * this.getLookAngle().z, (int) (40 * Mth.abs(this.entityData.get(POWER))), 0.15, 0.15, 0.15, 0.02, true);
|
sendParticle(serverLevel, ParticleTypes.BUBBLE_COLUMN_UP, this.getX() - 4.5 * this.getLookAngle().x, this.getY() - 0.25, this.getZ() - 4.5 * this.getLookAngle().z, (int) (40 * Mth.abs(this.entityData.get(POWER))), 0.15, 0.15, 0.15, 0.02, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
collideBlock();
|
collideBoatBlock();
|
||||||
gunnerAngle();
|
gunnerAngle();
|
||||||
lowHealthWarning();
|
lowHealthWarning();
|
||||||
|
|
||||||
|
@ -307,7 +307,7 @@ public class SpeedboatEntity extends ContainerMobileEntity implements GeoEntity,
|
||||||
/**
|
/**
|
||||||
* 撞掉莲叶和冰块
|
* 撞掉莲叶和冰块
|
||||||
*/
|
*/
|
||||||
public void collideBlock() {
|
public void collideBoatBlock() {
|
||||||
AABB aabb = AABB.ofSize(new Vec3(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ()), 3.6, 2.6, 3.6);
|
AABB aabb = AABB.ofSize(new Vec3(this.getX(), this.getY() + this.getBbHeight() * 0.5, this.getZ()), 3.6, 2.6, 3.6);
|
||||||
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
|
BlockPos.betweenClosedStream(aabb).forEach((pos) -> {
|
||||||
BlockState blockstate = this.level().getBlockState(pos);
|
BlockState blockstate = this.level().getBlockState(pos);
|
||||||
|
|
Loading…
Add table
Reference in a new issue