Do not send warp message if player is hidden.
https://github.com/BentoBoxWorld/Warps/issues/87
This commit is contained in:
parent
abf4b882c0
commit
bee85b0db1
2
pom.xml
2
pom.xml
|
@ -66,7 +66,7 @@
|
||||||
<!-- Do not change unless you want different name for local builds. -->
|
<!-- Do not change unless you want different name for local builds. -->
|
||||||
<build.number>-LOCAL</build.number>
|
<build.number>-LOCAL</build.number>
|
||||||
<!-- This allows to change between versions. -->
|
<!-- This allows to change between versions. -->
|
||||||
<build.version>1.10.0</build.version>
|
<build.version>1.10.1</build.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<!-- Profiles will allow to automatically change build version. -->
|
<!-- Profiles will allow to automatically change build version. -->
|
||||||
|
|
|
@ -327,13 +327,17 @@ public class WarpSignsManager {
|
||||||
final Location actualWarp = new Location(inFront.getWorld(), inFront.getBlockX() + 0.5D, inFront.getBlockY(),
|
final Location actualWarp = new Location(inFront.getWorld(), inFront.getBlockX() + 0.5D, inFront.getBlockY(),
|
||||||
inFront.getBlockZ() + 0.5D, yaw, 30F);
|
inFront.getBlockZ() + 0.5D, yaw, 30F);
|
||||||
Util.teleportAsync(user.getPlayer(), actualWarp, TeleportCause.COMMAND);
|
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) {
|
if (pvp) {
|
||||||
user.sendMessage("protection.flags.PVP_OVERWORLD.active");
|
user.sendMessage("protection.flags.PVP_OVERWORLD.active");
|
||||||
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_ARROW_HIT, 1F, 1F);
|
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_ARROW_HIT, 1F, 1F);
|
||||||
} else {
|
} else {
|
||||||
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 1F, 1F);
|
user.getWorld().playSound(user.getLocation(), Sound.ENTITY_BAT_TAKEOFF, 1F, 1F);
|
||||||
}
|
}
|
||||||
User warpOwner = User.getInstance(signOwner);
|
|
||||||
if (!warpOwner.equals(user)) {
|
if (!warpOwner.equals(user)) {
|
||||||
warpOwner.sendMessage("warps.player-warped", "[name]", user.getName());
|
warpOwner.sendMessage("warps.player-warped", "[name]", user.getName());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue