Package ch.njol.skript.util
Class BlockUtils
java.lang.Object
ch.njol.skript.util.BlockUtils
TODO !Update with every version [blocks] - also update aliases-*.sk
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable String
blockToString
(org.bukkit.block.Block block, int flags) Get the string version of a block, including type and location.static @Nullable org.bukkit.block.data.BlockData
createBlockData
(String dataString) static org.bukkit.block.Block
extractBlock
(org.bukkit.block.Block block) Extracts the actual CraftBukkit block from the given argument, by extracting the block fromDelayedChangeBlock
if the given argument is aDelayedChangeBlock
.static Iterable
<org.bukkit.block.Block> getBlocksAround
(org.bukkit.block.Block b) static Iterable
<org.bukkit.block.BlockFace> getFaces()
static @Nullable org.bukkit.Location
getLocation
(@Nullable org.bukkit.block.Block b) static void
sendBlockChange
(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.Material type, @Nullable BlockValues blockValues) static boolean
static boolean
set
(org.bukkit.block.Block block, org.bukkit.Material type, @Nullable BlockValues blockValues, boolean applyPhysics) Sets the given block.
-
Constructor Details
-
BlockUtils
public BlockUtils()
-
-
Method Details
-
set
public static boolean set(org.bukkit.block.Block block, org.bukkit.Material type, @Nullable @Nullable BlockValues blockValues, boolean applyPhysics) Sets the given block.- Parameters:
block
- Block to set.type
- New type of the block.blockValues
- Block values to apply after setting the type.applyPhysics
- Whether physics should be applied or not.- Returns:
- Whether setting block succeeded or not (currently always true).
-
set
-
sendBlockChange
public static void sendBlockChange(org.bukkit.entity.Player player, org.bukkit.Location location, org.bukkit.Material type, @Nullable @Nullable BlockValues blockValues) -
getBlocksAround
-
getFaces
-
getLocation
@Nullable public static @Nullable org.bukkit.Location getLocation(@Nullable @Nullable org.bukkit.block.Block b) - Parameters:
b
- A block- Returns:
- Location of the block, including its direction
-
createBlockData
@Nullable public static @Nullable org.bukkit.block.data.BlockData createBlockData(String dataString) -
blockToString
Get the string version of a block, including type and location. ex: 'stone' at 1.5, 1.5, 1.5 in world 'world' World can be null if the Block is Skript's BlockStateBlock.- Parameters:
block
- Block to get string offlags
-- Returns:
- String version of block
-
extractBlock
public static org.bukkit.block.Block extractBlock(org.bukkit.block.Block block) Extracts the actual CraftBukkit block from the given argument, by extracting the block fromDelayedChangeBlock
if the given argument is aDelayedChangeBlock
.- Returns:
- the actual CB block from the given argument
-