Tick Forcer?

Discussion in 'Plugin Development' started by Connor2weirdness, Apr 11, 2014.

Thread Status:
Not open for further replies.
  1. I've heard Minecraft only runs at a maximum of 20TPS. Is it possible to use Thread.sleep() and stuff to force a server to run at a higher TPS?
  2. Offline


  3. Offline


    You might be able to do so with an absurd amount of reflection, but I highly doubt that it will ever run near-stable (Thread.sleep() would lower the TPS, not raise them). Not to mention that you will run into additional problems with bukkit and plugins that somehow rely on the server's tick logic.
  4. Offline


    very very black usage of misc.Unsafe to replace bytecode of already running code, but it will be version-platform dependant and require lots of time to implement properly, basics can be read here:

    also there is lib called jillegal that already allows this.

    More viable method - terminate server and relaunch it with special classloader attached, that will replace classes you want, this is way how forge and vanilla loader works, you can get all code you need from forge, this method require lots of testing and set of heuristics for each type of platform\version.
    Jamesthatguy and xTrollxDudex like this.
  5. Offline


    You could go into the server's code and change the delay before it allows the next tick, just know that this would both clash with clients in some ways and also reflect a design deficiency that is asking for a higher TPS.

    A custom CraftBukkit build would work best in this case.
  6. Offline


    custom build is easy, you can edit main class and set any delay you want.

    but plugin that alter tickrate requires lots of blackmagic at random locations to keep higher tickrate without random issues.
  7. I've never gone into CraftBukkit's actual code. Could you explain the steps in more detail please? This could mean less lag more many servers.

    What I meant with the Thread.sleep() was maybe I could delay it until 100 ticks are reached and then have that in a loop, which basically would force it to run at a higher TPS.

    I'm lost. Thanks a lot for the detail, I'll try and decode this into noob language.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 7, 2016
  8. Offline


  9. Offline


    Thread#sleep() is never a good idea in a plugin...

    Hoestly, there is no point in changing the TPS. You'll get shitloads of problems, lag and almost every plugin that uses ticks in any way (-> BukkitRunnable) will not work as intended.
  10. Maybe you're right. Oh well. My dream is dust. Thanks everyone for the help.
Thread Status:
Not open for further replies.

Share This Page