Skip to content

Instantly share code, notes, and snippets.

@phit
Last active July 4, 2018 20:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phit/4242da3236e327248295a3b7747d7502 to your computer and use it in GitHub Desktop.
Save phit/4242da3236e327248295a3b7747d7502 to your computer and use it in GitHub Desktop.
java.lang.IllegalArgumentException: timeout value is negative minecraft server
long maxTickTime = server.getMaxTickTime(); // value from server.properties
long i = this.server.getCurrentTime(); // starttime of current tick
long j = MinecraftServer.getCurrentTimeMillis(); // current time
Thread.sleep(i + maxTickTime - j); // error is thrown when the sleep time is negative
long cutoff = i + maxTickTime; // cutoff time for current tick
cutoff - j // if this result < 0 then somehow a tick took longer than the cutoff allowed but it wasnt killed,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment