bukkit: Add missing @JsonIgnore to permission list

Also simply the setter to use .associate { ... }
This commit is contained in:
Minecrell 2021-04-30 11:30:45 +02:00
parent b976a8e983
commit c60658d745

View file

@ -79,10 +79,10 @@ class BukkitPluginDescription(project: Project) : Serializable {
data class Permission(@Transient @JsonIgnore val name: String) : Serializable { data class Permission(@Transient @JsonIgnore val name: String) : Serializable {
var description: String? = null var description: String? = null
var default: Default? = null var default: Default? = null
var children: List<String>? // No @[Transient JsonIgnore] needed as it has no backing value var children: List<String>?
get() = childrenMap?.filterValues { it }?.keys?.toList() @JsonIgnore get() = childrenMap?.filterValues { it }?.keys?.toList()
set(value) { set(value) {
childrenMap = value?.map { it to true }?.toMap() childrenMap = value?.associate { it to true }
} }
@JsonProperty("children") var childrenMap: Map<String, Boolean>? = null @JsonProperty("children") var childrenMap: Map<String, Boolean>? = null