2016-03-13 18:13:17 +00:00
|
|
|
|
|
|
|
// Stubs.cpp
|
|
|
|
|
|
|
|
// Implements stubs of various Cuberite methods that are needed for linking but not for runtime
|
|
|
|
// This is required so that we don't bring in the entire Cuberite via dependencies
|
|
|
|
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "BlockInfo.h"
|
|
|
|
#include "Blocks/BlockHandler.h"
|
2017-06-24 09:58:06 +00:00
|
|
|
#include "BlockEntities/BlockEntity.h"
|
2016-03-13 18:13:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 06:57:01 +00:00
|
|
|
cBlockInfo::cBlockInfo()
|
2019-10-16 08:06:34 +00:00
|
|
|
{
|
2020-04-03 06:57:01 +00:00
|
|
|
}
|
2019-10-16 08:06:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-03 16:34:27 +00:00
|
|
|
void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
2017-07-03 16:34:27 +00:00
|
|
|
delete a_Handler;
|
2016-03-13 18:13:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-03 16:34:27 +00:00
|
|
|
cBlockInfo::cBlockInfoArray::cBlockInfoArray()
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
2017-07-03 16:34:27 +00:00
|
|
|
cBlockInfoArray & BlockInfos = *this;
|
2016-03-13 18:13:17 +00:00
|
|
|
// The piece-loading code uses the handlers for rotations, so we need valid handlers
|
|
|
|
// Insert dummy handlers:
|
2017-07-03 16:34:27 +00:00
|
|
|
for (size_t i = 0; i < BlockInfos.size(); i++)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
2017-07-03 16:34:27 +00:00
|
|
|
BlockInfos[i].m_Handler.reset(new cBlockHandler(static_cast<BLOCKTYPE>(i)));
|
2016-03-13 18:13:17 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-09-29 12:59:24 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-28 16:59:21 +00:00
|
|
|
cBoundingBox::cBoundingBox(double, double, double, double, double, double)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-13 18:13:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cBlockHandler::cBlockHandler(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-28 16:59:21 +00:00
|
|
|
cBoundingBox cBlockHandler::GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP)
|
|
|
|
{
|
|
|
|
return cBoundingBox(0, 0, 0, 0, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-03-13 18:13:17 +00:00
|
|
|
bool cBlockHandler::GetPlacementBlockTypeMeta(
|
2017-07-31 20:17:52 +00:00
|
|
|
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
|
2020-04-21 20:19:22 +00:00
|
|
|
const Vector3i a_BlockPos,
|
|
|
|
eBlockFace a_BlockFace,
|
|
|
|
const Vector3i a_CursorPos,
|
2016-03-13 18:13:17 +00:00
|
|
|
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-17 09:36:37 +00:00
|
|
|
void cBlockHandler::OnUpdate(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, const Vector3i a_RelPos)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-08-04 17:39:47 +00:00
|
|
|
void cBlockHandler::OnNeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 08:06:34 +00:00
|
|
|
void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 08:06:34 +00:00
|
|
|
cItems cBlockHandler::ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
2019-10-16 08:06:34 +00:00
|
|
|
return cItems();
|
2016-03-13 18:13:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-21 20:19:22 +00:00
|
|
|
bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockHandler::IsUseable()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockHandler::IsClickedThrough(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-07 14:37:53 +00:00
|
|
|
bool cBlockHandler::DoesIgnoreBuildCollision(cChunkInterface & a_ChunkInterface, Vector3i a_Pos, cPlayer & a_Player, NIBBLETYPE a_Meta)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
return (m_BlockType == E_BLOCK_AIR);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockHandler::DoesDropOnUnsuitable(void)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 08:06:34 +00:00
|
|
|
void cBlockHandler::Check(cChunkInterface & a_ChunkInterface, cBlockPluginInterface & a_PluginInterface, Vector3i a_RelPos, cChunk & a_Chunk)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColourID cBlockHandler::GetMapBaseColourID(NIBBLETYPE a_Meta)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-21 20:19:22 +00:00
|
|
|
bool cBlockHandler::IsInsideBlock(Vector3d a_Position, const NIBBLETYPE a_BlockMeta)
|
2016-03-13 18:13:17 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-24 09:58:06 +00:00
|
|
|
bool cBlockEntity::IsBlockEntityBlockType(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-29 12:59:24 +00:00
|
|
|
void cBlockEntity::SetPos(Vector3i a_NewPos)
|
2017-06-24 09:58:06 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 21:23:38 +00:00
|
|
|
OwnedBlockEntity cBlockEntity::Clone(Vector3i a_Pos)
|
2017-06-24 09:58:06 +00:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 21:23:38 +00:00
|
|
|
OwnedBlockEntity cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World)
|
2017-06-24 09:58:06 +00:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|