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

Fix Folia scheduler tasks not canceling when plugin disable #10091

Merged
merged 1 commit into from
Dec 29, 2023

Conversation

LemonCaramel
Copy link
Contributor

TestPlugin.java

public final class TestPlugin extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        this.getServer().getPluginManager().registerEvents(this, this);

        this.getServer().getAsyncScheduler().runAtFixedRate(this, task -> {
            this.getLogger().info("Hello");
        }, 0L, 1L, TimeUnit.SECONDS);

        this.getServer().getScheduler().runTask(this, () -> {
            this.getServer().getPluginManager().disablePlugin(this);
        });
    }
}

@LemonCaramel LemonCaramel requested a review from a team as a code owner December 28, 2023 19:07
@lynxplay lynxplay merged commit 5e978d3 into PaperMC:master Dec 29, 2023
2 checks passed
@LemonCaramel LemonCaramel deleted the fix-folia-scheduler-unload branch December 29, 2023 01:00
lynxplay pushed a commit to lynxplay/paper that referenced this pull request Feb 23, 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.

4 participants