Interface EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>>
-
- All Superinterfaces:
BlockVolume
,BlockVolume.Modifiable<M>
,BlockVolume.Streamable<M>
,EntityVolume
,EntityVolume.Streamable<M>
,MutableVolume
,Volume
- All Known Subinterfaces:
ClientWorld
,EntityVolume.Mutable
,GenerationRegion
,ServerWorld
,World<W,L>
,WorldChunk
,WorldLike<P>
- Enclosing interface:
- EntityVolume
public static interface EntityVolume.Modifiable<M extends EntityVolume.Modifiable<M>> extends EntityVolume.Streamable<M>, MutableVolume, BlockVolume.Modifiable<M>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.spongepowered.api.world.volume.block.BlockVolume
BlockVolume.Immutable, BlockVolume.Modifiable<M extends BlockVolume.Modifiable<M>>, BlockVolume.Mutable, BlockVolume.Streamable<B extends BlockVolume.Streamable<B>>, BlockVolume.Unmodifiable<U extends BlockVolume.Unmodifiable<U>>
-
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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <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.Optional<Entity>
createEntity(DataContainer entityContainer)
Create an entity instance at the given position.Optional<Entity>
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.Collection<Entity>
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.block.BlockVolume
block, block, fluid, fluid, highestPositionAt, highestYAt, highestYAt
-
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume.Modifiable
removeBlock, removeBlock, setBlock, setBlock
-
Methods inherited from interface org.spongepowered.api.world.volume.block.BlockVolume.Streamable
blockStateStream
-
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 Detail
-
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
Optional<Entity> createEntity(DataContainer entityContainer)
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
Optional<Entity> createEntity(DataContainer entityContainer, Vector3d position)
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
boolean spawnEntity(Entity entity)
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
Collection<Entity> spawnEntities(Iterable<? extends Entity> entities)
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
-
-