Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7ff3eeef06 | ||
|
|
58faf6de23 | ||
|
|
7f42cbe32e | ||
|
|
ae12ab17fe |
@@ -1,6 +1,8 @@
|
|||||||
package com.willfp.eco.internal.spigot.data
|
package com.willfp.eco.internal.spigot.data
|
||||||
|
|
||||||
import com.willfp.eco.core.data.PlayerProfile
|
import com.willfp.eco.core.data.PlayerProfile
|
||||||
|
import com.willfp.eco.core.data.Profile
|
||||||
|
import com.willfp.eco.core.data.ServerProfile
|
||||||
import com.willfp.eco.core.data.keys.PersistentDataKey
|
import com.willfp.eco.core.data.keys.PersistentDataKey
|
||||||
import com.willfp.eco.internal.spigot.data.storage.DataHandler
|
import com.willfp.eco.internal.spigot.data.storage.DataHandler
|
||||||
import java.util.UUID
|
import java.util.UUID
|
||||||
@@ -10,7 +12,7 @@ abstract class EcoProfile(
|
|||||||
val data: MutableMap<PersistentDataKey<*>, Any>,
|
val data: MutableMap<PersistentDataKey<*>, Any>,
|
||||||
val uuid: UUID,
|
val uuid: UUID,
|
||||||
private val handler: DataHandler
|
private val handler: DataHandler
|
||||||
) : PlayerProfile {
|
) : Profile {
|
||||||
override fun <T : Any> write(key: PersistentDataKey<T>, value: T) {
|
override fun <T : Any> write(key: PersistentDataKey<T>, value: T) {
|
||||||
this.data[key] = value
|
this.data[key] = value
|
||||||
|
|
||||||
@@ -50,7 +52,7 @@ class EcoPlayerProfile(
|
|||||||
data: MutableMap<PersistentDataKey<*>, Any>,
|
data: MutableMap<PersistentDataKey<*>, Any>,
|
||||||
uuid: UUID,
|
uuid: UUID,
|
||||||
handler: DataHandler
|
handler: DataHandler
|
||||||
) : EcoProfile(data, uuid, handler) {
|
) : EcoProfile(data, uuid, handler), PlayerProfile {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "EcoPlayerProfile{uuid=$uuid}"
|
return "EcoPlayerProfile{uuid=$uuid}"
|
||||||
}
|
}
|
||||||
@@ -59,7 +61,7 @@ class EcoPlayerProfile(
|
|||||||
class EcoServerProfile(
|
class EcoServerProfile(
|
||||||
data: MutableMap<PersistentDataKey<*>, Any>,
|
data: MutableMap<PersistentDataKey<*>, Any>,
|
||||||
handler: DataHandler
|
handler: DataHandler
|
||||||
) : EcoProfile(data, serverProfileUUID, handler) {
|
) : EcoProfile(data, serverProfileUUID, handler), ServerProfile {
|
||||||
override fun toString(): String {
|
override fun toString(): String {
|
||||||
return "EcoServerProfile"
|
return "EcoServerProfile"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ class EcoProfileHandler(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun saveKeysFor(uuid: UUID, keys: Set<PersistentDataKey<*>>) {
|
override fun saveKeysFor(uuid: UUID, keys: Set<PersistentDataKey<*>>) {
|
||||||
val profile = PlayerProfile.load(uuid)
|
val profile = loadGenericProfile(uuid)
|
||||||
|
|
||||||
for (key in keys) {
|
for (key in keys) {
|
||||||
handler.write(uuid, key.key, profile.read(key))
|
handler.write(uuid, key.key, profile.read(key))
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
version = 6.22.1
|
version = 6.22.3
|
||||||
plugin-name = eco
|
plugin-name = eco
|
||||||
kotlin.code.style = official
|
kotlin.code.style = official
|
||||||
Reference in New Issue
Block a user