/** * Sets the value of this item. * @param value New value * @param updateClient Whether or not to update the client */ public void setValue(Object value, boolean updateClient) { if (VALUE_INDEX == null) { VALUE_INDEX = MinecraftReflection.watcherObjectExists() ? 1 : 2; } modifier.write(VALUE_INDEX, getUnwrapped(value)); if (updateClient) { setDirtyState(true); } }
Optional<?> optional = (Optional<?>) wrapped; if (optional.isPresent()) { return Optional.of(getUnwrapped(optional.get())); } else { return Optional.absent();
value = WrappedWatchableObject.getUnwrapped(value);