com.planet_ink.coffee_mud.Items.Basic
Class StdItem

java.lang.Object
  extended by com.planet_ink.coffee_mud.Items.Basic.StdItem
All Implemented Interfaces:
Behavable, CMModifiable, CMObject, Environmental, MsgListener, Rider, StatsAffecting, Tickable, Item, java.lang.Cloneable, java.lang.Comparable<CMObject>
Direct Known Subclasses:
DruidicMonument, Gem, GenAmmunition, GenItem, LightSource, ManualAdvancement, ManualArchon, ManualClasses, PracticePoint, QuestPoint, Ring, StdBook, StdClanFlag, StdClanItem, StdCoins, StdContainer, StdElecItem, StdFood, StdJournal, StdKey, StdLawBook, StdLimb, StdMap, StdPlayingCard, StdPowder, StdProgram, StdScroll, StdTitle, StdWand, StdWeapon, TrainingSession

public class StdItem
extends java.lang.Object
implements Item


Field Summary
protected  java.util.Vector affects
           
protected  EnvStats baseEnvStats
           
protected  int baseGoldValue
           
protected  java.util.Vector behaviors
           
protected static java.lang.String[] CODES
           
protected  java.lang.String databaseID
           
protected  byte[] description
           
protected  boolean destroyed
           
protected  java.lang.String displayText
           
protected  long dispossessionTime
           
protected  EnvStats envStats
           
protected  java.lang.String imageName
           
protected  int material
           
protected  java.lang.String miscText
           
protected  Item myContainer
           
protected  int myUses
           
protected  long myWornCode
           
protected  java.lang.String name
           
protected  Environmental owner
           
protected  long properWornBitmap
           
protected  Rideable riding
           
protected  java.util.Vector scripts
           
protected  java.lang.String secretIdentity
           
protected  long tickStatus
           
protected  boolean wornLogicalAnd
           
protected  java.lang.String[] xtraValues
           
 
Fields inherited from interface com.planet_ink.coffee_mud.Items.interfaces.Item
IN_INVENTORY, WORN_ABOUT_BODY, WORN_ARMS, WORN_BACK, WORN_CODES, WORN_DEPENDENCYGRID, WORN_DESCS, WORN_EARS, WORN_EYES, WORN_FEET, WORN_FLOATING_NEARBY, WORN_HANDS, WORN_HEAD, WORN_HELD, WORN_LEFT_FINGER, WORN_LEFT_WRIST, WORN_LEGS, WORN_MOUTH, WORN_NECK, WORN_ORDER, WORN_RIGHT_FINGER, WORN_RIGHT_WRIST, WORN_TORSO, WORN_WAIST, WORN_WEIGHT_POINTS, WORN_WEIGHTS, WORN_WIELD, WORNREQ_ANY, WORNREQ_UNWORNONLY, WORNREQ_WORNONLY
 
Constructor Summary
StdItem()
           
 
Method Summary
protected  boolean abilityImbuesMagic()
           
 void addBehavior(Behavior to)
          Manipulation of Behavior objects, which includes movement, speech, spellcasting, etc, etc.
 void addEffect(Ability to)
          Add a new effect to this object, whether permanent or temporary.
 void addNonUninvokableEffect(Ability to)
          Same as addEffect(Ability), but will set the Ability object as never being able to be uninvoked.
 void addScript(ScriptingEngine S)
          Manipulation of the scripts list
 void affectCharState(MOB affectedMob, CharState affectableMaxState)
          This method is called by the recoverCharState() method on other MOB objects.
 void affectCharStats(MOB affectedMob, CharStats affectableStats)
          This method is called by the recoverCharStats() method on other MOB objects.
 void affectEnvStats(Environmental affected, EnvStats affectableStats)
          This method is called by the recoverEnvStats() method on other Environmental objects.
protected  boolean alreadyWornMsg(MOB mob, Item thisItem)
           
 boolean amDestroyed()
          Whether the destroy() method has been previousy called on this object.
 boolean amWearingAt(long wornCode)
          Can test where, if anywhere, an item is being worn.
 EnvStats baseEnvStats()
          Object containing a set of base, unmodified, mostly numeric fields.
 int baseGoldValue()
          The user/builder-entered value of the item, represented in base CoffeeMud currency.
 boolean canWear(MOB mob, long where)
          Returns whether it is practical for the given mob to wear this Item on the given worn location as given by the wornCode.
protected  boolean canWearComplete(MOB mob)
           
protected  java.util.Vector cloneEffects()
           
protected  void cloneFix(Item E)
           
 boolean compareProperLocations(Item toThis)
          compares whether this item is allowed to be worn on the same locations as the given item.
 int compareTo(CMObject o)
           
 Item container()
          Where the item is located.
 CMObject copyOf()
          Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.
 java.lang.String databaseID()
          Gets the internal database id for mapping back to tables.
 void delBehavior(Behavior to)
          Delete a behavior from this object.
 void delEffect(Ability to)
          Delete an effect from this object, whether permanent or temporary.
 void delScript(ScriptingEngine S)
          Remove a running script from this object.
 java.lang.String description()
          The basic description of this object, as shown when the item is directly LOOKed at.
 void destroy()
          Utterly and permanently destroy this object, not only removing it from the map, but causing this object to be collected as garbage by Java.
 java.lang.String displayText()
          Gets the raw string used to show what this object looks like in the room.
 EnvStats envStats()
          Object containing a set of current, modified, usable, mostly numeric fields.
 void executeMsg(Environmental myHost, CMMsg msg)
          The general message event handler for the object.
 long expirationDate()
          If this object expires, it should have a timestamp saying when it expires, in real time.
 Behavior fetchBehavior(int index)
          Returns a behavior object on this object.
 Behavior fetchBehavior(java.lang.String ID)
          Returns a behavior object listed on this object.
 Ability fetchEffect(int index)
          Returns an ability object listed as an effect on this object.
 Ability fetchEffect(java.lang.String ID)
          Returns an ability object listed as an effect on this object.
 ScriptingEngine fetchScript(int x)
          Retreive one of the enumerated scripts running on this object
protected  void finalize()
           
 boolean fitsOn(long wornCode)
          Whether this item is designated as being wearable on the given worn codes defined in the Item interface.
protected  int getCodeNum(java.lang.String code)
           
 int getSaveStatIndex()
          Returns the index into the stat codes array where extra savable fields begins.
 java.lang.String getStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 java.lang.String[] getStatCodes()
          Returns an array of the string names of those fields which are modifiable on this object at run-time by builders.
 long getTickStatus()
          A coded status for this object during the period where its tick method is being called.
 java.lang.String ID()
          The CoffeeMud Java Class ID shared by all instances of this object.
 java.lang.String image()
          Returns the fully qualified and determined name of the image file displayed for this object when MXP is used.
 void initializeClass()
          Called ONCE after all objects are loaded, but before the map is read in during initialization.
 boolean isGeneric()
          Whether the fields of this item are set in code, or set by builders.
 boolean isStat(java.lang.String code)
          An alternative means of retreiving the values of those fields on this object which are modifiable at run-time by builders.
 int material()
          The resource code representing the material out of which this item is principally made.
 int maxRange()
          the maximum range of this object, if applicable.
 int minRange()
          the minimum range of this object, if applicable.
 java.lang.String miscTextFormat()
          Unimplemented as of yet, but will hold a string telling the system what the proper format of any miscText data.
 java.lang.String name()
          The displayable name of this object.
 java.lang.String Name()
          The raw unmodified name of this object as stored in the database.
 CMObject newInstance()
          Returns a new instance of this class.
 int numBehaviors()
          The number of behaviors this object has.
 int numberOfItems()
          How many items this Item object represents.
 int numEffects()
          Returns the number of ability objects listed as effects on this object.
 int numScripts()
          Return the number of scripts running on this object
 boolean okMessage(Environmental myHost, CMMsg msg)
          The general message event previewer for the object.
 Environmental owner()
          The Room or MOB representing where this item is located.
 java.lang.String rawImage()
          Returns the raw name of the image file to display for this object when MXP is used.
 boolean rawLogicalAnd()
          Flag which determines whether the rawProperLocationBitmap represents the fact that it is worn on ALL locations (value of true) or worn on any of the locations.
 long rawProperLocationBitmap()
          Returns the builder-defined bitmap made from a logical combination of the worn location constants from the Item interface.
 java.lang.String rawSecretIdentity()
          This method returns those secret properties of the item which are entered directly by the builder when the item is designed.
 long rawWornCode()
          Returns the bitmap representing where this item is presently being worn by the mob or player who has the item in his or inventory.
 java.lang.String readableText()
          If the IS_READABLE flag is set for the envStats().sensesMask() flag on this item, then this method will be consulted as representing any writing on the Item.
 void recoverEnvStats()
          This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method.
 int recursiveWeight()
          For a normal item, this method returns the same as envStats().weight().
 void removeFromOwnerContainer()
          This method basically calls setContainer(null), and then removes this item from its owner().
 Rideable riding()
          Returns the Rideable upon which this Rider is Riding.
 boolean sameAs(Environmental E)
          Whether this object instance is functionally identical to the object passed in.
 boolean savable()
          Whether, if this object is in a room, whether it is appropriate to save this object to the database as a permanent feature of its container.
 java.lang.String secretIdentity()
          This method returns the calculated and expanded description of the properties of the item as would be discovered through the Identify spell.
 void setBaseEnvStats(EnvStats newBaseEnvStats)
          Re-sets the object containing a set of base, unmodified, mostly numeric fields.
 void setBaseValue(int newValue)
          Changes the base value of the item, represented in base CoffeeMud currency.
 void setContainer(Item newContainer)
          Change the container where the item is located.
 void setDatabaseID(java.lang.String id)
          Sets the internal database id for mapping back to tables.
 void setDescription(java.lang.String newDescription)
          Sets the basic description of this object, as shown when the item is directly LOOKed at.
 void setDisplayText(java.lang.String newDisplayText)
          Sets the raw string used to show what this object looks like in the room.
 void setExpirationDate(long time)
          If this object expires, it should have a timestamp saying when it expires, in real time.
 void setImage(java.lang.String newImage)
          Sets the raw name of the image file to display for this object when MXP is used.
 void setMaterial(int newValue)
          Sets the resource code representing the material out of which this item is principally made.
 void setMiscText(java.lang.String newText)
          For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object.
 void setName(java.lang.String newName)
          Sets the raw unmodified name of this object as stored in the database.
 void setOwner(Environmental E)
          Sets the Room or MOB representing where this item is located.
 void setRawLogicalAnd(boolean newAnd)
          Sets flag which determines whether the rawProperLocationBitmap represents the fact that it is worn on ALL locations (value of true) or worn on any of the locations.
 void setRawProperLocationBitmap(long newValue)
          Sets the builder-defined bitmap made from a logical combination of the worn location constants from the Item interface.
 void setRawWornCode(long newValue)
          Sets the bitmap representing where this item is presently being worn by the mob or player who has the item in his or inventory.
 void setReadableText(java.lang.String text)
          Changes the text that is written on the item.
 void setRiding(Rideable ride)
          Sets the Rideable upon which this Rider is Riding.
 void setSecretIdentity(java.lang.String newIdentity)
          This method is used to change the string returned by rawSecretIdentity.
 void setStat(java.lang.String code, java.lang.String val)
          An alternative means of setting the values of those fields on this object which are modifiable at run-time by builders.
 void setUsesRemaining(int newUses)
          Sets the uses remaining field, which is a general numeric value whose meaning differs for different Item types.
 void stopTicking()
          If this Item is current Ticking due to its having Behaviors or other properties which might grant it the ability to Tick, this method will cause that ticking to cease and desist.
 boolean subjectToWearAndTear()
          Whether the usesRemaining() number above is used to determine the percentage health of the item.
protected  java.lang.String tackOns()
           
 java.lang.String text()
          For objects which have false for their isGeneric method, this is used to set any internally coded strings to change the nature or behavior of the object.
 boolean tick(Tickable ticking, int tickID)
          this is the method which is called periodically by the threading engine.
 Item ultimateContainer()
          If an item is in a container, which is in a container, etc, this will return the "highest" or ultimate container in which this item is located.
 void unWear()
          Removes this item from a state of being worn, and puts it back into the mob or player inventory.
 int usesRemaining()
          Uses remaining is a general use numeric value whose meaning differs for different Item types.
 int value()
          The default value of the item, represented in the base CoffeeMud currency.
 void wearAt(long wornCode)
          This method is similar to the wearEvenIfImpossible method method above, except that it does not inspect this item for allowed wearable locations, but always puts the item on the wear location represented by the given wornCode bitmap.
 void wearEvenIfImpossible(MOB mob)
          Puts this item into a state of being worn regardless of whether it is practical for the given mob to wear it -- for instance, even if an item is already being worn where this item wants to be worn, or if the player has no such limbs to wear this item.
 void wearIfPossible(MOB mob)
          Using the canWear method, this method will put the item into a state of being worn only if it is practical for the given mob or player to wear this Item.
 long whereCantWear(MOB mob)
          Returns a bitmap of all the locations where the given mob is practically unable to wear an item.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

displayText

protected java.lang.String displayText

description

protected byte[] description

myContainer

protected Item myContainer

myUses

protected int myUses

myWornCode

protected long myWornCode

miscText

protected java.lang.String miscText

imageName

protected java.lang.String imageName

secretIdentity

protected java.lang.String secretIdentity

wornLogicalAnd

protected boolean wornLogicalAnd

properWornBitmap

protected long properWornBitmap

baseGoldValue

protected int baseGoldValue

material

protected int material

owner

protected Environmental owner

xtraValues

protected java.lang.String[] xtraValues

dispossessionTime

protected long dispossessionTime

tickStatus

protected long tickStatus

databaseID

protected java.lang.String databaseID

affects

protected java.util.Vector affects

behaviors

protected java.util.Vector behaviors

scripts

protected java.util.Vector scripts

envStats

protected EnvStats envStats

baseEnvStats

protected EnvStats baseEnvStats

destroyed

protected boolean destroyed

riding

protected Rideable riding

CODES

protected static java.lang.String[] CODES
Constructor Detail

StdItem

public StdItem()
Method Detail

ID

public java.lang.String ID()
Description copied from interface: CMObject
The CoffeeMud Java Class ID shared by all instances of this object. Unlike the Java Class name, this method does not include package information. However, it must return a String value unique to its class category in the ClassLoader. Class categories include Libraries, Common, Areas, Abilities, Behaviors, CharClasses, Commands, Exits Locales, MOBS, Races, WebMacros, Basic Items, Armor, Weapons, ClanItems, MiscTech. The name is typically identical to the class name.

Specified by:
ID in interface CMObject
Returns:
the name of this class

abilityImbuesMagic

protected boolean abilityImbuesMagic()

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

initializeClass

public void initializeClass()
Description copied from interface: CMObject
Called ONCE after all objects are loaded, but before the map is read in during initialization.

Specified by:
initializeClass in interface CMObject

isGeneric

public boolean isGeneric()
Description copied from interface: Environmental
Whether the fields of this item are set in code, or set by builders. Generic means that they are set by builders, in which case XML is returned by the text() method containing all of the values for all the fields.

Specified by:
isGeneric in interface Environmental
Returns:
whether this item is modifiable by builders
See Also:
Environmental.text()

Name

public java.lang.String Name()
Description copied from interface: Environmental
The raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
Name in interface Environmental
Returns:
the raw base name of this object on the map.
See Also:
Environmental.name()

setName

public void setName(java.lang.String newName)
Description copied from interface: Environmental
Sets the raw unmodified name of this object as stored in the database. This is the name set by builders and used as a basis for the name() method.

Specified by:
setName in interface Environmental
Parameters:
newName - the raw base name of this object on the map.
See Also:
Environmental.Name()

name

public java.lang.String name()
Description copied from interface: Environmental
The displayable name of this object. May be modified by envStats() object. Is derived from the Name().

Specified by:
name in interface Environmental
Specified by:
name in interface Tickable
Returns:
the modified final name of this object on the map.
See Also:
Environmental.Name()

image

public java.lang.String image()
Description copied from interface: Environmental
Returns the fully qualified and determined name of the image file displayed for this object when MXP is used. If rawImage() is non-empty, it will return rawImage, and otherwise use the mxp default data file.

Specified by:
image in interface Environmental
Returns:
the name of the mxp image to display for this object.

rawImage

public java.lang.String rawImage()
Description copied from interface: Environmental
Returns the raw name of the image file to display for this object when MXP is used. This is the value set by the builder, and may be returned by image() if it is non-empty.

Specified by:
rawImage in interface Environmental
Returns:
the raw name of the mxp image file

setImage

public void setImage(java.lang.String newImage)
Description copied from interface: Environmental
Sets the raw name of the image file to display for this object when MXP is used. This is the value set by the builder, and may be returned by image() if it is non-empty.

Specified by:
setImage in interface Environmental
Parameters:
newImage - the raw name of the mxp image file

envStats

public EnvStats envStats()
Description copied from interface: Environmental
Object containing a set of current, modified, usable, mostly numeric fields. This object is based on the object from baseEnvStats() and then updated and modified by the recoverEnvStats() method. See the EnvStats interface for information on the fields herein.

Specified by:
envStats in interface Environmental
Returns:
the current set of state fields
See Also:
Environmental.baseEnvStats(), Environmental.recoverEnvStats(), EnvStats

baseEnvStats

public EnvStats baseEnvStats()
Description copied from interface: Environmental
Object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverEnvStats() method. See the EnvStats interface for information on the fields herein.

Specified by:
baseEnvStats in interface Environmental
Returns:
a set of state fields
See Also:
Environmental.envStats(), Environmental.recoverEnvStats(), EnvStats

recoverEnvStats

public void recoverEnvStats()
Description copied from interface: Environmental
This method copies the baseEnvStats() object into the envStats() object, then makes repeated calls to all surrounding objects with affectEnvStats(Environmental,EnvStats) method. Surrounding objects include the room where the object is located, the Ability objects in the Effects list, the Behaviors in the behaviors list, and race/charclass/area if applicable. Those methods will then make all necessary adjustments to the values in the new envStats() object. When it returns, envStats() will have a totally updated object. This method must be called in code whenever the object is placed on the map, or when anything changes in its environment, such as location, effects, or other states.

Specified by:
recoverEnvStats in interface Environmental
See Also:
Environmental.baseEnvStats(), Environmental.envStats(), Environmental.addEffect(Ability), Behavable.addBehavior(Behavior), EnvStats

setBaseEnvStats

public void setBaseEnvStats(EnvStats newBaseEnvStats)
Description copied from interface: Environmental
Re-sets the object containing a set of base, unmodified, mostly numeric fields. The values on the fields in this object will be as they were set by the builder. This object is used as a basis for the recoverEnvStats() method. See the EnvStats interface for information on the fields herein. This method is rarely called -- the fields therein are usually set using setter methods from the EnvStats interface on the object itself.

Specified by:
setBaseEnvStats in interface Environmental
Parameters:
newBaseEnvStats - a set of state fields
See Also:
Environmental.envStats(), Environmental.recoverEnvStats(), EnvStats

newInstance

public CMObject newInstance()
Description copied from interface: CMObject
Returns a new instance of this class.

Specified by:
newInstance in interface CMObject
Returns:
a new instance of this class

subjectToWearAndTear

public boolean subjectToWearAndTear()
Description copied from interface: Item
Whether the usesRemaining() number above is used to determine the percentage health of the item. If this method returns false, then health or condition is irrelevant to this Item. If true is returned, then usesRemaining is a number from 100 to 0, where 100 means perfect condition, and 0 means imminent disintegration.

Specified by:
subjectToWearAndTear in interface Item
Returns:
whether this item has a valid condition

cloneFix

protected void cloneFix(Item E)

copyOf

public CMObject copyOf()
Description copied from interface: CMObject
Similar to Cloneable.clone(), but does its best to make sure that any internal objects to this class are also copyOfed.

Specified by:
copyOf in interface CMObject
Returns:
a clone of this object

riding

public Rideable riding()
Description copied from interface: Rider
Returns the Rideable upon which this Rider is Riding.

Specified by:
riding in interface Rider
Returns:
the Rideable upon which this Rider is Riding.
See Also:
Rideable

setRiding

public void setRiding(Rideable ride)
Description copied from interface: Rider
Sets the Rideable upon which this Rider is Riding.

Specified by:
setRiding in interface Rider
Parameters:
ride - the Rideable to ride upon
See Also:
Rideable

owner

public Environmental owner()
Description copied from interface: Item
The Room or MOB representing where this item is located. Containers are handled by another pointer, container(), so those two methods be used together to determine where a given item is.

Specified by:
owner in interface Item
Returns:
the mob or room where the item is located
See Also:
MOB, Item

setOwner

public void setOwner(Environmental E)
Description copied from interface: Item
Sets the Room or MOB representing where this item is located. Containers are handled by another pointer, container(), so those two methods be used together to determine where a given item is. This method is called by the addInventory method on mobs and the addItem interface on Rooms. Alone, this method is insufficient to properly determine an items location, so one of the two above should be called instead.

Specified by:
setOwner in interface Item
Parameters:
E - the mob or room where the item is located
See Also:
MOB.addInventory(Item), Room.addItem(Item)

expirationDate

public long expirationDate()
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
expirationDate in interface Environmental
Returns:
the time stamp when this thing expires
See Also:
Environmental.setExpirationDate(long)

setDatabaseID

public void setDatabaseID(java.lang.String id)
Description copied from interface: Item
Sets the internal database id for mapping back to tables. Used principally by code that needs to do an UPDATE on a particular mob, so it can be traced back to its row in the appropriate table.

Specified by:
setDatabaseID in interface Item
Parameters:
id - the database id
See Also:
MOB.databaseID()

databaseID

public java.lang.String databaseID()
Description copied from interface: Item
Gets the internal database id for mapping back to tables. Used principally by code that needs to do an UPDATE on a particular mob, so it can be traced back to its row in the appropriate table.

Specified by:
databaseID in interface Item
Returns:
the database id
See Also:
MOB.setDatabaseID(String)

setExpirationDate

public void setExpirationDate(long time)
Description copied from interface: Environmental
If this object expires, it should have a timestamp saying when it expires, in real time. When it expires, a MSG_EXPIRE message will be sent to it.

Specified by:
setExpirationDate in interface Environmental
Parameters:
time - the time stamp when this thing expires
See Also:
Environmental.expirationDate()

amDestroyed

public boolean amDestroyed()
Description copied from interface: Environmental
Whether the destroy() method has been previousy called on this object.

Specified by:
amDestroyed in interface Environmental
Returns:
whether the object is destroy()ed.

amWearingAt

public boolean amWearingAt(long wornCode)
Description copied from interface: Item
Can test where, if anywhere, an item is being worn. The value may be 0 to see if the item is not being worn (since 0 means inventory) or a combination of 1 or more of the worn codes listed in the Item interface.

Specified by:
amWearingAt in interface Item
Parameters:
wornCode - either 0, or one or more worn codes
Returns:
whether this item is being worn on the wornCode location
See Also:
Item

fitsOn

public boolean fitsOn(long wornCode)
Description copied from interface: Item
Whether this item is designated as being wearable on the given worn codes defined in the Item interface. This method does not care about the practicality of wearing for a given mob (in other words, whether an item is already being worn on the location is not checked).

Specified by:
fitsOn in interface Item
Parameters:
wornCode - the worn code to check, as defined in the Item interface
Returns:
whether this item is allowed to be worn on that location
See Also:
Item

wearEvenIfImpossible

public void wearEvenIfImpossible(MOB mob)
Description copied from interface: Item
Puts this item into a state of being worn regardless of whether it is practical for the given mob to wear it -- for instance, even if an item is already being worn where this item wants to be worn, or if the player has no such limbs to wear this item. None of that matter to this method. The item must be in the mobs inventory first.

Specified by:
wearEvenIfImpossible in interface Item
Parameters:
mob - the player or mob

wearIfPossible

public void wearIfPossible(MOB mob)
Description copied from interface: Item
Using the canWear method, this method will put the item into a state of being worn only if it is practical for the given mob or player to wear this Item. The mob or player must have the item in his or her inventory first.

Specified by:
wearIfPossible in interface Item
Parameters:
mob - the player or mob to put this item on.

wearAt

public void wearAt(long wornCode)
Description copied from interface: Item
This method is similar to the wearEvenIfImpossible method method above, except that it does not inspect this item for allowed wearable locations, but always puts the item on the wear location represented by the given wornCode bitmap. This bitmap is made up of constants from the Item interface.

Specified by:
wearAt in interface Item
Parameters:
wornCode - the bitmap from Item interface constants used
See Also:
Item, Item.wearEvenIfImpossible(MOB)

rawProperLocationBitmap

public long rawProperLocationBitmap()
Description copied from interface: Item
Returns the builder-defined bitmap made from a logical combination of the worn location constants from the Item interface. When combined with the rawLogicalAnd() method, it says whether this item is wearable on all of the locations defined by this bitmap at the same time or whether this item is wearable on any of the locations defined by this bitmap.

Specified by:
rawProperLocationBitmap in interface Item
Returns:
the worn location bitmap defined by the Item interface.
See Also:
Item

rawLogicalAnd

public boolean r