-
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
Signed-off-by: Gabriel Harris-Rouquette <gabizou@me.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,13 +239,13 @@ public DataView set(DataQuery path, Object value) { | |
if (value instanceof DataView) { | ||
checkArgument(value != this, "Cannot set a DataView to itself."); | ||
copyDataView(path, (DataView) value); | ||
} else if (value instanceof CatalogType) { | ||
return set(path, ((CatalogType) value).getId()); | ||
} else if (value instanceof DataSerializable) { | ||
}else if (value instanceof DataSerializable) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
ST-DDT
Member
|
||
DataContainer valueContainer = ((DataSerializable) value).toContainer(); | ||
checkArgument(!(valueContainer).equals(this), "Cannot insert self-referencing DataSerializable"); | ||
copyDataView(path, valueContainer); | ||
} else { | ||
} else if (value instanceof CatalogType) { | ||
return set(path, ((CatalogType) value).getId()); | ||
} else { | ||
List<String> parts = path.getParts(); | ||
if (parts.size() > 1) { | ||
String subKey = parts.get(0); | ||
|
@@ -791,7 +791,10 @@ public <T extends DataSerializable> Optional<T> getSerializable(DataQuery path, | |
checkNotNull(clazz, "clazz"); | ||
DataManager manager = Sponge.getDataManager(); | ||
if (clazz.isAssignableFrom(CatalogType.class)) { | ||
return (Optional<T>) getCatalogType(path, ((Class<? extends CatalogType>) clazz)); | ||
final Optional<T> catalog = (Optional<T>) getCatalogType(path, ((Class<? extends CatalogType>) clazz)); | ||
if (catalog.isPresent()) { | ||
return catalog; | ||
} | ||
} | ||
Optional<DataView> optional = getUnsafeView(path); | ||
|
||
|
spacing
Note: Posted at #1000 (comment)