diff --git a/plugins/finale-paper/paper/src/main/java/com/github/maxopoly/finale/command/CardinalCommand.java b/plugins/finale-paper/paper/src/main/java/com/github/maxopoly/finale/command/CardinalCommand.java index c3ca0b5dd..141e0df66 100644 --- a/plugins/finale-paper/paper/src/main/java/com/github/maxopoly/finale/command/CardinalCommand.java +++ b/plugins/finale-paper/paper/src/main/java/com/github/maxopoly/finale/command/CardinalCommand.java @@ -6,6 +6,8 @@ import co.aikar.commands.annotation.CommandCompletion; import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Optional; import co.aikar.commands.annotation.Syntax; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.format.NamedTextColor; import org.bukkit.ChatColor; import org.bukkit.Location; import org.bukkit.entity.Player; @@ -20,6 +22,11 @@ public class CardinalCommand extends BaseCommand { Player player = (Player) commandSender; Location currLocation = player.getLocation(); + if (player.isInsideVehicle()) { + player.sendMessage(Component.text("You cannot run this command from inside a vehicle!", NamedTextColor.RED)); + return; + } + if(targetDirection == null){ double newYaw = Math.rint(currLocation.getYaw() / 45) * 45; player.teleport(new Location(player.getWorld(), currLocation.getX(), currLocation.getY(),