Skip to content

Commit

Permalink
Disable warp teleport while falling if world Flags.PREVENT_TELEPORT_W…
Browse files Browse the repository at this point in the history
…HEN_FALLING is enabled.
  • Loading branch information
BONNe committed Jan 31, 2019
1 parent aa1f0bd commit 9c88792
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/main/java/world/bentobox/warps/WarpSignsManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import org.bukkit.block.BlockFace;
import org.bukkit.block.Sign;

import world.bentobox.bentobox.lists.Flags;
import world.bentobox.warps.objects.WarpsData;
import world.bentobox.warps.event.WarpInitiateEvent;
import world.bentobox.warps.event.WarpListEvent;
Expand Down Expand Up @@ -353,6 +354,15 @@ public void warpPlayer(World world, User user, UUID owner) {
addon.getWarpSignsManager().removeWarp(world, owner);
return;
}

if (this.plugin.getIWM().inWorld(user.getWorld()) &&
Flags.PREVENT_TELEPORT_WHEN_FALLING.isSetForWorld(user.getWorld()) &&
user.getPlayer().getFallDistance() > 0) {
// We're sending the "hint" to the player to tell them they cannot teleport while falling.
user.sendMessage(Flags.PREVENT_TELEPORT_WHEN_FALLING.getHintReference());
return;
}

// Find out if island is locked
// TODO: Fire event

Expand Down

0 comments on commit 9c88792

Please sign in to comment.