Interface InteractableVolume
-
- All Superinterfaces:
BlockVolume
,LocationBaseDataHolder
,Volume
- All Known Subinterfaces:
ServerWorld
public interface InteractableVolume extends BlockVolume, LocationBaseDataHolder
-
-
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.game.LocationBaseDataHolder
LocationBaseDataHolder.Mutable
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.time.Duration
blockDigTimeWith(int x, int y, int z, ItemStack itemStack, GameProfile profile)
Gets theDuration
it takes to dig this block with the specified item.default java.time.Duration
blockDigTimeWith(Vector3i position, ItemStack itemStack, GameProfile profile)
Gets theDuration
it takes to dig this block with the specified item.boolean
digBlock(int x, int y, int z, GameProfile profile)
Simulate the digging of the block as if a player had done so.default boolean
digBlock(Vector3i position, GameProfile profile)
Simulate the digging of the block as if a player had done so.boolean
digBlockWith(int x, int y, int z, ItemStack itemStack, GameProfile profile)
Simulate the digging of the block with the given tool as if a player had done so.default boolean
digBlockWith(Vector3i position, ItemStack itemStack, GameProfile profile)
Simulate the digging of the block with the given tool as if a player had done so.boolean
hitBlock(int x, int y, int z, Direction side, GameProfile profile)
Simulates hitting a block as if a player had done so.default boolean
hitBlock(Vector3i position, Direction side, GameProfile profile)
Simulates hitting a block as if a player had done so.boolean
interactBlock(int x, int y, int z, Direction side, GameProfile profile)
Simulates the interaction the block as if a player had done so.default boolean
interactBlock(Vector3i position, Direction side, GameProfile profile)
Simulates the interaction the block as if a player had done so.boolean
interactBlockWith(int x, int y, int z, ItemStack itemStack, Direction side, GameProfile profile)
Simulates the interaction the block using the given item as if the player had done so.default boolean
interactBlockWith(Vector3i position, ItemStack itemStack, Direction side, GameProfile profile)
Simulates the interaction the block using the given item as if the player had done so.boolean
placeBlock(int x, int y, int z, BlockState block, Direction side, GameProfile profile)
Simulates the placement of a block at the given location as if a player had done so.default boolean
placeBlock(Vector3i position, BlockState block, Direction side, GameProfile profile)
Simulates the placement of a block at the given location as if a player had done so.-
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.game.LocationBaseDataHolder
get, get, get, get, getDouble, getDouble, getDouble, getDouble, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getValue, getValue, getValue, getValue, getValues, getValues, keys, keys, orElse, orElse, orElse, orElse, orElse, orElse, orElse, orElse, orNull, orNull, orNull, orNull, require, require, require, require, supports, supports, supports, supports, supports, supports
-
-
-
-
Method Detail
-
hitBlock
default boolean hitBlock(Vector3i position, Direction side, GameProfile profile)
Simulates hitting a block as if a player had done so.The difference between this and
digBlock(org.spongepowered.math.vector.Vector3i, org.spongepowered.api.profile.GameProfile)
is that this will only do a single instantaneous "click" whereas digBlock will simulate holding the primary mouse button until the block breaks.- Parameters:
position
- The position of the blockside
- The side of the block to interact withprofile
- The game profile of the player this is imitating- Returns:
- True if the interact succeeded
-
hitBlock
boolean hitBlock(int x, int y, int z, Direction side, GameProfile profile)
Simulates hitting a block as if a player had done so.The difference between this and
digBlock(org.spongepowered.math.vector.Vector3i, org.spongepowered.api.profile.GameProfile)
is that this will only do a single instantaneous "click" whereas digBlock will simulate holding the primary mouse button until the block breaks.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionside
- The side of the block to interact withprofile
- The game profile of the player this is imitating- Returns:
- True if the interact succeeded
-
interactBlock
default boolean interactBlock(Vector3i position, Direction side, GameProfile profile)
Simulates the interaction the block as if a player had done so.- Parameters:
position
- The position of the blockside
- The side of the block to interact withprofile
- The game profile of the player this is imitating- Returns:
- True if the interact succeeded
-
interactBlock
boolean interactBlock(int x, int y, int z, Direction side, GameProfile profile)
Simulates the interaction the block as if a player had done so.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionside
- The side of the block to interact withprofile
- The game profile of the player this is imitating- Returns:
- True if the interact succeeded
-
interactBlockWith
default boolean interactBlockWith(Vector3i position, ItemStack itemStack, Direction side, GameProfile profile)
Simulates the interaction the block using the given item as if the player had done so.- Parameters:
position
- The position of the blockitemStack
- The itemside
- The side of the block to interact withprofile
- The game profile of the player this is imitating- Returns:
- True if the interact succeeded
-
interactBlockWith
boolean interactBlockWith(int x, int y, int z, ItemStack itemStack, Direction side, GameProfile profile)
Simulates the interaction the block using the given item as if the player had done so.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionitemStack
- The itemside
- The side of the block to interact withprofile
- The game profile of the player this is imitating- Returns:
- True if the interact succeeded
-
placeBlock
default boolean placeBlock(Vector3i position, BlockState block, Direction side, GameProfile profile)
Simulates the placement of a block at the given location as if a player had done so.- Parameters:
position
- The position of the blockblock
- The block state to be set toside
- The face of the block to place onprofile
- The game profile of the player this is imitating- Returns:
- Whether the block was successfully set
-
placeBlock
boolean placeBlock(int x, int y, int z, BlockState block, Direction side, GameProfile profile)
Simulates the placement of a block at the given location as if a player had done so.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionblock
- The block state to be set toside
- The face of the block to place onprofile
- The game profile of the player this is imitating- Returns:
- Whether the block was successfully set
-
digBlock
default boolean digBlock(Vector3i position, GameProfile profile)
Simulate the digging of the block as if a player had done so.- Parameters:
position
- The position of the blockprofile
- The game profile of the player this is imitating- Returns:
- Whether the block was destroyed
-
digBlock
boolean digBlock(int x, int y, int z, GameProfile profile)
Simulate the digging of the block as if a player had done so.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionprofile
- The game profile of the player this is imitating- Returns:
- Whether the block was destroyed
-
digBlockWith
default boolean digBlockWith(Vector3i position, ItemStack itemStack, GameProfile profile)
Simulate the digging of the block with the given tool as if a player had done so.- Parameters:
position
- The position of the blockitemStack
- The toolprofile
- The game profile of the player this is imitating- Returns:
- Whether the block was destroyed
-
digBlockWith
boolean digBlockWith(int x, int y, int z, ItemStack itemStack, GameProfile profile)
Simulate the digging of the block with the given tool as if a player had done so.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionitemStack
- The toolprofile
- The game profile of the player this is imitating- Returns:
- Whether the block was destroyed
-
blockDigTimeWith
default java.time.Duration blockDigTimeWith(Vector3i position, ItemStack itemStack, GameProfile profile)
Gets theDuration
it takes to dig this block with the specified item.- Parameters:
position
- The position of the blockitemStack
- The item to pretend-dig withprofile
- The game profile of the player this is imitating- Returns:
- The duration it takes to dig the block
-
blockDigTimeWith
java.time.Duration blockDigTimeWith(int x, int y, int z, ItemStack itemStack, GameProfile profile)
Gets theDuration
it takes to dig this block with the specified item.- Parameters:
x
- The X positiony
- The Y positionz
- The Z positionitemStack
- The item to pretend-dig withprofile
- The game profile of the player this is imitating- Returns:
- The duration it takes to dig the block
-
-