mirror of
https://github.com/BlueMap-Minecraft/BlueMap.git
synced 2024-11-25 20:16:00 +01:00
Add check for vanished metadata on bukkit to hide vanished players on the map
This commit is contained in:
parent
e9ab39c052
commit
d113d0602f
@ -31,6 +31,7 @@
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.GameMode;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.potion.PotionEffectType;
|
||||
|
||||
import com.flowpowered.math.vector.Vector3d;
|
||||
@ -118,6 +119,11 @@ public void update() {
|
||||
|
||||
this.invisible = player.hasPotionEffect(PotionEffectType.INVISIBILITY);
|
||||
|
||||
//also check for "vanished" players
|
||||
for (MetadataValue meta : player.getMetadata("vanished")) {
|
||||
if (meta.asBoolean()) this.invisible = true;
|
||||
}
|
||||
|
||||
this.name = Text.of(player.getName());
|
||||
this.online = player.isOnline();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user