Class Hopper

    • Field Detail

      • DEFAULT_DIRECTION

        protected static final BlockFace DEFAULT_DIRECTION
    • Constructor Detail

      • Hopper

        public Hopper()
        Constructs a hopper facing the default direction (down) and initially active.
      • Hopper

        public Hopper​(BlockFace facingDirection)
        Constructs a hopper facing the specified direction and initially active.
        Parameters:
        facingDirection - the direction the hopper is facing
        See Also:
        BlockFace
      • Hopper

        public Hopper​(BlockFace facingDirection,
                      boolean isActive)
        Constructs a hopper facing the specified direction and either active or not.
        Parameters:
        facingDirection - the direction the hopper is facing
        isActive - True if the hopper is initially active, false if deactivated
        See Also:
        BlockFace
      • Hopper

        public Hopper​(Material type)
      • Hopper

        @Deprecated
        public Hopper​(Material type,
                      byte data)
        Deprecated.
        Magic value
        Parameters:
        type - the type
        data - the raw data value
    • Method Detail

      • setActive

        public void setActive​(boolean isActive)
        Sets whether the hopper is active or not.
        Parameters:
        isActive - True if the hopper is active, false if deactivated as if powered by redstone
      • isActive

        public boolean isActive()
        Checks whether the hopper is active or not.
        Returns:
        True if the hopper is active, false if deactivated
      • setFacingDirection

        public void setFacingDirection​(BlockFace face)
        Sets the direction this hopper is facing
        Specified by:
        setFacingDirection in interface Directional
        Parameters:
        face - The direction to set this hopper to
        See Also:
        BlockFace
      • getFacing

        public BlockFace getFacing()
        Gets the direction this hopper is facing
        Specified by:
        getFacing in interface Directional
        Returns:
        The direction this hopper is facing
        See Also:
        BlockFace
      • isPowered

        public boolean isPowered()
        Checks if the hopper is powered.
        Specified by:
        isPowered in interface Redstone
        Returns:
        true if the hopper is powered