Do not send warp message if player is hidden.

https://github.com/BentoBoxWorld/Warps/issues/87
This commit is contained in:
tastybento 2020-08-29 08:58:44 -07:00
parent abf4b882c0
commit bee85b0db1
2 changed files with 7 additions and 3 deletions

View File

@ -66,7 +66,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>1.10.0</build.version>
<build.version>1.10.1</build.version>
</properties>
<!-- Profiles will allow to automatically change build version. -->

View File

@ -327,13 +327,17 @@ public class WarpSignsManager {
final Location actualWarp = new Location(inFront.getWorld(), inFront.getBlockX() + 0.5D, inFront.getBlockY(),
inFront.getBlockZ() + 0.5D, yaw, 30F);
Util.teleportAsync(user.getPlayer(), actualWarp, TeleportCause.COMMAND);
User warpOwner = User.getInstance(signOwner);
// Hide invisible players
if (warpOwner.isOnline() && !warpOwner.getPlayer().canSee(user.getPlayer())) {
return;
}
if (pvp) {
user.sendMessage("protection.flags.PVP_OVERWORLD.active");
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_ARROW_HIT, 1F, 1F);
} else {
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 1F, 1F);
}
User warpOwner = User.getInstance(signOwner);
}
if (!warpOwner.equals(user)) {
warpOwner.sendMessage("warps.player-warped", "[name]", user.getName());
}