Improve `Scheduler` safety
Describe the new feature.
Scheduling tasks with the Scheduler outside of the Render Thread should hard fail with an exception otherwise it could introduce hard to debug CMEs if a task is scheduled while the scheduler is being ticked. Currently to my knowledge only the API authentication does off-thread task scheduling.
Additionally scheduling a null task should fail with an NPE and the Preconditions class should be used to ensure tasks aren't being scheduled in the past and whatnot.
The migration path for any off-thread scheduling is just to wrap it in a client#send call like so: client.send(() -> Scheduler.INSTANCE.schedule(...)).
These changes will decrease the likelihood of the Scheduler being used improperly.
Images
No response
Partially fixed in #1306 as it now just runs everything on the render thread automatically but this should still be enforced later.