From 4972ae5de73ae872247013b666cb0a9f25137d39 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 1 Sep 2022 20:58:13 +0700 Subject: [PATCH] A little removal --- .../mc/otm/core/CompoundTagDelegates.kt | 2 +- .../dbotthepony/mc/otm/core/CompoundTagExt.kt | 10 ------- .../ru/dbotthepony/mc/otm/core/EuclidMath.kt | 26 +++++++++---------- 3 files changed, 14 insertions(+), 24 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagDelegates.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagDelegates.kt index 828ff6520..2abb0af3a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagDelegates.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagDelegates.kt @@ -75,4 +75,4 @@ val CompoundTag.floats get() = CompoundTagFloat(this) val CompoundTag.doubles get() = CompoundTagDouble(this) val CompoundTag.booleans get() = CompoundTagBoolean(this) val CompoundTag.strings get() = CompoundTagString(this) -val CompoundTag.uuids get() = CompoundTagUUID(this) \ No newline at end of file +val CompoundTag.uuids get() = CompoundTagUUID(this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagExt.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagExt.kt index 7c78e7105..5e8f59e33 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagExt.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/CompoundTagExt.kt @@ -26,16 +26,6 @@ inline fun CompoundTag.map(s: String, consumer: (T) -> R): return null } -inline fun CompoundTag.ifCompound(s: String, consumer: (CompoundTag) -> T): T? { - val tag = get(s) - - if (tag is CompoundTag) { - return consumer(tag) - } - - return null -} - inline fun CompoundTag.ifHas(s: String, consumer: (Tag) -> Unit) { val tag = get(s) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/EuclidMath.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/EuclidMath.kt index e73b62447..d398711fa 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/EuclidMath.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/EuclidMath.kt @@ -10,12 +10,12 @@ import kotlin.math.* typealias Vector = Vec3 -@JvmField val VECTOR_UP = Vector(0.0, 1.0, 0.0) -@JvmField val VECTOR_FORWARD = Vector(1.0, 0.0, 0.0) -@JvmField val VECTOR_BACKWARD = Vector(-1.0, 0.0, 0.0) -@JvmField val VECTOR_DOWN = Vector(0.0, -1.0, 0.0) -@JvmField val VECTOR_RIGHT = Vector(0.0, 0.0, 1.0) -@JvmField val VECTOR_LEFT = Vector(0.0, 0.0, -1.0) +val VECTOR_UP = Vector(0.0, 1.0, 0.0) +val VECTOR_FORWARD = Vector(1.0, 0.0, 0.0) +val VECTOR_BACKWARD = Vector(-1.0, 0.0, 0.0) +val VECTOR_DOWN = Vector(0.0, -1.0, 0.0) +val VECTOR_RIGHT = Vector(0.0, 0.0, 1.0) +val VECTOR_LEFT = Vector(0.0, 0.0, -1.0) fun Vector.asAngle(): Angle { val norm = normalize() @@ -245,13 +245,13 @@ data class Angle(override val pitch: Double = 0.0, override val yaw: Double = 0. return Angle(Math.toRadians(pitch), Math.toRadians(yaw), Math.toRadians(roll)) } - @JvmField val ZERO = Angle() - @JvmField val UP = Angle(pitch = PI / 2) - @JvmField val DOWN = Angle(pitch = -PI / 2) - @JvmField val NORTH = Angle() - @JvmField val SOUTH = Angle(yaw = PI) - @JvmField val WEST = Angle(yaw = PI / 2) - @JvmField val EAST = Angle(yaw = -PI / 2) + val ZERO = Angle() + val UP = Angle(pitch = PI / 2) + val DOWN = Angle(pitch = -PI / 2) + val NORTH = Angle() + val SOUTH = Angle(yaw = PI) + val WEST = Angle(yaw = PI / 2) + val EAST = Angle(yaw = -PI / 2) } }