[fix] Fixed waypoint coordinate converting for end dimension

This commit is contained in:
Xiaro 2020-11-29 21:23:19 -05:00
parent f206d1a175
commit 07657c2446
No known key found for this signature in database
GPG Key ID: 996D265D6E155377
1 changed files with 8 additions and 8 deletions

View File

@ -15,19 +15,19 @@ object CoordinateConverter {
return if (dimension == WaypointManager.genDimension()) {
pos
} else {
if (dimension == -1) {
toOverworld(pos)
} else {
toNether(pos)
when (dimension) {
-1 -> toOverworld(pos) // Nether to overworld
0 -> toNether(pos) // Overworld to nether
else -> pos // End or custom dimension by server
}
}
}
fun bothConverted(dimension: Int, pos: BlockPos): String {
return if (dimension == -1) {
"${toOverworld(pos).asString()} (${pos.asString()})"
} else {
"${pos.asString()} (${toNether(pos).asString()})"
return when (dimension) {
-1 -> "${toOverworld(pos).asString()} (${pos.asString()})"
0 -> "${pos.asString()} (${toNether(pos).asString()})"
else -> pos.asString()
}
}