public class BlockStateDelegate extends Object
BlockState
's list in order to capture a
chain of modified blocks and update all the states in once, or never (ie: event cancelled).Constructor and Description |
---|
BlockStateDelegate() |
Modifier and Type | Method and Description |
---|---|
void |
backupBlockState(org.bukkit.block.Block block)
Backups a block state.
|
org.bukkit.block.BlockState |
getBlockState(org.bukkit.Location loc)
Returns the
BlockState of a block at the given location. |
org.bukkit.block.BlockState |
getBlockState(org.bukkit.World world,
int x,
int y,
int z)
Returns the
BlockState of a block at the given coordinates. |
Collection<org.bukkit.block.BlockState> |
getBlockStates()
Returns the BlockState list.
|
void |
rollbackBlockStates()
Roll-back previously backed-up block states.
|
void |
setType(org.bukkit.World world,
int x,
int y,
int z,
org.bukkit.Material type)
Sets a block type and add it to the BlockState list.
|
void |
setTypeAndData(org.bukkit.World world,
int x,
int y,
int z,
org.bukkit.Material type,
org.bukkit.material.MaterialData data)
Sets a block type and MaterialData, and add it to the BlockState list.
|
void |
setTypeAndRawData(org.bukkit.World world,
int x,
int y,
int z,
org.bukkit.Material type,
int data)
Sets a block type, data and add it to the BlockState list.
|
void |
updateBlockStates()
Updates all block states contained in the BlockState list.
|
public void setType(org.bukkit.World world, int x, int y, int z, org.bukkit.Material type)
world
- the world which contains the blockx
- the x-coordinate of this blocky
- the y-coordinate of this blockz
- the z-coordinate of this blocktype
- the new type of this blockpublic void setTypeAndData(org.bukkit.World world, int x, int y, int z, org.bukkit.Material type, org.bukkit.material.MaterialData data)
world
- the world which contains the blockx
- the x-coordinate of this blocky
- the y-coordinate of this blockz
- the z-coordinate of this blocktype
- the new type of this blockdata
- the new MaterialData of this blockpublic void setTypeAndRawData(org.bukkit.World world, int x, int y, int z, org.bukkit.Material type, int data)
world
- the world which contains the blockx
- the x-coordinate of this blocky
- the y-coordinate of this blockz
- the z-coordinate of this blocktype
- the new type of this blockdata
- the new data value of this blockpublic void backupBlockState(org.bukkit.block.Block block)
block
- the block which state should be backuppublic void rollbackBlockStates()
public Collection<org.bukkit.block.BlockState> getBlockStates()
BlockState
.public void updateBlockStates()
public org.bukkit.block.BlockState getBlockState(org.bukkit.World world, int x, int y, int z)
BlockState
of a block at the given coordinates.world
- the world which contains the blockx
- the x-coordinatey
- the y-coordinatez
- the z-coordinateBlockState
state.public org.bukkit.block.BlockState getBlockState(org.bukkit.Location loc)
BlockState
of a block at the given location.loc
- the location which contains the blockBlockState
state.Copyright © 2021. All rights reserved.