Minecraft CircadianRhythm mod 2024 download
logo
minecraft mod CircadianRhythm

CircadianRhythm

Game Version: 1.10
Total Downloads: 302
Updated: Jun 29, 2016
Created: Jun 29, 2016
Download CircadianRhythmDownload Earlier Versions

Earlier Versions

Name Size Uploaded Game Version Downloads
CircadianRhythm V1.1.0 release 3.26 KB Jun 29, 2016 1.10 216 download CircadianRhythm CircadianRhythm V1.1.0 releaseDownload
CircadianRhythm V 1.0.0 release 3.19 KB Jun 29, 2016 1.10 86 download CircadianRhythm CircadianRhythm V 1.0.0 releaseDownload

Screenshots

Description

Share this:

Circadian Rhythm By Lowbrain

Information

This plugin is intended to replace minecraft day and night cycle (20 min). Make it longer, smaller, your choice. It is free and open source. Use it, copy it, do what ever you want with it 🙂

PS : For it do work properly you will need to set gamerule.doDaylighCycle false

You can find the source code >>HERE<<.

How it works

It is basic mathematics.

public void syncTime() {
    	int hpd = this.getConfig().getInt("hoursPerDay");
    	double timespeed = (24/hpd);
        Calendar d = Calendar.getInstance();
        int h = d.get(11) + this.getConfig().getInt("hoursOffset");
        h = (int) (h * timespeed);
        if(h > 24)h -= 24;
        int m = d.get(12);
        m = (int) (m * timespeed);
        if(m > 60){
        	m -= 60;
        	h += 1;
        }
        if(this.getConfig().getBoolean("debug")){
        	this.getLogger().info("Time : " + h + "hrs " + m + " min");
        }
        long ticks = 1000 * h + (m *= 16) + 18000;
        ((World)this.getServer().getWorlds().get(0)).setTime(ticks);
    }
  • First, the time-speed is set by dividing a real day and night cycle (24 hrs) by the value of your choice (in config). For example, if it's set at 12 hrs, the time-speed will be 2x.
  • It then gets the server's current time
  • Multiply the hours by the time-speed, if the value gets higher then 24, we subtract 24 meaning it's a next day
  • Same goes for the minutes
  • Convert to tick for minecraft and then you're done !

If you set the hours per day to 24 you'll get the real time

Configurations

updateInterval
  • default value : 300
  • description : The amount of time between each time the time is set. If you lower the hoursPerDay value, i recommend to lower this one as well, it will be more fluid and won't really affect the performance.
hoursPerDay
  • default value : 12
  • description : the number of hours for a complete day-night cycle in minecraft
debug
  • default value : false
  • description : show the new time in console
hoursOffset
  • default value : 0
  • description : offset hours with the server. For example, if you and the server are in a different time zone, you could set this value to the time zone diffences

Comments

Add a comment