Class Comparator

java.lang.Object
org.bukkit.material.MaterialData
org.bukkit.material.Comparator
All Implemented Interfaces:
Cloneable, Directional, Redstone

@Deprecated(since="1.13", forRemoval=true) public class Comparator extends MaterialData implements Directional, Redstone
Deprecated, for removal: This API element is subject to removal in a future version.
all usage of MaterialData is deprecated and subject to removal. Use BlockData.
Represents a comparator in the on or off state, in normal or subtraction mode and facing in a specific direction.
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected static final BlockFace
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    protected static final boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a comparator switched off, with the default mode (normal) and facing the default direction (north).
    Comparator(BlockFace facingDirection)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a comparator switched off, with the default mode (normal) and facing the specified direction.
    Comparator(BlockFace facingDirection, boolean isSubtraction)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a comparator switched off, with the specified mode and facing the specified direction.
    Comparator(BlockFace facingDirection, boolean isSubtraction, boolean state)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Constructs a comparator switched on or off, with the specified mode and facing the specified direction.
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Comparator(Material type, byte data)
    Deprecated.
    Magic value
  • Method Summary

    Modifier and Type
    Method
    Description
    Deprecated, for removal: This API element is subject to removal in a future version.
     
    Deprecated, for removal: This API element is subject to removal in a future version.
    Gets the direction this comparator is facing
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the comparator is being powered
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks if the comparator is powered
    boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    Checks whether the comparator is in subtraction mode
    void
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets the direction this comparator is facing
    void
    setSubtractionMode(boolean isSubtraction)
    Deprecated, for removal: This API element is subject to removal in a future version.
    Sets whether the comparator is in subtraction mode.
    Deprecated, for removal: This API element is subject to removal in a future version.
     

    Methods inherited from class org.bukkit.material.MaterialData

    equals, getData, getItemType, hashCode, setData, toItemStack, toItemStack

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT_DIRECTION

      protected static final BlockFace DEFAULT_DIRECTION
      Deprecated, for removal: This API element is subject to removal in a future version.
    • DEFAULT_SUBTRACTION_MODE

      protected static final boolean DEFAULT_SUBTRACTION_MODE
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
    • DEFAULT_STATE

      protected static final boolean DEFAULT_STATE
      Deprecated, for removal: This API element is subject to removal in a future version.
      See Also:
  • Constructor Details

    • Comparator

      public Comparator()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a comparator switched off, with the default mode (normal) and facing the default direction (north).
    • Comparator

      public Comparator(BlockFace facingDirection)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a comparator switched off, with the default mode (normal) and facing the specified direction.
      Parameters:
      facingDirection - the direction the comparator is facing
      See Also:
    • Comparator

      public Comparator(BlockFace facingDirection, boolean isSubtraction)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a comparator switched off, with the specified mode and facing the specified direction.
      Parameters:
      facingDirection - the direction the comparator is facing
      isSubtraction - True if the comparator is in subtraction mode, false for normal comparator operation
      See Also:
    • Comparator

      public Comparator(BlockFace facingDirection, boolean isSubtraction, boolean state)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Constructs a comparator switched on or off, with the specified mode and facing the specified direction.
      Parameters:
      facingDirection - the direction the comparator is facing
      isSubtraction - True if the comparator is in subtraction mode, false for normal comparator operation
      state - True if the comparator is in the on state
      See Also:
    • Comparator

      public Comparator(Material type)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • Comparator

      @Deprecated(since="1.9") public Comparator(Material type, byte data)
      Deprecated.
      Magic value
      Parameters:
      type - the type
      data - the raw data value
  • Method Details

    • setSubtractionMode

      public void setSubtractionMode(boolean isSubtraction)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets whether the comparator is in subtraction mode.
      Parameters:
      isSubtraction - True if the comparator is in subtraction mode, false for normal comparator operation
    • isSubtractionMode

      public boolean isSubtractionMode()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks whether the comparator is in subtraction mode
      Returns:
      True if the comparator is in subtraction mode, false if normal comparator operation
    • setFacingDirection

      public void setFacingDirection(BlockFace face)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Sets the direction this comparator is facing
      Specified by:
      setFacingDirection in interface Directional
      Parameters:
      face - The direction to set this comparator to
      See Also:
    • getFacing

      public BlockFace getFacing()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Gets the direction this comparator is facing
      Specified by:
      getFacing in interface Directional
      Returns:
      The direction this comparator is facing
      See Also:
    • toString

      public String toString()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      toString in class MaterialData
    • clone

      public Comparator clone()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Overrides:
      clone in class MaterialData
    • isPowered

      public boolean isPowered()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the comparator is powered
      Specified by:
      isPowered in interface Redstone
      Returns:
      true if the comparator is powered
    • isBeingPowered

      public boolean isBeingPowered()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Checks if the comparator is being powered
      Returns:
      true if the comparator is being powered