Class Instance
- All Implemented Interfaces:
DataContainer
,EventHandler
,BlockModifier
- Direct Known Subclasses:
InstanceContainer
,SharedInstance
public abstract class Instance extends java.lang.Object implements BlockModifier, EventHandler, DataContainer
Entity.setInstance(Instance)
.
An instance has entities and chunks, each instance contains its own entity list but the
chunk implementation has to be defined, see InstanceContainer
.
WARNING: when making your own implementation registering the instance manually is required
with InstanceManager.registerInstance(Instance)
, and
you need to be sure to signal the UpdateManager
of the changes using
UpdateManager.signalChunkLoad(Instance, int, int)
and UpdateManager.signalChunkUnload(Instance, int, int)
.
-
Field Summary
Fields Modifier and Type Field Description protected static BlockManager
BLOCK_MANAGER
protected java.util.Map<java.lang.Long,java.util.Set<Entity>>
chunkEntities
protected java.util.Set<EntityCreature>
creatures
protected java.util.Set<Entity>
entities
protected java.util.Set<ExperienceOrb>
experienceOrbs
protected java.util.concurrent.ConcurrentLinkedQueue<java.util.function.Consumer<Instance>>
nextTick
protected java.util.Set<ObjectEntity>
objectEntities
protected java.util.Set<Player>
players
protected java.util.UUID
uniqueId
protected static UpdateManager
UPDATE_MANAGER
-
Constructor Summary
Constructors Constructor Description Instance(java.util.UUID uniqueId, DimensionType dimensionType)
Creates a new instance. -
Method Summary
Modifier and Type Method Description void
addEntityToChunk(Entity entity, Chunk chunk)
Adds the specifiedEntity
to the instance entities cache.abstract boolean
breakBlock(Player player, BlockPosition blockPosition)
Does callPlayerBlockBreakEvent
and send particle packetsabstract BlockBatch
createBlockBatch()
Creates a newBlockBatch
linked to this instance.protected abstract void
createChunk(int chunkX, int chunkZ, ChunkCallback callback)
Called to generated a newChunk
from scratch.abstract ChunkBatch
createChunkBatch(Chunk chunk)
Creates a newChunk
batch linked to this instance and the specified chunk.abstract void
enableAutoChunkLoad(boolean enable)
When set to true, chunks will load automatically when requested.void
explode(float centerX, float centerY, float centerZ, float strength)
Creates an explosion at the given position with the given strength.void
explode(float centerX, float centerY, float centerZ, float strength, Data additionalData)
Creates an explosion at the given position with the given strength.Data
getBlockData(int x, int y, int z)
Gets the block data at the given position.Data
getBlockData(BlockPosition blockPosition)
Gets the blockData
at the givenBlockPosition
.short
getBlockStateId(float x, float y, float z)
Gives the block state id at the given position.short
getBlockStateId(int x, int y, int z)
Gives the block state id at the given position.short
getBlockStateId(BlockPosition blockPosition)
Gives the block state id at the givenBlockPosition
.abstract Chunk
getChunk(int chunkX, int chunkZ)
Gets the loadedChunk
at a position.Chunk
getChunkAt(float x, float z)
Gets theChunk
at the givenBlockPosition
, null if not loaded.Chunk
getChunkAt(BlockPosition blockPosition)
Gets theChunk
at the givenBlockPosition
, null if not loaded.Chunk
getChunkAt(Position position)
java.util.Set<Entity>
getChunkEntities(Chunk chunk)
Gets the entities located in the chunk.abstract ChunkGenerator
getChunkGenerator()
Gets the instanceChunkGenerator
.abstract java.util.Collection<Chunk>
getChunks()
Gets all the instance's chunks.java.util.Set<EntityCreature>
getCreatures()
Gets the creatures in the instance;CustomBlock
getCustomBlock(int x, int y, int z)
Gets the custom block object at the given position.CustomBlock
getCustomBlock(BlockPosition blockPosition)
Gets the custom block object at the givenBlockPosition
.Data
getData()
Gets theData
of this container.DimensionType
getDimensionType()
Gets the instanceDimensionType
.java.util.Set<Entity>
getEntities()
Gets the entities in the instance;java.util.Map<java.lang.Class<? extends Event>,java.util.Collection<EventCallback>>
getEventCallbacksMap()
Gets aMap
containing all the listeners assigned to a specificEvent
type.java.util.Set<ExperienceOrb>
getExperienceOrbs()
Gets the experience orbs in the instance.ExplosionSupplier
getExplosionSupplier()
Gets the registeredExplosionSupplier
, or null if none was provided.PFInstanceSpace
getInstanceSpace()
Gets the instance space.java.util.Set<ObjectEntity>
getObjectEntities()
Gets the object entities in the instance;java.util.Set<Player>
getPlayers()
Gets the players in the instance;abstract StorageLocation
getStorageLocation()
Gets the instanceStorageLocation
.long
getTime()
Gets the current time in the instance (sun/moon).int
getTimeRate()
Gets the rate of the time passing, it is 1 by defaultUpdateOption
getTimeUpdate()
Gets the rate at which the client is updated with the current instance timejava.util.UUID
getUniqueId()
Gets the instance unique id.long
getWorldAge()
Gets the age of this instance in tick.WorldBorder
getWorldBorder()
Gets the instanceWorldBorder
;abstract boolean
hasEnabledAutoChunkLoad()
Gets if the instance should auto load chunks.boolean
isChunkLoaded(int chunkX, int chunkZ)
Checks if theChunk
at the position is loaded.abstract boolean
isInVoid(Position position)
Determines whether a position in the void.boolean
isRegistered()
Gets if the instance has been registered inInstanceManager
.void
loadChunk(int chunkX, int chunkZ)
Loads theChunk
at the given position without any callback.abstract void
loadChunk(int chunkX, int chunkZ, ChunkCallback callback)
Forces the generation of aChunk
, even if no file andChunkGenerator
are defined.void
loadChunk(Position position, ChunkCallback callback)
Loads the chunk at the givenPosition
with a callback.abstract void
loadOptionalChunk(int chunkX, int chunkZ, ChunkCallback callback)
Loads the chunk if the chunk is already loaded or ifhasEnabledAutoChunkLoad()
returns true.void
loadOptionalChunk(Position position, ChunkCallback callback)
void
refreshBlockId(int x, int y, int z, Block block)
Refreshes the visual block id at the position.void
refreshBlockId(BlockPosition blockPosition, Block block)
Refreshes the visual block id at theBlockPosition
.void
refreshBlockStateId(int x, int y, int z, short blockStateId)
Refreshes the visual block id at the position.abstract void
refreshBlockStateId(BlockPosition blockPosition, short blockStateId)
Used to change the id of the block in a specificBlockPosition
.void
removeEntityFromChunk(Entity entity, Chunk chunk)
Removes the specifiedEntity
to the instance entities cache.protected abstract void
retrieveChunk(int chunkX, int chunkZ, ChunkCallback callback)
Used when aChunk
is not currently loaded in memory and need to be retrieved from somewhere else.void
saveChunksToStorage()
Saves allChunk
without any callback.abstract void
saveChunksToStorage(java.lang.Runnable callback)
Saves multiple chunks to permanent storage.void
saveChunkToStorage(Chunk chunk)
Saves aChunk
without any callback.abstract void
saveChunkToStorage(Chunk chunk, java.lang.Runnable callback)
Saves aChunk
to permanent storage.void
scheduleNextTick(java.util.function.Consumer<Instance> callback)
Schedules a task to be run during the next instance tick.abstract void
scheduleUpdate(int time, TimeUnit unit, BlockPosition position)
Schedules a block update at a givenBlockPosition
.void
sendBlockAction(BlockPosition blockPosition, byte actionId, byte actionParam)
Sends aBlockActionPacket
for all the viewers of the specific position.void
setBlockData(int x, int y, int z, Data data)
Sets the blockData
at the givenBlockPosition
.void
setBlockData(BlockPosition blockPosition, Data data)
Sets the blockData
at the givenBlockPosition
.abstract void
setChunkGenerator(ChunkGenerator chunkGenerator)
Changes the instanceChunkGenerator
.void
setData(Data data)
Sets theData
of this container.void
setExplosionSupplier(ExplosionSupplier supplier)
Registers theExplosionSupplier
to use in this instance.protected void
setRegistered(boolean registered)
Changes the registered field.abstract void
setStorageLocation(StorageLocation storageLocation)
Changes the instanceStorageLocation
.void
setTime(long time)
Changes the current time in the instance, from 0 to 24000.void
setTimeRate(int timeRate)
Changes the time rate of the instancevoid
setTimeUpdate(UpdateOption timeUpdate)
Changes the rate at which the client is updated about the timevoid
tick(long time)
Performs a single tick in the instance, including scheduled tasks fromscheduleNextTick(Consumer)
.void
unloadChunk(int chunkX, int chunkZ)
Unloads the chunk at the given position.abstract void
unloadChunk(Chunk chunk)
Schedules the removal of aChunk
, this method does not promise when it will be done.void
UNSAFE_addEntity(Entity entity)
Used when calledEntity.setInstance(Instance)
, it is used to refresh viewable chunks and add viewers ifentity
is aPlayer
.void
UNSAFE_removeEntity(Entity entity)
Used when anEntity
is removed from the instance, it removes all of his viewers.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minestom.server.instance.BlockModifier
setBlock, setBlock, setBlockStateId, setBlockStateId, setBlockStateId, setCustomBlock, setCustomBlock, setCustomBlock, setCustomBlock, setCustomBlock, setSeparateBlocks, setSeparateBlocks, setSeparateBlocks
Methods inherited from interface net.minestom.server.event.handler.EventHandler
addEventCallback, callCancellableEvent, callEvent, getEventCallbacks, getEventCallbacks, removeEventCallback
-
Field Details
-
BLOCK_MANAGER
-
UPDATE_MANAGER
-
entities
-
players
-
creatures
-
objectEntities
-
experienceOrbs
-
chunkEntities
-
uniqueId
protected java.util.UUID uniqueId -
nextTick
protected final java.util.concurrent.ConcurrentLinkedQueue<java.util.function.Consumer<Instance>> nextTick
-
-
Constructor Details
-
Instance
Creates a new instance.- Parameters:
uniqueId
- theUUID
of the instancedimensionType
- theDimensionType
of the instance
-
-
Method Details
-
scheduleNextTick
Schedules a task to be run during the next instance tick. It ensures that the task will be executed in the same thread as the instance and its chunks/entities (depending of theThreadProvider
).- Parameters:
callback
- the task to execute during the next instance tick
-
refreshBlockStateId
Used to change the id of the block in a specificBlockPosition
.In case of a
CustomBlock
it does not remove it but only refresh its visual.- Parameters:
blockPosition
- the block positionblockStateId
- the new block state
-
breakBlock
Does callPlayerBlockBreakEvent
and send particle packets- Parameters:
player
- thePlayer
who break the blockblockPosition
- theBlockPosition
of the broken block- Returns:
- true if the block has been broken, false if it has been cancelled
-
loadChunk
Forces the generation of aChunk
, even if no file andChunkGenerator
are defined.- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Zcallback
- optional consumer called after the chunk has been generated, the returned chunk will never be null
-
loadOptionalChunk
Loads the chunk if the chunk is already loaded or ifhasEnabledAutoChunkLoad()
returns true.- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Zcallback
- optional consumer called after the chunk has tried to be loaded, contains a chunk if it is successful, null otherwise
-
unloadChunk
Schedules the removal of aChunk
, this method does not promise when it will be done.WARNING: during unloading, all entities other than
Player
will be removed.For
InstanceContainer
it is done during the nextInstanceContainer.tick(long)
.- Parameters:
chunk
- the chunk to unload
-
getChunk
Gets the loadedChunk
at a position.WARNING: this should only return already-loaded chunk, use
loadChunk(int, int)
or similar to load one instead.- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Z- Returns:
- the chunk at the specified position, null if not loaded
-
saveChunkToStorage
public abstract void saveChunkToStorage(@NotNull Chunk chunk, @Nullable java.lang.Runnable callback)Saves aChunk
to permanent storage. -
saveChunksToStorage
public abstract void saveChunksToStorage(@Nullable java.lang.Runnable callback)Saves multiple chunks to permanent storage.- Parameters:
callback
- optional callback called when the chunks are done saving
-
createBlockBatch
Creates a newBlockBatch
linked to this instance.- Returns:
- a
BlockBatch
linked to the instance
-
createChunkBatch
Creates a newChunk
batch linked to this instance and the specified chunk.- Parameters:
chunk
- the chunk to modify- Returns:
- a ChunkBatch linked to
chunk
- Throws:
java.lang.NullPointerException
- ifchunk
is null
-
getChunkGenerator
Gets the instanceChunkGenerator
.- Returns:
- the
ChunkGenerator
of the instance
-
setChunkGenerator
Changes the instanceChunkGenerator
.- Parameters:
chunkGenerator
- the newChunkGenerator
of the instance
-
getChunks
Gets all the instance's chunks.- Returns:
- an unmodifiable containing all the loaded chunks of the instance
-
getStorageLocation
Gets the instanceStorageLocation
.- Returns:
- the
StorageLocation
of the instance
-
setStorageLocation
Changes the instanceStorageLocation
.- Parameters:
storageLocation
- the newStorageLocation
of the instance
-
retrieveChunk
Used when aChunk
is not currently loaded in memory and need to be retrieved from somewhere else. Could be read from disk, or generated from scratch.Be sure to signal the chunk using
UpdateManager.signalChunkLoad(Instance, int, int)
and to cache that this chunk has been loaded.WARNING: it has to retrieve a chunk, this is not optional and should execute the callback in all case.
- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Xcallback
- the optional callback executed once theChunk
has been retrieved
-
createChunk
Called to generated a newChunk
from scratch.Be sure to signal the chunk using
UpdateManager.signalChunkLoad(Instance, int, int)
and to cache that this chunk has been loaded.This is where you can put your chunk generation code.
- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Zcallback
- the optional callback executed with the newly createdChunk
-
enableAutoChunkLoad
public abstract void enableAutoChunkLoad(boolean enable)When set to true, chunks will load automatically when requested. Otherwise usingloadChunk(int, int)
will be required to even spawn a player- Parameters:
enable
- enable the auto chunk load
-
hasEnabledAutoChunkLoad
public abstract boolean hasEnabledAutoChunkLoad()Gets if the instance should auto load chunks.- Returns:
- true if auto chunk load is enabled, false otherwise
-
isInVoid
Determines whether a position in the void. If true, entities should take damage and die.Always returning false allow entities to survive in the void.
- Parameters:
position
- the position in the world- Returns:
- true iif position is inside the void
-
isRegistered
public boolean isRegistered()Gets if the instance has been registered inInstanceManager
.- Returns:
- true if the instance has been registered
-
setRegistered
protected void setRegistered(boolean registered)Changes the registered field.WARNING: should only be used by
InstanceManager
.- Parameters:
registered
- true to mark the instance as registered
-
getDimensionType
Gets the instanceDimensionType
.- Returns:
- the dimension of the instance
-
getWorldAge
public long getWorldAge()Gets the age of this instance in tick.- Returns:
- the age of this instance in tick
-
getTime
public long getTime()Gets the current time in the instance (sun/moon).- Returns:
- the time in the instance
-
setTime
public void setTime(long time)Changes the current time in the instance, from 0 to 24000.0 = sunrise 6000 = noon 12000 = sunset 18000 = midnight
This method is unaffected by
getTimeRate()
It does send the new time to all players in the instance, unaffected by
getTimeUpdate()
- Parameters:
time
- the new time of the instance
-
getTimeRate
public int getTimeRate()Gets the rate of the time passing, it is 1 by default- Returns:
- the time rate of the instance
-
setTimeRate
public void setTimeRate(int timeRate)Changes the time rate of the instance1 is the default value and can be set to 0 to be completely disabled (constant time)
- Parameters:
timeRate
- the new time rate of the instance- Throws:
java.lang.IllegalStateException
- iftimeRate
is lower than 0
-
getTimeUpdate
Gets the rate at which the client is updated with the current instance time- Returns:
- the client update rate for time related packet
-
setTimeUpdate
Changes the rate at which the client is updated about the timeSetting it to null means that the client will never know about time change (but will still change server-side)
- Parameters:
timeUpdate
- the new update rate concerning time
-
getWorldBorder
Gets the instanceWorldBorder
;- Returns:
- the
WorldBorder
linked to the instance
-
getEntities
Gets the entities in the instance;- Returns:
- an unmodifiable
Set
containing all the entities in the instance
-
getPlayers
Gets the players in the instance;- Returns:
- an unmodifiable
Set
containing all the players in the instance
-
getCreatures
Gets the creatures in the instance;- Returns:
- an unmodifiable
Set
containing all the creatures in the instance
-
getObjectEntities
Gets the object entities in the instance;- Returns:
- an unmodifiable
Set
containing all the object entities in the instance
-
getExperienceOrbs
Gets the experience orbs in the instance.- Returns:
- an unmodifiable
Set
containing all the experience orbs in the instance
-
getChunkEntities
Gets the entities located in the chunk.- Parameters:
chunk
- the chunk to get the entities from- Returns:
- an unmodifiable
Set
containing all the entities in a chunk, ifchunk
is unloaded, return an emptyHashSet
-
refreshBlockStateId
public void refreshBlockStateId(int x, int y, int z, short blockStateId)Refreshes the visual block id at the position.WARNING: the custom block id at the position will not change.
- Parameters:
x
- the X positiony
- the Y positionz
- the Z positionblockStateId
- the new block state id
-
refreshBlockId
Refreshes the visual block id at the position.WARNING: the custom block id at the position will not change.
- Parameters:
x
- the X positiony
- the Y positionz
- the Z positionblock
- the new visual block
-
refreshBlockId
Refreshes the visual block id at theBlockPosition
.WARNING: the custom block id at the position will not change.
- Parameters:
blockPosition
- the block positionblock
- the new visual block
-
loadChunk
public void loadChunk(int chunkX, int chunkZ)Loads theChunk
at the given position without any callback.WARNING: this is a non-blocking task.
- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Z
-
loadChunk
Loads the chunk at the givenPosition
with a callback.- Parameters:
position
- the chunk positioncallback
- the optional callback to run when the chunk is loaded
-
loadOptionalChunk
- Parameters:
position
- the chunk positioncallback
- the optional callback executed when the chunk is loaded (or with a null chunk if not)
-
unloadChunk
public void unloadChunk(int chunkX, int chunkZ)Unloads the chunk at the given position.- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Z
-
getBlockStateId
public short getBlockStateId(int x, int y, int z)Gives the block state id at the given position.- Parameters:
x
- the X positiony
- the Y positionz
- the Z position- Returns:
- the block state id at the position
-
getBlockStateId
public short getBlockStateId(float x, float y, float z)Gives the block state id at the given position.- Parameters:
x
- the X positiony
- the Y positionz
- the Z position- Returns:
- the block state id at the position
-
getBlockStateId
Gives the block state id at the givenBlockPosition
.- Parameters:
blockPosition
- the block position- Returns:
- the block state id at the position
-
getCustomBlock
Gets the custom block object at the given position.- Parameters:
x
- the X positiony
- the Y positionz
- the Z position- Returns:
- the custom block object at the position, null if not any
-
getCustomBlock
Gets the custom block object at the givenBlockPosition
.- Parameters:
blockPosition
- the block position- Returns:
- the custom block object at the position, null if not any
-
sendBlockAction
Sends aBlockActionPacket
for all the viewers of the specific position.- Parameters:
blockPosition
- the block positionactionId
- the action id, depends on the blockactionParam
- the action parameter, depends on the block- See Also:
- BlockActionPacket for the action id & param
-
getBlockData
Gets the block data at the given position.- Parameters:
x
- the X positiony
- the Y positionz
- the Z position- Returns:
- the block data at the position, null if not any
-
getBlockData
Gets the blockData
at the givenBlockPosition
.- Parameters:
blockPosition
- the block position- Returns:
- the block data at the position, null if not any
-
setBlockData
Sets the blockData
at the givenBlockPosition
.- Parameters:
x
- the X positiony
- the Y positionz
- the Z positiondata
- the data to be set, can be null
-
setBlockData
Sets the blockData
at the givenBlockPosition
.- Parameters:
blockPosition
- the block positiondata
- the data to be set, can be null
-
getChunkAt
Gets theChunk
at the givenBlockPosition
, null if not loaded.- Parameters:
x
- the X positionz
- the Z position- Returns:
- the chunk at the given position, null if not loaded
-
isChunkLoaded
public boolean isChunkLoaded(int chunkX, int chunkZ)Checks if theChunk
at the position is loaded.- Parameters:
chunkX
- the chunk XchunkZ
- the chunk Z- Returns:
- true if the chunk is loaded, false otherwise
-
getChunkAt
Gets theChunk
at the givenBlockPosition
, null if not loaded.- Parameters:
blockPosition
- the chunk position- Returns:
- the chunk at the given position, null if not loaded
-
getChunkAt
- Parameters:
position
- the chunk position- Returns:
- the chunk at the given position, null if not loaded
-
saveChunkToStorage
Saves aChunk
without any callback.- Parameters:
chunk
- the chunk to save
-
saveChunksToStorage
public void saveChunksToStorage()Saves allChunk
without any callback. -
getUniqueId
@NotNull public java.util.UUID getUniqueId()Gets the instance unique id.- Returns:
- the instance unique id
-
getData
Description copied from interface:DataContainer
Gets theData
of this container.A
DataContainer
data is always optional, meaning that this will be null if no data has been defined.- Specified by:
getData
in interfaceDataContainer
- Returns:
- the
Data
of this container, can be null
-
setData
Description copied from interface:DataContainer
Sets theData
of this container.Default implementations are
DataImpl
andSerializableDataImpl
depending on your use-case.- Specified by:
setData
in interfaceDataContainer
- Parameters:
data
- the newData
of this container, null to remove it
-
getEventCallbacksMap
@NotNull public java.util.Map<java.lang.Class<? extends Event>,java.util.Collection<EventCallback>> getEventCallbacksMap()Description copied from interface:EventHandler
Gets aMap
containing all the listeners assigned to a specificEvent
type.- Specified by:
getEventCallbacksMap
in interfaceEventHandler
- Returns:
- a
Map
with all the listeners
-
UNSAFE_addEntity
Used when calledEntity.setInstance(Instance)
, it is used to refresh viewable chunks and add viewers ifentity
is aPlayer
.Warning: unsafe, you probably want to use
Entity.setInstance(Instance)
instead.- Parameters:
entity
- the entity to add
-
UNSAFE_removeEntity
Used when anEntity
is removed from the instance, it removes all of his viewers.Warning: unsafe, you probably want to set the entity to another instance.
- Parameters:
entity
- the entity to remove
-
addEntityToChunk
Adds the specifiedEntity
to the instance entities cache.Warning: this is done automatically when the entity move out of his chunk.
- Parameters:
entity
- the entity to addchunk
- the chunk where the entity will be added
-
removeEntityFromChunk
Removes the specifiedEntity
to the instance entities cache.Warning: this is done automatically when the entity move out of his chunk.
- Parameters:
entity
- the entity to removechunk
- the chunk where the entity will be removed
-
scheduleUpdate
public abstract void scheduleUpdate(int time, @NotNull TimeUnit unit, @NotNull BlockPosition position)Schedules a block update at a givenBlockPosition
. Does nothing if noCustomBlock
is present atposition
.Cancelled if the block changes between this call and the actual update.
- Parameters:
time
- in how long this update must be performed?unit
- in what unit is the time expressedposition
- the location of the block to update
-
tick
public void tick(long time)Performs a single tick in the instance, including scheduled tasks fromscheduleNextTick(Consumer)
.Warning: this does not update chunks and entities.
- Parameters:
time
- the tick time in milliseconds
-
explode
public void explode(float centerX, float centerY, float centerZ, float strength)Creates an explosion at the given position with the given strength. The algorithm used to compute damages is provided bygetExplosionSupplier()
.- Parameters:
centerX
- the center XcenterY
- the center YcenterZ
- the center Zstrength
- the strength of the explosion- Throws:
java.lang.IllegalStateException
- If noExplosionSupplier
was supplied
-
explode
public void explode(float centerX, float centerY, float centerZ, float strength, @Nullable Data additionalData)Creates an explosion at the given position with the given strength. The algorithm used to compute damages is provided bygetExplosionSupplier()
.- Parameters:
centerX
- center X of the explosioncenterY
- center Y of the explosioncenterZ
- center Z of the explosionstrength
- the strength of the explosionadditionalData
- data to pass to the explosion supplier- Throws:
java.lang.IllegalStateException
- If noExplosionSupplier
was supplied
-
getExplosionSupplier
Gets the registeredExplosionSupplier
, or null if none was provided.- Returns:
- the instance explosion supplier, null if none was provided
-
setExplosionSupplier
Registers theExplosionSupplier
to use in this instance.- Parameters:
supplier
- the explosion supplier
-
getInstanceSpace
Gets the instance space.Used by the pathfinder for entities.
- Returns:
- the instance space
-