Interface BlockPalette


public interface BlockPalette
Represents a palette of blocks with associated percentages, used for defining the composition of blocks in a mine.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(com.cryptomorin.xseries.XMaterial material, double percentage)
    Adds a material to the palette with a given percentage.
    boolean
    contains(com.cryptomorin.xseries.XMaterial material)
    Checks if the palette contains the specified material.
    double
    getPercentage(com.cryptomorin.xseries.XMaterial material)
    Gets the percentage of the specified material in the palette.
    void
    remove(com.cryptomorin.xseries.XMaterial material)
    Removes the specified material from the palette.
    void
    setPercentage(com.cryptomorin.xseries.XMaterial material, double percentage)
    Sets the percentage for the specified material in the palette.
  • Method Details

    • contains

      boolean contains(com.cryptomorin.xseries.XMaterial material)
      Checks if the palette contains the specified material.
      Parameters:
      material - the XMaterial to check
      Returns:
      true if the material is present, false otherwise
    • getPercentage

      double getPercentage(com.cryptomorin.xseries.XMaterial material)
      Gets the percentage of the specified material in the palette.
      Parameters:
      material - the XMaterial to get the percentage for
      Returns:
      the percentage (0.0 to 1.0) of the material in the palette
    • setPercentage

      void setPercentage(com.cryptomorin.xseries.XMaterial material, double percentage)
      Sets the percentage for the specified material in the palette.
      Parameters:
      material - the XMaterial to set the percentage for
      percentage - the new percentage value (0.0 to 1.0)
    • add

      void add(com.cryptomorin.xseries.XMaterial material, double percentage)
      Adds a material to the palette with a given percentage.
      Parameters:
      material - the XMaterial to add
      percentage - the percentage (0.0 to 1.0) of the material in the palette
    • remove

      void remove(com.cryptomorin.xseries.XMaterial material)
      Removes the specified material from the palette.
      Parameters:
      material - the XMaterial to remove