diff --git a/gradle.properties b/gradle.properties index cfda120..3da81df 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ kotlin.code.style = official minecraftVersion = 1.17 pluginName = Authy -pluginVersion = 3.2.2 +pluginVersion = 3.2.3 diff --git a/src/main/kotlin/me/iru/process/JoinProcess.kt b/src/main/kotlin/me/iru/process/JoinProcess.kt index 6d194e9..9ea2670 100644 --- a/src/main/kotlin/me/iru/process/JoinProcess.kt +++ b/src/main/kotlin/me/iru/process/JoinProcess.kt @@ -42,18 +42,18 @@ class JoinProcess(private val player: Player) { } private fun joinTeleports() { - if(!this.player.hasPlayedBefore() && authy.config.getBoolean("onFirstJoin.teleport")) { - val x = authy.config.getDouble("onFirstJoin.x") - val y = authy.config.getDouble("onFirstJoin.y") + 0.1 - val z = authy.config.getDouble("onFirstJoin.z") - val world = authy.config.getString("onFirstJoin.world") ?: "world" - player.teleport(Location(authy.server.getWorld(world), x, y, z)) - } else if(authy.config.getBoolean("onJoin.teleport")) { - val x = authy.config.getDouble("onJoin.x") - val y = authy.config.getDouble("onJoin.y") + 0.1 - val z = authy.config.getDouble("onJoin.z") - val world = authy.config.getString("onJoin.world") ?: "world" - player.teleport(Location(authy.server.getWorld(world), x, y, z)) + var key = "onJoin" + if(!this.player.hasPlayedBefore()) { + key = "onFirstJoin" + } + if(authy.config.getBoolean("onFirstJoin.teleport") || authy.config.getBoolean("onJoin.teleport")) { + val x = authy.config.getDouble("$key.x") + val y = authy.config.getDouble("$key.y") + 0.1 + val z = authy.config.getDouble("$key.z") + val yaw = authy.config.getDouble("$key.yaw").toFloat() + val pitch = authy.config.getDouble("$key.pitch").toFloat() + val world = authy.config.getString("$key.world") ?: "world" + player.teleport(Location(authy.server.getWorld(world), x, y, z, yaw, pitch)) } } diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index e767580..cbb740a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -34,6 +34,8 @@ onFirstJoin: x: 0 y: 0 z: 0 + yaw: 0 + pitch: 0 world: world onJoin: @@ -43,6 +45,8 @@ onJoin: x: 0 y: 0 z: 0 + yaw: 0 + pitch: 0 world: world duplicateIpProtection: