}
}
}
worldname = WorldManager.getWorldName(sender, args, useWorld);
if (this.handleWorld()) {
WorldConfig wc = WorldConfig.get(worldname);
if (time == -1) {
World w = WorldManager.getWorld(worldname);
if (w == null) {
WorldInfo i = wc.getInfo();
if (i == null) {
time = 0;
} else {
time = i.time;
}
} else {
time = w.getFullTime();
}
}
if (args.length == 0) {
message(ChatColor.YELLOW + "The current time of world '" +
worldname + "' is " + TimeUtil.getTimeString(time));
} else {
TimeControl tc = wc.timeControl;
boolean wasLocked = tc.isLocked();
tc.setLocking(lock);
tc.setTime(time);
if (lock) {
if (wc.isLoaded()) {
message(ChatColor.GREEN + "Time of world '" + worldname + "' locked to " +
TimeUtil.getTimeString(time) + "!");
} else {
Localization.WORLD_NOTLOADED.message(sender, worldname);
message(ChatColor.YELLOW + "Time will be locked to " +
TimeUtil.getTimeString(time) + " as soon it is loaded!");
}
} else {
World w = wc.getWorld();
if (w != null) {
if (wasLocked) {
message(ChatColor.GREEN + "Time of world '" + worldname + "' unlocked and set to " +
TimeUtil.getTimeString(time) + "!");
} else {