mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 14:38:53 +00:00
fix: fix tests
This commit is contained in:
1 file changed
+3
-5
@@ -44,6 +44,7 @@ import java.util.stream.Collectors;
|
|||||||
*/
|
*/
|
||||||
public class BukkitUser extends OnlineUser {
|
public class BukkitUser extends OnlineUser {
|
||||||
|
|
||||||
|
private static final String VANISHED_META_KEY = "vanished";
|
||||||
private final NamespacedKey INVULNERABLE_KEY = new NamespacedKey((BukkitHuskHomes) plugin, "invulnerable");
|
private final NamespacedKey INVULNERABLE_KEY = new NamespacedKey((BukkitHuskHomes) plugin, "invulnerable");
|
||||||
private final Player bukkitPlayer;
|
private final Player bukkitPlayer;
|
||||||
|
|
||||||
@@ -141,11 +142,8 @@ public class BukkitUser extends OnlineUser {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isVanished() {
|
public boolean isVanished() {
|
||||||
return bukkitPlayer.getMetadata("vanished")
|
return bukkitPlayer.hasMetadata(VANISHED_META_KEY) && bukkitPlayer.getMetadata(VANISHED_META_KEY).stream()
|
||||||
.stream()
|
.map(MetadataValue::asBoolean).findFirst().orElse(false);
|
||||||
.map(MetadataValue::asBoolean)
|
|
||||||
.findFirst()
|
|
||||||
.orElse(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in new issue
Block a user