From 3d35de3fe3ac5040fe7fc687a243b739d528d671 Mon Sep 17 00:00:00 2001 From: TONY_All Date: Sat, 10 Jun 2023 19:40:14 +0800 Subject: [PATCH] add toString for Area --- src/main/kotlin/cc/maxmc/blastingcrisis/misc/Area.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/cc/maxmc/blastingcrisis/misc/Area.kt b/src/main/kotlin/cc/maxmc/blastingcrisis/misc/Area.kt index a7add4a..f3b52a2 100644 --- a/src/main/kotlin/cc/maxmc/blastingcrisis/misc/Area.kt +++ b/src/main/kotlin/cc/maxmc/blastingcrisis/misc/Area.kt @@ -2,7 +2,6 @@ package cc.maxmc.blastingcrisis.misc import org.bukkit.Location import org.bukkit.Material -import org.bukkit.block.Block import org.bukkit.configuration.serialization.ConfigurationSerializable import org.bukkit.configuration.serialization.SerializableAs import org.bukkit.util.Vector @@ -102,6 +101,7 @@ class Area(loc1: Location, loc2: Location) : ConfigurationSerializable { return locMin == other.locMin } + override fun hashCode(): Int { var result = locTop.hashCode() result = 31 * result + locMin.hashCode() @@ -110,4 +110,8 @@ class Area(loc1: Location, loc2: Location) : ConfigurationSerializable { override fun serialize() = mutableMapOf("locTop" to locTop, "locMin" to locMin) + override fun toString(): String { + return "Area(locTop=$locTop, locMin=$locMin)" + } + }