Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
StoredEntityData#remove
Dieser Commit ist enthalten in:
Ursprung
d36d5d6def
Commit
8df48bc378
@ -51,6 +51,15 @@ public interface StoredEntityData {
|
||||
*/
|
||||
@Nullable <T> T get(Class<T> objectClass);
|
||||
|
||||
/**
|
||||
* Removes and returns an object from the storage if present.
|
||||
*
|
||||
* @param objectClass class of the object to remove
|
||||
* @param <T> object type
|
||||
* @return removed object if present
|
||||
*/
|
||||
@Nullable <T> T remove(Class<T> objectClass);
|
||||
|
||||
/**
|
||||
* Stores an object based on its class.
|
||||
*
|
||||
|
@ -42,6 +42,11 @@ public final class StoredEntityImpl implements StoredEntityData {
|
||||
return (T) storedObjects.get(objectClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> @Nullable T remove(Class<T> objectClass) {
|
||||
return (T) storedObjects.remove(objectClass);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean has(Class<?> objectClass) {
|
||||
return storedObjects.containsKey(objectClass);
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren