Proper naming for visibility setters and getters.
This commit is contained in:
@@ -110,7 +110,7 @@ public class AdminEffects implements IAdminCommandHandler
|
|||||||
|
|
||||||
if (command.startsWith("admin_invis_menu"))
|
if (command.startsWith("admin_invis_menu"))
|
||||||
{
|
{
|
||||||
if (!activeChar.getAppearance().getInvisible())
|
if (!activeChar.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
activeChar.getAppearance().setInvisible();
|
activeChar.getAppearance().setInvisible();
|
||||||
activeChar.decayMe();
|
activeChar.decayMe();
|
||||||
|
@@ -141,7 +141,7 @@ public class ItemsOnGroundManager
|
|||||||
item.setProtected(false);
|
item.setProtected(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
item.setIsVisible(true);
|
item.setVisible(true);
|
||||||
World.getInstance().addVisibleObject(item, item.getPosition().getWorldRegion(), null);
|
World.getInstance().addVisibleObject(item, item.getPosition().getWorldRegion(), null);
|
||||||
_items.add(item);
|
_items.add(item);
|
||||||
count++;
|
count++;
|
||||||
|
@@ -125,7 +125,7 @@ public class ObjectPosition
|
|||||||
}
|
}
|
||||||
|
|
||||||
setWorldPosition(x, y, z);
|
setWorldPosition(x, y, z);
|
||||||
_activeObject.setIsVisible(false);
|
_activeObject.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -1685,7 +1685,7 @@ public abstract class Skill
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (((PlayerInstance) obj).getAppearance().getInvisible())
|
if (((PlayerInstance) obj).getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1867,7 +1867,7 @@ public abstract class Skill
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (((PlayerInstance) obj).getAppearance().getInvisible())
|
if (((PlayerInstance) obj).getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@@ -44,10 +44,10 @@ public abstract class WorldObject
|
|||||||
{
|
{
|
||||||
private final Logger LOGGER = Logger.getLogger(WorldObject.class.getName());
|
private final Logger LOGGER = Logger.getLogger(WorldObject.class.getName());
|
||||||
|
|
||||||
private boolean _isVisible; // Object visibility
|
private boolean _visible;
|
||||||
private WorldObjectKnownList _knownList;
|
private WorldObjectKnownList _knownList;
|
||||||
private String _name;
|
private String _name;
|
||||||
private int _objectId; // Object identifier
|
private int _objectId;
|
||||||
private ObjectPoly _poly;
|
private ObjectPoly _poly;
|
||||||
private ObjectPosition _position;
|
private ObjectPosition _position;
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ public abstract class WorldObject
|
|||||||
public final void decayMe()
|
public final void decayMe()
|
||||||
{
|
{
|
||||||
// Remove the WorldObject from the world
|
// Remove the WorldObject from the world
|
||||||
_isVisible = false;
|
_visible = false;
|
||||||
World.getInstance().removeVisibleObject(this, getPosition().getWorldRegion());
|
World.getInstance().removeVisibleObject(this, getPosition().getWorldRegion());
|
||||||
World.getInstance().removeObject(this);
|
World.getInstance().removeObject(this);
|
||||||
getPosition().setWorldRegion(null);
|
getPosition().setWorldRegion(null);
|
||||||
@@ -186,7 +186,7 @@ public abstract class WorldObject
|
|||||||
|
|
||||||
synchronized (this)
|
synchronized (this)
|
||||||
{
|
{
|
||||||
_isVisible = false;
|
_visible = false;
|
||||||
getPosition().setWorldRegion(null);
|
getPosition().setWorldRegion(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,7 +237,7 @@ public abstract class WorldObject
|
|||||||
synchronized (this)
|
synchronized (this)
|
||||||
{
|
{
|
||||||
// Set the x,y,z position of the WorldObject spawn and update its _worldregion
|
// 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()));
|
getPosition().setWorldRegion(World.getInstance().getRegion(getPosition().getWorldPosition()));
|
||||||
|
|
||||||
// Add the WorldObject spawn in the _allobjects of World
|
// Add the WorldObject spawn in the _allobjects of World
|
||||||
@@ -259,7 +259,7 @@ public abstract class WorldObject
|
|||||||
synchronized (this)
|
synchronized (this)
|
||||||
{
|
{
|
||||||
// Set the x,y,z position of the WorldObject spawn and update its _worldregion
|
// Set the x,y,z position of the WorldObject spawn and update its _worldregion
|
||||||
_isVisible = true;
|
_visible = true;
|
||||||
|
|
||||||
if (x > World.MAP_MAX_X)
|
if (x > World.MAP_MAX_X)
|
||||||
{
|
{
|
||||||
@@ -325,16 +325,16 @@ public abstract class WorldObject
|
|||||||
* <BR>
|
* <BR>
|
||||||
* @return the visibility state of the WorldObject.
|
* @return the visibility state of the WorldObject.
|
||||||
*/
|
*/
|
||||||
public final boolean isVisible()
|
public boolean isVisible()
|
||||||
{
|
{
|
||||||
return getPosition().getWorldRegion() != null;
|
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);
|
getPosition().setWorldRegion(null);
|
||||||
}
|
}
|
||||||
@@ -414,7 +414,7 @@ public abstract class WorldObject
|
|||||||
_instanceId = instanceId;
|
_instanceId = instanceId;
|
||||||
|
|
||||||
// If we change it for visible objects, me must clear & revalidates knownlists
|
// If we change it for visible objects, me must clear & revalidates knownlists
|
||||||
if (_isVisible && (_knownList != null))
|
if (_visible && (_knownList != null))
|
||||||
{
|
{
|
||||||
if (this instanceof PlayerInstance)
|
if (this instanceof PlayerInstance)
|
||||||
{
|
{
|
||||||
|
@@ -1210,7 +1210,7 @@ public class Attackable extends NpcInstance
|
|||||||
return 0;
|
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
|
// Remove Object Should Use This Method and Can be Blocked While iterating
|
||||||
_aggroList.remove(target);
|
_aggroList.remove(target);
|
||||||
|
@@ -455,7 +455,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder
|
|||||||
{
|
{
|
||||||
if (player != null)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -86,7 +86,7 @@ public class PlayerAppearance
|
|||||||
_invisible = false;
|
_invisible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getInvisible()
|
public boolean isInvisible()
|
||||||
{
|
{
|
||||||
return _invisible;
|
return _invisible;
|
||||||
}
|
}
|
||||||
|
@@ -1172,7 +1172,7 @@ public final class ItemInstance extends WorldObject
|
|||||||
synchronized (this)
|
synchronized (this)
|
||||||
{
|
{
|
||||||
// Set the x,y,z position of the ItemInstance dropped and update its _worldregion
|
// Set the x,y,z position of the ItemInstance dropped and update its _worldregion
|
||||||
setIsVisible(true);
|
setVisible(true);
|
||||||
getPosition().setWorldPosition(x, y, z);
|
getPosition().setWorldPosition(x, y, z);
|
||||||
getPosition().setWorldRegion(World.getInstance().getRegion(getPosition().getWorldPosition()));
|
getPosition().setWorldRegion(World.getInstance().getRegion(getPosition().getWorldPosition()));
|
||||||
|
|
||||||
|
@@ -12368,7 +12368,7 @@ public final class PlayerInstance extends Playable
|
|||||||
setIsParalyzed(true);
|
setIsParalyzed(true);
|
||||||
setIsInvul(true);
|
setIsInvul(true);
|
||||||
|
|
||||||
_wasInvisible = getAppearance().getInvisible();
|
_wasInvisible = getAppearance().isInvisible();
|
||||||
getAppearance().setInvisible();
|
getAppearance().setInvisible();
|
||||||
|
|
||||||
sendPacket(new ObservationMode(x, y, z));
|
sendPacket(new ObservationMode(x, y, z));
|
||||||
@@ -12418,7 +12418,7 @@ public final class PlayerInstance extends Playable
|
|||||||
_observerMode = true;
|
_observerMode = true;
|
||||||
setTarget(null);
|
setTarget(null);
|
||||||
setIsInvul(true);
|
setIsInvul(true);
|
||||||
_wasInvisible = getAppearance().getInvisible();
|
_wasInvisible = getAppearance().isInvisible();
|
||||||
getAppearance().setInvisible();
|
getAppearance().setInvisible();
|
||||||
|
|
||||||
teleToLocation(x, y, z, false);
|
teleToLocation(x, y, z, false);
|
||||||
@@ -14013,7 +14013,7 @@ public final class PlayerInstance extends Playable
|
|||||||
sendMessage("Entering world in Invulnerable mode.");
|
sendMessage("Entering world in Invulnerable mode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getAppearance().getInvisible())
|
if (getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
sendMessage("Entering world in Invisible mode.");
|
sendMessage("Entering world in Invisible mode.");
|
||||||
}
|
}
|
||||||
|
@@ -261,12 +261,12 @@ public class PlayerKnownList extends PlayableKnownList
|
|||||||
if ((object_char != null) && !active_char.isGM())
|
if ((object_char != null) && !active_char.isGM())
|
||||||
{ // GM has to receive remove however because he can see any invisible or inobservermode player
|
{ // 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
|
// Send Server-Client Packet DeleteObject to the PlayerInstance
|
||||||
active_char.sendPacket(new DeleteObject(object));
|
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
|
// Send Server-Client Packet DeleteObject to the PlayerInstance
|
||||||
active_char.sendPacket(new DeleteObject(object));
|
active_char.sendPacket(new DeleteObject(object));
|
||||||
|
@@ -90,7 +90,7 @@ public final class Action extends GameClientPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only GMs can directly interact with invisible characters
|
// 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);
|
getClient().sendPacket(ActionFailed.STATIC_PACKET);
|
||||||
return;
|
return;
|
||||||
|
@@ -92,7 +92,7 @@ public final class AttackRequest extends GameClientPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Only GMs can directly attack invisible characters
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ public final class RequestFriendInvite extends GameClientPacket
|
|||||||
final PlayerInstance friend = World.getInstance().getPlayer(_name);
|
final PlayerInstance friend = World.getInstance().getPlayer(_name);
|
||||||
|
|
||||||
// can't use friend invite for locating invisible characters
|
// 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.
|
// Target is not found in the game.
|
||||||
player.sendPacket(SystemMessageId.THE_USER_YOU_REQUESTED_IS_NOT_IN_GAME);
|
player.sendPacket(SystemMessageId.THE_USER_YOU_REQUESTED_IS_NOT_IN_GAME);
|
||||||
|
@@ -94,7 +94,7 @@ public final class RequestJoinParty extends GameClientPacket
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.isGM() && target.getAppearance().getInvisible())
|
if (target.isGM() && target.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
requestor.sendMessage("You can't invite GM in invisible mode.");
|
requestor.sendMessage("You can't invite GM in invisible mode.");
|
||||||
return;
|
return;
|
||||||
|
@@ -121,7 +121,7 @@ public class CharInfo extends GameServerPacket
|
|||||||
receiver_is_gm = true;
|
receiver_is_gm = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!receiver_is_gm && _player.getAppearance().getInvisible())
|
if (!receiver_is_gm && _player.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -174,7 +174,7 @@ public class CharInfo extends GameServerPacket
|
|||||||
|
|
||||||
writeS(_player.getName());
|
writeS(_player.getName());
|
||||||
|
|
||||||
if (_player.getAppearance().getInvisible())
|
if (_player.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
writeS("Invisible");
|
writeS("Invisible");
|
||||||
}
|
}
|
||||||
@@ -187,7 +187,7 @@ public class CharInfo extends GameServerPacket
|
|||||||
writeD(0);
|
writeD(0);
|
||||||
writeD(0); // hmm karma ??
|
writeD(0); // hmm karma ??
|
||||||
|
|
||||||
if (_player.getAppearance().getInvisible())
|
if (_player.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
|
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
|
||||||
}
|
}
|
||||||
@@ -291,7 +291,7 @@ public class CharInfo extends GameServerPacket
|
|||||||
writeD(_player.getAppearance().getHairColor());
|
writeD(_player.getAppearance().getHairColor());
|
||||||
writeD(_player.getAppearance().getFace());
|
writeD(_player.getAppearance().getFace());
|
||||||
|
|
||||||
if (_player.getAppearance().getInvisible())
|
if (_player.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
writeS("[Invisible]");
|
writeS("[Invisible]");
|
||||||
}
|
}
|
||||||
@@ -341,7 +341,7 @@ public class CharInfo extends GameServerPacket
|
|||||||
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
|
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
|
||||||
// writeC(0x00); // find party members
|
// writeC(0x00); // find party members
|
||||||
|
|
||||||
if (_player.getAppearance().getInvisible())
|
if (_player.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
|
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
|
||||||
}
|
}
|
||||||
|
@@ -166,7 +166,7 @@ public class NpcInfo extends GameServerPacket
|
|||||||
|
|
||||||
if (_creature instanceof Summon)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
@@ -248,7 +248,7 @@ public class UserInfo extends GameServerPacket
|
|||||||
writeD(_player.isGM() ? 1 : 0); // builder level
|
writeD(_player.isGM() ? 1 : 0); // builder level
|
||||||
|
|
||||||
String title = _player.getTitle();
|
String title = _player.getTitle();
|
||||||
if (_player.getAppearance().getInvisible() && _player.isGM())
|
if (_player.getAppearance().isInvisible() && _player.isGM())
|
||||||
{
|
{
|
||||||
title = "[Invisible]";
|
title = "[Invisible]";
|
||||||
}
|
}
|
||||||
@@ -284,7 +284,7 @@ public class UserInfo extends GameServerPacket
|
|||||||
|
|
||||||
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
|
writeC(_player.isInPartyMatchRoom() ? 1 : 0);
|
||||||
|
|
||||||
if (_player.getAppearance().getInvisible())
|
if (_player.getAppearance().isInvisible())
|
||||||
{
|
{
|
||||||
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
|
writeD((_player.getAbnormalEffect() | Creature.ABNORMAL_EFFECT_STEALTH));
|
||||||
}
|
}
|
||||||
|
@@ -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.
|
// 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;
|
return;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user