Some more compilation fixes

This commit is contained in:
Bjarne Koll
2024-04-25 19:42:24 +02:00
parent 2af3439727
commit d6adc0b264
6 changed files with 112 additions and 20 deletions

View File

@@ -23,9 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+ // Paper start - Fix cancelling ProjectileHitEvent for piercing arrows
@Override
- protected double getDefaultGravity() {
- return 0.05D;
+ @Override
+ public ProjectileDeflection preHitTargetOrDeflectSelf(HitResult hitResult) {
+ if (hitResult instanceof EntityHitResult entityHitResult && this.hitCancelled && this.getPierceLevel() > 0) {
+ if (this.piercingIgnoreEntityIds == null) {
@@ -33,9 +31,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ }
+ this.piercingIgnoreEntityIds.add(entityHitResult.getEntity().getId());
+ }
+ super.preHitTargetOrDeflectSelf(hitResult);
}
+ return super.preHitTargetOrDeflectSelf(hitResult);
+ }
+ // Paper end - Fix cancelling ProjectileHitEvent for piercing arrows
private boolean shouldFall() {
return this.inGround && this.level().noCollision((new AABB(this.position(), this.position())).inflate(0.06D));
+
@Override
protected double getDefaultGravity() {
return 0.05D;