Update decimal singletons to make neoforge component checker happy

This commit is contained in:
DBotThePony 2024-08-28 00:02:01 +07:00
parent da0f5d544b
commit 85e477f386
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -701,6 +701,14 @@ sealed class Decimal : Number(), Comparable<Decimal> {
override val isFinite: Boolean
get() = false
override fun equals(other: Any?): Boolean {
return this === other
}
override fun hashCode(): Int {
return super.hashCode()
}
override fun compareTo(other: Decimal): Int {
return if (other === this) 0 else 1
}
@ -942,6 +950,14 @@ sealed class Decimal : Number(), Comparable<Decimal> {
override val isFinite: Boolean
get() = false
override fun equals(other: Any?): Boolean {
return this === other
}
override fun hashCode(): Int {
return super.hashCode()
}
override fun compareTo(other: Decimal): Int {
return if (other === this) 0 else -1
}
@ -1177,6 +1193,14 @@ sealed class Decimal : Number(), Comparable<Decimal> {
override val isFinite: Boolean
get() = true
override fun equals(other: Any?): Boolean {
return this === other || other is Decimal && other.isZero
}
override fun hashCode(): Int {
return super.hashCode()
}
override fun compareTo(other: Decimal): Int {
return -other.signum()
}