Inactive [MECH] TimeFold - Fold the time to your needs!

Discussion in 'Inactive/Unsupported Plugins' started by SilverstarX, May 11, 2011.

  1. Offline


    New maintaner! This project is now managed by @!Phoenix! and you will find all news and updates on the projects devbukkit page!

    Do you think a day needs to have 48 hours for all your work to do?
    You don't want to be interrupted by fading out light and torches don't do the job?
    But you also want to go on monster hunting in the night?
    TimeFold lets you fold the time the way you want!

    Everything below here is partly or completely outdated, so please visit the projects devbukkit page to be up to date, I'll just leave it here for documentary purposes.

    • Extend/lower the day and/or night to an amount of your choice, even 0
    • Multiworld support
    • Does not break redstone circuits or plant growing
    • CraftBukkitUpToDate support
    Planned Features:
    • Change the settings on the fly ingame
    • Possibility to set the day/night to an amout <1, e.g. 0.25
    • Check for using beds -in progress
    • Announcements on dawn/dusk/timefold -in progress
    • Dawn/dusk every x days
    • Voting
    • May be incompatible with Multiverse 2
    Function / How it works:
    The plugin cycles through the set amount of days and after that, through the nights.
    For the days, right before dusk, it will set the time back* to morning right after dawn, as long as all set days are gone, and then the same for the nights
    For example, if you set it to <worldname>:3:2 it will look like this:
    Day 1
    Day 2
    Day 3
    Night 1
    Night 2
    and then again from the beginning.
    *It does not really sets the time back into the past (that would break redstone and growing etc) but instead, it skips the night.

    Way A) Start the server once to let TimeFold create the settings file itself.
    Way B) Use the file provided in the ZIP-download.
    Way C) Create the directory and file yourself at plugins/TimeFold/TimeFold.settings
    Stop the server (or do a /reload later), customize the file to your needs. One line for every world like this:
    Worldnames are case insensitive.
    If you don't specify a world in the file, its day/night cycle will be untouched and run like normal.

    • /timefold - shows you the current day/night in the cycle
    • /timefold report - creates a textfile in the plugins/TimeFold/ directory with some information which may be helpful for me helping you
    • timefold <world> (server console) - same as /timefold
    ***outdated! See the devbukkit page for current versions and downloads!***
    Static JAR
    v0.5.beta1 1060: ZIP
    v0.4.2 953: JAR | ZIP
    v0.4 766: JAR | ZIP
    v0.3 740: JAR | ZIP
    Source: GitHub
    All downloads are also available at github.

    v0.4.2 02.07.11 b754/cb953
    • Added /timefold report command
    • Fixed TimeFold calling from server console
    • Fixed something which could cause an OutOfMemoryError
    • general code reworking
    v0.4 19.05.11 b681/cb766
    • Fixed: creating settings file on startup
    • Fixed: crash on non-existent world
    • reworked ActionListener, now allows 0 as a value for day or night
    • general code cleanup
    older changes (open)

    v0.3 12.05.11 b669/cb740
    • initial public release
    • removed debug code
    • reworked FileHandler and ActionListener using HashMaps instead of Arrays
    • first git versioned version

    Inspired by the discontinued Extendday I wrote this for my server because we did not want to have day OR night as the other plugins do. And made it public because I wanted to give something back to this great community!
    As this is my first bukkit plugin and my first project in java since a while (over a year) and I'm not a native english speaker (I'm german), please, be clement, thank you :)
    zipron and Mitsugaru like this.
  2. Offline


    Maybe I'll put that into a simple plugin this evening. If you make the idea more general, you could use that for many purposes. But, thinking further... Isn't there already a plugin for that? Well, I just didn't find one on a quick search.

    And you might want to announce it only once, if you have extended your nights, right? I might get a quick hack ready before I'm in holiday as said before.
  3. Offline


    That would be great!
    You are right, there is already this Plugin but I'm not sure how to configure it for my needs as there seems only to be an interval of seconds and not something like dusk, dawn, day, night or a definite time to trigger the announcement.
    Additionally IMO it would be even more difficult to configure, with the different day/night cycles from your plugin.

    And many thanks in advance!
  4. Offline


    818 Support? :D
  5. Offline


    Can someone confirm if this works on 818?
  6. Offline


    Working fine for me on 818.
  7. Offline


    I'm sorry, I'm in holiday and so I can't test it at the moment. But as far as I know nothing regarding time changed in the bukkit API so it obviously (and reported by reutnes) still works. New version will follow some days after my holiday (I'll be back on 19.06.).
  8. Offline


    With your plugin i was using a ratio of 3:1. immediately after a server reboot to have these config changes take place I was getting plagued with the error

    Internal exception: Read timed out
    Which is around a 6 month old bug which hasn't surfaced in a while (if my search button serves me correctly)

    What it seems to be happening (and excuse me if i got this wrong) but somewhere inbetween my computer and the server I was losing packets (note only when i changed the ratio, plugin was running just fine with a 1:1 ratio, aka unchanged config) and as such while i could still receive information from the server it was not receiving any from me, and would eventually give me a time out. Upon disabling your plugin, all was well again.

    As for performance issues that could also cause said error message.

    Speedtest done at the exact same time of the error showed 29 mb/s down 8 mb/s up (literally running MC and Speed test side by side)
    Server was running at 254/2048mb ram with 2% cpu usage at peaks (usually 1%)
    My personal CPU load was 29% with physical memory usage at 42%

    All of which tell me that the error is not due to lack of power server side, client side, or the connection inbetween. Which again was further proved by the lack of the problem recurring when your plugin was disabled.

    I hope to use your plugin in the future as i would prefer 30min day/30min night, and I hope my information helps you solve this mysterious issue (as it seems others are running this w/o problems)

    Best of luck
  9. Offline


    Interesting. I must admit that I don't have any idea what part of my plugin could cause so much lag that you'll get a timeout. I never touch any packets or (touch/do) anything else network-related. I just check periodically what time it is, and if the day/night is going to end, and shouldn't end now, I set the time. Nothing what takes much time. I can't reproduce this error, and, sadly for you, no one else seems to have this problem. You have the latest version, don't you? And on what CB # are you running? And could you paste your settings file please? Are you using other plugins which deal with the time?

    Changing the real lenght of a day or night is difficult, as I already said here:
  10. Offline


    I'm using the latest version (server is set to autoupdate it) which i believe is 820? but i could be mistaken maybe its only 818...

    and yeah i thought it was a bit weird that this was happening. as while i didn't know the structure of your plugin I assumed it wouldn't need to touch anything regarding client sent information. But none the less it happened, and became a problem that was fixed with the disabling of your plugin
  11. Offline


    I'll have a look into it when I'm back home, but I currently don't have the possibility to investigate that further, sorry.
  12. Offline


    Reported not working on #860.
  13. Offline


    @NeatMonster ... We're on #860 already? Man i can't keep up lol... so many numbers! Its a full time job just making sure this server's plugins play nice with eachother and the current version of bukkit XD

    And thanks Silver =) Like I said, I would love to use it, and the problem may not be specifically you (might be another plugin I use, and there are soooo many of them, interfering with it.. or maybe its just the current craftbukkit version? or maybe I made a typo in the syntax of the config file... I am somewhat new at this and while I'm not inexperienced by far... It is still a good deal of work to get a server fully up and running lol
  14. Offline


    Well, you might paste the config file here (in CODE-Tags or attached). But my plugin should just ignore malformed lines, or at least spit out some error.

    Maybe it's related to the new (craft-)bukkit builds, because nether/multiworld is now official part of the server and so some things while dealing with the worlds is different now. I'm back at 19.06. and can fiddle around, here I don't have my full workspace available.
  15. Offline


    I'm having a strange issue with TimeFold. I was using it to keep 1 world night all the time while the other worlds functioned normally. All was well until I upgraded to the latests build of Bukkit (#860) (I did not actually have time to check if it was working with the previous build)

    Basically I have the config file setup for just one world to be night all the time. When I go there and use the /TimeFold command all I get is 'Time Fold is not configured for this world' However when I edit the file to effect the Main Starting world it works perfectly.

    I actually don't know what the issue could be other than incompatibility with the new Bukkit Build. I have tried everything down to changing the worlds names to 1 2 3 4 to check if I'm spelling the names wrong, Only settings for world 1 would work. Tried setting the worlds in a different order 2 1 4 3 and still only world 1 is effected.
  16. Offline


    It seems that TimeFold isn't working for #860 because of the "new multiworld"/"official nether". But I'm in holiday till 19.06. and have only my laptop without my complete workspace here, so I currently can't check / fix it. But I'll have a look at it asap when I'm back home.
  17. Offline


    Thanks man, I thought as much :) Enjoy the remainder of your Holiday
  18. Offline


    Okay, Time fold RANDOMLY started working again on my test server :) Hopefully when I update the live server, what ever random thing I did will get it working there too ^_^
  19. Offline


    Hopefully you enjoyed your holidays and came back with new strength!
    I see that you already recognized that your plugin is at least semi-broken with CB #860 but I post my problem anyway. It has nothing to do with multiworld, as far as I can say.
    Whenever I use a bed at night the day/night cycle seems to be interrupted and changed back to normal. I can see that you added the point "Check for using beds(?)" under planned features. Are you already aware of this problem?
  20. Offline


    I'm currently testing around and I'll add a feature to stop messing up the cycle if beds are used.
  21. Offline


    so 10/0 works?

    or can I just put 1/0?

    I just would like all day no night :)
  22. Offline


    Since v0.4, 1:0 works (as 0:1 also). But it seems to be luck if it (the whole plugin, not only that setting) works on RB #860; and on RB #928 I wasn't able to test yet. I'm still at work (I'm on a late shift) now, so I can't say when I'll be able to bring up the next version.

    @NeatMonster @Bloodyneck92 @Cybird @manura133 @ToXicFRaGz
    I did some testing with different settings with v0.4 on #860 and #928 and I've to say that it works for me flawlessly.
    Nonetheless, I'll release v0.5 in the next days, build against #928 (or the RB which is current then:rolleyes:).
    If we are lucky, it will contain "bed-support" already. I'm working on it (and some other, small improvements).

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jul 16, 2016
  23. Offline


    Yes, all in all it is working fine for me, too. Except the bed thingy. Looking forward to the new release. Thanks!
  24. Offline


    I'm currently working on the bed "thingy" :D
    It does not work that well, seems bukkit does not use the same conditions as me for deciding if it switches to day or not on bed usage. I'll have to have a look at the bukkit source, I think.
    It would be great if there would be an event for that. I might have an idea for my first pull request for bukkit! :D

    Currently, v0.4b is available (as source) on github, tested with cb#935, refactored some code and now you can do timefold <world> on the server console.
  25. Offline


    Bukkit 935
    2011-06-29 17:29:58 [SEVERE] Exception in thread "AWT-EventQueue-0"
    2011-06-29 17:30:05 [SEVERE] java.lang.OutOfMemoryError: Java heap space
    2011-06-29 17:30:19 [INFO] Es ist 17:30 Uhr
    2011-06-29 17:30:19 [SEVERE]     at java.util.Arrays.copyOf(Unknown Source)
    2011-06-29 17:30:19 [SEVERE]     at java.util.ArrayList.ensureCapacity(Unknown Source)
    2011-06-29 17:30:29 [SEVERE]     at java.util.ArrayList.add(Unknown Source)
    2011-06-29 17:30:39 [SEVERE]     at org.bukkit.craftbukkit.util.LongHashtable.values(
    2011-06-29 17:31:12 [SEVERE]     at org.bukkit.craftbukkit.CraftWorld.getLoadedChunks(
    2011-06-29 17:31:17 [SEVERE]     at me.silverstar.timefold.TimeFoldActionListener.actionPerformed(
    Then the Server crashes :(
  26. Offline


    Okay, I see. Your server is under heavy load and you are at your memory limit?
    I do a obviously not that efficient check if a world is loaded, so that when no one is in there, timefold does not touch the cycle. :( Seems more efficient to do a run over a world where no one is in instead of having timefold checking crowded worlds.

    Well, I attached a "quick fix" for you and everyone else with that problem; It's v0.4.1, built for cb#935 and contains also the improvements mentioned in my post before.

    EDIT: Deleted v0.4.1 attachment, please use newer version from the opening post.
    wassilij likes this.
  27. Offline


    I'll try that quick fix later today, not sure if it helps on my server..
    After restart, timefold is not configured for any world.. (using the /timefold command tells me that in every world)
    After a /reload, on default world it seems to work and /timefold tells me the correct information
    On any other world, after the /reload using /timefold will give an unexpected error..
    All I need is a way to have days last one hour on main world, and disable nights on the factory (freebuild for OPs) world

    I'm not near a computer at the moment, so can't test anything right now
  28. Offline


    The above fix is just for the problem wassilij encountered, but others might have the same problem, so this fix will be in the next versions as well.

    Thats interesting. Could you please attach the config file or paste it somewhere? ( for example)
    I will add some "end-user-debug-options" in the next versions to help me helping you.
    What exactly is the "unexpected error"? Can you paste it here too?
  29. Offline


    Config file:
    The error is: An internal error occured while attempting to perform this command
    (I was so sure it was something with "An unexpected error occured" but I was wrong on that)
    There is nothing in the console about it
  30. Offline


    It loads fine but then when I try calling the plugin, I get this:
    23:57:14 [WARNING] Unexpected exception while parsing console command
    org.bukkit.command.CommandException: Unhandled exception executing command 'timefold' in plugin TimeFold v0.4
            at org.bukkit.command.PluginCommand.execute(
            at org.bukkit.command.SimpleCommandMap.dispatch(
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(
            at net.minecraft.server.MinecraftServer.b(
            at net.minecraft.server.MinecraftServer.h(
    Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            at java.lang.String.substring(
            at me.silverstar.timefold.TimeFold.senderToPlayer(
            at me.silverstar.timefold.TimeFold.getCycle(
            at me.silverstar.timefold.TimeFold.onCommand(
            at org.bukkit.command.PluginCommand.execute(
            ... 6 more
    Build #946, btw… :)
  31. Offline


    The new version is working perfectly for me, bukkit Build 950 ;)

Share This Page