Skip to content

Commit

Permalink
Offset VoxelShape by block position in supporting block entity moveme…
Browse files Browse the repository at this point in the history
…nt optimization
  • Loading branch information
2No2Name committed Jun 8, 2024
1 parent b696be3 commit 5e4fa7a
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ private void uncacheSupportingBlockSearch1(boolean onGround, Vec3d movement, Cal
if (bc.isTracking()) {
BlockState cachedSupportingBlock = bc.getCachedSupportingBlock();
if (cachedSupportingBlock != null && this.supportingBlockPos.isPresent()) {
return cachedSupportingBlock.getCollisionShape(this.getWorld(), this.supportingBlockPos.get(), ShapeContext.of((Entity) (Object) this));
BlockPos blockPos = this.supportingBlockPos.get();
return cachedSupportingBlock.getCollisionShape(this.getWorld(), blockPos, ShapeContext.of((Entity) (Object) this)).offset(blockPos.getX(), blockPos.getY(), blockPos.getZ());
}
}
return null;
Expand Down

0 comments on commit 5e4fa7a

Please sign in to comment.