Interface EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>
- All Superinterfaces:
EntityVolume
,EntityVolume.Streamable<M>
,MutableVolume
,Volume
- All Known Subinterfaces:
ClientWorld
,EntityChunk
,EntityVolume.Mutable
,GenerationRegion
,ServerWorld
,World<W,
,L> WorldChunk
,WorldLike<P>
- Enclosing interface:
EntityVolume
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume
EntityVolume.EntityVolumeFactory, EntityVolume.Immutable, EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>, EntityVolume.Mutable, EntityVolume.Streamable<E extends EntityVolume.Streamable<E>>, EntityVolume.Unmodifiable<U extends EntityVolume.Unmodifiable<U>>
-
Method Summary
Modifier and TypeMethodDescriptiondefault <E extends Entity>
EcreateEntity
(Supplier<EntityType<E>> type, Vector3d position) Create an entity instance at the given position.default <E extends Entity>
EcreateEntity
(Supplier<EntityType<E>> type, Vector3i position) Create an entity instance at the given position.createEntity
(DataContainer entityContainer) Create an entity instance at the given position.createEntity
(DataContainer entityContainer, Vector3d position) Create an entity instance at the given position.<E extends Entity>
EcreateEntity
(EntityType<E> type, Vector3d position) Create an entity instance at the given position.default <E extends Entity>
EcreateEntity
(EntityType<E> type, Vector3i position) Create an entity instance at the given position.default <E extends Entity>
EcreateEntityNaturally
(Supplier<EntityType<E>> type, Vector3d position) Create an entity instance at the given position with the default equipment.default <E extends Entity>
EcreateEntityNaturally
(Supplier<EntityType<E>> type, Vector3i position) Create an entity instance at the given position with the default equipment.<E extends Entity>
EcreateEntityNaturally
(EntityType<E> type, Vector3d position) Create an entity instance at the given position with the default equipment.default <E extends Entity>
EcreateEntityNaturally
(EntityType<E> type, Vector3i position) Create an entity instance at the given position with the default equipment.spawnEntities
(Iterable<? extends Entity> entities) Similar tospawnEntity(Entity)
except where multiple entities can be attempted to be spawned.boolean
spawnEntity
(Entity entity) Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume
entities, entities, entities, entities, entities, entity, nearbyEntities, nearestPlayer, players
Methods inherited from interface org.spongepowered.api.world.volume.entity.EntityVolume.Streamable
entityStream
-
Method Details
-
createEntity
<E extends Entity> E createEntity(EntityType<E> type, Vector3d position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The typeposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntity
default <E extends Entity> E createEntity(Supplier<EntityType<E>> type, Vector3d position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The type supplierposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntity
default <E extends Entity> E createEntity(EntityType<E> type, Vector3i position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The typeposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntity
default <E extends Entity> E createEntity(Supplier<EntityType<E>> type, Vector3i position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The type supplierposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntityNaturally
<E extends Entity> E createEntityNaturally(EntityType<E> type, Vector3d position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position with the default equipment.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The typeposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntityNaturally
default <E extends Entity> E createEntityNaturally(Supplier<EntityType<E>> type, Vector3d position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position with the default equipment.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The type supplierposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntityNaturally
default <E extends Entity> E createEntityNaturally(EntityType<E> type, Vector3i position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position with the default equipment.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The typeposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntityNaturally
default <E extends Entity> E createEntityNaturally(Supplier<EntityType<E>> type, Vector3i position) throws IllegalArgumentException, IllegalStateException Create an entity instance at the given position with the default equipment.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
type
- The type supplierposition
- The position- Returns:
- An entity, if one was created
- Throws:
IllegalArgumentException
- If the position or entity type is not valid to createIllegalStateException
- If a constructor cannot be found
-
createEntity
Create an entity instance at the given position.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
entityContainer
- The data container of the entity- Returns:
- An entity, if one was created
-
createEntity
Create an entity instance at the given position.Creating an entity does not spawn the entity into the world. An entity created means the entity can be spawned at the given location. If
Optional.empty()
was returned, the entity is not able to spawn at the given location. Furthermore, this allows for theEntity
to be customized further prior to traditional "ticking" and processing by core systems.- Parameters:
entityContainer
- The data container of the entityposition
- The position of the entity to spawn at- Returns:
- An entity, if one was created
-
spawnEntity
Spawns anEntity
using the already set properties (extent, position, rotation) and applicableValue
s for spawning the entity.The requirements involve that all necessary setup of states and data is already preformed on the entity retrieved from the various
createEntity(EntityType,Vector3d)
methods. Calling this will make the now-spawned entity able to be processed by various systems.If the entity was unable to spawn, the entity is not removed, but it should be taken note that there can be many reasons for a failure.
- Parameters:
entity
- The entity to spawn- Returns:
- True if successful, false if not
-
spawnEntities
Similar tospawnEntity(Entity)
except where multiple entities can be attempted to be spawned.- Parameters:
entities
- The created entities you wish to spawn- Returns:
- The entities which spawned correctly, or empty if none
-