Package ch.njol.skript.bukkitutil.block
Interface BlockSetter
public interface BlockSetter
Manages setting blocks.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intWhen placing the block, apply physics.static final intTakes rotation or direction of the block (depending on the block) and attempts to place other parts of it according to those.static final intAttempts to automatically correct rotation and direction of the block when setting it.static final intChanges type of the block if that is needed to get the correct rotation.static final intOverrides rotation and direction that might have been specified in block values whenROTATEis also set. -
Method Summary
Modifier and TypeMethodDescriptionvoidsendBlockChange(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.Material type, @Nullable BlockValues values) Send a block change to a player.voidsetBlock(org.bukkit.block.Block block, org.bukkit.Material type, @Nullable BlockValues values, int flags) Sets the given block.
-
Field Details
-
ROTATE
static final int ROTATEAttempts to automatically correct rotation and direction of the block when setting it. Note that this will NOT overwrite any existing data supplied in block values.- See Also:
-
ROTATE_FORCE
static final int ROTATE_FORCEOverrides rotation and direction that might have been specified in block values whenROTATEis also set.- See Also:
-
ROTATE_FIX_TYPE
static final int ROTATE_FIX_TYPEChanges type of the block if that is needed to get the correct rotation.- See Also:
-
MULTIPART
static final int MULTIPARTTakes rotation or direction of the block (depending on the block) and attempts to place other parts of it according to those. For example, placing beds and doors should be simple enough with this flag.- See Also:
-
APPLY_PHYSICS
static final int APPLY_PHYSICSWhen placing the block, apply physics.- See Also:
-
-
Method Details
-
setBlock
void setBlock(org.bukkit.block.Block block, org.bukkit.Material type, @Nullable @Nullable BlockValues values, int flags) Sets the given block.- Parameters:
block- Block to set.type- New type of the block.values- Additional block data, such as block states.flags- Flags for block setter.
-
sendBlockChange
void sendBlockChange(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.Material type, @Nullable @Nullable BlockValues values) Send a block change to a player.This will send a fake block change to the player, and will not change the block on the server.
- Parameters:
player- Player to send change tolocation- Location of block to changetype- Material of changevalues- Additional block data, such as block states.
-