public class WrappedWatchableObject extends AbstractWrapper
Modifier and Type | Field and Description |
---|---|
protected StructureModifier<java.lang.Object> |
modifier |
handle, handleType
Constructor and Description |
---|
WrappedWatchableObject(int index,
java.lang.Object value)
Construct a watchable object from an index and a given value.
|
WrappedWatchableObject(java.lang.Object handle)
Wrap a given raw Minecraft watchable object.
|
Modifier and Type | Method and Description |
---|---|
WrappedWatchableObject |
deepClone()
Clone the current wrapped watchable object, along with any contained objects.
|
boolean |
equals(java.lang.Object obj) |
boolean |
getDirtyState()
Retrieve whether or not the value must be synchronized with the client.
|
int |
getIndex()
Retrieve the index of this watchable object.
|
java.lang.Class<?> |
getType()
Retrieve the correct super type of the current value.
|
int |
getTypeID()
Retrieve the type ID of a watchable object.
|
java.lang.Object |
getValue()
Read the value field.
|
int |
hashCode() |
void |
setDirtyState(boolean dirty)
Set whether or not the value must be synchronized with the client.
|
void |
setIndex(int index)
Set the the index of this watchable object.
|
void |
setTypeID(int id)
Set the type ID of a watchable object.
|
void |
setValue(java.lang.Object newValue)
Update the value field.
|
void |
setValue(java.lang.Object newValue,
boolean updateClient)
Update the value field.
|
java.lang.String |
toString() |
getHandle, getHandleType, setHandle
protected StructureModifier<java.lang.Object> modifier
public WrappedWatchableObject(java.lang.Object handle)
handle
- - the raw watchable object to wrap.public WrappedWatchableObject(int index, java.lang.Object value)
index
- - the index.value
- - non-null value of specific types.public java.lang.Class<?> getType() throws FieldAccessException
FieldAccessException
- Unable to read values.public int getIndex() throws FieldAccessException
FieldAccessException
- Reflection failed.public void setIndex(int index) throws FieldAccessException
index
- - the new object index.FieldAccessException
- Reflection failed.public int getTypeID() throws FieldAccessException
Type ID | Data Type |
---|---|
0 | Byte |
1 | Short |
2 | Int |
3 | Float |
4 | String |
5 | ItemStack |
6* | ChunkPosition |
FieldAccessException
- Reflection failed.public void setTypeID(int id) throws FieldAccessException
id
- - the new ID.FieldAccessException
- Reflection failed.#getTypeID()} for more information.
public void setValue(java.lang.Object newValue) throws FieldAccessException
newValue
- - new value.FieldAccessException
- Unable to use reflection.public void setValue(java.lang.Object newValue, boolean updateClient) throws FieldAccessException
newValue
- - new value.updateClient
- - whether or not to update listening clients.FieldAccessException
- Unable to use reflection.public java.lang.Object getValue() throws FieldAccessException
FieldAccessException
- Unable to use reflection.public void setDirtyState(boolean dirty) throws FieldAccessException
dirty
- - TRUE if the value should be synchronized, FALSE otherwise.FieldAccessException
- Unable to use reflection.public boolean getDirtyState() throws FieldAccessException
FieldAccessException
- Unable to use reflection.public WrappedWatchableObject deepClone() throws FieldAccessException
FieldAccessException
- If we're unable to use reflection.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object