Skip to content

Commit

Permalink
/tt <track> No longer places spectators in boats
Browse files Browse the repository at this point in the history
Closes #12
  • Loading branch information
JustBru00 committed Aug 17, 2024
1 parent 91efd9b commit 2728fce
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
import me.makkuusen.timing.system.track.Track;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
import org.bukkit.Location;
import org.bukkit.command.BlockCommandSender;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent;

@CommandAlias("timetrial|tt")
public class CommandTimeTrial extends BaseCommand {
Expand Down Expand Up @@ -87,8 +89,11 @@ public static void onTimeTrial(CommandSender sender, @Optional Track track) {
Text.send(player, Success.TELEPORT_TO_TRACK, "%track%", track.getDisplayName());
}


ApiUtilities.teleportPlayerAndSpawnBoat(player, track, track.getSpawnLocation());
if (player.getGameMode() != GameMode.SPECTATOR) { // Issue #12
ApiUtilities.teleportPlayerAndSpawnBoat(player, track, track.getSpawnLocation());
} else {
player.teleportAsync(track.getSpawnLocation(), PlayerTeleportEvent.TeleportCause.PLUGIN);
}
}
}
}

0 comments on commit 2728fce

Please sign in to comment.