Class BlockBag
java.lang.Object
com.sk89q.worldedit.extent.inventory.BlockBag
Represents a source to get blocks from and store removed ones.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
Adds a position to be used a source.abstract void
Adds a position to be used a source.abstract void
fetchBlock
(BlockState blockState) Get a block.void
fetchPlacedBlock
(BlockState blockState) Sets a block as if it was placed by hand.abstract void
Flush any changes.boolean
peekBlock
(BlockState blockState) Checks to see if a block exists without removing it.void
storeBlock
(BlockState blockState) Store a block.abstract void
storeBlock
(BlockState blockState, int amount) Store a block.void
storeDroppedBlock
(BlockState blockState) Stores a block as if it was mined.
-
Constructor Details
-
BlockBag
public BlockBag()
-
-
Method Details
-
storeDroppedBlock
Stores a block as if it was mined.- Parameters:
blockState
- the block state- Throws:
BlockBagException
- on error
-
fetchPlacedBlock
Sets a block as if it was placed by hand.- Parameters:
blockState
- The block state- Throws:
BlockBagException
- on error
-
fetchBlock
Get a block.- Parameters:
blockState
- the block state- Throws:
BlockBagException
- on error
-
storeBlock
Store a block.- Parameters:
blockState
- The block state- Throws:
BlockBagException
- on error
-
storeBlock
Store a block.- Parameters:
blockState
- The block stateamount
- The amount- Throws:
BlockBagException
- on error
-
peekBlock
Checks to see if a block exists without removing it.- Parameters:
blockState
- the block state- Returns:
- whether the block exists
-
flushChanges
public abstract void flushChanges()Flush any changes. This is called at the end. -
addSourcePosition
Adds a position to be used a source.- Parameters:
pos
- the position
-
addSingleSourcePosition
Adds a position to be used a source.- Parameters:
pos
- the position
-