Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for folia #126

Merged
merged 3 commits into from
Sep 22, 2024
Merged

support for folia #126

merged 3 commits into from
Sep 22, 2024

Conversation

ricsal1
Copy link
Contributor

@ricsal1 ricsal1 commented Sep 16, 2024

SubmitTaskConsumer seems to halt processing on the scheduler with Folia and since the scheduler itself is usable in schedule and scheduleAtFixedRate methods, so on folia version it is passed a null in order to force call this.submitData().

Tested with auto-generated Metrics class for bukkit with the changes presented here with bstats https://bstats.org/plugin/bukkit/CoolGateway/23166

Regards

@@ -62,14 +62,17 @@ public Metrics(Plugin plugin, int serviceId) {
boolean logSentData = config.getBoolean("logSentData", false);
boolean logResponseStatusText = config.getBoolean("logResponseStatusText", false);

String minecraftVersion2 = Bukkit.getServer().getName();
boolean folia = (minecraftVersion2.toUpperCase().contains("FOLIA"));

Choose a reason for hiding this comment

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

This wouldn't catch forks of folia, you should detect if the class io.papermc.paper.threadedregions.RegionizedServer exists instead.

Copy link
Owner

@Bastian Bastian left a comment

Choose a reason for hiding this comment

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

Just a few small code changes, but overall looks good to me.

Thanks for the PR! 👍

bukkit/src/main/java/org/bstats/bukkit/Metrics.java Outdated Show resolved Hide resolved
bukkit/src/main/java/org/bstats/bukkit/Metrics.java Outdated Show resolved Hide resolved
@Bastian Bastian merged commit 388d72a into Bastian:master Sep 22, 2024
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.

3 participants