/** * Alias for {@link #setObject(int, WrappedWatchableObject, boolean)} */ public void setObject(int index, WrappedWatchableObject value) { setObject(index, value.getRawValue(), false); }
/** * Gets the wrapped value of this data watcher item. * @return The wrapped value */ public Object getValue() { return getWrapped(getRawValue()); }
/** * Sets the DataWatcher Item at a given index to a new value. * * @param index Index of the object to set * @param value New value * @param update Whether or not to inform the client * * @see {@link #setObject(int, Object, boolean)} */ public void setObject(int index, WrappedWatchableObject value, boolean update) { setObject(index, value.getRawValue(), update); }
/** * Sets the DataWatcher Item associated with a given watcher object to a new value. * * @param object Associated watcher object * @param value Wrapped value * @param update Whether or not to inform the client * * @see #setObject(WrappedDataWatcherObject, Object) */ public void setObject(WrappedDataWatcherObject object, WrappedWatchableObject value, boolean update) { setObject(object, value.getRawValue(), update); }
/** * Shortcut for {@link #setObject(WrappedDataWatcherObject, WrappedWatchableObject, boolean)} */ public void setObject(WrappedDataWatcherObject object, WrappedWatchableObject value) { setObject(object, value.getRawValue(), false); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + getIndex(); result = prime * result + getRawValue().hashCode(); result = prime * result + (getDirtyState() ? 1231 : 1237); return result; }
@Override public boolean equals(Object obj) { if (obj == this) return true; if (obj instanceof WrappedWatchableObject) { WrappedWatchableObject that = (WrappedWatchableObject) obj; return this.getIndex() == that.getIndex() && this.getRawValue().equals(that.getRawValue()) && this.getDirtyState() == that.getDirtyState(); } return false; }
getLogger().severe("Value: " + watch.getRawValue() + " (" + watch.getRawValue().getClass() + ") (" + nmsEntity.getClass() + ") & " + watcherClass.getSimpleName()); continue; getLogger().severe("Minecraft: " + watch.getRawValue() + " (" + watch.getRawValue().getClass() + ")"); getLogger().severe("Minecraft Converted: " + nmsValue + " (" + nmsValue.getClass() + ")");
return getWrapped(new WrappedWatchableObject(value).getRawValue());