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 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 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 BlockValues blockValues) -
getBlocksAround
-
getFaces
-
getLocation
public static @Nullable org.bukkit.Location getLocation(@Nullable org.bukkit.block.Block b)- Parameters:
b
- A block- Returns:
- Location of the block, including its direction
-
createBlockData
-
blockToString
Get the string version of a block, including type and location. ex: 'stone' at 1.5, 1.5, 1.5 in world 'world'- Parameters:
block
- Block to get string offlags
-- Returns:
- String version of block
-