Class DataWatcher
java.lang.Object
me.neznamy.tab.platforms.bukkit.nms.datawatcher.DataWatcher
A class representing the n.m.s.DataWatcher class to make work with it much easier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DataWatcherReads NMS data watcher and returns and instance of this class with same datagetItem(int position) Returns item with given positionhelper()Returns helper created by this instancevoidremoveValue(int position) Removes value by positionvoidsetValue(DataWatcherObject type, Object value) Sets value into data valuestoNMS()Converts the class into an instance of NMS.DataWatcher
-
Constructor Details
-
DataWatcher
public DataWatcher()
-
-
Method Details
-
setValue
Sets value into data values- Parameters:
type- type of valuevalue- value
-
removeValue
public void removeValue(int position) Removes value by position- Parameters:
position- position of value to remove
-
getItem
Returns item with given position- Parameters:
position- position of item- Returns:
- item or null if not set
-
helper
Returns helper created by this instance- Returns:
- data write helper
-
toNMS
Converts the class into an instance of NMS.DataWatcher- Returns:
- an instance of NMS.DataWatcher with same data
- Throws:
ReflectiveOperationException- if thrown by reflective operation
-
fromNMS
Reads NMS data watcher and returns and instance of this class with same data- Parameters:
nmsWatcher- NMS DataWatcher to read- Returns:
- an instance of this class with same values
- Throws:
ReflectiveOperationException- if thrown by reflective operation
-