mirror of
https://github.com/nkomarn/harbor.git
synced 2025-01-05 07:07:34 +01:00
Use pose check instead of Player::isSleeping checks
This may potentially resolve some issues with plugins that allow you to "lay" on the ground to sleep.
This commit is contained in:
parent
67fdfa05b4
commit
c77c747858
@ -7,6 +7,7 @@ import org.bukkit.configuration.ConfigurationSection;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import org.bukkit.entity.Pose;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.scheduler.BukkitRunnable;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -159,7 +160,7 @@ public class Checker extends BukkitRunnable {
|
||||
@NotNull
|
||||
public List<Player> getSleepingPlayers(@NotNull World world) {
|
||||
return world.getPlayers().stream()
|
||||
.filter(Player::isSleeping)
|
||||
.filter(player -> player.getPose() == Pose.SLEEPING)
|
||||
.collect(toList());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user