Fixed data.yml
This commit is contained in:
@@ -36,11 +36,11 @@ abstract class EcoProfile(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.data == other.data && this.uuid == other.uuid
|
return this.uuid == other.uuid
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun hashCode(): Int {
|
override fun hashCode(): Int {
|
||||||
return this.data.hashCode()
|
return this.uuid.hashCode()
|
||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
|||||||
@@ -39,12 +39,14 @@ class YamlDataHandler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun <T> read(uuid: UUID, key: PersistentDataKey<T>): T? {
|
override fun <T> read(uuid: UUID, key: PersistentDataKey<T>): T? {
|
||||||
return when (key.type) {
|
val value = when (key.type) {
|
||||||
PersistentDataKeyType.INT -> dataYml.getInt("player.$uuid.$key")
|
PersistentDataKeyType.INT -> dataYml.getInt("player.$uuid.${key.key}")
|
||||||
PersistentDataKeyType.DOUBLE -> dataYml.getDouble("player.$uuid.$key")
|
PersistentDataKeyType.DOUBLE -> dataYml.getDouble("player.$uuid.${key.key}")
|
||||||
PersistentDataKeyType.STRING -> dataYml.getString("player.$uuid.$key")
|
PersistentDataKeyType.STRING -> dataYml.getString("player.$uuid.${key.key}")
|
||||||
PersistentDataKeyType.BOOLEAN -> dataYml.getBool("player.$uuid.$key")
|
PersistentDataKeyType.BOOLEAN -> dataYml.getBool("player.$uuid.${key.key}")
|
||||||
else -> null
|
else -> null
|
||||||
} as? T?
|
} as? T?
|
||||||
|
|
||||||
|
return value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user