修复密集摆放迫击炮时可能出现的炸膛事故
This commit is contained in:
parent
77fdc0c126
commit
8d494f6aee
1 changed files with 7 additions and 7 deletions
|
@ -94,14 +94,14 @@ public class MortarShellEntity extends ThrowableItemProjectile {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onHitEntity(EntityHitResult entityHitResult) {
|
public void onHitEntity(EntityHitResult entityHitResult) {
|
||||||
Entity entity = entityHitResult.getEntity();
|
if (this.tickCount > 1) {
|
||||||
|
Entity entity = entityHitResult.getEntity();
|
||||||
entity.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), this, this.getOwner()), this.damage);
|
entity.hurt(ModDamageTypes.causeCannonFireDamage(this.level().registryAccess(), this, this.getOwner()), this.damage);
|
||||||
|
if (this.level() instanceof ServerLevel) {
|
||||||
if (this.level() instanceof ServerLevel) {
|
ProjectileTool.causeCustomExplode(this, this.damage, this.radius);
|
||||||
ProjectileTool.causeCustomExplode(this, this.damage, this.radius);
|
}
|
||||||
|
this.discard();
|
||||||
}
|
}
|
||||||
this.discard();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue