fix: 型の問題
This commit is contained in:
parent
3674586cfc
commit
3d5f6ee1c8
|
|
@ -1,6 +1,8 @@
|
|||
package net.hareworks.npc_mannequin.service
|
||||
|
||||
import net.hareworks.npc_mannequin.mannequin.MannequinRecord
|
||||
import org.bukkit.GameMode
|
||||
import org.bukkit.Location
|
||||
|
||||
class MannequinTickTask(private val registry: MannequinRegistry) {
|
||||
fun tick() {
|
||||
|
|
@ -106,19 +108,19 @@ class MannequinTickTask(private val registry: MannequinRegistry) {
|
|||
var startYaw = state.resetStartYaw
|
||||
var endYaw = homeLoc.yaw
|
||||
// Normalize to -180..180
|
||||
while (startYaw < -180) startYaw += 360
|
||||
while (startYaw >= 180) startYaw -= 360
|
||||
while (endYaw < -180) endYaw += 360
|
||||
while (endYaw >= 180) endYaw -= 360
|
||||
|
||||
while (startYaw < -180f) startYaw += 360f
|
||||
while (startYaw >= 180f) startYaw -= 360f
|
||||
while (endYaw < -180f) endYaw += 360f
|
||||
while (endYaw >= 180f) endYaw -= 360f
|
||||
|
||||
var diff = endYaw - startYaw
|
||||
if (diff < -180) diff += 360
|
||||
if (diff > 180) diff -= 360
|
||||
if (diff < -180f) diff += 360f
|
||||
if (diff > 180f) diff -= 360f
|
||||
|
||||
val currentYaw = startYaw + (diff * progress)
|
||||
val currentPitch = state.resetStartPitch + (homeLoc.pitch - state.resetStartPitch) * progress
|
||||
|
||||
val newLoc = location.clone()
|
||||
val newLoc = location.clone() as Location
|
||||
newLoc.yaw = currentYaw
|
||||
newLoc.pitch = currentPitch
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user