Cuberite
A lightweight, fast and extensible game server for Minecraft
BlockState.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 struct BlockState
6 {
7  constexpr BlockState(uint_least16_t StateID) :
8  ID(StateID)
9  {
10  }
11 
13  BlockType Type() const;
14 
16  {
17  return ID == Block.ID;
18  }
19 
21  {
22  return ID != Block.ID;
23  }
24 
26  uint_least16_t ID;
27 };
BlockType
Definition: BlockTypes.h:4
Represents the state of a single block (previously known as "block meta").
Definition: BlockState.h:20
BlockType Type() const
Gets the block type of this block state.
bool operator!=(const BlockState &aOther) const
Fast inequality check.
Definition: BlockState.h:62
uint_least16_t ID
The state ID of the block state.
Definition: BlockState.h:26
bool operator==(const BlockState &aOther) const
Fast equality check.
Definition: BlockState.cpp:132
constexpr BlockState(uint_least16_t StateID)
Definition: BlockState.h:7