From af6f81263b10efe9b1b0d7c854a3160b25bb1bf6 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment <8391001+MobiusDevelopment@users.noreply.github.com> Date: Wed, 31 Jul 2019 11:44:19 +0000 Subject: [PATCH] Proper naming for visibility setters and getters. --- .../admincommandhandlers/AdminEffects.java | 2 +- .../instancemanager/ItemsOnGroundManager.java | 2 +- .../gameserver/model/ObjectPosition.java | 2 +- .../org/l2jmobius/gameserver/model/Skill.java | 4 ++-- .../gameserver/model/WorldObject.java | 22 +++++++++---------- .../gameserver/model/actor/Attackable.java | 2 +- .../gameserver/model/actor/Creature.java | 2 +- .../actor/appearance/PlayerAppearance.java | 2 +- .../model/actor/instance/ItemInstance.java | 2 +- .../model/actor/instance/PlayerInstance.java | 6 ++--- .../actor/knownlist/PlayerKnownList.java | 4 ++-- .../network/clientpackets/Action.java | 2 +- .../network/clientpackets/AttackRequest.java | 2 +- .../clientpackets/RequestFriendInvite.java | 2 +- .../clientpackets/RequestJoinParty.java | 2 +- .../network/serverpackets/CharInfo.java | 10 ++++----- .../network/serverpackets/NpcInfo.java | 2 +- .../network/serverpackets/UserInfo.java | 4 ++-- .../l2jmobius/gameserver/util/Broadcast.java | 2 +- 19 files changed, 38 insertions(+), 38 deletions(-) diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java index 8263db93dd..a382511f16 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/handler/admincommandhandlers/AdminEffects.java @@ -110,7 +110,7 @@ public class AdminEffects implements IAdminCommandHandler if (command.startsWith("admin_invis_menu")) { - if (!activeChar.getAppearance().getInvisible()) + if (!activeChar.getAppearance().isInvisible()) { activeChar.getAppearance().setInvisible(); activeChar.decayMe(); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java index 8216fe6cd3..7eb80ba579 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/instancemanager/ItemsOnGroundManager.java @@ -141,7 +141,7 @@ public class ItemsOnGroundManager item.setProtected(false); } - item.setIsVisible(true); + item.setVisible(true); World.getInstance().addVisibleObject(item, item.getPosition().getWorldRegion(), null); _items.add(item); count++; diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java index bb685f9f08..33fb73b5e1 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/ObjectPosition.java @@ -125,7 +125,7 @@ public class ObjectPosition } setWorldPosition(x, y, z); - _activeObject.setIsVisible(false); + _activeObject.setVisible(false); } /** diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java index 19236e7379..011235ccf9 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/Skill.java @@ -1685,7 +1685,7 @@ public abstract class Skill { continue; } - if (((PlayerInstance) obj).getAppearance().getInvisible()) + if (((PlayerInstance) obj).getAppearance().isInvisible()) { continue; } @@ -1867,7 +1867,7 @@ public abstract class Skill { continue; } - if (((PlayerInstance) obj).getAppearance().getInvisible()) + if (((PlayerInstance) obj).getAppearance().isInvisible()) { continue; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldObject.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldObject.java index 648af2f696..5f9a521ef3 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldObject.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/WorldObject.java @@ -44,10 +44,10 @@ public abstract class WorldObject { private final Logger LOGGER = Logger.getLogger(WorldObject.class.getName()); - private boolean _isVisible; // Object visibility + private boolean _visible; private WorldObjectKnownList _knownList; private String _name; - private int _objectId; // Object identifier + private int _objectId; private ObjectPoly _poly; private ObjectPosition _position; @@ -144,7 +144,7 @@ public abstract class WorldObject public final void decayMe() { // Remove the WorldObject from the world - _isVisible = false; + _visible = false; World.getInstance().removeVisibleObject(this, getPosition().getWorldRegion()); World.getInstance().removeObject(this); getPosition().setWorldRegion(null); @@ -186,7 +186,7 @@ public abstract class WorldObject synchronized (this) { - _isVisible = false; + _visible = false; getPosition().setWorldRegion(null); } @@ -237,7 +237,7 @@ public abstract class WorldObject synchronized (this) { // Set the x,y,z position of the WorldObject spawn and update its _worldregion - _isVisible = true; + _visible = true; getPosition().setWorldRegion(World.getInstance().getRegion(getPosition().getWorldPosition())); // Add the WorldObject spawn in the _allobjects of World @@ -259,7 +259,7 @@ public abstract class WorldObject synchronized (this) { // Set the x,y,z position of the WorldObject spawn and update its _worldregion - _isVisible = true; + _visible = true; if (x > World.MAP_MAX_X) { @@ -325,16 +325,16 @@ public abstract class WorldObject *
* @return the visibility state of the WorldObject. */ - public final boolean isVisible() + public boolean isVisible() { return getPosition().getWorldRegion() != null; } - public final void setIsVisible(boolean value) + public void setVisible(boolean value) { - _isVisible = value; + _visible = value; - if (!_isVisible) + if (!_visible) { getPosition().setWorldRegion(null); } @@ -414,7 +414,7 @@ public abstract class WorldObject _instanceId = instanceId; // If we change it for visible objects, me must clear & revalidates knownlists - if (_isVisible && (_knownList != null)) + if (_visible && (_knownList != null)) { if (this instanceof PlayerInstance) { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java index c8c016be17..78bdcbddbb 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Attackable.java @@ -1210,7 +1210,7 @@ public class Attackable extends NpcInstance return 0; } - if ((ai._attacker instanceof PlayerInstance) && (((PlayerInstance) ai._attacker).getAppearance().getInvisible() || ((PlayerInstance) ai._attacker).isSpawnProtected() || ((PlayerInstance) ai._attacker).isTeleportProtected() || ai._attacker.isInvul())) + if ((ai._attacker instanceof PlayerInstance) && (((PlayerInstance) ai._attacker).getAppearance().isInvisible() || ((PlayerInstance) ai._attacker).isSpawnProtected() || ((PlayerInstance) ai._attacker).isTeleportProtected() || ai._attacker.isInvul())) { // Remove Object Should Use This Method and Can be Blocked While iterating _aggroList.remove(target); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java index c245ffa74f..08717bdb3a 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Creature.java @@ -455,7 +455,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder { if (player != null) { - if ((this instanceof PlayerInstance) && !player.isGM() && (((PlayerInstance) this).getAppearance().getInvisible() || ((PlayerInstance) this).inObserverMode())) + if ((this instanceof PlayerInstance) && !player.isGM() && (((PlayerInstance) this).getAppearance().isInvisible() || ((PlayerInstance) this).inObserverMode())) { return; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/appearance/PlayerAppearance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/appearance/PlayerAppearance.java index 1ddf7a7f8b..7b3685ee3c 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/appearance/PlayerAppearance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/appearance/PlayerAppearance.java @@ -86,7 +86,7 @@ public class PlayerAppearance _invisible = false; } - public boolean getInvisible() + public boolean isInvisible() { return _invisible; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ItemInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ItemInstance.java index 09c841af91..ee38a43c37 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ItemInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/ItemInstance.java @@ -1172,7 +1172,7 @@ public final class ItemInstance extends WorldObject synchronized (this) { // Set the x,y,z position of the ItemInstance dropped and update its _worldregion - setIsVisible(true); + setVisible(true); getPosition().setWorldPosition(x, y, z); getPosition().setWorldRegion(World.getInstance().getRegion(getPosition().getWorldPosition())); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 34f7b3fae4..83556b6df0 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -12368,7 +12368,7 @@ public final class PlayerInstance extends Playable setIsParalyzed(true); setIsInvul(true); - _wasInvisible = getAppearance().getInvisible(); + _wasInvisible = getAppearance().isInvisible(); getAppearance().setInvisible(); sendPacket(new ObservationMode(x, y, z)); @@ -12418,7 +12418,7 @@ public final class PlayerInstance extends Playable _observerMode = true; setTarget(null); setIsInvul(true); - _wasInvisible = getAppearance().getInvisible(); + _wasInvisible = getAppearance().isInvisible(); getAppearance().setInvisible(); teleToLocation(x, y, z, false); @@ -14013,7 +14013,7 @@ public final class PlayerInstance extends Playable sendMessage("Entering world in Invulnerable mode."); } - if (getAppearance().getInvisible()) + if (getAppearance().isInvisible()) { sendMessage("Entering world in Invisible mode."); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/knownlist/PlayerKnownList.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/knownlist/PlayerKnownList.java index 87f1bc8b0c..5d00f635f4 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/knownlist/PlayerKnownList.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/knownlist/PlayerKnownList.java @@ -261,12 +261,12 @@ public class PlayerKnownList extends PlayableKnownList if ((object_char != null) && !active_char.isGM()) { // GM has to receive remove however because he can see any invisible or inobservermode player - if (!object_char.getAppearance().getInvisible() && !object_char.inObserverMode()) + if (!object_char.getAppearance().isInvisible() && !object_char.inObserverMode()) { // Send Server-Client Packet DeleteObject to the PlayerInstance active_char.sendPacket(new DeleteObject(object)); } - else if (object_char.isGM() && object_char.getAppearance().getInvisible() && !object_char.isTeleporting()) + else if (object_char.isGM() && object_char.getAppearance().isInvisible() && !object_char.isTeleporting()) { // Send Server-Client Packet DeleteObject to the PlayerInstance active_char.sendPacket(new DeleteObject(object)); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Action.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Action.java index e1acb3b12b..8511c4025f 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Action.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/Action.java @@ -90,7 +90,7 @@ public final class Action extends GameClientPacket } // Only GMs can directly interact with invisible characters - if ((obj instanceof PlayerInstance) && (((PlayerInstance) obj).getAppearance().getInvisible()) && !player.isGM()) + if ((obj instanceof PlayerInstance) && (((PlayerInstance) obj).getAppearance().isInvisible()) && !player.isGM()) { getClient().sendPacket(ActionFailed.STATIC_PACKET); return; diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/AttackRequest.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/AttackRequest.java index e8db14d7f8..31b32bb456 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/AttackRequest.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/AttackRequest.java @@ -92,7 +92,7 @@ public final class AttackRequest extends GameClientPacket } // Only GMs can directly attack invisible characters - if ((target instanceof PlayerInstance) && ((PlayerInstance) target).getAppearance().getInvisible() && !player.isGM()) + if ((target instanceof PlayerInstance) && ((PlayerInstance) target).getAppearance().isInvisible() && !player.isGM()) { return; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestFriendInvite.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestFriendInvite.java index 5d6a38eca3..cf9be11aef 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestFriendInvite.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestFriendInvite.java @@ -46,7 +46,7 @@ public final class RequestFriendInvite extends GameClientPacket final PlayerInstance friend = World.getInstance().getPlayer(_name); // can't use friend invite for locating invisible characters - if ((friend == null) || (friend.isOnline() == 1) || friend.getAppearance().getInvisible()) + if ((friend == null) || (friend.isOnline() == 1) || friend.getAppearance().isInvisible()) { // Target is not found in the game. player.sendPacket(SystemMessageId.THE_USER_YOU_REQUESTED_IS_NOT_IN_GAME); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java index 67c0a547a3..e5a2082644 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/RequestJoinParty.java @@ -94,7 +94,7 @@ public final class RequestJoinParty extends GameClientPacket return; } - if (target.isGM() && target.getAppearance().getInvisible()) + if (target.isGM() && target.getAppearance().isInvisible()) { requestor.sendMessage("You can't invite GM in invisible mode."); return; diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java index 29caecd961..b2c5cb985a 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/CharInfo.java @@ -121,7 +121,7 @@ public class CharInfo extends GameServerPacket receiver_is_gm = true; } - if (!receiver_is_gm && _player.getAppearance().getInvisible()) + if (!receiver_is_gm && _player.getAppearance().isInvisible()) { return; } @@ -174,7 +174,7 @@ public class CharInfo extends GameServerPacket writeS(_player.getName()); - if (_player.getAppearance().getInvisible()) + if (_player.getAppearance().isInvisible()) { writeS("Invisible"); } @@ -187,7 +187,7 @@ public class CharInfo extends GameServerPacket writeD(0); writeD(0); // hmm karma ?? - if (_player.getAppearance().getInvisible()) + if (_player.getAppearance().isInvisible()) { writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH)); } @@ -291,7 +291,7 @@ public class CharInfo extends GameServerPacket writeD(_player.getAppearance().getHairColor()); writeD(_player.getAppearance().getFace()); - if (_player.getAppearance().getInvisible()) + if (_player.getAppearance().isInvisible()) { writeS("[Invisible]"); } @@ -341,7 +341,7 @@ public class CharInfo extends GameServerPacket writeC(_player.isInPartyMatchRoom() ? 1 : 0); // writeC(0x00); // find party members - if (_player.getAppearance().getInvisible()) + if (_player.getAppearance().isInvisible()) { writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH)); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java index 021c11b313..f54c599051 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/NpcInfo.java @@ -166,7 +166,7 @@ public class NpcInfo extends GameServerPacket if (_creature instanceof Summon) { - if ((((Summon) _creature).getOwner() != null) && ((Summon) _creature).getOwner().getAppearance().getInvisible()) + if ((((Summon) _creature).getOwner() != null) && ((Summon) _creature).getOwner().getAppearance().isInvisible()) { return; } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java index 77d5a30351..2acd4f6789 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/UserInfo.java @@ -248,7 +248,7 @@ public class UserInfo extends GameServerPacket writeD(_player.isGM() ? 1 : 0); // builder level String title = _player.getTitle(); - if (_player.getAppearance().getInvisible() && _player.isGM()) + if (_player.getAppearance().isInvisible() && _player.isGM()) { title = "[Invisible]"; } @@ -284,7 +284,7 @@ public class UserInfo extends GameServerPacket writeC(_player.isInPartyMatchRoom() ? 1 : 0); - if (_player.getAppearance().getInvisible()) + if (_player.getAppearance().isInvisible()) { writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH)); } diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/Broadcast.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/Broadcast.java index 489417e5f7..cea3a15226 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/Broadcast.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/util/Broadcast.java @@ -70,7 +70,7 @@ public final class Broadcast } // TEMP FIX: If player is not visible don't send packets broadcast to all his KnowList. This will avoid GM detection with l2net and olympiad's crash. We can now find old problems with invisible mode. - if ((creature instanceof PlayerInstance) && !player.isGM() && (((PlayerInstance) creature).getAppearance().getInvisible() || ((PlayerInstance) creature).inObserverMode())) + if ((creature instanceof PlayerInstance) && !player.isGM() && (((PlayerInstance) creature).getAppearance().isInvisible() || ((PlayerInstance) creature).inObserverMode())) { return; }