TIME STAMPS MOD - WIP! A mod to tweak how time works in Minecraft (LGPL Open Source)
Minecraft, while being an amazing game, is not without its problems. One of these problems is that if you go really far away from your house, the chunks get unloaded and nothing happens in them until you come back. Ever go to the nether and come back to find your paddock full of baby animals that forgot to grow up, and your farm filled with freshly planted crops? Yeah, it's annoying isn't it.
For my first Minecraft mod (in fact, my first Java project), I decided to try and solve this problem, but in the least intrusive way possible, and without any of the hassle or performance loss that comes with things chunk loaders and the like. Simply plant stuff, go far away, come back, and see that it has grown while you were gone.
What exactly does the mod do?
The mod simply keeps a track of how long a chunk is unloaded for, then when the chunk is next loaded, it will simulate the block updates that ~should~ have occurred during that time (it also makes baby animals grow up). Simple. In fact, there's a good chance that you will even forget that it is there... unless it crashes, which is REALLY bad, and if this happens, come straight back and post the crash log here [in spoiler tags] or on the issue tracker on my GIT!.
The mod can currently update most vanilla blocks and crops, and can grow baby animals. Coco beans (I forgot about them), mushrooms, grass, will probably be in the next version. Hoppers don't work with furnaces just yet, but I also have plans to add simplistic support for them.
The mod is also very fast and will not generate lag. Testing showed that it can grow hundreds of crops and saplings pretty much instantly. Thanks to my spiffy queuing system (it's actually pretty simple), ridiculous numbers of updates get spread out over a reasonable number of ticks, preventing the updates from causing lag.
NOTE: The beta version currently stores all of it's files in a folder within the world save ("saves\worldname\Time Stamps"). Currently, it makes lots of teensy-tiny files, though it writes data no more often than the game itself. This system is kind of like... a place-holder, and I'm probably going to rewrite how it works at a later stage, maybe even for the next version, but whatever. This is just a warning that there may be more files than usual in the world save.
Spotlights and Screenshots
I had a little bit of trouble finding a decent screen recorder that didn't look like malware, and I'm way too poor to pay for FRAPS, so for now, the best I can do are bootleg screenshots (which pretty much anyone could take, with or without this mod installed :P).
I made a farm (really far from the spawn area of the world)!
Then I went to the nether!
Then I stayed in the nether and explored a nether fortress
After that, I got bored (~2 minutes), so I fast forwarded time, spent 5 minutes looking for my portal, and went back to the overworld!!
Yes, the nether wart died because I told it that it needed less than 5 light to survive (brain fart). Luckily I fixed that bug before building and uploading.
This is a regular forge mod, just drop it in your /mods folder and watch it go.
The mod should work on both SSP and SMP, although I've only done limited testing for servers.
Initially it may be hard to see the effect of the mod. Play in creative, plant a sapling, stand back, and enter; "/timestamp progress time 1000000"
if the mod is installed correctly, the tree will grow instantly.
I can't promise that there won't be bugs, and bugs can do terrible things to world saves. It's an initial beta release, so cut me some slack. What I can promise is that if you report them in this thread, or to the Issue tracker on my GIT, I will do my best to fix them and make everything work properly again.
Commands and config
There are various settings and features that can be accessed using the config file, plus a new command with various parameters. Capabilities range from pausing the mod, to changing the rate of time in unloaded chunks. For extra fun, there is one command that will even let you jump forwards through time (backwards time travel is also on the drawing board).
List of commands '(get/set)' indicates that you can use both "/timestamp get XXX" and "/timestamp set XXX [value]".
/timestamp start => resumes the mod on this world. /timestamp stop => pauses the mod on this world. /timestamp reset => RESETS SETTINGS TO CONFIG DEFAULTS
/timestamp (get/set) time [integer] => sets the mod-counted ticks to the specified value /timestamp (get/set) timescale [integer] => gets the rate at which the mod counts ticks. 64 is default. /timestamp (get/set) updates [integer] => gets or sets the update quota (ms per tick)
/timestamp progress time [integer] => Magic Command to fast forward time by X ticks (20 ticks per second)
For example,
"/timestamp set updates 10" will limit the mod to using 10ms per tick for updating blocks.
"/timestamp progress time 12000" will progress time by 12000 ticks = 600 seconds = 10 minutes.
NOTE: The config file applies settings to NEW worlds only. After a world is made, things like the timescale are FIXED and can only be changed through commands. The mod enabled/disabled setting is EXEMPT from this, and can disable the mod on all worlds.
LICENSING INFORMATION
Certainly anyone can fake screenshots like the ones above, however I would be willing to bet you an entire dollar that those people probably don't have the entire source code for their mod freely available on a public GIT repository.
Rollback Post to RevisionRollBack
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
Not at the moment. When I've finished my current mod, I might come back and redo this entire project, which is more like... an experiment cross proof of concept to see how feasible it is to make things happen in unloaded chunks. Until then, this will probably just sit on the shelf as proof that it can be done to a certain extent
Rollback Post to RevisionRollBack
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
You, my friend, are a genius. If I were to get a burning desire to fork this and update it, would that be ok?
EDIT: I guess not - the source is gone
Hmmm, that's no good... hmmm, very no good. Thanks for alerting me to that, I'll have to fix it tomorrow (or rewrite a better version lol, I could do with a quick break from fluids, and this was my first Java code ever so it isn't really... good code or a good implementation)
Anyway, forking is/would be fine provided you follow the license. I think I will change it to WTFPL for next version actually...
EDIT: Ooops I deleted the repo by accident when I was spring cleaning, lol, at least I have I copy in my dev folder.... nah, screw it, remake the mod I shall
Rollback Post to RevisionRollBack
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
Okay, so good development progress has been made. I've rewritten absolutely everything from the ground up, and devised some new ways to recognize blocks (my own random tick implementation, which will also be used to make some blocks, like grass and mushrooms, experience faster rates of growth in chunks which were not visited for a long time).
Currently, the pipeline is basically;
i) Blocks are mapped (in HashMap) to instances of IUpdateHandler interface (calls performUpdateTask method with all necessary params)
ii) Time-affected blocks are listed in collections, for flexibility with adding new blocks and stuff.
1. Flag a coordinate when time-affected block is found (currently uses bitset which I may expand for concurrency, or switch to bool[], not sure yet).
2. When loading chunk, iterate over flagged coordinates and add tasks to a queue
3. Every tick, tasks in the queue are deferred to the corresponding IUpdateHandler, limited to a max of N milliseconds per tick (lag-stomp).
Rollback Post to RevisionRollBack
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
At some point or another, I deleted the repo (mentioned a couple of posts up), and I honestly have no idea where the rewritten code went (most likely it was in a local git on my old laptop). I definitely don't have a copy of the old compiled jars either.
That said, I have always wanted to come back to this mod, I just have trouble finding time for it between real life and other projects
Rollback Post to RevisionRollBack
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
A mod to tweak how time works in Minecraft (LGPL Open Source)
Minecraft, while being an amazing game, is not without its problems. One of these problems is that if you go really far away from your house, the chunks get unloaded and nothing happens in them until you come back. Ever go to the nether and come back to find your paddock full of baby animals that forgot to grow up, and your farm filled with freshly planted crops? Yeah, it's annoying isn't it.
For my first Minecraft mod (in fact, my first Java project), I decided to try and solve this problem, but in the least intrusive way possible, and without any of the hassle or performance loss that comes with things chunk loaders and the like. Simply plant stuff, go far away, come back, and see that it has grown while you were gone.
NOTE: The beta version currently stores all of it's files in a folder within the world save ("saves\worldname\Time Stamps"). Currently, it makes lots of teensy-tiny files, though it writes data no more often than the game itself. This system is kind of like... a place-holder, and I'm probably going to rewrite how it works at a later stage, maybe even for the next version, but whatever. This is just a warning that there may be more files than usual in the world save.
I made a farm (really far from the spawn area of the world)!
Then I went to the nether!
Then I stayed in the nether and explored a nether fortress
After that, I got bored (~2 minutes), so I fast forwarded time, spent 5 minutes looking for my portal, and went back to the overworld!!
Yes, the nether wart died because I told it that it needed less than 5 light to survive (brain fart). Luckily I fixed that bug before building and uploading.
BETA 0.1: https://www.dropbox.com/s/5snfcozr8vgj9qw/Time_Stamps_Mod_Beta_0.1.jar
SOURCE (LGPL): https://bitbucket.org/4HeadTiger/time-stamps-mod/src
The mod should work on both SSP and SMP, although I've only done limited testing for servers.
Initially it may be hard to see the effect of the mod. Play in creative, plant a sapling, stand back, and enter;
"/timestamp progress time 1000000"
if the mod is installed correctly, the tree will grow instantly.
I can't promise that there won't be bugs, and bugs can do terrible things to world saves. It's an initial beta release, so cut me some slack. What I can promise is that if you report them in this thread, or to the Issue tracker on my GIT, I will do my best to fix them and make everything work properly again.
List of commands
'(get/set)' indicates that you can use both "/timestamp get XXX" and "/timestamp set XXX [value]".
/timestamp start => resumes the mod on this world.
/timestamp stop => pauses the mod on this world.
/timestamp reset => RESETS SETTINGS TO CONFIG DEFAULTS
/timestamp (get/set) time [integer] => sets the mod-counted ticks to the specified value
/timestamp (get/set) timescale [integer] => gets the rate at which the mod counts ticks. 64 is default.
/timestamp (get/set) updates [integer] => gets or sets the update quota (ms per tick)
/timestamp progress time [integer] => Magic Command to fast forward time by X ticks (20 ticks per second)
For example,
"/timestamp set updates 10" will limit the mod to using 10ms per tick for updating blocks.
"/timestamp progress time 12000" will progress time by 12000 ticks = 600 seconds = 10 minutes.
NOTE: The config file applies settings to NEW worlds only. After a world is made, things like the timescale are FIXED and can only be changed through commands. The mod enabled/disabled setting is EXEMPT from this, and can disable the mod on all worlds.
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
Not at the moment. When I've finished my current mod, I might come back and redo this entire project, which is more like... an experiment cross proof of concept to see how feasible it is to make things happen in unloaded chunks. Until then, this will probably just sit on the shelf as proof that it can be done to a certain extent
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
EDIT: I guess not - the source is gone
Hmmm, that's no good... hmmm, very no good. Thanks for alerting me to that, I'll have to fix it tomorrow (or rewrite a better version lol, I could do with a quick break from fluids, and this was my first Java code ever so it isn't really... good code or a good implementation)
Anyway, forking is/would be fine provided you follow the license. I think I will change it to WTFPL for next version actually...
EDIT: Ooops I deleted the repo by accident when I was spring cleaning, lol, at least I have I copy in my dev folder.... nah, screw it, remake the mod I shall
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
Currently, the pipeline is basically;
i) Blocks are mapped (in HashMap) to instances of IUpdateHandler interface (calls performUpdateTask method with all necessary params)
ii) Time-affected blocks are listed in collections, for flexibility with adding new blocks and stuff.
1. Flag a coordinate when time-affected block is found (currently uses bitset which I may expand for concurrency, or switch to bool[], not sure yet).
2. When loading chunk, iterate over flagged coordinates and add tasks to a queue
3. Every tick, tasks in the queue are deferred to the corresponding IUpdateHandler, limited to a max of N milliseconds per tick (lag-stomp).
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.
Hey man where did the DL link go ? Are you stopping this mod ? Is there anyway I could get the old download ?
At some point or another, I deleted the repo (mentioned a couple of posts up), and I honestly have no idea where the rewritten code went (most likely it was in a local git on my old laptop). I definitely don't have a copy of the old compiled jars either.
That said, I have always wanted to come back to this mod, I just have trouble finding time for it between real life and other projects
I believe in the Invisible Pink Unicorn, bless her Invisible Pinkness.