summaryrefslogtreecommitdiffstats
path: root/src/Block.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Block.cpp')
-rw-r--r--src/Block.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Block.cpp b/src/Block.cpp
index a12db9d..421cb5d 100644
--- a/src/Block.cpp
+++ b/src/Block.cpp
@@ -1,5 +1,9 @@
#include "Block.hpp"
+#include <map>
+
+#include "Plugin.hpp"
+
std::pair<std::string, std::string> TransformBlockIdToBlockStateName(BlockId blockId) {
switch (blockId.id) {
case 1: {
@@ -523,3 +527,18 @@ std::pair<std::string, std::string> TransformBlockIdToBlockStateName(BlockId blo
return std::make_pair("", "");
}
+
+std::map<BlockId, BlockInfo> staticBlockInfo;
+
+void RegisterStaticBlockInfo(BlockId blockId, BlockInfo blockInfo) {
+ staticBlockInfo[blockId] = blockInfo;
+}
+
+BlockInfo GetBlockInfo(BlockId blockId, Vector blockPos) {
+ auto it = staticBlockInfo.find(blockId);
+ if (it != staticBlockInfo.end())
+ return it->second;
+ if (blockPos == Vector())
+ return BlockInfo{ true, "", "" };
+ return PluginSystem::RequestBlockInfo(blockPos);
+}