Skip to content

Commit

Permalink
Re-addressed Issue #3. Teleportation is now exact.
Browse files Browse the repository at this point in the history
  • Loading branch information
toydotgame committed Mar 5, 2021
1 parent 37a9d8d commit 3fd4c60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/io/github/toydotgame/Thisway.java
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ public void thisway(CommandSender sender, String[] args) {

// _This_ detects the player's coordinates!:
Location location = player.getLocation();
int playerX = location.getBlockX();
double playerX = location.getX();
int playerY = location.getBlockY();
int playerZ = location.getBlockZ();
double playerZ = location.getZ();
if(DataStorage.debug == true) {
sender.sendMessage("Player Position: " + playerX + ", " + playerY + ", " + playerZ); // Simple debug for what coordinates it's looking at.
}
Expand All @@ -152,8 +152,8 @@ public void thisway(CommandSender sender, String[] args) {
DataStorage.zModDistance = 0;
}

double playerModifiedX = playerX + DataStorage.xModDistance + 0.5;
double playerModifiedZ = playerZ + DataStorage.zModDistance + 0.5;
double playerModifiedX = playerX + DataStorage.xModDistance /* + 0.5 */;
double playerModifiedZ = playerZ + DataStorage.zModDistance /* + 0.5 */;
if(DataStorage.debug == true) {
sender.sendMessage("New Player Position (To TP to): " + playerModifiedX + ", " + playerY + ", " + playerModifiedZ);
}
Expand Down

0 comments on commit 3fd4c60

Please sign in to comment.