summaryrefslogtreecommitdiffstats
path: root/source/Blocks
diff options
context:
space:
mode:
Diffstat (limited to 'source/Blocks')
-rw-r--r--source/Blocks/BlockEnderchest.h28
-rw-r--r--source/Blocks/BlockHandler.cpp2
-rw-r--r--source/Blocks/BlockMycelium.h2
3 files changed, 30 insertions, 2 deletions
diff --git a/source/Blocks/BlockEnderchest.h b/source/Blocks/BlockEnderchest.h
new file mode 100644
index 000000000..b40deb1f7
--- /dev/null
+++ b/source/Blocks/BlockEnderchest.h
@@ -0,0 +1,28 @@
+
+#pragma once
+
+#include "BlockHandler.h"
+
+
+
+
+
+class cBlockEnderchestHandler :
+ public cBlockHandler
+{
+public:
+ cBlockEnderchestHandler(BLOCKTYPE a_BlockType)
+ : cBlockHandler(a_BlockType)
+ {
+ }
+
+ virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+ {
+ //todo: Drop Ender Chest if using silk touch pickaxe
+ a_Pickups.push_back(cItem(E_BLOCK_OBSIDIAN, 8, 0));
+ }
+} ;
+
+
+
+
diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp
index 3f63de89f..3fb96f6a0 100644
--- a/source/Blocks/BlockHandler.cpp
+++ b/source/Blocks/BlockHandler.cpp
@@ -47,6 +47,7 @@
#include "BlockMycelium.h"
#include "BlockRail.h"
#include "BlockGlass.h"
+#include "BlockEnderchest.h"
@@ -100,6 +101,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_DOUBLE_STONE_SLAB: return new cBlockSlabHandler (a_BlockType);
case E_BLOCK_DOUBLE_WOODEN_SLAB: return new cBlockSlabHandler (a_BlockType);
case E_BLOCK_EMERALD_ORE: return new cBlockOreHandler (a_BlockType);
+ case E_BLOCK_ENDER_CHEST: return new cBlockEnderchestHandler (a_BlockType);
case E_BLOCK_FARMLAND: return new cBlockFarmlandHandler;
case E_BLOCK_FIRE: return new cBlockFireHandler (a_BlockType);
case E_BLOCK_FURNACE: return new cBlockFurnaceHandler (a_BlockType);
diff --git a/source/Blocks/BlockMycelium.h b/source/Blocks/BlockMycelium.h
index 57b45dfe1..8e1f577e1 100644
--- a/source/Blocks/BlockMycelium.h
+++ b/source/Blocks/BlockMycelium.h
@@ -2,8 +2,6 @@
#pragma once
#include "BlockHandler.h"
-#include "../MersenneTwister.h"
-#include "../World.h"