Skip to content

Commit 013d922

Browse files
committed
add API to register DataTranslator
fixes #2434
1 parent acc155c commit 013d922

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/main/java/org/spongepowered/api/data/DataManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,15 @@ public interface DataManager {
158158
*/
159159
<T> Optional<DataTranslator<T>> translator(Class<T> objectClass);
160160

161+
/**
162+
* Registers a {@link DataTranslator} for the desired class.
163+
*
164+
* @param objectClass The class of the object type being managed
165+
* @param translator The translator for the desired class object
166+
* @param <T> The type of object
167+
*/
168+
<T> void registerTranslator(Class<T> objectClass, DataTranslator<T> translator);
169+
161170
/**
162171
* Creates a new {@link DataContainer} with a default
163172
* {@link org.spongepowered.api.data.persistence.DataView.SafetyMode} of

0 commit comments

Comments
 (0)