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 voidsetBlockSuperFast(@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 voidsetBlockSuperFast(@NotNull Location location, @NotNull XBlockData blockData, @NotNull PlaceType placeType) Sets a block at the specified location using block data with optimized performance.final voidsetBlockSuperFast(@NotNull Location location, @NotNull Material material, @NotNull PlaceType placeType) Sets a block at the specified location using Bukkit material with optimized performance.final voidsetBlockSuperFast(@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 voidsetBlockSuperFast(@NotNull Block block, @NotNull XBlockData blockData, @NotNull PlaceType placeType) Sets a block using the specified block data with optimized performance.final voidsetBlockSuperFast(@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
XMaterialfor cross-version compatibility. The placement behavior is controlled by thePlaceTypeparameter, 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
Materialenum. The material is automatically converted toXMaterialfor 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- theBlockto modifyblockData- theXBlockDatacontaining the block informationplaceType- thePlaceTypedetermining 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- theLocationof the block to modifyblockData- theXBlockDatacontaining the block informationplaceType- thePlaceTypedetermining placement behavior
-