Rebrand to Galaxy, major improvements to Bedrock support, still needs some TLC though

This commit is contained in:
Ryan Ward
2026-05-07 11:29:34 -05:00
parent f4e2475c60
commit a41cbd8cc7
2433 changed files with 14208 additions and 9409 deletions
+28
View File
@@ -0,0 +1,28 @@
#[cfg(test)]
use chrono::TimeZone;
use chrono::{DateTime, Utc};
#[cfg(test)]
use std::sync::atomic::{AtomicI64, Ordering};
#[cfg(not(test))]
pub fn get_current_time() -> DateTime<Utc> {
Utc::now()
}
thread_local! {
#[cfg(test)]
static CURRENT_SECS: AtomicI64 = const { AtomicI64::new(0) };
}
#[cfg(test)]
pub fn get_current_time() -> DateTime<Utc> {
CURRENT_SECS.with(|current_secs| {
Utc.timestamp_opt(current_secs.load(Ordering::SeqCst), 0)
.unwrap()
})
}
#[cfg(test)]
pub fn test_offset_time(offset_secs: i64) {
CURRENT_SECS.with(|current_secs| {
current_secs.fetch_add(offset_secs, Ordering::SeqCst);
})
}