Class AbstractBlockUtil
This abstraction provides optimized block placement methods that can operate
at different performance levels depending on the requirements. It offers
multiple placement strategies through the PlaceType
enum, allowing
developers to choose between full game mechanics compliance and maximum performance.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
setBlockSuperFast
(@NotNull Location location, @NotNull com.cryptomorin.xseries.XMaterial xMaterial, @NotNull PlaceType placeType) Sets a block at the specified location using cross-version material with optimized performance.final void
setBlockSuperFast
(@NotNull Location location, @NotNull XBlockData blockData, @NotNull PlaceType placeType) Sets a block at the specified location using block data with optimized performance.final void
setBlockSuperFast
(@NotNull Location location, @NotNull Material material, @NotNull PlaceType placeType) Sets a block at the specified location using Bukkit material with optimized performance.final void
setBlockSuperFast
(@NotNull Block block, @NotNull com.cryptomorin.xseries.XMaterial xMaterial, @NotNull PlaceType placeType) Sets a block using the specified cross-version material with optimized performance.final void
setBlockSuperFast
(@NotNull Block block, @NotNull XBlockData blockData, @NotNull PlaceType placeType) Sets a block using the specified block data with optimized performance.final void
setBlockSuperFast
(@NotNull Block block, @NotNull Material material, @NotNull PlaceType placeType) Sets a block using the specified Bukkit material with optimized performance.
-
Constructor Details
-
AbstractBlockUtil
public AbstractBlockUtil()
-
-
Method Details
-
setBlockSuperFast
public final void setBlockSuperFast(@NotNull @NotNull Block block, @NotNull @NotNull com.cryptomorin.xseries.XMaterial xMaterial, @NotNull @NotNull PlaceType placeType) Sets a block using the specified cross-version material with optimized performance.This method provides high-performance block placement using
XMaterial
for cross-version compatibility. The placement behavior is controlled by thePlaceType
parameter, allowing you to choose the appropriate balance between performance and game mechanics compliance. -
setBlockSuperFast
public final void setBlockSuperFast(@NotNull @NotNull Block block, @NotNull @NotNull Material material, @NotNull @NotNull PlaceType placeType) Sets a block using the specified Bukkit material with optimized performance.This method provides high-performance block placement using Bukkit's
Material
enum. The material is automatically converted toXMaterial
for cross-version compatibility before placement. -
setBlockSuperFast
public final void setBlockSuperFast(@NotNull @NotNull Block block, @NotNull @NotNull XBlockData blockData, @NotNull @NotNull PlaceType placeType) Sets a block using the specified block data with optimized performance.This method provides high-performance block placement using pre-configured
XBlockData
. This is the most direct approach when you already have the block data prepared and want maximum control over the placement operation.- Parameters:
block
- theBlock
to modifyblockData
- theXBlockData
containing the block informationplaceType
- thePlaceType
determining placement behavior
-
setBlockSuperFast
public final void setBlockSuperFast(@NotNull @NotNull Location location, @NotNull @NotNull com.cryptomorin.xseries.XMaterial xMaterial, @NotNull @NotNull PlaceType placeType) Sets a block at the specified location using cross-version material with optimized performance.This convenience method extracts the block from the provided location and sets it using the specified
XMaterial
. It provides the same performance characteristics as the block-based method while offering location-based convenience. -
setBlockSuperFast
public final void setBlockSuperFast(@NotNull @NotNull Location location, @NotNull @NotNull Material material, @NotNull @NotNull PlaceType placeType) Sets a block at the specified location using Bukkit material with optimized performance.This convenience method extracts the block from the provided location and sets it using the specified
Material
. The material is automatically converted for cross-version compatibility before placement. -
setBlockSuperFast
public final void setBlockSuperFast(@NotNull @NotNull Location location, @NotNull @NotNull XBlockData blockData, @NotNull @NotNull PlaceType placeType) Sets a block at the specified location using block data with optimized performance.This convenience method extracts the block from the provided location and sets it using the specified
XBlockData
. It provides location-based convenience while maintaining the performance benefits of pre-configured block data.- Parameters:
location
- theLocation
of the block to modifyblockData
- theXBlockData
containing the block informationplaceType
- thePlaceType
determining placement behavior
-