public Collection<TileEntityCrystalPylon> getNearbyPylons( World world, int x, int y, int z, CrystalElement e, int range, boolean LOS) { TileEntityCache<TileEntityCrystalPylon> c = pylons.get(e); Collection<TileEntityCrystalPylon> li = new ArrayList(); if (c != null) { for (WorldLocation loc : c.keySet()) { if (loc.dimensionID == world.provider.dimensionId && loc.getDistanceTo(x, y, z) <= range) { if (!LOS || PylonFinder.lineOfSight(world, x, y, z, loc.xCoord, loc.yCoord, loc.zCoord)) { li.add(c.get(loc)); } } } } return li; }
void recalculateLOS() { hasLOS = PylonFinder.lineOfSight(loc1, loc2); }