summaryrefslogtreecommitdiffstats
path: root/src/BlockState.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-12-21 14:54:04 +0100
committerGitHub <noreply@github.com>2020-12-21 14:54:04 +0100
commit9518a273570e8d38438c2a29aa10f987e7d44ce1 (patch)
tree11806582f5e27bad01ae96705f75f431ec3e9caf /src/BlockState.h
parentImprove Enderman targeting (diff)
downloadcuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar
cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.gz
cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.bz2
cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.lz
cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.xz
cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.tar.zst
cuberite-9518a273570e8d38438c2a29aa10f987e7d44ce1.zip
Diffstat (limited to 'src/BlockState.h')
-rw-r--r--src/BlockState.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/BlockState.h b/src/BlockState.h
new file mode 100644
index 000000000..0928dad83
--- /dev/null
+++ b/src/BlockState.h
@@ -0,0 +1,27 @@
+#pragma once
+
+#include "Registries/BlockTypes.h"
+
+struct BlockState
+{
+ constexpr BlockState(uint_least16_t StateID) :
+ ID(StateID)
+ {
+ }
+
+ /** Gets the block type of this block state. */
+ BlockType Type() const;
+
+ bool operator == (BlockState Block) const
+ {
+ return ID == Block.ID;
+ }
+
+ bool operator != (BlockState Block) const
+ {
+ return ID != Block.ID;
+ }
+
+ /** The state ID of the block state. */
+ uint_least16_t ID;
+};