Sync with L2jServer HighFive Mar 25th 2015.
This commit is contained in:
@ -42,7 +42,7 @@ public final class CastleManager implements InstanceListManager
|
||||
{
|
||||
private static final Logger _log = Logger.getLogger(CastleManager.class.getName());
|
||||
|
||||
private List<Castle> _castles;
|
||||
private final List<Castle> _castles = new ArrayList<>();
|
||||
|
||||
private final Map<Integer, Long> _castleSiegeDate = new ConcurrentHashMap<>();
|
||||
|
||||
@ -72,9 +72,9 @@ public final class CastleManager implements InstanceListManager
|
||||
{
|
||||
double distance;
|
||||
Castle castle;
|
||||
for (int i = 0; i < getCastles().size(); i++)
|
||||
for (int i = 0; i < _castles.size(); i++)
|
||||
{
|
||||
castle = getCastles().get(i);
|
||||
castle = _castles.get(i);
|
||||
if (castle == null)
|
||||
{
|
||||
continue;
|
||||
@ -92,7 +92,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastleById(int castleId)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles)
|
||||
{
|
||||
if (temp.getResidenceId() == castleId)
|
||||
{
|
||||
@ -104,7 +104,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastleByOwner(L2Clan clan)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles)
|
||||
{
|
||||
if (temp.getOwnerId() == clan.getId())
|
||||
{
|
||||
@ -116,7 +116,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastle(String name)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles)
|
||||
{
|
||||
if (temp.getName().equalsIgnoreCase(name.trim()))
|
||||
{
|
||||
@ -128,7 +128,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastle(int x, int y, int z)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles)
|
||||
{
|
||||
if (temp.checkIfInZone(x, y, z))
|
||||
{
|
||||
@ -146,9 +146,9 @@ public final class CastleManager implements InstanceListManager
|
||||
public final int getCastleIndex(int castleId)
|
||||
{
|
||||
Castle castle;
|
||||
for (int i = 0; i < getCastles().size(); i++)
|
||||
for (int i = 0; i < _castles.size(); i++)
|
||||
{
|
||||
castle = getCastles().get(i);
|
||||
castle = _castles.get(i);
|
||||
if ((castle != null) && (castle.getResidenceId() == castleId))
|
||||
{
|
||||
return i;
|
||||
@ -165,9 +165,9 @@ public final class CastleManager implements InstanceListManager
|
||||
public final int getCastleIndex(int x, int y, int z)
|
||||
{
|
||||
Castle castle;
|
||||
for (int i = 0; i < getCastles().size(); i++)
|
||||
for (int i = 0; i < _castles.size(); i++)
|
||||
{
|
||||
castle = getCastles().get(i);
|
||||
castle = _castles.get(i);
|
||||
if ((castle != null) && castle.checkIfInZone(x, y, z))
|
||||
{
|
||||
return i;
|
||||
@ -178,17 +178,13 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final List<Castle> getCastles()
|
||||
{
|
||||
if (_castles == null)
|
||||
{
|
||||
_castles = new ArrayList<>();
|
||||
}
|
||||
return _castles;
|
||||
}
|
||||
|
||||
public boolean hasOwnedCastle()
|
||||
{
|
||||
boolean hasOwnedCastle = false;
|
||||
for (Castle castle : getCastles())
|
||||
for (Castle castle : _castles)
|
||||
{
|
||||
if (castle.getOwnerId() > 0)
|
||||
{
|
||||
@ -279,9 +275,9 @@ public final class CastleManager implements InstanceListManager
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
getCastles().add(new Castle(rs.getInt("id")));
|
||||
_castles.add(new Castle(rs.getInt("id")));
|
||||
}
|
||||
_log.info(getClass().getSimpleName() + ": Loaded: " + getCastles().size() + " castles");
|
||||
_log.info(getClass().getSimpleName() + ": Loaded: " + _castles.size() + " castles");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
Reference in New Issue
Block a user