Temporary fix for Canceling ProjectileImpactEvents of Piercing ammo.

Event needs to be re-worked to have finer control. #9370
This commit is contained in:
LexManos committed 2023-04-05 11:16:39 -07:00
1 parent d4836bc769
commit e6aaaff3f3
1 file changed
+4 -2
@@ -9,12 +9,14 @@
this.m_20095_();
}
@@ -186,7 +_,7 @@
@@ -186,7 +_,9 @@
}
}
- if (hitresult != null && !flag) {
+ if (hitresult != null && hitresult.m_6662_() != HitResult.Type.MISS && !flag && !net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, hitresult)) {
+ if (hitresult != null && hitresult.m_6662_() != HitResult.Type.MISS && !flag) {
+ if (net.minecraftforge.event.ForgeEventFactory.onProjectileImpact(this, hitresult))
+ break;
this.m_6532_(hitresult);
this.f_19812_ = true;
}