优化子弹类代码

This commit is contained in:
17146 2025-06-29 18:08:36 +08:00 committed by Light_Quanta
parent df1741a955
commit 521fc8d080
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959

View file

@ -355,7 +355,7 @@ public class ProjectileEntity extends Projectile implements IEntityWithComplexSp
this.legShot = tag.getFloat("LegShot"); this.legShot = tag.getFloat("LegShot");
this.bypassArmorRate = tag.getFloat("BypassArmorRate"); this.bypassArmorRate = tag.getFloat("BypassArmorRate");
this.undeadMultiple = tag.getFloat("UndeadMultiple"); this.undeadMultiple = tag.getFloat("UndeadMultiple");
this.illagerMultiple = tag.getFloat("illagerMultiple"); this.illagerMultiple = tag.getFloat("IllagerMultiple");
this.knockback = tag.getFloat("Knockback"); this.knockback = tag.getFloat("Knockback");
this.beast = tag.getBoolean("Beast"); this.beast = tag.getBoolean("Beast");
@ -374,7 +374,7 @@ public class ProjectileEntity extends Projectile implements IEntityWithComplexSp
tag.putFloat("LegShot", this.legShot); tag.putFloat("LegShot", this.legShot);
tag.putFloat("BypassArmorRate", this.bypassArmorRate); tag.putFloat("BypassArmorRate", this.bypassArmorRate);
tag.putFloat("UndeadMultiple", this.undeadMultiple); tag.putFloat("UndeadMultiple", this.undeadMultiple);
tag.putFloat("illagerMultiple", this.illagerMultiple); tag.putFloat("IllagerMultiple", this.illagerMultiple);
tag.putFloat("Knockback", this.knockback); tag.putFloat("Knockback", this.knockback);
tag.putBoolean("Beast", this.beast); tag.putBoolean("Beast", this.beast);
@ -386,7 +386,7 @@ public class ProjectileEntity extends Projectile implements IEntityWithComplexSp
} }
@Override @Override
protected void onHit(@NotNull HitResult result) { protected void onHit(@Nullable HitResult result) {
if (result instanceof BlockHitResult blockHitResult) { if (result instanceof BlockHitResult blockHitResult) {
if (blockHitResult.getType() == HitResult.Type.MISS) { if (blockHitResult.getType() == HitResult.Type.MISS) {
return; return;