Skip to content

Commit

Permalink
Add config option for world when teleporting on join (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Iru21 committed Aug 30, 2022
1 parent 4c122a1 commit 22392b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
@@ -1,4 +1,4 @@
kotlin.code.style = official
minecraftVersion = 1.17
pluginName = Authy
pluginVersion = 3.1.2
pluginVersion = 3.1.3
6 changes: 4 additions & 2 deletions src/main/kotlin/me/iru/process/JoinProcess.kt
Expand Up @@ -46,12 +46,14 @@ class JoinProcess(private val player: Player) {
val x = authy.config.getDouble("onFirstJoin.x")
val y = authy.config.getDouble("onFirstJoin.y") + 0.1
val z = authy.config.getDouble("onFirstJoin.z")
player.teleport(Location(player.world, x, y, 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")
player.teleport(Location(player.world, x, y, z))
val world = authy.config.getString("onJoin.world") ?: "world"
player.teleport(Location(authy.server.getWorld(world), x, y, z))
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Expand Up @@ -31,6 +31,7 @@ onFirstJoin:
x: 0
y: 0
z: 0
world: world

onJoin:
# Concealment if set to true (also requires teleport to be true) will teleport a player to their position after authentication
Expand All @@ -39,6 +40,7 @@ onJoin:
x: 0
y: 0
z: 0
world: world

duplicateIpProtection:
# 0 - No protection
Expand Down

0 comments on commit 22392b8

Please sign in to comment.