Skip to content

Commit

Permalink
fix: /rtp trying to call teleport event async
Browse files Browse the repository at this point in the history
Signed-off-by: Thatsmusic99 <25277367+thatsmusic99@users.noreply.github.com>
  • Loading branch information
Thatsmusic99 committed Mar 23, 2024
1 parent a4c03bc commit 02a16b9
Showing 1 changed file with 3 additions and 2 deletions.
@@ -1,5 +1,6 @@
package io.github.niestrat99.advancedteleport.commands.teleport;

import io.github.niestrat99.advancedteleport.CoreClass;
import io.github.niestrat99.advancedteleport.api.ATPlayer;
import io.github.niestrat99.advancedteleport.api.AdvancedTeleportAPI;
import io.github.niestrat99.advancedteleport.api.events.ATTeleportEvent;
Expand Down Expand Up @@ -127,7 +128,7 @@ public static boolean randomTeleport(Player player, CommandSender sender, World

// Search for a random location
AdvancedTeleportAPI.getRandomLocation(world, player)
.whenComplete(
.whenCompleteAsync(
(result, err) -> {

// If there was an error, let the player know
Expand All @@ -139,7 +140,7 @@ public static boolean randomTeleport(Player player, CommandSender sender, World

// Process the teleportation location
processLocation(player, result);
});
}, CoreClass.sync);

return true;
}
Expand Down

0 comments on commit 02a16b9

Please sign in to comment.