summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-07-14 21:50:56 +0200
committerTycho <work.tycho+git@gmail.com>2014-07-14 21:50:56 +0200
commit333f4f982cbd24ffcb376594eddef439b3f05e9e (patch)
treec5567d23eee76e38d41cf828d1f642ab271cbd91 /src
parentSimplified ClearMetaOnDrop (diff)
downloadcuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.tar
cuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.tar.gz
cuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.tar.bz2
cuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.tar.lz
cuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.tar.xz
cuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.tar.zst
cuberite-333f4f982cbd24ffcb376594eddef439b3f05e9e.zip
Diffstat (limited to 'src')
-rw-r--r--src/Blocks/BlockBrewingStand.h10
-rw-r--r--src/Blocks/BlockCobWeb.h10
-rw-r--r--src/Blocks/BlockFlowerPot.h9
-rw-r--r--src/Blocks/BlockLilypad.h9
-rw-r--r--src/Blocks/BlockMycelium.h8
-rw-r--r--src/Blocks/BlockRedstone.h11
-rw-r--r--src/Blocks/BlockRedstoneLamp.h9
-rw-r--r--src/Blocks/BlockRedstoneRepeater.h13
-rw-r--r--src/Blocks/BlockStone.h9
9 files changed, 21 insertions, 67 deletions
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<cBlockHandler>
{
public:
cBlockBrewingStandHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<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 982bfaa30..29a6b8155 100644
--- a/src/Blocks/BlockCobWeb.h
+++ b/src/Blocks/BlockCobWeb.h
@@ -10,19 +10,13 @@
class cBlockCobWebHandler :
- public cBlockHandler
+ public cClearMetaOnDrop<cBlockHandler>
{
public:
cBlockCobWebHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<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 fc75ef638..39fbe1bd9 100644
--- a/src/Blocks/BlockFlowerPot.h
+++ b/src/Blocks/BlockFlowerPot.h
@@ -9,18 +9,13 @@
class cBlockFlowerPotHandler :
- public cBlockEntityHandler
+ public cClearMetaOnDrop<cBlockEntityHandler>
{
public:
cBlockFlowerPotHandler(BLOCKTYPE a_BlockType) :
- cBlockEntityHandler(a_BlockType)
+ cClearMetaOnDrop<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 2dd4ec768..fc37f360c 100644
--- a/src/Blocks/BlockLilypad.h
+++ b/src/Blocks/BlockLilypad.h
@@ -8,19 +8,14 @@
class cBlockLilypadHandler :
- public cBlockHandler
+ public cClearMetaOnDrop<cBlockHandler>
{
public:
cBlockLilypadHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<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 2a8ef5fca..4d4a0bb4f 100644
--- a/src/Blocks/BlockMycelium.h
+++ b/src/Blocks/BlockMycelium.h
@@ -8,20 +8,16 @@
class cBlockMyceliumHandler :
- public cBlockHandler
+ public cClearMetaOnDrop<cBlockHandler>
{
public:
cBlockMyceliumHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<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 a898c9acb..6dbf46a57 100644
--- a/src/Blocks/BlockRedstone.h
+++ b/src/Blocks/BlockRedstone.h
@@ -9,11 +9,11 @@
class cBlockRedstoneHandler :
- public cBlockHandler
+ public cClearMetaOnDrop<cBlockHandler>
{
public:
cBlockRedstoneHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<cBlockHandler>(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<cBlockHandler>
{
public:
cBlockRedstoneLampHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<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 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<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>
+ public cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true> >
{
public:
cBlockRedstoneRepeaterHandler(BLOCKTYPE a_BlockType)
- : cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true>(a_BlockType)
+ : cClearMetaOnDrop<cMetaRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03, true> >(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<cBlockHandler>
{
public:
cBlockStoneHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cClearMetaOnDrop<cBlockHandler>(a_BlockType)
{
}
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
- {
- a_Pickups.push_back(cItem(E_BLOCK_COBBLESTONE, 1, 0));
- }
} ;