Skip to content

Conversation

@crosby-moe
Copy link
Contributor

Overview

This pull request does two things:

  1. Fixes the unused HashSet allocation redirect in block_raycast.ServerExplosionMixin that was removed during the 1.21.3 update of lithium (NEW redirects have to return a non-null object.)
  2. Readds and improves upon the specialized raycast hit factory that I had added in my earlier pull request (Optimized explosion entity exposure calculations #507)

Benchmarks

~80% improvement in time spent exploding 4096 tnts.
Benchmarked using seed -3199243952349285632 (randomly chosen) and 4096 tnt (/fill ~1 ~-7 ~ ~16 ~8 ~15 tnt)

Before:
6612 ms spent in World#createExplosion (5102 ms spent in ExplosionImpl#damageEntities)
image

After:
3710 ms spent in World#createExplosion (1982 ms spent in ExplosionImpl#damageEntities)
image

@2No2Name
Copy link
Member

The BlockGetter.clipWithInteractionOverride is replaced with VoxelShape.clip because the raycast result's direction on the block does not matter for explosions

@2No2Name 2No2Name merged commit 46a6c7f into CaffeineMC:develop Feb 23, 2025
1 check passed
@crosby-moe crosby-moe deleted the optimize-explosion-entity-raycasts branch February 24, 2025 04:01
@2No2Name
Copy link
Member

This PR causes #630 due to removing the EntityCollisionContext, which affects raycasts, e.g. through scaffolding blocks. This is fixed in 0.15.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants