use of com.bekvon.bukkit.residence.containers.ResidencePlayer in project MagicPlugin by elBukkit.
the class ResidenceManager method getWarps.
@Nullable
@Override
public Collection<PlayerWarp> getWarps(@Nonnull Player player) {
ResidencePlayer residencePlayer = getResidencePlayer(player);
if (residencePlayer == null) {
return null;
}
Collection<ClaimedResidence> residences = residencePlayer.getResList();
if (residences == null || residences.isEmpty()) {
return null;
}
Collection<PlayerWarp> warps = new ArrayList<>();
for (ClaimedResidence residence : residences) {
Location location = residence.getTeleportLocation(player);
if (location == null) {
location = residence.getMainArea().getHighLoc().clone().add(residence.getMainArea().getLowLoc()).multiply(0.5);
location = location.getWorld().getHighestBlockAt(location).getLocation();
}
PlayerWarp warp = new PlayerWarp(residence.getName(), location);
warps.add(warp);
}
return warps;
}
Aggregations