Skip to content

Commit

Permalink
gamemode check
Browse files Browse the repository at this point in the history
  • Loading branch information
ewof committed Apr 29, 2024
1 parent 83dd265 commit b63d8f6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit b63d8f6

Please sign in to comment.