Interface EntityStorage<T extends net.minecraft.world.entity.Entity>
- All Superinterfaces:
Iterable<StoredEntity<T>>
- All Known Implementing Classes:
MapBasedEntityStorage
,NBTEntityStorage
public interface EntityStorage<T extends net.minecraft.world.entity.Entity>
extends Iterable<StoredEntity<T>>
This is used for storing important data about NPCs that exist
in the world and were placed by an admin.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an entity to be tracked and storedFinds the entity storage for the given UUIDgetAll()
Gets all the entities that are being trackedvoid
load()
Loads the entities from the storagevoid
Removes an entity from being tracked and storedvoid
save()
Saves the entities to the storageMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
add
Adds an entity to be tracked and stored- Parameters:
entity
- The entity to add
-
remove
Removes an entity from being tracked and stored- Parameters:
entity
- The entity to remove
-
find
Finds the entity storage for the given UUID- Parameters:
uuid
- The UUID of the entity- Returns:
- The entity storage
-
getAll
List<StoredEntity<T>> getAll()Gets all the entities that are being tracked- Returns:
- The entities
-
load
void load()Loads the entities from the storage -
save
void save()Saves the entities to the storage
-