Skip to content

Commit 38fbdcc

Browse files
committed
fix!: remove BukkitLocation.kt
1 parent d80b180 commit 38fbdcc

File tree

5 files changed

+8
-18
lines changed

5 files changed

+8
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ repositories {
1111
}
1212
1313
dependencies {
14-
implementation('io.typst:bukkit-kotlin-serialization:1.3.0')
14+
implementation('io.typst:bukkit-kotlin-serialization:2.0.0')
1515
}
1616
```
1717

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88
}
99

1010
group = 'io.typst'
11-
version = '1.3.0'
11+
version = '2.0.0'
1212

1313
repositories {
1414
mavenCentral()

src/main/kotlin/io/typst/bukkit/kotlin/serialization/location/BukkitLocation.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.

src/main/kotlin/io/typst/bukkit/kotlin/serialization/location/WorldLocation.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,24 @@ package io.typst.bukkit.kotlin.serialization.location
33
import kotlinx.serialization.Serializable
44
import org.bukkit.Bukkit
55
import org.bukkit.Location
6+
import org.bukkit.World
67
import org.bukkit.entity.Entity
78

89
@Serializable
910
data class WorldLocation(
10-
val world: String,
11+
val worldName: String,
1112
val x: Double,
1213
val y: Double,
1314
val z: Double,
1415
val yaw: Float = 0f,
1516
val pitch: Float = 0f,
1617
) {
18+
val world: World? get() = Bukkit.getWorld(worldName)
19+
1720
fun toBukkitLocation(entity: Entity? = null): Location {
1821
val yaw = entity?.location?.yaw ?: this.yaw
1922
val pitch = entity?.location?.pitch ?: this.pitch
20-
return Location(Bukkit.getWorld(world), x, y, z, yaw, pitch)
23+
return Location(Bukkit.getWorld(worldName), x, y, z, yaw, pitch)
2124
}
2225

2326
companion object {

src/main/kotlin/io/typst/bukkit/kotlin/serialization/time/PeriodSerializer.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import java.time.Period
1212

1313
typealias PeriodAsString = @Serializable(PeriodSerializer::class) Period
1414
object PeriodSerializer : KSerializer<Period> {
15-
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("Period", PrimitiveKind.STRING)
15+
override val descriptor: SerialDescriptor = PrimitiveSerialDescriptor("JavaPeriod", PrimitiveKind.STRING)
1616

1717
override fun deserialize(decoder: Decoder): Period {
1818
return Period.parse(decoder.decodeString())

0 commit comments

Comments
 (0)