Any way to reset a worlds internal time?

Discussion in 'Plugin Development' started by iamdansker, May 22, 2013.

Thread Status:
Not open for further replies.
  1. Due to a bug within the minecraft client with floating points https://mojang.atlassian.net/browse/MC-1279 beacons will bug out over time as many server owners might have noticed.
    The way to "fix" this is by resetting the internal time of the world, both Time and DayTime in Data

    Now i'v done this before manually but it is generally a pain in the ass when you have 30+ worlds
    then i tried editing the time with this
    Code:
            List<World> worlds = Bukkit.getWorlds();
            for(World world : worlds){
                CraftWorld cWorld = (CraftWorld) world;
                NBTTagCompound tag = cWorld.getHandle().worldData.a();
                if(tag != null){
                    tag.setLong("DayTime",0);
                    tag.setLong("Time",0);
                    cWorld.save();
                } else {
                    this.sendErrorMessage(cs, "Cannot change time and daytime for world "+world.getName());
                }
            }
    But it doesn't work and i guess the reason why, is that it is changed constantly. I have considered also changing the value in the NMS World object, but haven't been able to find these 2 variables in it.

    So my question is, how can i reset the internal time of a world or do you have any fix for the annoying beacon graphics bug?
     
Thread Status:
Not open for further replies.

Share This Page