Class AbstractBlockUtil

java.lang.Object
com.kamikazejam.kamicommon.nms.abstraction.block.AbstractBlockUtil

public abstract class AbstractBlockUtil extends Object
Abstract class providing version-specific implementations for high-performance block manipulation operations across different Minecraft versions.

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 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 the PlaceType parameter, allowing you to choose the appropriate balance between performance and game mechanics compliance.

      Parameters:
      block - the Block to modify
      xMaterial - the XMaterial to set the block to
      placeType - the PlaceType determining placement behavior
    • 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 to XMaterial for cross-version compatibility before placement.

      Parameters:
      block - the Block to modify
      material - the Material to set the block to
      placeType - the PlaceType determining placement behavior
    • 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 - the Block to modify
      blockData - the XBlockData containing the block information
      placeType - the PlaceType 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.

      Parameters:
      location - the Location of the block to modify
      xMaterial - the XMaterial to set the block to
      placeType - the PlaceType determining placement behavior
    • 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.

      Parameters:
      location - the Location of the block to modify
      material - the Material to set the block to
      placeType - the PlaceType determining placement behavior
    • 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 - the Location of the block to modify
      blockData - the XBlockData containing the block information
      placeType - the PlaceType determining placement behavior