parent
ad6494fb36
commit
5b1552435f
@ -16,13 +16,6 @@ public:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
|
||||||
{
|
|
||||||
a_Pickups.push_back(cItem(E_BLOCK_WOOL, 1, a_BlockMeta));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
virtual const char * GetStepSound(void) override
|
virtual const char * GetStepSound(void) override
|
||||||
{
|
{
|
||||||
return "step.cloth";
|
return "step.cloth";
|
||||||
|
@ -19,15 +19,13 @@
|
|||||||
class cBlockFarmlandHandler :
|
class cBlockFarmlandHandler :
|
||||||
public cBlockHandler
|
public cBlockHandler
|
||||||
{
|
{
|
||||||
typedef cBlockHandler super;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cBlockFarmlandHandler(void) :
|
cBlockFarmlandHandler(BLOCKTYPE a_BlockType) :
|
||||||
super(E_BLOCK_FARMLAND)
|
cBlockHandler(a_BlockType)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
|
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
|
||||||
{
|
{
|
||||||
bool Found = false;
|
bool Found = false;
|
||||||
@ -105,6 +103,11 @@ public:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||||
|
{
|
||||||
|
a_Pickups.Add(E_BLOCK_DIRT, 1, 0); // Reset meta
|
||||||
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
|
|||||||
case E_BLOCK_EMERALD_ORE: return new cBlockOreHandler (a_BlockType);
|
case E_BLOCK_EMERALD_ORE: return new cBlockOreHandler (a_BlockType);
|
||||||
case E_BLOCK_ENCHANTMENT_TABLE: return new cBlockEnchantmentTableHandler(a_BlockType);
|
case E_BLOCK_ENCHANTMENT_TABLE: return new cBlockEnchantmentTableHandler(a_BlockType);
|
||||||
case E_BLOCK_ENDER_CHEST: return new cBlockEnderchestHandler (a_BlockType);
|
case E_BLOCK_ENDER_CHEST: return new cBlockEnderchestHandler (a_BlockType);
|
||||||
case E_BLOCK_FARMLAND: return new cBlockFarmlandHandler ( );
|
case E_BLOCK_FARMLAND: return new cBlockFarmlandHandler (a_BlockType);
|
||||||
case E_BLOCK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
|
case E_BLOCK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType);
|
||||||
case E_BLOCK_FIRE: return new cBlockFireHandler (a_BlockType);
|
case E_BLOCK_FIRE: return new cBlockFireHandler (a_BlockType);
|
||||||
case E_BLOCK_FLOWER_POT: return new cBlockFlowerPotHandler (a_BlockType);
|
case E_BLOCK_FLOWER_POT: return new cBlockFlowerPotHandler (a_BlockType);
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "BlockHandler.h"
|
|
||||||
#include "BlockSideways.h"
|
#include "BlockSideways.h"
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,8 +41,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction) // tolua_export
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||||
{ // tolua_export
|
{
|
||||||
|
a_Pickups.Add(m_BlockType, 1, 0); // Reset meta
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static NIBBLETYPE DirectionToMetaData(eBlockFace a_Direction)
|
||||||
|
{
|
||||||
switch (a_Direction)
|
switch (a_Direction)
|
||||||
{
|
{
|
||||||
case BLOCK_FACE_ZM: return 0x2;
|
case BLOCK_FACE_ZM: return 0x2;
|
||||||
@ -51,11 +57,11 @@ public:
|
|||||||
case BLOCK_FACE_XP: return 0x5;
|
case BLOCK_FACE_XP: return 0x5;
|
||||||
default: return 0x2;
|
default: return 0x2;
|
||||||
}
|
}
|
||||||
} // tolua_export
|
}
|
||||||
|
|
||||||
|
|
||||||
static eBlockFace MetaDataToDirection(NIBBLETYPE a_MetaData) // tolua_export
|
static eBlockFace MetaDataToDirection(NIBBLETYPE a_MetaData)
|
||||||
{ // tolua_export
|
{
|
||||||
switch (a_MetaData)
|
switch (a_MetaData)
|
||||||
{
|
{
|
||||||
case 0x2: return BLOCK_FACE_ZM;
|
case 0x2: return BLOCK_FACE_ZM;
|
||||||
@ -64,10 +70,10 @@ public:
|
|||||||
case 0x5: return BLOCK_FACE_XP;
|
case 0x5: return BLOCK_FACE_XP;
|
||||||
default: return BLOCK_FACE_ZM;
|
default: return BLOCK_FACE_ZM;
|
||||||
}
|
}
|
||||||
} // tolua_export
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Finds a suitable Direction for the Ladder. Returns BLOCK_FACE_BOTTOM on failure
|
/** Finds a suitable Direction for the Ladder. Returns BLOCK_FACE_BOTTOM on failure */
|
||||||
static eBlockFace FindSuitableBlockFace(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
|
static eBlockFace FindSuitableBlockFace(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
|
||||||
{
|
{
|
||||||
for (int FaceInt = BLOCK_FACE_ZM; FaceInt <= BLOCK_FACE_XP; FaceInt++)
|
for (int FaceInt = BLOCK_FACE_ZM; FaceInt <= BLOCK_FACE_XP; FaceInt++)
|
||||||
|
@ -32,36 +32,36 @@ public:
|
|||||||
|
|
||||||
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
|
||||||
{
|
{
|
||||||
a_Pickups.Add(m_BlockType, 1, a_BlockMeta & 0x3);
|
a_Pickups.Add(m_BlockType, 1, a_BlockMeta & 0x3); // Reset meta
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace, NIBBLETYPE a_WoodMeta)
|
inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace, NIBBLETYPE a_Meta)
|
||||||
{
|
{
|
||||||
switch (a_BlockFace)
|
switch (a_BlockFace)
|
||||||
{
|
{
|
||||||
case BLOCK_FACE_YM:
|
case BLOCK_FACE_YM:
|
||||||
case BLOCK_FACE_YP:
|
case BLOCK_FACE_YP:
|
||||||
{
|
{
|
||||||
return a_WoodMeta; // Top or bottom, just return original
|
return a_Meta; // Top or bottom, just return original
|
||||||
}
|
}
|
||||||
|
|
||||||
case BLOCK_FACE_ZP:
|
case BLOCK_FACE_ZP:
|
||||||
case BLOCK_FACE_ZM:
|
case BLOCK_FACE_ZM:
|
||||||
{
|
{
|
||||||
return a_WoodMeta | 0x8; // North or south
|
return a_Meta | 0x8; // North or south
|
||||||
}
|
}
|
||||||
|
|
||||||
case BLOCK_FACE_XP:
|
case BLOCK_FACE_XP:
|
||||||
case BLOCK_FACE_XM:
|
case BLOCK_FACE_XM:
|
||||||
{
|
{
|
||||||
return a_WoodMeta | 0x4; // East or west
|
return a_Meta | 0x4; // East or west
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
ASSERT(!"Unhandled block face!");
|
ASSERT(!"Unhandled block face!");
|
||||||
return a_WoodMeta | 0xC; // No idea, give a special meta (all sides bark)
|
return a_Meta | 0xC; // No idea, give a special meta
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user