summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-07-14 21:26:36 +0200
committerTycho <work.tycho+git@gmail.com>2014-07-14 21:26:36 +0200
commit1929d16724de6f451c9485076b4091cbc457916c (patch)
tree2ec9a31b02c6224d21fbcdbf9cba8600ef24965c /src
parentMerge pull request #1177 from mc-server/ChestFix (diff)
downloadcuberite-1929d16724de6f451c9485076b4091cbc457916c.tar
cuberite-1929d16724de6f451c9485076b4091cbc457916c.tar.gz
cuberite-1929d16724de6f451c9485076b4091cbc457916c.tar.bz2
cuberite-1929d16724de6f451c9485076b4091cbc457916c.tar.lz
cuberite-1929d16724de6f451c9485076b4091cbc457916c.tar.xz
cuberite-1929d16724de6f451c9485076b4091cbc457916c.tar.zst
cuberite-1929d16724de6f451c9485076b4091cbc457916c.zip
Diffstat (limited to 'src')
-rw-r--r--src/Blocks/BlockLadder.h5
-rw-r--r--src/Blocks/ClearMetaOnDrop.h18
2 files changed, 21 insertions, 2 deletions
diff --git a/src/Blocks/BlockLadder.h b/src/Blocks/BlockLadder.h
index a605edf3f..1af2be067 100644
--- a/src/Blocks/BlockLadder.h
+++ b/src/Blocks/BlockLadder.h
@@ -3,17 +3,18 @@
#include "BlockHandler.h"
#include "../World.h"
+#include "ClearMetaOnDrop.h"
class cBlockLadderHandler :
- public cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04>
+ public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04> >
{
public:
cBlockLadderHandler(BLOCKTYPE a_BlockType)
- : cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04>(a_BlockType)
+ : cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x07, 0x02, 0x05, 0x03, 0x04> >(a_BlockType)
{
}
diff --git a/src/Blocks/ClearMetaOnDrop.h b/src/Blocks/ClearMetaOnDrop.h
new file mode 100644
index 000000000..21b987f2c
--- /dev/null
+++ b/src/Blocks/ClearMetaOnDrop.h
@@ -0,0 +1,18 @@
+
+#pragma once
+
+template<class Base>
+class cClearMetaOnDrop : public Base
+{
+public:
+
+ cClearMetaOnDrop(BLOCKTYPE a_BlockType) :
+ Base(a_BlockType)
+ {}
+
+ virtual ~cClearMetaOnDrop() {}
+ virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+ {
+ a_Pickups.push_back(cItem(this->m_BlockType, 1, 0));
+ }
+};