[INACTIVE][FIX/MECH] properTime v1.8.9 - Control the speed of time (+multiworld) [1000]

Discussion in 'Inactive/Unsupported Plugins' started by xupwup, Jan 29, 2011.

  1. Offline


    properTime - Control the speed of time, for example to fix too long days/nights due to lag.
    Version: 1.8.9

    THIS PLUGIN HAS BEEN DISCONTINUED. See here for the continuation of this plugin.

    On many servers, lag causes the time to pass extremely slow, so I created a fix.

    properTime runs in a dedicated thread, so it wont really be affected by lag.
    By default this plugin makes sure that the day/night cycle lasts exactly 20 minutes.

    If desired you can change this, so that it always runs at half speed, or -10 times as fast, causing the time to go backwards really fast :). Please note that this will cause the sun/moon to jerk, this can only be fixed with a client mod.
    This plugin is also compatible with other time changing plugins, however, I advise against using it in combination with time stopping plugins. It also works fine with beds.

    Sample config file:
    # Use 2 for double speed, 3 for triple, etc.
    # At 1x speed, the complete day-night cycle takes 20 minutes.
    world: "nether"
    timespeedDay: 1.0 #these settings will be ignored because perma > 0
    timespeedNight: 1.0
    timespeedDusk: 1.0
    timespeedDawn: 1.0
    perma: 15000 # the time will always be 15000, which is at night. Use a value between 0 (sunrise) and 24000.
    world: "world"
    timespeedDay: 5.0
    timespeedNight: 5.0
    timespeedDusk: 1.0
    timespeedDawn: 1.0
    perma: -1 # less than 0, so will be ignored
    Normally day lasts 10 minutes, dawn + dusk 1.5, and night 7.
    If you want your day to last 12 minutes, you should set timespeedDay to 10/12 = 0.833

    Also, when freezing time, if you set the time to somewhere during dusk or dawn, the light will flicker for the client. I advise against this.

    • Configurable time speeds
    • Dedicated thread (so lag proof)
    • Separate configuration for day, night, dawn, dusk
    • Multiworld support (the plugin that creates the secondary worlds needs to load before properTime)
    • Permanent day/night
    • Ability to freeze time.

    To make sure that properTime loads after your multiworld plugin: (thanks to @tehbeard)
    Open properTime.jar with a program like winrar, and edit the plugin.yml file inside. Add the following code to it:
    softdepend: [MultiVerse]
    In this example properTime will load after MultiVerse. Do this for any multiworld plugin you use. (note: you need the name of the multi world plugin as stated in it's own plugin.yml)

    World "foo" not found
    Make sure your plugins load in the correct order. You can also try to remove or rename your config file, so that it is regenerated with the correct worldnames and syntax.

    First of all, carefully read all errors, as well as the last few comments on this thread. If that does not fix your problem, try adding "debug" to the top of your config file. That way the plugin will give you a lot of information, some of which may be useful for finding out what is wrong.

    Download: http://www.xupwup.nl/data/games/minecraft/properTime.jar
    Source: Inside the jar.
    Please also vote on the poll here so I have a better idea about the popularity of my plugin.

    Show Spoiler

    Version 1.8.9
    • Sources are now inside the jar file. No other changes.
    Version 1.8.8
    • Open sourced!
    • Different synchronisation with the main thread, this should fix concurrentModificationException errors.
    Version 1.8.7
    • Use the bukkit scheduler to set the time from a thread. (should fix concurrentModificationException errors)
    Version 1.8.6
    • Added debugging functionality that can be enabled by putting the word "debug" somewhere in your config file, preferably at the top.
    Version 1.8.5
    • The parser now supports world names with spaces.
    • (A bit) nicer error messages.
    Version 1.8.4
    • Fixed stupid mistake where it said 2400 instead of 24000, causing a lot of weirdness when using the perma option.
    Version 1.8.3
    • Fixed a bug in the parser that caused nullpointer exceptions for some files.
    • Added the "perma" option for configuring permanent day/night.
    Version 1.8.2
    • Fixed bug that caused values below 1 to get rounded to 0, causing the time to stop for those that use a timespeed less than 1.
    Version 1.8.1
    • Fixed nullpointerexception when stopping the server when an invalid config file has been used.
    Version 1.8
    • Added multiworld support
    Version 1.7
    • Fixed compatibility with newer bukkit versions
    • The config file is now located at: plugins/properTime/properTime.conf
    Version 1.6
    • If the client would jump to for example dusk, the server will use the timespeed for dusk, so if you set your day speed to 0.25, and the dusk speed to 1, this will fix the flicker during the few seconds when the client wants to go to dusk, and the server still says day. This should not change anything if you use timespeeds >= 1.
    Version 1.5.1
    • Fixed namespace, see this.
    Version 1.5
    • Fixed compatibility with newer bukkit versions
    • You can now configure what world this plugin should work on. (only one is supported and this is not in the default config file)
    Version 1.4
    • Added the ability to configure timespeeds for dusk/dawn.
    Version 1.3
    • Fix compatibility with newer bukkit versions.
    Version 1.2
    • Added the ability to configure timespeeds for day/night independently.
    Version 1.1
    • Renamed properties file + location
    Version 1.0
    • Initial release

    I got bored with minecraft a while ago, and now I also got bored with maintaining my plugins. That means that there will be no more feature updates by me. If you want to take over this plugin, please send me a pm on this forum and I will answer your questions, put a link here to your version etc.
  2. Offline


    I'm starting to think that too... I'm just waiting for more feedback. Hmm
  3. Offline


    it *was* crashing my server when I was running 602... working fine now on 617.
  4. Working fine here, all on latest. BUT...

    Won't recognise World names with spaces in them. It only reads the first word.
  5. Offline


    Can I have the source? I think I can fix the syncing with client-side by pushing a packet through craftbukkit.jar. There is an updateTime() packet that you can send.
  6. Offline


    I do not see how that woud improve the stuttering. Doesn't that updateTime() packet do exactly the same as setTime()? And even if it does something slightly different, how does that improve the stuttering? The only thing you can do is update the client's time more often to improve the stuttering, but that would cause lag (probably).

    I would like to see your proposal though. I do not see, however, why you need my sources for that. All I do is getTime() some calculations, and a setTime(). Your proposal would just replace those two functions (I believe) so you should not need the sources. If you do need them, please give a better explanation why.
  7. Offline


    This plugin is auto-forcing night time on a new tempworld I made using default settings in config (+ world folder name). I tried using "/time day" but it returns night after a second.

    latest plugin version + cb 610
  8. Offline


    Please update to 615+. That might be a bukkit bug.

    Fixed in v1.8.5.
    Please note that your old config files will no longer work, you need to put quotes ("worldname") around the worldname now.

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


    This plugin seems to make every world have a constant, and random time. I assume I am doing something in the config wrong.
    # Use 2 for double speed, 3 for triple, etc.
    # At 1x speed, the complete day-night cycle takes 20 minutes.
    world: "republica"
    timespeedDay: 1.0
    timespeedNight: 3.0
    timespeedDusk: 1.0
    timespeedDawn: 1.0
    perma: -1
    world: "test"
    timespeedDay: 1.0
    timespeedNight: 3.0
    timespeedDusk: 1.0
    timespeedDawn: 1.0
    perma: 24000
    world: "ruins"
    timespeedDay: 1.0
    timespeedNight: 3.0
    timespeedDusk: 1.0
    timespeedDawn: 1.0
    perma: 24000
    world: "world"
    timespeedDay: 1.0
    timespeedNight: 3.0
    timespeedDusk: 1.0
    timespeedDawn: 1.0
    perma: -1
    Thanks for any help

    EDIT: CB 612 and properTime 1.8.5
  10. Offline


    Please post your craftbukkit version and properTime version.
  11. Offline


    I'm also having this problem.

    I have properTime v1.8.5 and CB 617.

    My config looks like this:

    It seems to be stuck in sunrise.
  12. Offline


    I cannot reproduce this problem. I am also using CB 617. I would like you to download version 1.8.6 and put the word "debug" at the top of the config file, without anything else on that line (not even spaces), so that it enters debugging mode. Just look for strange outputs.
  13. Hi there - I've been using this plugin for some time now, and I notice some comments about time being kept at permanent day.
    I have read the comments on this thread - I notice that @Nate204 is using Java 7. I also use java 7, and although my server doesn't crash as his appears to do, this plugin can cause time to stand still. I updated from bukkit #560 to #612 - Time stands still on this version using this plugin, no matter what you do. I un-installed the plugin because of this. However, when I updated again to bukkit #621, I tried again re-installing this plugin (I'm using ver. 1.8.2), and the plugin started working as normal again.
    Clearly, there is probably a small batch of bukkit builds where they broke whatever this plugin uses for timing, and fixed it again later. If you are having the time stands still problem with this plugin installed, I can only suggest updating bukkit to #621 or greater ..........

    Just to prove it, I went back to bukkit #612 and the problem started again, then I re-installed bukkit #621 - No problem !! Of course, I don't know which build starts the problem, or which one fixes it
  14. Offline


    As far as I know this problem was fixed in build 615. This was, as you have already noticed, a bukkit bug, not a properTime bug.
    That means that all bukkit versions between the first 1.4 release until 615 are broken.
  15. it's broken for me since CB#670 with the following error
    2011-04-08 17:29:31 [SEVERE] Exception in thread "Timer-2"
    2011-04-08 17:29:31 [SEVERE] java.util.ConcurrentModificationException
    2011-04-08 17:29:31 [SEVERE]     at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
    2011-04-08 17:29:31 [SEVERE]     at java.util.AbstractList$Itr.next(Unknown Source)
    2011-04-08 17:29:31 [SEVERE]     at org.bukkit.craftbukkit.CraftWorld.getPlayers(CraftWorld.java:524)
    2011-04-08 17:29:31 [SEVERE]     at org.bukkit.craftbukkit.CraftWorld.setFullTime(CraftWorld.java:423)
    2011-04-08 17:29:31 [SEVERE]     at org.bukkit.craftbukkit.CraftWorld.setTime(CraftWorld.java:412)
    2011-04-08 17:29:31 [SEVERE]     at nl.xupwup.properTime.properTime$FixTime$Step.run(properTime.java:229)
    2011-04-08 17:29:31 [SEVERE]     at java.util.TimerThread.mainLoop(Unknown Source)
    2011-04-08 17:29:31 [SEVERE]     at java.util.TimerThread.run(Unknown Source)
    2011-04-08 17:29:41 [INFO] [HeroChat] [g] SyrCrydel: ka viel :D
  16. Offline


    Broken for me as well - #670 and exceptions.
  17. Offline


    Works fine for me:
    2011-04-08 17:06:26 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-646-gb61ef8c-b670jnks (MC: 1.4)
    2011-04-08 17:06:30 [INFO] properTime reading from config at /share/HDA_DATA/mc/plugins/properTime/properTime.conf
    2011-04-08 17:06:31 [INFO] properTime 1.8.6 initialized
  18. Offline


    It starts - but as soon as it SHOULD change the time it throws exceptions at me.
  19. Offline


    Ah yeah, I see the time just keeps looping...
  20. Offline


    I cannot reproduce this problem, however I did expect this error to come up one day, so I did fix it.

    Fixed in v1.8.7
  21. Offline


    works fine in 670...

    Is there any way to specify when this plugin loads? It loads before multiverse (which loads multiple worlds) so it throws this error:

    23:43:58 [INFO] properTime reading from config at /home/minecraft/server/plugins/properTime/properTime.conf
    23:43:58 [WARNING] properTime: World 'nether' not found
  22. Offline


    rename properTime.jar to zProperTime.jar
  23. Offline


    Bukkit 670, properTime 1.8.7

  24. Offline


    Very strange... Are you using any plugins that do things with time (besides this one)? How long does it take for this problem to come up? When does it happen exactly?
    My local test server does not exhibit this problem, so it would help to know what is causing this.
  25. Offline


    Given recent events, e.g. Doridian and Zidonuke, I'm extremely hesitant to install a plugin where I do not have the source easily available. It's simply too much of a risk. Other than the closed-source nature, this would be a plugin that I'd love to use!
  26. Hey xupwup. We use your plugin as part of a set of plugins that control our nightmare world (to make sure it's always night there) and we get the concurrent modification issue occasionally, which crashes your timer thread and allows the world to get daytime periods. If possible please do this:

    * Synchronize all your collection/structure access code and/or remove all iterators (Iterator object usage or for(Object o : collection)) replacing iteration with for (int i = 0; i < collection.size(); i++) ...
    * CATCH the stupid exception so it doesn't crash the timer!

    arthoz likes this.
  27. Offline


    Should be fixed now. I was doing some ugly synchronisation to stop craftbukkit from whining, but that failed. So now, with proper synchronisation. Also, looking at the stack trace, the problem occurred in setTime(), which apparently does not like to be called from a different thread.

    If the problem persists, please contact me again.

    Now open-source.
  28. Offline


    Feature request:
    A command to reload the config so as to not interrupt players with a server restart after making changes.
  29. Offline


    Type reload in the console, that will reload all plugins.
  30. Offline


    Not everyone has console access, especially if you're with a paid host and not running your own VPS. An in-game option would be nice for those people.
  31. Offline


    I'm assuming you are aware, but it seems that when one uses 12000 as the perma value, the client is constantly iterating between full brightness and the beginning of the sunset, causing a flickering effect.

    Would you be willing to look at a patch? Basically, when perma is in the vulnerable range (it also seems values in the 22750-23750 range exhibit similar effects) I just statically offset such that the time is actually set just before the flicker effect starts to show up. Effectively, if you select a perma time within the "sunset" and "sunrise" ranges, it instead sets the time to just before/after that period so that you get the lighting effect of that time without the flicker.

    If you want to just leave the solution as "don't use 12000," I can fully understand, but it might be worth adding explicit mention of it here or in some documentation if that is the case, as my initial thought (before I had looked at the code) was that the flicker was a bug with properTime itself.

Share This Page