2012-10-01 17:08:15 -04:00
|
|
|
|
2012-07-16 09:30:33 -04:00
|
|
|
#pragma once
|
2012-10-01 17:08:15 -04:00
|
|
|
|
2012-09-23 18:09:57 -04:00
|
|
|
#include "BlockHandler.h"
|
2012-07-16 09:30:33 -04:00
|
|
|
#include "../MersenneTwister.h"
|
2012-09-23 18:09:57 -04:00
|
|
|
#include "../World.h"
|
2012-07-16 09:30:33 -04:00
|
|
|
|
2012-10-01 17:08:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockOreHandler :
|
|
|
|
public cBlockHandler
|
2012-07-16 09:30:33 -04:00
|
|
|
{
|
|
|
|
public:
|
2012-10-03 04:52:11 -04:00
|
|
|
cBlockOreHandler(BLOCKTYPE a_BlockType)
|
|
|
|
: cBlockHandler(a_BlockType)
|
2012-07-16 09:30:33 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-10-01 17:08:15 -04:00
|
|
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
2012-07-16 09:30:33 -04:00
|
|
|
{
|
2012-10-01 17:08:15 -04:00
|
|
|
short ItemType = E_ITEM_EMPTY;
|
|
|
|
char Count = 1;
|
|
|
|
short Meta = 0;
|
|
|
|
|
2012-07-16 09:30:33 -04:00
|
|
|
MTRand r1;
|
2012-10-03 04:52:11 -04:00
|
|
|
switch (m_BlockType)
|
2012-07-16 09:30:33 -04:00
|
|
|
{
|
2012-10-01 17:08:15 -04:00
|
|
|
case E_BLOCK_LAPIS_ORE:
|
|
|
|
{
|
|
|
|
ItemType = E_ITEM_DYE;
|
|
|
|
Count = 4 + (char)r1.randInt(4);
|
|
|
|
Meta = 4;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_REDSTONE_ORE:
|
|
|
|
case E_BLOCK_REDSTONE_ORE_GLOWING:
|
|
|
|
{
|
|
|
|
Count = 4 + (char)r1.randInt(1);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
{
|
|
|
|
Count = 1;
|
|
|
|
break;
|
|
|
|
}
|
2012-07-16 09:30:33 -04:00
|
|
|
}
|
|
|
|
|
2012-10-03 04:52:11 -04:00
|
|
|
switch (m_BlockType)
|
2012-07-16 09:30:33 -04:00
|
|
|
{
|
2012-10-01 17:08:15 -04:00
|
|
|
case E_BLOCK_DIAMOND_ORE:
|
|
|
|
{
|
|
|
|
ItemType = E_ITEM_DIAMOND;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_REDSTONE_ORE:
|
|
|
|
case E_BLOCK_REDSTONE_ORE_GLOWING:
|
|
|
|
{
|
|
|
|
ItemType = E_ITEM_REDSTONE_DUST;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_EMERALD_ORE:
|
|
|
|
{
|
|
|
|
ItemType = E_ITEM_EMERALD;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case E_BLOCK_COAL_ORE:
|
|
|
|
{
|
|
|
|
ItemType = E_ITEM_COAL;
|
|
|
|
break;
|
|
|
|
}
|
2012-07-16 09:30:33 -04:00
|
|
|
}
|
2012-10-01 17:08:15 -04:00
|
|
|
a_Pickups.push_back(cItem(ItemType, Count, Meta));
|
2012-07-16 09:30:33 -04:00
|
|
|
}
|
2012-10-01 17:08:15 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-07-16 09:30:33 -04:00
|
|
|
|