Skip to content

Class endstone::Campfire

ClassList > endstone > Campfire

Represents a captured state of a campfire.

  • #include <endstone/block/campfire.h>

Inherits the following classes: endstone::BlockState

Public Functions

Type Name
virtual int getCookTime (int index) const = 0
Gets how long the item in the given slot has been cooking for.
virtual std::optional< ItemStack > getItem (int index) const = 0
Gets the item currently cooking in the given slot.
virtual int getSize () const = 0
Gets the number of items this campfire can cook at once.
virtual void setCookTime (int index, int cook_time) = 0
Sets how long the item in the given slot has been cooking for.
virtual void setItem (int index, const std::optional< ItemStack > & item) = 0
Sets the item currently cooking in the given slot.

Public Functions inherited from endstone::BlockState

See endstone::BlockState

Type Name
virtual std::unique_ptr< Block > getBlock () const = 0
Gets the block represented by this block state.
virtual std::unique_ptr< BlockData > getData () const = 0
Gets the data for this block state.
virtual NotNull< Dimension > getDimension () const = 0
Gets the dimension which contains the block represented by this block state.
virtual Location getLocation () const = 0
Gets the location of this block state.
virtual const BlockType & getType () const = 0
Gets the type of this block state.
virtual int getX () const = 0
Gets the x-coordinate of this block state.
virtual int getY () const = 0
Gets the y-coordinate of this block state.
virtual int getZ () const = 0
Gets the z-coordinate of this block state.
virtual void setData (const BlockData & data) = 0
Sets the data for this block state.
virtual void setType (BlockTypeId type) = 0
Sets the type of this block state.
virtual bool update () = 0
Attempts to update the block represented by this state, setting it to yhe new values as defined by this state.
virtual bool update (bool force) = 0
Attempts to update the block represented by this state, setting it to the new values as defined by this state.
virtual bool update (bool force, bool apply_physics) = 0
Attempts to update the block represented by this state, setting it to the new values as defined by this state.
~BlockState () override

Public Functions inherited from endstone::Object

See endstone::Object

Type Name
T * as ()
Attempts to cast this object to the given type T.
const T * as () const
Attempts to cast this object to the given type T.
virtual const std::type_info & getClassTypeId () const = 0
bool is () const
Checks if this object is an instance of the given type T (or a subclass of T).
virtual bool isInstanceOf (const std::type_info & target) const = 0
virtual ~Object () = default

Public Functions Documentation

function getCookTime

Gets how long the item in the given slot has been cooking for.

virtual int endstone::Campfire::getCookTime (
    int index
) const = 0

Parameters:

  • index the slot, between 0 and getSize() - 1

Returns:

the cook time, in ticks


function getItem

Gets the item currently cooking in the given slot.

virtual std::optional< ItemStack > endstone::Campfire::getItem (
    int index
) const = 0

Parameters:

  • index the slot, between 0 and getSize() - 1

Returns:

the item, or std::nullopt if the slot is empty


function getSize

Gets the number of items this campfire can cook at once.

virtual int endstone::Campfire::getSize () const = 0

Returns:

the number of slots


function setCookTime

Sets how long the item in the given slot has been cooking for.

virtual void endstone::Campfire::setCookTime (
    int index,
    int cook_time
) = 0

Parameters:

  • index the slot, between 0 and getSize() - 1
  • cook_time the cook time, in ticks

function setItem

Sets the item currently cooking in the given slot.

virtual void endstone::Campfire::setItem (
    int index,
    const std::optional< ItemStack > & item
) = 0

Parameters:

  • index the slot, between 0 and getSize() - 1
  • item the item, or std::nullopt to empty the slot


The documentation for this class was generated from the following file include/endstone/block/campfire.h