Take player visibility into account when sending notify-enter and notify-leave messages. Fixes PS-103.

This commit is contained in:
Alexander Söderberg
2020-09-05 18:48:58 +02:00
parent 5c48e4ad19
commit 0aeca40137
4 changed files with 26 additions and 4 deletions

View File

@ -32,6 +32,7 @@ import com.plotsquared.core.configuration.Captions;
import com.plotsquared.core.configuration.Settings;
import com.plotsquared.core.events.TeleportCause;
import com.plotsquared.core.location.Location;
import com.plotsquared.core.player.ConsolePlayer;
import com.plotsquared.core.player.PlotPlayer;
import com.plotsquared.core.plot.PlotWeather;
import com.plotsquared.core.util.EconHandler;
@ -354,6 +355,13 @@ public class BukkitPlayer extends PlotPlayer<Player> {
return this.player.isBanned();
}
@Override public boolean canSee(final PlotPlayer<?> other) {
if (other instanceof ConsolePlayer) {
return true;
} else {
return this.player.canSee(((BukkitPlayer) other).getPlatformPlayer());
}
}
public PlayerTeleportEvent.TeleportCause getTeleportCause(@NotNull final TeleportCause cause) {
switch (cause) {