summaryrefslogtreewikicommitdiff
path: root/core/src/world/World.kt
blob: 4ab575f6452552d4711a0a074cca9f8ad15bff2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package cat.freya.khs.world

import java.io.File

interface World {
    /// The name of the minecraft world
    val name: String
    val type: Type

    enum class Type {
        NORMAL,
        FLAT,
        NETHER,
        END,
        UNKNOWN,
    }

    // The extent of the height
    val minY: Int
    val maxY: Int

    val spawn: Position

    /// Wrapper for world border values
    interface Border {
        val x: Double
        val z: Double
        val size: Double

        fun move(newX: Double, newZ: Double, newSize: ULong, delay: ULong)

        fun move(newSize: ULong, delay: ULong)
    }

    // World border
    val border: Border

    interface Loader {
        val name: String
        val world: World?

        // Returns the world folder
        val dir: File

        // Returns the map save folder
        val saveDir: File

        // Returns the temp map save folder
        val tempSaveDir: File

        fun load()

        fun unload()

        fun rollback()
    }

    // Returns the world loader
    val loader: Loader
}