From 1929d16724de6f451c9485076b4091cbc457916c Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 14 Jul 2014 20:26:36 +0100 Subject: Added first implementation of cClearMetaOnDrop --- src/Blocks/BlockLadder.h | 5 +++-- src/Blocks/ClearMetaOnDrop.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 src/Blocks/ClearMetaOnDrop.h (limited to 'src/Blocks') 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 + public cClearMetaOnDrop > { public: cBlockLadderHandler(BLOCKTYPE a_BlockType) - : cMetaRotator(a_BlockType) + : cClearMetaOnDrop >(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 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)); + } +}; -- cgit v1.2.3 From 515c3cbc67816fb770ff7e32bd593bd55c26788c Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 14 Jul 2014 20:28:16 +0100 Subject: Added cClearOnDrop Mixin to cPumpkin --- src/Blocks/BlockPumpkin.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockPumpkin.h b/src/Blocks/BlockPumpkin.h index ac2b9817a..f4022735b 100644 --- a/src/Blocks/BlockPumpkin.h +++ b/src/Blocks/BlockPumpkin.h @@ -6,11 +6,11 @@ class cBlockPumpkinHandler : - public cMetaRotator + public cClearMetaOnDrop > { public: cBlockPumpkinHandler(BLOCKTYPE a_BlockType) - : cMetaRotator(a_BlockType) + : cClearMetaOnDrop >(a_BlockType) { } -- cgit v1.2.3 From 093b5c6456fd2c635441630c87853a3a00008af8 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 14 Jul 2014 20:33:30 +0100 Subject: Simplified ClearMetaOnDrop --- src/Blocks/ClearMetaOnDrop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Blocks') diff --git a/src/Blocks/ClearMetaOnDrop.h b/src/Blocks/ClearMetaOnDrop.h index 21b987f2c..e6d26863a 100644 --- a/src/Blocks/ClearMetaOnDrop.h +++ b/src/Blocks/ClearMetaOnDrop.h @@ -13,6 +13,6 @@ public: virtual ~cClearMetaOnDrop() {} virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - a_Pickups.push_back(cItem(this->m_BlockType, 1, 0)); + a_Pickups.push_back(cItem(this->m_BlockType)); } }; -- cgit v1.2.3 From 333f4f982cbd24ffcb376594eddef439b3f05e9e Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 14 Jul 2014 20:50:56 +0100 Subject: Converted some blockhandlers to use cClearMetaOnDrop --- src/Blocks/BlockBrewingStand.h | 10 +++------- src/Blocks/BlockCobWeb.h | 10 ++-------- src/Blocks/BlockFlowerPot.h | 9 ++------- src/Blocks/BlockLilypad.h | 9 ++------- src/Blocks/BlockMycelium.h | 8 ++------ src/Blocks/BlockRedstone.h | 11 ++--------- src/Blocks/BlockRedstoneLamp.h | 9 ++------- src/Blocks/BlockRedstoneRepeater.h | 13 +++---------- src/Blocks/BlockStone.h | 9 +++------ 9 files changed, 21 insertions(+), 67 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockBrewingStand.h b/src/Blocks/BlockBrewingStand.h index 57642bcb6..77e383b16 100644 --- a/src/Blocks/BlockBrewingStand.h +++ b/src/Blocks/BlockBrewingStand.h @@ -2,25 +2,21 @@ #pragma once #include "BlockHandler.h" +#include "ClearMetaOnDrop.h" class cBlockBrewingStandHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockBrewingStandHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - a_Pickups.push_back(cItem(E_ITEM_BREWING_STAND, 1, 0)); - } - virtual bool IsUseable() override { return true; diff --git a/src/Blocks/BlockCobWeb.h b/src/Blocks/BlockCobWeb.h index 982bfaa30..29a6b8155 100644 --- a/src/Blocks/BlockCobWeb.h +++ b/src/Blocks/BlockCobWeb.h @@ -10,19 +10,13 @@ class cBlockCobWebHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockCobWebHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } - - - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_Meta) override - { - a_Pickups.push_back(cItem(E_ITEM_STRING, 1, 0)); - } } ; diff --git a/src/Blocks/BlockFlowerPot.h b/src/Blocks/BlockFlowerPot.h index fc75ef638..39fbe1bd9 100644 --- a/src/Blocks/BlockFlowerPot.h +++ b/src/Blocks/BlockFlowerPot.h @@ -9,18 +9,13 @@ class cBlockFlowerPotHandler : - public cBlockEntityHandler + public cClearMetaOnDrop { public: cBlockFlowerPotHandler(BLOCKTYPE a_BlockType) : - cBlockEntityHandler(a_BlockType) + cClearMetaOnDrop(a_BlockType) { } - - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - a_Pickups.push_back(cItem(E_ITEM_FLOWER_POT, 1, 0)); - } } ; diff --git a/src/Blocks/BlockLilypad.h b/src/Blocks/BlockLilypad.h index 2dd4ec768..fc37f360c 100644 --- a/src/Blocks/BlockLilypad.h +++ b/src/Blocks/BlockLilypad.h @@ -8,19 +8,14 @@ class cBlockLilypadHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockLilypadHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - // Reset meta to zero - a_Pickups.push_back(cItem(E_BLOCK_LILY_PAD, 1, 0)); - } }; diff --git a/src/Blocks/BlockMycelium.h b/src/Blocks/BlockMycelium.h index 2a8ef5fca..4d4a0bb4f 100644 --- a/src/Blocks/BlockMycelium.h +++ b/src/Blocks/BlockMycelium.h @@ -8,20 +8,16 @@ class cBlockMyceliumHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockMyceliumHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } // TODO: Add Mycel Spread - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - a_Pickups.push_back(cItem(E_BLOCK_DIRT, 1, 0)); - } virtual const char * GetStepSound(void) override { diff --git a/src/Blocks/BlockRedstone.h b/src/Blocks/BlockRedstone.h index a898c9acb..6dbf46a57 100644 --- a/src/Blocks/BlockRedstone.h +++ b/src/Blocks/BlockRedstone.h @@ -9,11 +9,11 @@ class cBlockRedstoneHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockRedstoneHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } @@ -22,13 +22,6 @@ public: { return ((a_RelY > 0) && cBlockInfo::FullyOccupiesVoxel(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ))); } - - - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - // Reset meta to 0 - a_Pickups.push_back(cItem(E_ITEM_REDSTONE_DUST, 1)); - } } ; diff --git a/src/Blocks/BlockRedstoneLamp.h b/src/Blocks/BlockRedstoneLamp.h index 69a2b27c2..4b0ca5b34 100644 --- a/src/Blocks/BlockRedstoneLamp.h +++ b/src/Blocks/BlockRedstoneLamp.h @@ -8,18 +8,13 @@ class cBlockRedstoneLampHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockRedstoneLampHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } - - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - a_Pickups.push_back(cItem(E_BLOCK_REDSTONE_LAMP_OFF, 1, 0)); - } }; diff --git a/src/Blocks/BlockRedstoneRepeater.h b/src/Blocks/BlockRedstoneRepeater.h index fe6cd21b9..1e9c00f2e 100644 --- a/src/Blocks/BlockRedstoneRepeater.h +++ b/src/Blocks/BlockRedstoneRepeater.h @@ -4,16 +4,16 @@ #include "BlockHandler.h" #include "Chunk.h" #include "MetaRotator.h" - +#include "ClearMetaOnDrop.h" class cBlockRedstoneRepeaterHandler : - public cMetaRotator + public cClearMetaOnDrop > { public: cBlockRedstoneRepeaterHandler(BLOCKTYPE a_BlockType) - : cMetaRotator(a_BlockType) + : cClearMetaOnDrop >(a_BlockType) { } @@ -44,13 +44,6 @@ public: } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - // Reset meta to 0 - a_Pickups.push_back(cItem(E_ITEM_REDSTONE_REPEATER, 1, 0)); - } - - virtual bool IsUseable(void) override { return true; diff --git a/src/Blocks/BlockStone.h b/src/Blocks/BlockStone.h index cd5230f49..697ab0312 100644 --- a/src/Blocks/BlockStone.h +++ b/src/Blocks/BlockStone.h @@ -2,24 +2,21 @@ #pragma once #include "BlockHandler.h" +#include "ClearMetaOnDrop.h" class cBlockStoneHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockStoneHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - a_Pickups.push_back(cItem(E_BLOCK_COBBLESTONE, 1, 0)); - } } ; -- cgit v1.2.3 From 2cd3443fbbb498f06227ed44db0c6a749cafdb76 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 14 Jul 2014 21:21:17 +0100 Subject: Added documentation --- src/Blocks/ClearMetaOnDrop.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Blocks') diff --git a/src/Blocks/ClearMetaOnDrop.h b/src/Blocks/ClearMetaOnDrop.h index e6d26863a..3f8c33819 100644 --- a/src/Blocks/ClearMetaOnDrop.h +++ b/src/Blocks/ClearMetaOnDrop.h @@ -1,6 +1,12 @@ #pragma once +// mixin for use to clear meta values when the block is converted to a pickup + +// Usage: inherit from this class, passing the parent class as the parameter Base +// For example to use in class Foo which should inherit Bar use +// class Foo : public cClearMetaOnDrop; + template class cClearMetaOnDrop : public Base { -- cgit v1.2.3 From 8fd636aa7235698263e3b85388a4f6373cbedb76 Mon Sep 17 00:00:00 2001 From: Tycho Date: Mon, 14 Jul 2014 23:59:24 +0100 Subject: Revert "Converted some blockhandlers to use cClearMetaOnDrop" This reverts commit 333f4f982cbd24ffcb376594eddef439b3f05e9e. --- src/Blocks/BlockBrewingStand.h | 10 +++++++--- src/Blocks/BlockCobWeb.h | 10 ++++++++-- src/Blocks/BlockFlowerPot.h | 9 +++++++-- src/Blocks/BlockLilypad.h | 9 +++++++-- src/Blocks/BlockMycelium.h | 8 ++++++-- src/Blocks/BlockRedstone.h | 11 +++++++++-- src/Blocks/BlockRedstoneLamp.h | 9 +++++++-- src/Blocks/BlockRedstoneRepeater.h | 13 ++++++++++--- src/Blocks/BlockStone.h | 9 ++++++--- 9 files changed, 67 insertions(+), 21 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockBrewingStand.h b/src/Blocks/BlockBrewingStand.h index 77e383b16..57642bcb6 100644 --- a/src/Blocks/BlockBrewingStand.h +++ b/src/Blocks/BlockBrewingStand.h @@ -2,21 +2,25 @@ #pragma once #include "BlockHandler.h" -#include "ClearMetaOnDrop.h" class cBlockBrewingStandHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockBrewingStandHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(E_ITEM_BREWING_STAND, 1, 0)); + } + virtual bool IsUseable() override { return true; diff --git a/src/Blocks/BlockCobWeb.h b/src/Blocks/BlockCobWeb.h index 29a6b8155..982bfaa30 100644 --- a/src/Blocks/BlockCobWeb.h +++ b/src/Blocks/BlockCobWeb.h @@ -10,13 +10,19 @@ class cBlockCobWebHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockCobWebHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } + + + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_Meta) override + { + a_Pickups.push_back(cItem(E_ITEM_STRING, 1, 0)); + } } ; diff --git a/src/Blocks/BlockFlowerPot.h b/src/Blocks/BlockFlowerPot.h index 39fbe1bd9..fc75ef638 100644 --- a/src/Blocks/BlockFlowerPot.h +++ b/src/Blocks/BlockFlowerPot.h @@ -9,13 +9,18 @@ class cBlockFlowerPotHandler : - public cClearMetaOnDrop + public cBlockEntityHandler { public: cBlockFlowerPotHandler(BLOCKTYPE a_BlockType) : - cClearMetaOnDrop(a_BlockType) + cBlockEntityHandler(a_BlockType) { } + + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(E_ITEM_FLOWER_POT, 1, 0)); + } } ; diff --git a/src/Blocks/BlockLilypad.h b/src/Blocks/BlockLilypad.h index fc37f360c..2dd4ec768 100644 --- a/src/Blocks/BlockLilypad.h +++ b/src/Blocks/BlockLilypad.h @@ -8,14 +8,19 @@ class cBlockLilypadHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockLilypadHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + // Reset meta to zero + a_Pickups.push_back(cItem(E_BLOCK_LILY_PAD, 1, 0)); + } }; diff --git a/src/Blocks/BlockMycelium.h b/src/Blocks/BlockMycelium.h index 4d4a0bb4f..2a8ef5fca 100644 --- a/src/Blocks/BlockMycelium.h +++ b/src/Blocks/BlockMycelium.h @@ -8,16 +8,20 @@ class cBlockMyceliumHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockMyceliumHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } // TODO: Add Mycel Spread + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(E_BLOCK_DIRT, 1, 0)); + } virtual const char * GetStepSound(void) override { diff --git a/src/Blocks/BlockRedstone.h b/src/Blocks/BlockRedstone.h index 6dbf46a57..a898c9acb 100644 --- a/src/Blocks/BlockRedstone.h +++ b/src/Blocks/BlockRedstone.h @@ -9,11 +9,11 @@ class cBlockRedstoneHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockRedstoneHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } @@ -22,6 +22,13 @@ public: { return ((a_RelY > 0) && cBlockInfo::FullyOccupiesVoxel(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ))); } + + + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + // Reset meta to 0 + a_Pickups.push_back(cItem(E_ITEM_REDSTONE_DUST, 1)); + } } ; diff --git a/src/Blocks/BlockRedstoneLamp.h b/src/Blocks/BlockRedstoneLamp.h index 4b0ca5b34..69a2b27c2 100644 --- a/src/Blocks/BlockRedstoneLamp.h +++ b/src/Blocks/BlockRedstoneLamp.h @@ -8,13 +8,18 @@ class cBlockRedstoneLampHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockRedstoneLampHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } + + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(E_BLOCK_REDSTONE_LAMP_OFF, 1, 0)); + } }; diff --git a/src/Blocks/BlockRedstoneRepeater.h b/src/Blocks/BlockRedstoneRepeater.h index 1e9c00f2e..fe6cd21b9 100644 --- a/src/Blocks/BlockRedstoneRepeater.h +++ b/src/Blocks/BlockRedstoneRepeater.h @@ -4,16 +4,16 @@ #include "BlockHandler.h" #include "Chunk.h" #include "MetaRotator.h" -#include "ClearMetaOnDrop.h" + class cBlockRedstoneRepeaterHandler : - public cClearMetaOnDrop > + public cMetaRotator { public: cBlockRedstoneRepeaterHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop >(a_BlockType) + : cMetaRotator(a_BlockType) { } @@ -44,6 +44,13 @@ public: } + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + // Reset meta to 0 + a_Pickups.push_back(cItem(E_ITEM_REDSTONE_REPEATER, 1, 0)); + } + + virtual bool IsUseable(void) override { return true; diff --git a/src/Blocks/BlockStone.h b/src/Blocks/BlockStone.h index 697ab0312..cd5230f49 100644 --- a/src/Blocks/BlockStone.h +++ b/src/Blocks/BlockStone.h @@ -2,21 +2,24 @@ #pragma once #include "BlockHandler.h" -#include "ClearMetaOnDrop.h" class cBlockStoneHandler : - public cClearMetaOnDrop + public cBlockHandler { public: cBlockStoneHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : cBlockHandler(a_BlockType) { } + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(E_BLOCK_COBBLESTONE, 1, 0)); + } } ; -- cgit v1.2.3 From 0e5fa2662aa2b559335a25ee78cd086f795be79e Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 15 Jul 2014 00:01:16 +0100 Subject: COnverted Lilypad back to mixin --- src/Blocks/BlockLilypad.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockLilypad.h b/src/Blocks/BlockLilypad.h index 2dd4ec768..c25f150c7 100644 --- a/src/Blocks/BlockLilypad.h +++ b/src/Blocks/BlockLilypad.h @@ -8,19 +8,13 @@ class cBlockLilypadHandler : - public cBlockHandler + public cClearMetaOnDrop { public: cBlockLilypadHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cClearMetaOnDrop(a_BlockType) { } - - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override - { - // Reset meta to zero - a_Pickups.push_back(cItem(E_BLOCK_LILY_PAD, 1, 0)); - } }; -- cgit v1.2.3 From 01a31a1872bb7c33d5a4d0a13dae083c4ef7792e Mon Sep 17 00:00:00 2001 From: Tycho Date: Tue, 15 Jul 2014 12:27:36 +0100 Subject: Added super typedef --- src/Blocks/BlockLadder.h | 3 ++- src/Blocks/BlockLilypad.h | 3 ++- src/Blocks/BlockPumpkin.h | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockLadder.h b/src/Blocks/BlockLadder.h index 1af2be067..211bbdd9e 100644 --- a/src/Blocks/BlockLadder.h +++ b/src/Blocks/BlockLadder.h @@ -12,9 +12,10 @@ class cBlockLadderHandler : public cClearMetaOnDrop > { + typedef cClearMetaOnDrop > super; public: cBlockLadderHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop >(a_BlockType) + : super(a_BlockType) { } diff --git a/src/Blocks/BlockLilypad.h b/src/Blocks/BlockLilypad.h index c25f150c7..1320174fc 100644 --- a/src/Blocks/BlockLilypad.h +++ b/src/Blocks/BlockLilypad.h @@ -10,9 +10,10 @@ class cBlockLilypadHandler : public cClearMetaOnDrop { +typedef cClearMetaOnDrop super; public: cBlockLilypadHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop(a_BlockType) + : super(a_BlockType) { } }; diff --git a/src/Blocks/BlockPumpkin.h b/src/Blocks/BlockPumpkin.h index f4022735b..d2e9d7843 100644 --- a/src/Blocks/BlockPumpkin.h +++ b/src/Blocks/BlockPumpkin.h @@ -8,9 +8,10 @@ class cBlockPumpkinHandler : public cClearMetaOnDrop > { +typedef cClearMetaOnDrop > super; public: cBlockPumpkinHandler(BLOCKTYPE a_BlockType) - : cClearMetaOnDrop >(a_BlockType) + : super(a_BlockType) { } -- cgit v1.2.3 From 2d245264b1b630dd9c6af6ffb6e6387e011a3198 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Tue, 15 Jul 2014 13:34:45 +0200 Subject: Added various missing blocks in the lists in BlockInfo.cpp --- src/Blocks/BlockPiston.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockPiston.h b/src/Blocks/BlockPiston.h index 27a44d829..1c8ac6a35 100644 --- a/src/Blocks/BlockPiston.h +++ b/src/Blocks/BlockPiston.h @@ -94,7 +94,6 @@ private: switch (a_BlockType) { case E_BLOCK_ANVIL: - case E_BLOCK_BED: case E_BLOCK_BEDROCK: case E_BLOCK_BREWING_STAND: case E_BLOCK_CHEST: -- cgit v1.2.3 From 9a970479efaef781ea8f69e3d8b8a1e2aa367847 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Tue, 15 Jul 2014 14:54:24 +0200 Subject: Fixed code formatting. --- src/Blocks/BlockLilypad.h | 7 ++++--- src/Blocks/BlockPumpkin.h | 8 +++++--- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/Blocks') diff --git a/src/Blocks/BlockLilypad.h b/src/Blocks/BlockLilypad.h index 1320174fc..53277caa5 100644 --- a/src/Blocks/BlockLilypad.h +++ b/src/Blocks/BlockLilypad.h @@ -10,10 +10,11 @@ class cBlockLilypadHandler : public cClearMetaOnDrop { -typedef cClearMetaOnDrop super; + typedef cClearMetaOnDrop super; public: - cBlockLilypadHandler(BLOCKTYPE a_BlockType) - : super(a_BlockType) + + cBlockLilypadHandler(BLOCKTYPE a_BlockType) : + super(a_BlockType) { } }; diff --git a/src/Blocks/BlockPumpkin.h b/src/Blocks/BlockPumpkin.h index d2e9d7843..4692a47df 100644 --- a/src/Blocks/BlockPumpkin.h +++ b/src/Blocks/BlockPumpkin.h @@ -8,12 +8,14 @@ class cBlockPumpkinHandler : public cClearMetaOnDrop > { -typedef cClearMetaOnDrop > super; + typedef cClearMetaOnDrop > super; public: - cBlockPumpkinHandler(BLOCKTYPE a_BlockType) - : super(a_BlockType) + + cBlockPumpkinHandler(BLOCKTYPE a_BlockType) : + super(a_BlockType) { } + virtual void OnPlacedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override { -- cgit v1.2.3