Cloneable
, Directional
, Redstone
public class Comparator extends MaterialData implements Directional, Redstone
Modifier and Type | Field | Description |
---|---|---|
protected static BlockFace |
DEFAULT_DIRECTION |
|
protected static boolean |
DEFAULT_STATE |
|
protected static boolean |
DEFAULT_SUBTRACTION_MODE |
Constructor | Description |
---|---|
Comparator() |
Constructs a comparator switched off, with the default mode (normal) and facing the default direction (north).
|
Comparator(BlockFace facingDirection) |
Constructs a comparator switched off, with the default mode (normal) and facing the specified direction.
|
Comparator(BlockFace facingDirection,
boolean isSubtraction) |
Constructs a comparator switched off, with the specified mode and facing the specified direction.
|
Comparator(BlockFace facingDirection,
boolean isSubtraction,
boolean state) |
Constructs a comparator switched on or off, with the specified mode and facing the specified direction.
|
Comparator(Material type) |
|
Comparator(Material type,
byte data) |
Deprecated.
Magic value
|
Modifier and Type | Method | Description |
---|---|---|
Comparator |
clone() |
|
BlockFace |
getFacing() |
Gets the direction this comparator is facing
|
boolean |
isBeingPowered() |
Checks if the comparator is being powered
|
boolean |
isPowered() |
Checks if the comparator is powered
|
boolean |
isSubtractionMode() |
Checks whether the comparator is in subtraction mode
|
void |
setFacingDirection(BlockFace face) |
Sets the direction this comparator is facing
|
void |
setSubtractionMode(boolean isSubtraction) |
Sets whether the comparator is in subtraction mode.
|
String |
toString() |
equals, getData, getItemType, hashCode, setData, toItemStack, toItemStack
protected static final BlockFace DEFAULT_DIRECTION
protected static final boolean DEFAULT_SUBTRACTION_MODE
protected static final boolean DEFAULT_STATE
public Comparator()
public Comparator(BlockFace facingDirection)
facingDirection
- the direction the comparator is facingBlockFace
public Comparator(BlockFace facingDirection, boolean isSubtraction)
facingDirection
- the direction the comparator is facingisSubtraction
- True if the comparator is in subtraction mode, false for normal comparator operationBlockFace
public Comparator(BlockFace facingDirection, boolean isSubtraction, boolean state)
facingDirection
- the direction the comparator is facingisSubtraction
- True if the comparator is in subtraction mode, false for normal comparator operationstate
- True if the comparator is in the on stateBlockFace
public Comparator(Material type)
@Deprecated public Comparator(Material type, byte data)
type
- the typedata
- the raw data valuepublic void setSubtractionMode(boolean isSubtraction)
isSubtraction
- True if the comparator is in subtraction mode, false for normal comparator operationpublic boolean isSubtractionMode()
public void setFacingDirection(BlockFace face)
setFacingDirection
in interface Directional
face
- The direction to set this comparator toBlockFace
public BlockFace getFacing()
getFacing
in interface Directional
BlockFace
public String toString()
toString
in class MaterialData
public Comparator clone()
clone
in class MaterialData
public boolean isPowered()
public boolean isBeingPowered()
Copyright © 2020. All rights reserved.