src/main/java/me/neznamy/tab/platforms/bukkit/nms/datawatcher/DataWatcher.java
@SuppressWarnings("unchecked")
	public static DataWatcher fromNMS(Object nmsWatcher) throws Exception{
		DataWatcher watcher = new DataWatcher();
		List<Object> items = (List<Object>) nmsWatcher.getClass().getMethod("c").invoke(nmsWatcher);
		if (items != null) {
			for (Object watchableObject : items) {
				DataWatcherItem w = DataWatcherItem.fromNMS(watchableObject);
				watcher.setValue(w.type, w.value);
			}
		}
		return watcher;
	}
/**
	 * Reads NMS data watcher and returns and instance of this class with same data
	 * @param nmsWatcher - NMS datawatcher to read
	 * @return an instance of this class with same values
	 * @throws Exception - if something fails
	 */
Reads NMS data watcher and returns and instance of this class with same data
@param nmsWatcher - NMS datawatcher to read
@return an instance of this class with same values
@throws Exception - if something fails
Reads NMS data watcher and returns and instance of this class with same data @param nmsWatcher - NMS datawatcher to read @return an instance of this class with same values @throws Exception - if something fails
@SuppressWarnings("unchecked")
	public static DataWatcher fromNMS(Object nmsWatcher) throws Exception{
		DataWatcher watcher = new DataWatcher();
		List<Object> items = (List<Object>) nmsWatcher.getClass().getMethod("c").invoke(nmsWatcher);
		if (items != null) {
			for (Object watchableObject : items) {
				DataWatcherItem w = DataWatcherItem.fromNMS(watchableObject);
				watcher.setValue(w.type, w.value);
			}
		}
		return watcher;
	}
@ SuppressWarnings ( "unchecked" ) public static DataWatcher fromNMS ( Object nmsWatcher ) throws Exception { DataWatcher watcher = new DataWatcher ( ) ; List < Object > items = ( List < Object > ) nmsWatcher . getClass ( ) . getMethod ( "c" ) . invoke ( nmsWatcher ) ; if ( items != null ) { for ( Object watchableObject : items ) { DataWatcherItem w = DataWatcherItem . fromNMS ( watchableObject ) ; watcher . setValue ( w . type , w . value ) ; } } return watcher ; }
Reads NMS data watcher and returns and instance of this class with same data
 @param nmsWatcher - NMS datawatcher to read
 @return an instance of this class with same values
 @throws Exception - if something fails
Reads NMS data watcher and returns and instance of this class with same data @param nmsWatcher - NMS datawatcher to read @return an instance of this class with same values @throws Exception - if something fails