Code style changes.

This commit is contained in:
MobiusDev
2016-04-26 19:21:19 +00:00
parent 6a13705766
commit fc070c9238
768 changed files with 3338 additions and 4252 deletions

View File

@@ -48,13 +48,13 @@ public class ZoneCuboid extends L2ZoneForm
@Override
public boolean isInsideZone(int x, int y, int z)
{
return (_r.contains(x, y) && (z >= _z1) && (z <= _z2));
return _r.contains(x, y) && (z >= _z1) && (z <= _z2);
}
@Override
public boolean intersectsRectangle(int ax1, int ax2, int ay1, int ay2)
{
return (_r.intersects(Math.min(ax1, ax2), Math.min(ay1, ay2), Math.abs(ax2 - ax1), Math.abs(ay2 - ay1)));
return _r.intersects(Math.min(ax1, ax2), Math.min(ay1, ay2), Math.abs(ax2 - ax1), Math.abs(ay2 - ay1));
}
@Override

View File

@@ -60,7 +60,7 @@ public class ZoneCylinder extends L2ZoneForm
@Override
public double getDistanceToZone(int x, int y)
{
return (Math.sqrt((Math.pow(_x - x, 2) + Math.pow(_y - y, 2))) - _rad);
return Math.sqrt(Math.pow(_x - x, 2) + Math.pow(_y - y, 2)) - _rad;
}
// getLowZ() / getHighZ() - These two functions were added to cope with the demand of the new fishing algorithms, wich are now able to correctly place the hook in the water, thanks to getHighZ(). getLowZ() was added, considering potential future modifications.

View File

@@ -50,13 +50,13 @@ public class ZoneNPoly extends L2ZoneForm
@Override
public boolean isInsideZone(int x, int y, int z)
{
return (_p.contains(x, y) && (z >= _z1) && (z <= _z2));
return _p.contains(x, y) && (z >= _z1) && (z <= _z2);
}
@Override
public boolean intersectsRectangle(int ax1, int ax2, int ay1, int ay2)
{
return (_p.intersects(Math.min(ax1, ax2), Math.min(ay1, ay2), Math.abs(ax2 - ax1), Math.abs(ay2 - ay1)));
return _p.intersects(Math.min(ax1, ax2), Math.min(ay1, ay2), Math.abs(ax2 - ax1), Math.abs(ay2 - ay1));
}
@Override

View File

@@ -162,7 +162,7 @@ public class L2BossZone extends L2ZoneType
// with legal entries, do nothing.
if (expirationTime == null) // legal null expirationTime entries
{
if ((GameServer.dateTimeServerStarted.getTimeInMillis() > (System.currentTimeMillis() - _timeInvade)))
if (GameServer.dateTimeServerStarted.getTimeInMillis() > (System.currentTimeMillis() - _timeInvade))
{
return;
}

View File

@@ -42,13 +42,13 @@ public class L2ClanHallZone extends L2ResidenceZone
setResidenceId(Integer.parseInt(value));
// Register self to the correct clan hall
final ClanHall hall = ClanHallManager.getInstance().getClanHallById(getResidenceId());
if (hall == null)
if (hall != null)
{
_log.warning("L2ClanHallZone: Clan hall with id " + getResidenceId() + " does not exist!");
hall.setZone(this);
}
else
{
hall.setZone(this);
_log.warning("L2ClanHallZone: Clan hall with id " + getResidenceId() + " does not exist!");
}
}
else

View File

@@ -59,7 +59,7 @@ public class L2DamageZone extends L2ZoneType
_castle = null;
setTargetType(InstanceType.L2Playable); // default only playabale
setSettings((ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName())));
setSettings(ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName()));
}
@Override
@@ -106,7 +106,7 @@ public class L2DamageZone extends L2ZoneType
}
final L2PcInstance player = character.getActingPlayer();
if ((getCastle() != null) && !(getCastle().getSiege().isInProgress() && (player != null) && (player.getSiegeState() != 2)))
if ((getCastle() != null) && (!getCastle().getSiege().isInProgress() || (player == null) || (player.getSiegeState() == 2)))
{
return;
}

View File

@@ -55,7 +55,7 @@ public class L2EffectZone extends L2ZoneType
setTargetType(InstanceType.L2Playable); // default only playabale
_bypassConditions = false;
_isShowDangerIcon = true;
setSettings((ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName())));
setSettings(ZoneManager.getSettings(getName()) == null ? new TaskZoneSettings() : ZoneManager.getSettings(getName()));
}
@Override

View File

@@ -52,7 +52,7 @@ public class L2OlympiadStadiumZone extends L2ZoneRespawn
public L2OlympiadStadiumZone(int id)
{
super(id);
setSettings((ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName())));
setSettings(ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName()));
}
public final class Settings extends AbstractZoneSettings

View File

@@ -48,7 +48,7 @@ public class L2SiegeZone extends L2ZoneType
public L2SiegeZone(int id)
{
super(id);
setSettings((ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName())));
setSettings(ZoneManager.getSettings(getName()) == null ? new Settings() : ZoneManager.getSettings(getName()));
}
public final class Settings extends AbstractZoneSettings
@@ -133,13 +133,13 @@ public class L2SiegeZone extends L2ZoneType
}
getSettings().setSiegeableId(Integer.parseInt(value));
final SiegableHall hall = CHSiegeManager.getInstance().getConquerableHalls().get(getSettings().getSiegeableId());
if (hall == null)
if (hall != null)
{
_log.warning("L2SiegeZone: Siegable clan hall with id " + value + " does not exist!");
hall.setSiegeZone(this);
}
else
{
hall.setSiegeZone(this);
_log.warning("L2SiegeZone: Siegable clan hall with id " + value + " does not exist!");
}
}
else
@@ -182,7 +182,7 @@ public class L2SiegeZone extends L2ZoneType
plyer.enteredNoLanding(DISMOUNT_DELAY);
}
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && (plyer.isMounted()))
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && plyer.isMounted())
{
plyer.dismount();
}