diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt index 3332158ed..a200f1ff9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/Decimal.kt @@ -746,6 +746,14 @@ class Decimal @JvmOverloads constructor(whole: BigInteger, decimal: Double = 0.0 private val cache = Array(2048) { Decimal(it - 1024, 0.0) } + init { + cache[1024] = ZERO + cache[1025] = ONE + cache[1023] = MINUS_ONE + cache[1026] = TWO + cache[1034] = TEN + } + /** * Returns pooled value if present, otherwise constructs new object */