mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-25 20:25:19 +01:00
Fix canSee(Entity) not existing on old minecraft versions
This commit is contained in:
parent
8ca8c14f89
commit
cd25930373
@ -518,11 +518,11 @@ public class NMS {
|
||||
return BRIDGE.getNBT(item);
|
||||
}
|
||||
|
||||
private static Collection<Player> getNearbyPlayers(Entity from) {
|
||||
private static Collection<Player> getNearbyPlayers(Player from) {
|
||||
return getNearbyPlayers(from, from.getLocation(), 64);
|
||||
}
|
||||
|
||||
private static Collection<Player> getNearbyPlayers(Entity from, Location location, double radius) {
|
||||
private static Collection<Player> getNearbyPlayers(Player from, Location location, double radius) {
|
||||
List<Player> players = Lists.newArrayList();
|
||||
for (Player player : CitizensAPI.getLocationLookup().getNearbyPlayers(location, radius)) {
|
||||
if (location.getWorld() != player.getWorld() || from != null && !player.canSee(from)
|
||||
@ -760,12 +760,12 @@ public class NMS {
|
||||
BRIDGE.sendPositionUpdate(from, to, position, bodyYaw, pitch, headYaw);
|
||||
}
|
||||
|
||||
public static void sendPositionUpdateNearby(Entity from, boolean position) {
|
||||
public static void sendPositionUpdateNearby(Player from, boolean position) {
|
||||
sendPositionUpdate(from, getNearbyPlayers(from), position, NMS.getYaw(from), from.getLocation().getPitch(),
|
||||
NMS.getHeadYaw(from));
|
||||
}
|
||||
|
||||
public static void sendPositionUpdateNearby(Entity from, boolean position, Float bodyYaw, Float pitch,
|
||||
public static void sendPositionUpdateNearby(Player from, boolean position, Float bodyYaw, Float pitch,
|
||||
Float headYaw) {
|
||||
sendPositionUpdate(from, getNearbyPlayers(from), position, bodyYaw, pitch, headYaw);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user