WorldEdit

WorldEdit

42M Downloads

Adapter methods using Map caches (e.g. adapt(org.bukkit.block.data.BlockData) are not thread-safe

dordsor21 opened this issue ยท 1 comments

commented

WorldEdit Version

7.2.11-SNAPSHOT

Platform Version

git-Paper-295

Confirmations

  • I am using the most recent Minecraft release.
  • I am using a version of WorldEdit compatible with my Minecraft version.
  • I am using the latest or recommended version of my platform software.
  • I am NOT using a hybrid server, e.g. a server that combines Bukkit and Forge. Examples include Arclight, Mohist, and Cardboard.
  • I am NOT using a fork of WorldEdit, such as FastAsyncWorldEdit (FAWE) or AsyncWorldEdit (AWE)

Bug Description

The maps used for caching values that have already been adapted are not thread-safe/concurrent implementations. This means that WorldEdit blocks cannot be adapted to Bukkit blocks for the purposes of asynchronous chunk generation. PlotSquared's internal use of WE in the core module means blocks have to be adapted when set to the world, and may result in errors such as: https://paste.gg/p/anonymous/d6a65dcc7fd643c4a1e0a1e838d2dcad/files/ed8c3d55a5714b59a77e509ac2c22120/raw

Expected Behavior

Thread-safe use of cache-maps for adapting blocks

Reproduction Steps

Attempt to adapt the same (or different) as-of-yet uncached blocks from different threads. The nature of such concurrency issues means that it is not easily reproducible, as clashes may not occur every time.

Anything Else?

No response

commented

This was resolved in 298b641