1
0

Converted some blockhandlers to use cClearMetaOnDrop

This commit is contained in:
Tycho 2014-07-14 20:50:56 +01:00
parent 093b5c6456
commit 333f4f982c
9 changed files with 21 additions and 67 deletions

View File

@ -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;

View File

@ -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));
}
} ;

View File

@ -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));
}
} ;

View File

@ -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));
}
};

View File

@ -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
{

View File

@ -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));
}
} ;

View File

@ -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));
}
};

View File

@ -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;

View File

@ -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));
}
} ;