-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add API to allow/disallow tick sleeping #11611
base: master
Are you sure you want to change the base?
Add API to allow/disallow tick sleeping #11611
Conversation
I could also add a check which puts the server out of sleep when this gets called. |
I have implemented the changes. The original reason to make it static was a bit dumb, because I didn't know that |
plugins could easily step on each other like this, it might be best to have this be a list of plugins blocking sleep or something to that effect instead |
Something like that all plugins have to allow it, but when only one plugin disallows it (and the others allow it) that pausing still gets disabled? |
The new system adds a |
I don't know how to fix this test error. Could I maybe get a bit of help? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should fix the test.
The tests are fixed. |
I don't think a map is needed - a list or set should be enough. If the collection is not empty then sleep would be blocked. |
I have made these changes, the only thing is that Intellij randomly imported a bunch of things, but hopefully this isn't a problem. |
3e9ccde
to
4d859c8
Compare
I am now using FQN imports |
Hi,
I added a simple API to
Server
which allows or disallows the server sleeping, as requested in #11511.This works with a simple boolean in
MinecraftServer
which is now one of the requirements to sleep.CraftServer
sets this boolean wheneverServer#allowSleeping
gets called.That's all, and I wish you a wonderful rest of your day!