2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockHandler.h"
|
|
|
|
#include "../World.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockOreHandler :
|
|
|
|
public cBlockHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cBlockOreHandler(BLOCKTYPE a_BlockType)
|
|
|
|
: cBlockHandler(a_BlockType)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
|
|
|
{
|
2014-08-19 16:14:37 -04:00
|
|
|
cFastRandom Random;
|
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
switch (m_BlockType)
|
|
|
|
{
|
|
|
|
case E_BLOCK_LAPIS_ORE:
|
|
|
|
{
|
2014-08-19 16:14:37 -04:00
|
|
|
a_Pickups.push_back(cItem(E_ITEM_DYE, (char)(4 + Random.NextInt(5)), 4));
|
2013-07-29 07:13:03 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_REDSTONE_ORE:
|
|
|
|
case E_BLOCK_REDSTONE_ORE_GLOWING:
|
|
|
|
{
|
2014-08-19 16:14:37 -04:00
|
|
|
a_Pickups.push_back(cItem(E_ITEM_REDSTONE_DUST, (char)(4 + Random.NextInt(2)), 0));
|
2013-07-29 07:13:03 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_DIAMOND_ORE:
|
|
|
|
{
|
2014-08-19 16:14:37 -04:00
|
|
|
a_Pickups.push_back(cItem(E_ITEM_DIAMOND));
|
2013-07-29 07:13:03 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_EMERALD_ORE:
|
|
|
|
{
|
2014-08-19 16:14:37 -04:00
|
|
|
a_Pickups.push_back(cItem(E_ITEM_EMERALD));
|
2013-07-29 07:13:03 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_COAL_ORE:
|
|
|
|
{
|
2014-08-19 16:14:37 -04:00
|
|
|
a_Pickups.push_back(cItem(E_ITEM_COAL));
|
2013-07-29 07:13:03 -04:00
|
|
|
break;
|
|
|
|
}
|
2014-08-19 16:14:37 -04:00
|
|
|
default:
|
|
|
|
{
|
2014-09-12 08:08:56 -04:00
|
|
|
a_Pickups.push_back(cItem(m_BlockType));
|
|
|
|
break;
|
2014-08-19 16:14:37 -04:00
|
|
|
}
|
2013-07-29 07:13:03 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|