[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

    xupwup

    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:
    Code:
    # 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.

    Features:
    • 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:
    Code:
    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.

    Troubleshooting
    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.

    Changelog:
    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

    Gimmic

    Interesting idea. Loaded with no errors on build 166, You might make a note in the properties file indicating that 1.0 is 20 minutes for each.

    Also, you might consider following the plugin semistandards and make it a .properties file.
     
  3. Offline

    xupwup

    20 minutes for the entire cycle, so about 10 minutes for day and 10 for night.
    I have clarified the config file, and I am now reading from properTime.conf. (.properties is too long :))
     
  4. Offline

    Gimmic

    Could you seperate day and night? Maybe even make a config option to straight specify day/night times?
    example:
    day=20
    night=12
    to make daytime 20 minutes, night 12.
     
  5. Offline

    xupwup

    Good idea!
    EDIT: done, you can now configure the speeds for day and night independently.
     
  6. Offline

    Gimmic

    Using this config file:
    Code:
    # Use 2 for double speed, 3 for triple, etc.
    # At 1x speed, the complete day-night cycle takes 20 minutes.
    timespeedDay: 0.5
    timespeedNight: 1.0
    
    During startup:
    properTime reading from config at /home/gimmic/survivalmc/properTime.conf
    properTime using timespeed 1.0
    =================

    Seems to be a minor bug. Have not checked if time is applied properly.
    You might make it actually list the minutes duration during startup so people tweaking it can do so easily.
    Example:
    properTime reading from config...
    propertime using timespeed Day: 15 minutes, Night: 10 minutes
     
  7. Offline

    xupwup

    Oops! I uploaded the wrong version. Should be version 1.2 now.
     
  8. Offline

    Azraeil

    Wonderful! I'm hoping this plugin does exactly as advertised.

    One a side note, if I use this plugin to make night twice as long as day, will it have any weird client side effects?

    EDIT: Would you be able to put the configuration file in a folder titled properTime in the plugins directory? That's generally the expected place to find such configuration files :p
     
  9. Offline

    freman

    Took me a couple of try's to get that right(ish) but here's the code I used

    Code:
    public <PluginName>(PluginLoader pluginLoader, Server instance, PluginDescriptionFile desc, File folder, File plugin, ClassLoader cLoader) {
        super(pluginLoader, instance, desc, folder, plugin, cLoader);
    
        if (!folder.exists()) {
            folder.mkdir();
        }
        propertiesFile = folder.getAbsolutePath() + File.separator + desc.getName() + ".properties";
    }
     
  10. Offline

    Azraeil

    I'm really glad that standard has started to pop up. I just want my minecraft server base directory to be as clean as possible.
     
  11. Offline

    xupwup

    Update your status...
    The client side time will always be 20 minutes for the entire day/night cycle, and it is usually synced with the server every 10 seconds. So if the server time is slower, the client's time will jump back a little every 10 seconds, just like on laggy servers.
     
  12. Offline

    Azraeil

    I noticed. A small price to pay for accurate time!
     
  13. Offline

    EvilSeph

  14. Offline

    QQCucumber

    As of build 197, org.bukkit.Server.getTime() has been changed to org.bukkit.World.getTime() which has broken several time-based plugins.
     
  15. And no source code. Else this would be an easy fix. Waaaaaaah!

    Edit: nevermind, it seems to decompile ok. :)
     
  16. Offline

    xupwup

    I will update tomorrow.
     
  17. Offline

    Azraeil

    Just on a purely 'I like open source stuff', would you be willing to package the source either in the jar or separately? (jar would be preferred)
    --- merged: Feb 4, 2011 11:04 AM ---
    Oh! And sorry to double post, but a cool feature request:

    Allow different time setups based on real server time. Specifically, I would love to be able to make a particular time of the real day always daylight to give some of my more avid builders a large chunk of day to build. I suppose an extension of that would be to be able to specify that at particular intervals during the [real] day a particular subset of day/night rules applied.
     
  18. Offline

    xupwup

    I will post the source when I stop maintaining this plugin.

    This is beyond the scope of this plugin.
     
  19. Offline

    Arcwolf

    Would it be outside the scope of this mod to request settings to change dawn and dusk? Right now I have my server set for .25 day and 2x night. This results in blinking of light at dawn and dusk as the server tells the client dusk or dawn is happening too soon or too late jumping the time forward darker or lighter.

    dawn 1.0
    dusk 1.0
    day .25
    night 2.0
     
  20. Offline

    Azraeil

    I'll second that -- same blinking dawn/dusk side effect.
     
  21. Offline

    xupwup

    That is not outside the scope of this plugin :), so I have implemented this in version 1.4
     
  22. Offline

    Arcwolf

    Awesome! thank you.. updating now :)
     
  23. Offline

    Ovocean

    I'm setting everything to 0.5. It works but the effect of the sun/moon jumping backwards every few seconds is disturbing, especially at dusk and dawn. Anything you can do to make it smooth ?
    What functions are available to you ? Only changing the current time ?
    Also what about having an option to reduce the time updates interval ?
     
  24. Offline

    Azraeil

    That is all client side, you would have to install a client mod that checked for that kind of stuff.
     
  25. Offline

    xupwup

    I cannot do anything for you here, the minecraft server always sends the server time to the client every 10 seconds, so if the server time is not the same as the client time, you will get jumps. I cannot change the interval, so you would, as Azraeil said, need a client mod, so the client's time goes at the same speed as the server time.
    I suggest you set the timespeed to 1.0 for dusk and dawn, and .5 for day and night. That way it will be a lot less disturbing.
     
  26. Offline

    Ovocean

    Ok, too bad. Makes one regret that Minecraft is not free software.
    Thanks for your answers !

    PS: I've measured 5 seconds between each time jump, not 10.
     
  27. Offline

    Azraeil

    Now something that would be possible would be a client mod that attempted to smooth out the transitions. Something that would basically take the average speeds of the day/night/dawn/dusk times and move everything accordingly.
     
  28. Offline

    Ovocean

    Yep, a companion client mod would be nice. :)

    This would be nice too. :)
    --- merged: Feb 6, 2011 9:23 AM ---
    You could change the plugin's category to [FIX][MECH] and add to the description that it allows to modifiy the time speed, which is probably what will interest most people.
     
  29. Offline

    xupwup

    Fixed a few days ago, maybe this post should be moved to plugin releases?
     
  30. Offline

    Ovocean

    I think your post contents don't comply with the template. You need to add the name of the plugin at the top, plus the list of features below the description and maybe a changelog, todo list.
     

Share This Page