Minigame map/arena library to hold & store data.
minecraft minecraft-lib minecraft-library
2

Configure Feed

Select the types of activity you want to include in your feed.

Add javadocs for WorldData, its #section and #getSection

Lukiiy (Jul 13, 2026, 8:11 PM -0300) 8230fc77 6e134ae6

+15
+15
src/main/kotlin/me/lukiiy/mapling/WorldData.kt
··· 1 1 package me.lukiiy.mapling 2 2 3 + /** 4 + * Data holder for a [ManagedWorld]. Can hold positions, areas and cusotm values. 5 + */ 3 6 class WorldData(private val values: MutableMap<String, Any> = linkedMapOf(), private val sections: MutableMap<String, WorldData> = linkedMapOf(), private val positions: MutableMap<String, Position> = linkedMapOf(), private val areas: MutableMap<String, Pair<Position, Position>> = linkedMapOf()) { 4 7 fun set(key: String, value: Any): WorldData { 5 8 if (value is Position) return setPosition(key, value) ··· 29 32 } 30 33 } 31 34 35 + /** 36 + * Gets or creates a nested [WorldData] section, serving as sort of a group. 37 + * 38 + * @param name Dot-separated path, (like "spawns.overworld") 39 + * @return The section at that path (created if absent) 40 + */ 32 41 fun section(name: String): WorldData { 33 42 val parts = name.split('.').filter { it.isNotBlank() } 34 43 var current = this ··· 38 47 return current 39 48 } 40 49 50 + /** 51 + * Gets the nested [WorldData] section at the given dot-separated path, if it exists. Does not create missing sections. 52 + * 53 + * @param name Dot-separated path, (like "spawns.overworld") 54 + * @return The section at that path, or `null` if any part of the path doesn't exist 55 + */ 41 56 fun getSection(name: String): WorldData? { 42 57 val parts = name.split('.').filter { it.isNotBlank() } 43 58 var current: WorldData = this