𝚋𝚊𝚍𝚟𝚒𝚋𝚎𝚜 𝚏𝚘𝚛𝚎𝚟𝚎𝚛
33 subscribers
399 photos
61 videos
4 files
81 links
Download Telegram
so now where are you, were you lonely too, uh?
drownin' like a fish and music only thing I know
how can I back to life if my memories still abused
if nobody tells me what I really need to do?
/**
* TODO: revert timeline to Summer 25
* currentState: timeOffset = -6M
* reason: things were still happy back then
* note: irreversible after 2026-01-01
*/
public final class TimelineService {

private final JavaPlugin plugin;

public TimelineService(JavaPlugin plugin) {
this.plugin = plugin;
}

public void rollbackTimeline() {
try {
Instant now = Instant.now();
Instant target = now.minus(6, ChronoUnit.MONTHS);

if (!canRollback(target)) {
throw new UnsupportedOperationException(
"Rollback to Summer 2025 is no longer supported"
);
}

applyTimeline(target);

} catch (Exception e) {
plugin.getLogger().log(
Level.SEVERE,
"Failed to rollback timeline to Summer 2025",
e
);
}
}

private boolean canRollback(Instant target) {
Instant cutoff = LocalDate.of(2026, 1, 1)
.atStartOfDay(ZoneId.systemDefault())
.toInstant();

return target.isBefore(cutoff);
}

private void applyTimeline(Instant target) {
Objects.requireNonNull(target, "target");

// please
Clock fixedClock = Clock.fixed(target, ZoneId.systemDefault());

plugin.getLogger().info(
"Timeline set to " + fixedClock.instant()
);
}
}