com.skillw.attsystem.internal.feature.personal.InitialAttrData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of AttributeSystem Show documentation
Show all versions of AttributeSystem Show documentation
Bukkit Attribute Engine Plugin.
The newest version!
package com.skillw.attsystem.internal.feature.personal
import com.google.gson.GsonBuilder
import com.skillw.attsystem.AttributeSystem.attributeDataManager
import com.skillw.attsystem.api.attribute.compound.AttributeDataCompound
import com.skillw.attsystem.internal.feature.database.ASContainer
import com.skillw.pouvoir.api.plugin.map.component.Keyable
import com.skillw.pouvoir.util.decodeFromString
import com.skillw.pouvoir.util.encodeJson
import org.bukkit.entity.Player
import taboolib.common.util.unsafeLazy
import java.util.*
/**
* @className InitialAttrData
*
* @author Glom
* @date 2023/8/1 18:07 Copyright 2023 user. All rights reserved.
*/
class InitialAttrData(override val key: UUID, val compound: AttributeDataCompound = AttributeDataCompound()) :
Keyable {
companion object {
private val gson by unsafeLazy {
GsonBuilder().create()
}
@JvmStatic
fun deserialize(uuid: UUID, str: String): InitialAttrData? {
return InitialAttrData(
uuid,
AttributeDataCompound.fromMap(gson.fromJson