add toString for Area

This commit is contained in:
TONY_All 2023-06-10 19:40:14 +08:00
parent 764ead46c2
commit 3d35de3fe3
No known key found for this signature in database
GPG Key ID: B868A344D7435E88
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,6 @@ package cc.maxmc.blastingcrisis.misc
import org.bukkit.Location import org.bukkit.Location
import org.bukkit.Material import org.bukkit.Material
import org.bukkit.block.Block
import org.bukkit.configuration.serialization.ConfigurationSerializable import org.bukkit.configuration.serialization.ConfigurationSerializable
import org.bukkit.configuration.serialization.SerializableAs import org.bukkit.configuration.serialization.SerializableAs
import org.bukkit.util.Vector import org.bukkit.util.Vector
@ -102,6 +101,7 @@ class Area(loc1: Location, loc2: Location) : ConfigurationSerializable {
return locMin == other.locMin return locMin == other.locMin
} }
override fun hashCode(): Int { override fun hashCode(): Int {
var result = locTop.hashCode() var result = locTop.hashCode()
result = 31 * result + locMin.hashCode() result = 31 * result + locMin.hashCode()
@ -110,4 +110,8 @@ class Area(loc1: Location, loc2: Location) : ConfigurationSerializable {
override fun serialize() = mutableMapOf<String, Any>("locTop" to locTop, "locMin" to locMin) override fun serialize() = mutableMapOf<String, Any>("locTop" to locTop, "locMin" to locMin)
override fun toString(): String {
return "Area(locTop=$locTop, locMin=$locMin)"
}
} }