From 994f80890c1db2f79b7d7e8f583379f80f69cfdf Mon Sep 17 00:00:00 2001 From: MobiusDev <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 11 Apr 2018 12:57:58 +0000 Subject: [PATCH] Zone related changes. --- .../instancemanager/MapRegionManager.java | 10 ++-------- .../instancemanager/ZoneManager.java | 6 +++--- .../gameserver/model/actor/L2Tower.java | 13 +++++------- .../gameserver/model/zone/L2ZoneType.java | 7 ++----- .../instancemanager/MapRegionManager.java | 10 ++-------- .../instancemanager/ZoneManager.java | 6 +++--- .../gameserver/model/actor/L2Tower.java | 13 +++++------- .../gameserver/model/zone/L2ZoneType.java | 7 ++----- .../instancemanager/MapRegionManager.java | 10 ++-------- .../instancemanager/ZoneManager.java | 6 +++--- .../gameserver/model/actor/L2Tower.java | 13 +++++------- .../gameserver/model/zone/L2ZoneType.java | 7 ++----- .../instancemanager/MapRegionManager.java | 10 ++-------- .../instancemanager/ZoneManager.java | 6 +++--- .../gameserver/model/actor/L2Tower.java | 13 +++++------- .../gameserver/model/zone/L2ZoneType.java | 7 ++----- .../instancemanager/MapRegionManager.java | 6 +++++- .../gameserver/model/actor/L2Character.java | 20 ++++++++++++++++--- .../gameserver/model/actor/L2Npc.java | 3 --- .../gameserver/model/actor/L2Tower.java | 4 ---- .../gameserver/model/actor/L2Vehicle.java | 3 --- .../gameserver/model/entity/TvTEvent.java | 2 +- .../model/instancezone/Instance.java | 14 ++++++------- .../gameserver/model/zone/L2ZoneType.java | 11 ++++++++-- .../instancemanager/MapRegionManager.java | 10 ++-------- .../instancemanager/ZoneManager.java | 6 +++--- .../gameserver/model/actor/L2Tower.java | 13 +++++------- .../gameserver/model/zone/L2ZoneType.java | 7 ++----- .../instancemanager/MapRegionManager.java | 10 ++-------- .../instancemanager/ZoneManager.java | 6 +++--- .../gameserver/model/actor/L2Tower.java | 13 +++++------- .../gameserver/model/zone/L2ZoneType.java | 7 ++----- 32 files changed, 111 insertions(+), 168 deletions(-) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 002a6f75c3..4d0867bf14 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader public String getClosestTownName(L2Character activeChar) { final L2MapRegion region = getMapRegion(activeChar); - - if (region == null) - { - return "Aden Castle Town"; - } - - return region.getTown(); + return region == null ? "Aden Castle Town" : region.getTown(); } /** @@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader { try { - final L2PcInstance player = ((L2PcInstance) activeChar); + final L2PcInstance player = (L2PcInstance) activeChar; final L2MapRegion region = _regions.get(point); if (region.getBannedRace().containsKey(player.getRace())) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java index aff7f59c6a..85073ad9ad 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java @@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader } if (checkId(zoneId)) { - LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); + LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); } if ((zoneName != null) && !zoneName.isEmpty()) @@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character)) { - return ((L2ArenaZone) temp); + return (L2ArenaZone) temp; } } @@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character)) { - return ((L2OlympiadStadiumZone) temp); + return (L2OlympiadStadiumZone) temp; } } return null; diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 8390083019..10b2537640 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc public boolean canBeAttacked() { // Attackable during siege by attacker only - return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress()); + return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress(); } @Override public boolean isAutoAttackable(L2Character attacker) { // Attackable during siege by attacker only - return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan())); + return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan()); } @Override @@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc // Set the target of the L2PcInstance player player.setTarget(this); } - else if (interact) + else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) { - if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) - { - // Notify the L2PcInstance AI with AI_INTENTION_INTERACT - player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); - } + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT + player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index a6790a61d9..66f0ce1b9f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer if (isInsideZone(character)) { // If the character can't be affected by this zone return - if (_checkAffected) + if (_checkAffected && !isAffected(character)) { - if (!isAffected(character)) - { - return; - } + return; } if (_characterList.putIfAbsent(character.getObjectId(), character) == null) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 002a6f75c3..4d0867bf14 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader public String getClosestTownName(L2Character activeChar) { final L2MapRegion region = getMapRegion(activeChar); - - if (region == null) - { - return "Aden Castle Town"; - } - - return region.getTown(); + return region == null ? "Aden Castle Town" : region.getTown(); } /** @@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader { try { - final L2PcInstance player = ((L2PcInstance) activeChar); + final L2PcInstance player = (L2PcInstance) activeChar; final L2MapRegion region = _regions.get(point); if (region.getBannedRace().containsKey(player.getRace())) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java index aff7f59c6a..85073ad9ad 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java @@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader } if (checkId(zoneId)) { - LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); + LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); } if ((zoneName != null) && !zoneName.isEmpty()) @@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character)) { - return ((L2ArenaZone) temp); + return (L2ArenaZone) temp; } } @@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character)) { - return ((L2OlympiadStadiumZone) temp); + return (L2OlympiadStadiumZone) temp; } } return null; diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 8390083019..10b2537640 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc public boolean canBeAttacked() { // Attackable during siege by attacker only - return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress()); + return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress(); } @Override public boolean isAutoAttackable(L2Character attacker) { // Attackable during siege by attacker only - return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan())); + return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan()); } @Override @@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc // Set the target of the L2PcInstance player player.setTarget(this); } - else if (interact) + else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) { - if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) - { - // Notify the L2PcInstance AI with AI_INTENTION_INTERACT - player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); - } + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT + player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index a6790a61d9..66f0ce1b9f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer if (isInsideZone(character)) { // If the character can't be affected by this zone return - if (_checkAffected) + if (_checkAffected && !isAffected(character)) { - if (!isAffected(character)) - { - return; - } + return; } if (_characterList.putIfAbsent(character.getObjectId(), character) == null) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 002a6f75c3..4d0867bf14 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader public String getClosestTownName(L2Character activeChar) { final L2MapRegion region = getMapRegion(activeChar); - - if (region == null) - { - return "Aden Castle Town"; - } - - return region.getTown(); + return region == null ? "Aden Castle Town" : region.getTown(); } /** @@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader { try { - final L2PcInstance player = ((L2PcInstance) activeChar); + final L2PcInstance player = (L2PcInstance) activeChar; final L2MapRegion region = _regions.get(point); if (region.getBannedRace().containsKey(player.getRace())) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java index aff7f59c6a..85073ad9ad 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java @@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader } if (checkId(zoneId)) { - LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); + LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); } if ((zoneName != null) && !zoneName.isEmpty()) @@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character)) { - return ((L2ArenaZone) temp); + return (L2ArenaZone) temp; } } @@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character)) { - return ((L2OlympiadStadiumZone) temp); + return (L2OlympiadStadiumZone) temp; } } return null; diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 8390083019..10b2537640 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc public boolean canBeAttacked() { // Attackable during siege by attacker only - return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress()); + return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress(); } @Override public boolean isAutoAttackable(L2Character attacker) { // Attackable during siege by attacker only - return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan())); + return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan()); } @Override @@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc // Set the target of the L2PcInstance player player.setTarget(this); } - else if (interact) + else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) { - if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) - { - // Notify the L2PcInstance AI with AI_INTENTION_INTERACT - player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); - } + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT + player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index a6790a61d9..66f0ce1b9f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer if (isInsideZone(character)) { // If the character can't be affected by this zone return - if (_checkAffected) + if (_checkAffected && !isAffected(character)) { - if (!isAffected(character)) - { - return; - } + return; } if (_characterList.putIfAbsent(character.getObjectId(), character) == null) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 002a6f75c3..4d0867bf14 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader public String getClosestTownName(L2Character activeChar) { final L2MapRegion region = getMapRegion(activeChar); - - if (region == null) - { - return "Aden Castle Town"; - } - - return region.getTown(); + return region == null ? "Aden Castle Town" : region.getTown(); } /** @@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader { try { - final L2PcInstance player = ((L2PcInstance) activeChar); + final L2PcInstance player = (L2PcInstance) activeChar; final L2MapRegion region = _regions.get(point); if (region.getBannedRace().containsKey(player.getRace())) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java index aff7f59c6a..85073ad9ad 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java @@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader } if (checkId(zoneId)) { - LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); + LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); } if ((zoneName != null) && !zoneName.isEmpty()) @@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character)) { - return ((L2ArenaZone) temp); + return (L2ArenaZone) temp; } } @@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character)) { - return ((L2OlympiadStadiumZone) temp); + return (L2OlympiadStadiumZone) temp; } } return null; diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 8390083019..10b2537640 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc public boolean canBeAttacked() { // Attackable during siege by attacker only - return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress()); + return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress(); } @Override public boolean isAutoAttackable(L2Character attacker) { // Attackable during siege by attacker only - return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan())); + return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan()); } @Override @@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc // Set the target of the L2PcInstance player player.setTarget(this); } - else if (interact) + else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) { - if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) - { - // Notify the L2PcInstance AI with AI_INTENTION_INTERACT - player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); - } + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT + player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index a6790a61d9..66f0ce1b9f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer if (isInsideZone(character)) { // If the character can't be affected by this zone return - if (_checkAffected) + if (_checkAffected && !isAffected(character)) { - if (!isAffected(character)) - { - return; - } + return; } if (_characterList.putIfAbsent(character.getObjectId(), character) == null) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 60d6688941..b1d8673607 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -426,7 +426,11 @@ public final class MapRegionManager implements IGameXmlReader try { final L2RespawnZone zone = ZoneManager.getInstance().getZone(activeChar, L2RespawnZone.class); - return zone != null ? getRestartRegion(activeChar, zone.getRespawnPoint((L2PcInstance) activeChar)).getSpawnLoc() : getMapRegion(activeChar).getSpawnLoc(); + if (zone != null) + { + return getRestartRegion(activeChar, zone.getRespawnPoint((L2PcInstance) activeChar)).getSpawnLoc(); + } + return getMapRegion(activeChar).getSpawnLoc(); } catch (Exception e) { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java index d88374f9b7..190c5db666 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Character.java @@ -391,7 +391,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { case PVP: { - if ((instance != null) && instance.isPvPInstance()) + if ((instance != null) && instance.isPvP()) { return true; } @@ -399,7 +399,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } case PEACE: { - if ((instance != null) && instance.isPvPInstance()) + if ((instance != null) && instance.isPvP()) { return false; } @@ -4936,7 +4936,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { return false; } - if (InstanceManager.getInstance().getInstance(getInstanceId()).isPvPInstance()) + if (InstanceManager.getInstance().getInstance(getInstanceId()).isPvP()) { return false; } @@ -6713,6 +6713,20 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe return getTemplate().getRace(); } + @Override + public final void setXYZ(int newX, int newY, int newZ) + { + final ZoneRegion oldZoneRegion = ZoneManager.getInstance().getRegion(this); + final ZoneRegion newZoneRegion = ZoneManager.getInstance().getRegion(newX, newY); + if (oldZoneRegion != newZoneRegion) + { + oldZoneRegion.removeFromZones(this); + newZoneRegion.revalidateZones(this); + } + + super.setXYZ(newX, newY, newZ); + } + public boolean isInDuel() { return false; diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java index 6aeff17f9c..0024f1b8b0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Npc.java @@ -1347,9 +1347,6 @@ public class L2Npc extends L2Character ZoneManager.getInstance().getRegion(this).removeFromZones(this); - // Remove L2Object object from _allObjects of L2World - // L2World.getInstance().removeObject(this); - return super.deleteMe(); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 61e4d6a2de..450bff4c49 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -28,10 +28,6 @@ import com.l2jmobius.gameserver.network.serverpackets.ActionFailed; */ public abstract class L2Tower extends L2Npc { - /** - * Creates an abstract Tower. - * @param template the tower template - */ public L2Tower(L2NpcTemplate template) { super(template); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java index 9d8a7ac617..a699934b6f 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/L2Vehicle.java @@ -405,9 +405,6 @@ public abstract class L2Vehicle extends L2Character oldZoneRegion.removeFromZones(this); - // Remove L2Object object from _allObjects of L2World - // L2World.getInstance().removeObject(this); - return super.deleteMe(); } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java index 3e5170b284..c4504c25ec 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/entity/TvTEvent.java @@ -270,7 +270,7 @@ public class TvTEvent { _TvTEventInstance = InstanceManager.getInstance().createDynamicInstance(Config.TVT_EVENT_INSTANCE_FILE); InstanceManager.getInstance().getInstance(_TvTEventInstance).setAllowSummon(false); - InstanceManager.getInstance().getInstance(_TvTEventInstance).setPvPInstance(true); + InstanceManager.getInstance().getInstance(_TvTEventInstance).setIsPvP(true); InstanceManager.getInstance().getInstance(_TvTEventInstance).setEmptyDestroyTime((Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY * 1000) + 60000L); } catch (Exception e) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java index ce062fb374..bbbbb852f8 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/instancezone/Instance.java @@ -86,7 +86,7 @@ public final class Instance private long _lastLeft = -1; private long _instanceStartTime = -1; private long _instanceEndTime = -1; - private boolean _isPvPInstance = false; + private boolean _isPvP = false; private boolean _showTimer = false; private boolean _isTimerIncrease = true; private String _timerText = ""; @@ -171,18 +171,18 @@ public final class Instance * Returns true if entire instance is PvP zone * @return */ - public boolean isPvPInstance() + public boolean isPvP() { - return _isPvPInstance; + return _isPvP; } /** * Sets PvP zone status of the instance - * @param b + * @param value */ - public void setPvPInstance(boolean b) + public void setIsPvP(boolean value) { - _isPvPInstance = b; + _isPvP = value; } /** @@ -573,7 +573,7 @@ public final class Instance a = n.getAttributes().getNamedItem("val"); if (a != null) { - setPvPInstance(Boolean.parseBoolean(a.getNodeValue())); + setIsPvP(Boolean.parseBoolean(a.getNodeValue())); } break; } diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index 315b690fe3..cfb6041234 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -198,7 +198,7 @@ public abstract class L2ZoneType extends ListenersContainer */ private boolean isAffected(L2Character character) { - // Check instance Template Id + // Check instance if (_instanceTemplateId > 0) { final InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId()); @@ -208,7 +208,14 @@ public abstract class L2ZoneType extends ListenersContainer } } - if ((character.getLevel() < _minLvl) || (character.getLevel() > _maxLvl) || !character.isInstanceTypes(_target)) + // Check lvl + if ((character.getLevel() < _minLvl) || (character.getLevel() > _maxLvl)) + { + return false; + } + + // check obj class + if (!character.isInstanceTypes(_target)) { return false; } diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 002a6f75c3..4d0867bf14 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader public String getClosestTownName(L2Character activeChar) { final L2MapRegion region = getMapRegion(activeChar); - - if (region == null) - { - return "Aden Castle Town"; - } - - return region.getTown(); + return region == null ? "Aden Castle Town" : region.getTown(); } /** @@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader { try { - final L2PcInstance player = ((L2PcInstance) activeChar); + final L2PcInstance player = (L2PcInstance) activeChar; final L2MapRegion region = _regions.get(point); if (region.getBannedRace().containsKey(player.getRace())) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java index aff7f59c6a..85073ad9ad 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java @@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader } if (checkId(zoneId)) { - LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); + LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); } if ((zoneName != null) && !zoneName.isEmpty()) @@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character)) { - return ((L2ArenaZone) temp); + return (L2ArenaZone) temp; } } @@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character)) { - return ((L2OlympiadStadiumZone) temp); + return (L2OlympiadStadiumZone) temp; } } return null; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 8390083019..10b2537640 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc public boolean canBeAttacked() { // Attackable during siege by attacker only - return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress()); + return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress(); } @Override public boolean isAutoAttackable(L2Character attacker) { // Attackable during siege by attacker only - return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan())); + return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan()); } @Override @@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc // Set the target of the L2PcInstance player player.setTarget(this); } - else if (interact) + else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) { - if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) - { - // Notify the L2PcInstance AI with AI_INTENTION_INTERACT - player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); - } + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT + player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index a6790a61d9..66f0ce1b9f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer if (isInsideZone(character)) { // If the character can't be affected by this zone return - if (_checkAffected) + if (_checkAffected && !isAffected(character)) { - if (!isAffected(character)) - { - return; - } + return; } if (_characterList.putIfAbsent(character.getObjectId(), character) == null) diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java index 002a6f75c3..4d0867bf14 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/MapRegionManager.java @@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader public String getClosestTownName(L2Character activeChar) { final L2MapRegion region = getMapRegion(activeChar); - - if (region == null) - { - return "Aden Castle Town"; - } - - return region.getTown(); + return region == null ? "Aden Castle Town" : region.getTown(); } /** @@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader { try { - final L2PcInstance player = ((L2PcInstance) activeChar); + final L2PcInstance player = (L2PcInstance) activeChar; final L2MapRegion region = _regions.get(point); if (region.getBannedRace().containsKey(player.getRace())) diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java index aff7f59c6a..85073ad9ad 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/instancemanager/ZoneManager.java @@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader } if (checkId(zoneId)) { - LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); + LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition."); } if ((zoneName != null) && !zoneName.isEmpty()) @@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character)) { - return ((L2ArenaZone) temp); + return (L2ArenaZone) temp; } } @@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader { if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character)) { - return ((L2OlympiadStadiumZone) temp); + return (L2OlympiadStadiumZone) temp; } } return null; diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Tower.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Tower.java index 8390083019..10b2537640 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Tower.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/actor/L2Tower.java @@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc public boolean canBeAttacked() { // Attackable during siege by attacker only - return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress()); + return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress(); } @Override public boolean isAutoAttackable(L2Character attacker) { // Attackable during siege by attacker only - return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan())); + return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan()); } @Override @@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc // Set the target of the L2PcInstance player player.setTarget(this); } - else if (interact) + else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) { - if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this)) - { - // Notify the L2PcInstance AI with AI_INTENTION_INTERACT - player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); - } + // Notify the L2PcInstance AI with AI_INTENTION_INTERACT + player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this); } // Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet player.sendPacket(ActionFailed.STATIC_PACKET); diff --git a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java index a6790a61d9..66f0ce1b9f 100644 --- a/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java +++ b/L2J_Mobius_Classic_2.0_Zaken/java/com/l2jmobius/gameserver/model/zone/L2ZoneType.java @@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer if (isInsideZone(character)) { // If the character can't be affected by this zone return - if (_checkAffected) + if (_checkAffected && !isAffected(character)) { - if (!isAffected(character)) - { - return; - } + return; } if (_characterList.putIfAbsent(character.getObjectId(), character) == null)