Folia support - Jannyboy11/InvSee-plus-plus GitHub Wiki
Edit 2023/08/31: There is a known game-breaking bug with InvSee++ on Folia; use in production is strongly disrecommended until fixed. For this reason Folia support has been disabled since version 0.24.0. Below you can read the old wiki article:
Since version 0.20.0, InvSee++ experimentally supports the Folia server software. This server software throws away many of the implicit assumptions that Bukkit plugins could make because there was only a single main thread that ticked everything in the Minecraft world.
Folia changes this around by introducing multiple region schedulers, explained here.
To accommodate for this change, InvSee++ introduced its own Scheduler abstraction, obtainable via InvseeAPI#getScheduler()
. There are two implementations, the FoliaScheduler that is created when InvSee++ is running on Folia, and there is the DefaultScheduler that is a BukkitScheduler-based fallback implementation.
When InvSee++ is running on Folia, all CompletableFuture's returned by InvSee++ for spectating a specific target's inventory or enderchest, this CompletableFuture will complete in a task scheduled by the target's own entity scheduler. If the target is offline, then the CompletableFuture will complete in a task scheduled by the GlobalRegionScheduler. This makes it safe to make modifications to the SpectatorInventory.