Skip to content

Refactor dirty block management with ConcurrentHashMap and version bump#259

Merged
twisti-dev merged 3 commits intoversion/1.21.11from
fix/block-pdc-cme
Mar 21, 2026
Merged

Refactor dirty block management with ConcurrentHashMap and version bump#259
twisti-dev merged 3 commits intoversion/1.21.11from
fix/block-pdc-cme

Conversation

@twisti-dev
Copy link
Contributor

This pull request includes a version bump and an internal improvement to how dirty blocks are tracked in the BlockPdcManager. The most significant change is the replacement of a custom mutable set with a thread-safe concurrent set for managing dirty blocks, which increases safety in concurrent environments.

Version update:

  • Incremented the project version in gradle.properties from 1.21.11-2.70.0 to 1.21.11-2.70.1.

Thread safety improvement:

  • Replaced the use of mutableObjectSetOf with ConcurrentHashMap.newKeySet for the dirtyBlocks set in BlockPdcManager, ensuring thread-safe access and modification.

@twisti-dev twisti-dev self-assigned this Mar 21, 2026
Copilot AI review requested due to automatic review settings March 21, 2026 14:38
@twisti-dev twisti-dev merged commit a52d04c into version/1.21.11 Mar 21, 2026
3 of 4 checks passed
@twisti-dev twisti-dev deleted the fix/block-pdc-cme branch March 21, 2026 14:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the project version and refactors internal “dirty block” tracking in the Bukkit server implementation to use a thread-safe concurrent set, improving safety when dirty tracking is accessed from multiple coroutines/threads.

Changes:

  • Bumped version in gradle.properties from 1.21.11-2.70.0 to 1.21.11-2.70.1.
  • Replaced mutableObjectSetOf with ConcurrentHashMap.newKeySet() for BlockPdcManager.dirtyBlocks to make dirty tracking thread-safe.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
surf-api-bukkit/surf-api-bukkit-server/src/main/kotlin/dev/slne/surf/surfapi/bukkit/server/impl/pdc/block/BlockPdcManager.kt Switches dirty block tracking to a concurrent set and removes the custom fastutil set usage.
gradle.properties Applies the patch-level version bump for the release containing the internal refactor.

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