Interface InteractableVolume
- All Superinterfaces:
BlockVolume,LocationBaseDataHolder,Volume
- All Known Subinterfaces:
ServerWorld
-
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
Modifier and TypeMethodDescriptionblockDigTimeWith(int x, int y, int z, ItemStack itemStack, GameProfile profile) Gets theDurationit takes to dig this block with the specified item.default DurationblockDigTimeWith(Vector3i position, ItemStack itemStack, GameProfile profile) Gets theDurationit takes to dig this block with the specified item.booleandigBlock(int x, int y, int z, GameProfile profile) Simulate the digging of the block as if a player had done so.default booleandigBlock(Vector3i position, GameProfile profile) Simulate the digging of the block as if a player had done so.booleandigBlockWith(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 booleandigBlockWith(Vector3i position, ItemStack itemStack, GameProfile profile) Simulate the digging of the block with the given tool as if a player had done so.booleanhitBlock(int x, int y, int z, Direction side, GameProfile profile) Simulates hitting a block as if a player had done so.default booleanhitBlock(Vector3i position, Direction side, GameProfile profile) Simulates hitting a block as if a player had done so.booleaninteractBlock(int x, int y, int z, Direction side, GameProfile profile) Simulates the interaction the block as if a player had done so.default booleaninteractBlock(Vector3i position, Direction side, GameProfile profile) Simulates the interaction the block as if a player had done so.booleaninteractBlockWith(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 booleaninteractBlockWith(Vector3i position, ItemStack itemStack, Direction side, GameProfile profile) Simulates the interaction the block using the given item as if the player had done so.booleanplaceBlock(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 booleanplaceBlock(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, blockPalette, fluid, fluid, highestPositionAt, highestYAt, highestYAtMethods 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 Details
-
hitBlock
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
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
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
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
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
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
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
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
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
Gets theDurationit 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
Gets theDurationit 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
-