From b63d8f66e40e15d3bf3609896ed381b9539223d0 Mon Sep 17 00:00:00 2001 From: ewof Date: Sun, 28 Apr 2024 21:37:32 -0400 Subject: [PATCH] gamemode check --- .../townywaypoints/commands/TownyWaypointsCommand.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/mvndicraft/townywaypoints/commands/TownyWaypointsCommand.java b/src/main/java/net/mvndicraft/townywaypoints/commands/TownyWaypointsCommand.java index 78f64ba..8c73b9a 100644 --- a/src/main/java/net/mvndicraft/townywaypoints/commands/TownyWaypointsCommand.java +++ b/src/main/java/net/mvndicraft/townywaypoints/commands/TownyWaypointsCommand.java @@ -1,6 +1,8 @@ package net.mvndicraft.townywaypoints.commands; import javax.annotation.Nonnull; + +import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.entity.Entity; @@ -166,7 +168,8 @@ public static void onTravel(Player player, String townName, String waypointName, Messaging.sendMsg(player, Translatable.of("msg_waypoint_travel_warmup_cost", travelcost)); teleport(player, loc, waypoint.travelWithVehicle()); - if (TownyWaypointsSettings.getSplit() != -1) { + if (TownyWaypointsSettings.getSplit() != -1 || player.getGameMode() == GameMode.CREATIVE + || player.getGameMode() == GameMode.SPECTATOR) { double splitCostNation = travelcost * (1.0 - TownyWaypointsSettings.getSplit()); double splitCostTown = travelcost * TownyWaypointsSettings.getSplit();