Package games.stendhal.client.entity
Class User
java.lang.Object
games.stendhal.client.entity.Entity
games.stendhal.client.entity.ActiveEntity
games.stendhal.client.entity.RPEntity
games.stendhal.client.entity.Player
games.stendhal.client.entity.User
- All Implemented Interfaces:
IEntity,RPObjectChangeListener
This class identifies the user of this client.
- Author:
- durkham, hendrik
-
Nested Class Summary
Nested classes/interfaces inherited from class games.stendhal.client.entity.RPEntity
RPEntity.Resolution -
Field Summary
Fields inherited from class games.stendhal.client.entity.Player
PROP_AWAY, PROP_GRUMPY, PROP_PLAYER_KILLERFields inherited from class games.stendhal.client.entity.RPEntity
OUTFIT_UNSET, PROP_ADMIN_LEVEL, PROP_ATTACK, PROP_CONFUSED, PROP_EATING, PROP_GHOSTMODE, PROP_GROUP_MEMBERSHIP, PROP_HEALER, PROP_HEAVY, PROP_HP_DISPLAY, PROP_HP_RATIO, PROP_MERCHANT, PROP_OUTFIT, PROP_POISONED, PROP_PRODUCER, PROP_SHOCK, PROP_TEXT_INDICATORS, PROP_TITLE_TYPE, PROP_ZOMBIEFields inherited from class games.stendhal.client.entity.ActiveEntity
PROP_DIRECTION, PROP_SPEEDFields inherited from class games.stendhal.client.entity.Entity
clazz, inAdd, name, rpObject, title, type, x, yFields inherited from interface games.stendhal.client.entity.IEntity
PROP_ANIMATED, PROP_CLASS, PROP_NAME, PROP_POSITION, PROP_SIZE, PROP_STATE, PROP_TITLE, PROP_VISIBILITY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidintReturns the objectid for the named item.static Userget()gets the User objectstatic Stringgets the name of the player's characterintgetPetID()gets the ID of a petstatic intgets the level of the current userstatic Stringgets the server release versionintgets the ID of a sheepgets the zone namestatic booleanis the specified charname a buddy of us?booleanhasPet()checks whether the user owns a petbooleanhasSheep()checks whether the user owns a sheepstatic booleanisAdmin()is this user an admin with an adminlevel equal or above 600?static booleanis the player in a group which shares the loot?static booleanisIgnoring(String name) is the named player ignored?static booleanisNull()is the user object not set, yet?static booleanisPlayerInGroup(String otherPlayer) checks if the specified player is in the same group as this playerbooleanisUser()Is this object the user of this client?protected voidAn away message was set/cleared.voidonChangedAdded(RPObject object, RPObject changes) The object added/changed attribute(s).voidonChangedRemoved(RPObject base, RPObject diff) The object removed attribute(s).voidonHealed(int amount) Called when the entity gets healed.protected voidonPosition(double x, double y) When the entity's position changed.protected voidplayRandomSoundFromCategory(String groupName, String categoryName) protected voidplayRandomSoundFromGroup(String groupName, String categoryName, long waitTimeInMilliSec) protected voidplaySoundFromCategory(String groupName, String categoryName) protected voidplaySoundFromCategory(String groupName, String categoryName, int index) voidpredictMovement(Direction direction, boolean facing) Start movement towards a direction.protected voidprocessPositioning(RPObject base, RPObject diff) Process attribute changes that may affect positioning.voidStop the user's movement.static voidupdateGroupStatus(Collection<String> members, String lootmode) updates the group informationMethods inherited from class games.stendhal.client.entity.Player
getAway, isAway, isBadBoy, isGrumpy, onTalkMethods inherited from class games.stendhal.client.entity.RPEntity
addTextIndicator, castsShadow, getAdminLevel, getAtk, getAtkItem, getAtkXP, getAttackers, getAttackTarget, getBaseHP, getBaseMana, getDef, getDefItem, getDefXP, getExtOutfit, getHpRatio, getMana, getOldOutfitCode, getOutfit, getRatk, getRatkItem, getRatkXP, getResistance, getResolution, getShadowStyle, getShownDamageType, getShownWeapon, getTextIndicators, getTitle, getTitleType, getXP, hasStatus, ignoresCollision, initialize, isAttackedBy, isAttacking, isBeingAttacked, isChoking, isConfused, isDefending, isDoingRangedAttack, isEating, isGhostMode, isInHearingRange, isInHearingRange, onAttackPerformed, onBlocked, onDamaged, onLevelChanged, onMissed, onPrivateListen, onReachAchievement, onTalk, release, showHPBar, showTitle, updateMethods inherited from class games.stendhal.client.entity.ActiveEntity
getDirection, isFlying, stoppedMethods inherited from class games.stendhal.client.entity.Entity
addChangeListener, addContentChangeListener, fireChange, getArea, getCursor, getEntityClass, getEntitySubclass, getHeight, getID, getName, getObjectID, getPath, getResistance, getRPObject, getSlot, getType, getVisibility, getWidth, getX, getY, isObstacle, isOnGround, onAdded, onRemoved, onSlotAdded, onSlotChangedAdded, onSlotChangedRemoved, onSlotRemoved, removeChangeListener, removeContentChangeListener, toString
-
Constructor Details
-
User
public User()creates a User object
-
-
Method Details
-
get
gets the User object- Returns:
- user object
-
isNull
public static boolean isNull()is the user object not set, yet?- Returns:
- true, if the the user object is unknown; false if it is known
-
getCharacterName
gets the name of the player's character- Returns:
- charname or
null
-
getPlayerLevel
public static int getPlayerLevel()gets the level of the current user- Returns:
- level
-
getServerRelease
gets the server release version- Returns:
- server release version or
null
-
hasBuddy
is the specified charname a buddy of us?- Parameters:
name- charname to test- Returns:
- true, if it is a buddy, false if it is not a buddy or the user object is unknown.
-
isAdmin
public static boolean isAdmin()is this user an admin with an adminlevel equal or above 600?- Returns:
- true, if the user is an admin; false otherwise
-
isGroupSharingLoot
public static boolean isGroupSharingLoot()is the player in a group which shares the loot?- Returns:
- true if this player is a group and it uses shared looting
-
isIgnoring
is the named player ignored?- Parameters:
name- name of player- Returns:
- true, if the player should be ignored; false otherwise
-
isPlayerInGroup
checks if the specified player is in the same group as this player- Parameters:
otherPlayer- name of the other player- Returns:
- true if the other player is in the same group
-
updateGroupStatus
updates the group information- Parameters:
members- memberslootmode- lootmode
-
findItem
Returns the objectid for the named item.- Parameters:
slotName- name of slot to searchitemName- name of item- Returns:
- objectid or
-1in case there is no such item
-
hasPet
public boolean hasPet()checks whether the user owns a pet- Returns:
- true, if the user owns a pet; false otherwise
-
getPetID
public int getPetID()gets the ID of a pet- Returns:
- ID of pet
-
hasSheep
public boolean hasSheep()checks whether the user owns a sheep- Returns:
- true, if the user owns a sheep; false otherwise
-
getSheepID
public int getSheepID()gets the ID of a sheep- Returns:
- ID of sheep
-
getZoneName
gets the zone name- Returns:
- zone name
-
isUser
public boolean isUser()Is this object the user of this client? -
onAway
Description copied from class:PlayerAn away message was set/cleared. -
onChangedAdded
The object added/changed attribute(s).- Specified by:
onChangedAddedin interfaceRPObjectChangeListener- Overrides:
onChangedAddedin classPlayer- Parameters:
object- The base object.changes- The changes.
-
onChangedRemoved
Description copied from class:PlayerThe object removed attribute(s).- Specified by:
onChangedRemovedin interfaceRPObjectChangeListener- Overrides:
onChangedRemovedin classPlayer- Parameters:
base- The base object.diff- The changes.
-
onHealed
public void onHealed(int amount) Description copied from class:RPEntityCalled when the entity gets healed. -
predictMovement
Start movement towards a direction. This is for the client side movement prediction to start moving before the server responds to the move action.- Parameters:
direction- new directionfacing-trueif the player should just turn
-
processPositioning
Description copied from class:ActiveEntityProcess attribute changes that may affect positioning. This is needed because different entities may want to process coordinate changes more gracefully.- Overrides:
processPositioningin classActiveEntity- Parameters:
base- The previous values.diff- The changes.
-
stopMovement
public void stopMovement()Stop the user's movement. -
addSounds
-
onPosition
protected void onPosition(double x, double y) Description copied from class:EntityWhen the entity's position changed.- Overrides:
onPositionin classEntity- Parameters:
x- The new X coordinate.y- The new Y coordinate.
-
playRandomSoundFromCategory
-
playRandomSoundFromGroup
-
playSoundFromCategory
-
playSoundFromCategory
-