[Feature Request] Folia support
Netherwhal opened this issue · 8 comments
Would be great if Folia could be supported with this plugin.
Notes for further development:
- Folia is supported by the
itzg/minecraft
image which makes this testable: https://docker-minecraft-server.readthedocs.io/en/latest/types-and-platforms/server-types/paper/#folia - Check Folia, current API additions to see which APIs should be used. Since the API is different from Spigot/Bukkit, we will probably need two separate builds of the plugin.
As of right now the documentation on Folia Plugin development is rather limited and the whole subject is not quite stable. Let's keep this open for the near future.
I had a more in-depth look at this as it seems to be a requested topic.
Open questions and challenges for implementing Folia support
- ⚒️ Metrics
mc_entities_total
,mc_villagers_total
will need to be re-implemented to use the newRegionScheduler
class. It is no longer possible to callWorld#getEntities
from the main thread.- If we use the regionised scheduling, we can add the label
region
to the metric and the total entity counts can be aggregated by Prometheus/Grafana. - It should also be possible to use an event-based approach (see #226). Basically, we can subscribe to entity load/unload events and count entities that way.
- If we use the regionised scheduling, we can add the label
⚠️ Metricsmc_tps
andmc_tick_duration_*
will not be supported because there is no Folia API to get the TPS for a given region/thread (see PaperMC/Folia#31)- Edit: see comments below on how this could be implemented manually.
- ⚒️ Any changes should be backward compatible with Paper/Spigot
You can get that information with thread-access in folia-dev. Look at spark implementation of Folia.
You can get that information with thread-access in folia-dev. Look at spark implementation of Folia.
I think I found the relevant commit. @PedroMPagani That's a nice source, thank you.
The current plan is to release a new version soon which will include rudimentary support for Folia - only a small set of metrics will be provided.
I will create additional tasks for making the Folia implementation more feature-complete.
@Netherwhal Rudimentary Folia support is now available in v3.0.0. Lots of metrics are still missing though, it will require some more work to get those to work.
The open tasks are tracked here:
thanks so much - this is great! I think TPS is most important now because with JMX also not showing TPS with Folia its currently not possible to measure that.