/** * Sets the DataWatcher Item at a given index to a new value. In 1.9 and up, * you cannot register objects without a watcher object. * * @param index Index of the object to set * @param value New value * @param update Whether or not to inform the client * * @see {@link #setObject(WrappedDataWatcherObject, Object, boolean)} * @throws IllegalArgumentException in 1.9 and up if there isn't already an * object at this index */ public void setObject(int index, Object value, boolean update) { if (MinecraftReflection.watcherObjectExists() && !hasIndex(index)) { throw new IllegalArgumentException("You cannot register objects without a watcher object!"); } setObject(WrappedDataWatcherObject.fromIndex(index), value, update); }
if (hasIndex(object.getIndex())) { SETTER.invoke(handle, object.getHandle(), value); } else {