From 14dec070b81f4452c3f098c76f1b444917d93e86 Mon Sep 17 00:00:00 2001 From: oglassdev <23040613+oglassdev@users.noreply.github.com> Date: Wed, 14 Oct 2026 19:24:28 -0400 Subject: [PATCH] fix(particle): include overrideLimiter in ParticleBuilder equality The hand-written equals/hashCode skipped overrideLimiter. Remove them so the data class generates both from every property. --- .../net/bladehunt/kotstom/dsl/Particle.kt | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/src/main/kotlin/net/bladehunt/kotstom/dsl/Particle.kt b/src/main/kotlin/net/bladehunt/kotstom/dsl/Particle.kt index 45ab162..6160dc7 100644 --- a/src/main/kotlin/net/bladehunt/kotstom/dsl/Particle.kt +++ b/src/main/kotlin/net/bladehunt/kotstom/dsl/Particle.kt @@ -15,32 +15,6 @@ data class ParticleBuilder( var count: Int = 1, ) { fun build(): ParticlePacket = ParticlePacket(particle, overrideLimiter, longDistance, position, offset, particleData, count) - - override fun equals(other: Any?): Boolean { - if (this === other) return true - if (javaClass != other?.javaClass) return false - - other as ParticleBuilder - - if (particle != other.particle) return false - if (longDistance != other.longDistance) return false - if (position != other.position) return false - if (offset != other.offset) return false - if (particleData != other.particleData) return false - if (count != other.count) return false - - return true - } - - override fun hashCode(): Int { - var result = particle.hashCode() - result = 31 * result + longDistance.hashCode() - result = 31 * result + position.hashCode() - result = 31 * result + offset.hashCode() - result = 31 * result + particleData.hashCode() - result = 31 * result + count - return result - } } inline fun particle(block: ParticleBuilder.() -> Unit): ParticlePacket = ParticleBuilder().apply(block).build()