Skip to content

Commit

Permalink
SET_AND_UPDATE redirected on USUALLY_TELEPORT.
Browse files Browse the repository at this point in the history
  • Loading branch information
MairwunNx committed Feb 8, 2020
1 parent 7782c2b commit 3358822
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,15 @@ object BadLocationCommand {
)

when (ConfigurationManager.get().teleportStrategy) {
USUALLY_TELEPORT, KEEP_LOADED, ATTEMPT_TELEPORT -> {
USUALLY_TELEPORT, KEEP_LOADED, ATTEMPT_TELEPORT, SET_AND_UPDATE -> {
player.teleport(
position.x + getCenterPosBlock(),
position.y + getCenterPosBlock(),
position.z + getCenterPosBlock()
)
}
SET_AND_UPDATE -> {
player.setPositionAnglesAndUpdate(
position.x + getCenterPosBlock(),
position.y + getCenterPosBlock(),
position.z + getCenterPosBlock(),
player.yaw,
player.pitch
)
}
SET_POSITION -> {
player.setPosition(
player.setPos(
position.x + getCenterPosBlock(),
position.y + getCenterPosBlock(),
position.z + getCenterPosBlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,24 +187,15 @@ object RandomTeleportCommand {
TeleportRollbackManager.commitPosition(player.name.string, position)

when (ConfigurationManager.get().teleportStrategy) {
USUALLY_TELEPORT, KEEP_LOADED, ATTEMPT_TELEPORT -> {
USUALLY_TELEPORT, KEEP_LOADED, ATTEMPT_TELEPORT, SET_AND_UPDATE -> {
player.teleport(
newPosition!!.x + getCenterPosBlock(),
newPosition!!.y + getCenterPosBlock(),
newPosition!!.z + getCenterPosBlock()
)
}
SET_AND_UPDATE -> {
player.setPositionAnglesAndUpdate(
newPosition!!.x + getCenterPosBlock(),
newPosition!!.y + getCenterPosBlock(),
newPosition!!.z + getCenterPosBlock(),
player.yaw,
player.pitch
)
}
SET_POSITION -> {
player.setPosition(
player.setPos(
newPosition!!.x + getCenterPosBlock(),
newPosition!!.y + getCenterPosBlock(),
newPosition!!.z + getCenterPosBlock()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import kotlinx.serialization.Serializable
@Serializable
enum class TeleportStrategy {
USUALLY_TELEPORT,
SET_AND_UPDATE,
SET_AND_UPDATE, // For compatibility with fabric 1.14.4 configuration, just redirect on `USALLY_TELEPORT`.
SET_POSITION,
KEEP_LOADED, // For compatibility with forge configuration, just redirect on `USALLY_TELEPORT`.
ATTEMPT_TELEPORT // For compatibility with forge configuration, just redirect on `USALLY_TELEPORT`.
Expand Down

0 comments on commit 3358822

Please sign in to comment.