public class MetadataMap extends Object implements DynamicallyTypedMapWithFloats<MetadataIndex>
Modifier and Type | Class and Description |
---|---|
static class |
MetadataMap.Entry |
Constructor and Description |
---|
MetadataMap(Class<? extends org.bukkit.entity.Entity> entityClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(MetadataIndex index) |
Object |
get(MetadataIndex index) |
boolean |
getBit(MetadataIndex index,
int bit)
Tests for the given bit mask in a bit field.
|
boolean |
getBoolean(MetadataIndex index)
Retrieves an entry as a
boolean . |
byte |
getByte(MetadataIndex index) |
List<MetadataMap.Entry> |
getChanges() |
List<MetadataMap.Entry> |
getEntryList()
Returns a list containing copies of all the entries.
|
float |
getFloat(MetadataIndex index)
Retrieves an entry as a
float . |
int |
getInt(MetadataIndex index)
Retrieves an entry as an
int . |
org.bukkit.inventory.ItemStack |
getItem(MetadataIndex index) |
Number |
getNumber(MetadataIndex index)
Returns the numeric value of a metadata field.
|
org.bukkit.util.BlockVector |
getOptPosition(MetadataIndex index)
Gets the optional position value for the given MetadataIndex.
|
String |
getString(MetadataIndex index)
Retrieves an entry as a
String . |
void |
resetChanges() |
void |
set(MetadataIndex index,
Object value)
Sets the value of a metadata field.
|
void |
set(MetadataIndex index,
Object value,
boolean force)
Sets the value of a metadata field.
|
void |
setBit(MetadataIndex index,
int bit,
boolean status)
Sets or clears bits in a bit field.
|
String |
toString() |
public MetadataMap(Class<? extends org.bukkit.entity.Entity> entityClass)
public boolean containsKey(MetadataIndex index)
public void set(MetadataIndex index, Object value)
index
- the field to setvalue
- the new valuepublic void set(MetadataIndex index, Object value, boolean force)
index
- the field to setvalue
- the new valueforce
- if the value should be forced as a change regardless of equalitypublic Object get(MetadataIndex index)
public boolean getBit(MetadataIndex index, int bit)
index
- the field to testbit
- a mask of the bits to testpublic void setBit(MetadataIndex index, int bit, boolean status)
index
- the field to updatebit
- a mask of the bits to set or clearstatus
- true to set; false to clearpublic Number getNumber(MetadataIndex index)
index
- the field to look upIllegalArgumentException
- if the value doesn't exist or isn't numericpublic boolean getBoolean(MetadataIndex index)
DynamicallyTypedMap
boolean
.getBoolean
in interface DynamicallyTypedMap<MetadataIndex>
index
- the key to look uppublic byte getByte(MetadataIndex index)
public int getInt(MetadataIndex index)
DynamicallyTypedMap
int
.getInt
in interface DynamicallyTypedMap<MetadataIndex>
index
- the key to look uppublic float getFloat(MetadataIndex index)
DynamicallyTypedMapWithFloats
float
.getFloat
in interface DynamicallyTypedMapWithFloats<MetadataIndex>
index
- the key to look upfloat
public String getString(MetadataIndex index)
DynamicallyTypedMap
String
.getString
in interface DynamicallyTypedMap<MetadataIndex>
index
- the key to look uppublic org.bukkit.inventory.ItemStack getItem(MetadataIndex index)
public org.bukkit.util.BlockVector getOptPosition(MetadataIndex index)
index
- the MetadataIndex of the optional positionpublic List<MetadataMap.Entry> getEntryList()
public List<MetadataMap.Entry> getChanges()
public void resetChanges()
Copyright © 2021. All rights reserved.