2016-03-13 14:13:17 -04: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 05:58:06 -04:00
|
|
|
#include "BlockEntities/BlockEntity.h"
|
2016-03-13 14:13:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 02:57:01 -04:00
|
|
|
cBlockInfo::cBlockInfo()
|
2019-10-16 04:06:34 -04:00
|
|
|
{
|
2020-04-03 02:57:01 -04:00
|
|
|
}
|
2019-10-16 04:06:34 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-03 12:34:27 -04:00
|
|
|
void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
2017-07-03 12:34:27 -04:00
|
|
|
delete a_Handler;
|
2016-03-13 14:13:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-03 12:34:27 -04:00
|
|
|
cBlockInfo::cBlockInfoArray::cBlockInfoArray()
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
2017-07-03 12:34:27 -04:00
|
|
|
cBlockInfoArray & BlockInfos = *this;
|
2016-03-13 14:13:17 -04:00
|
|
|
// The piece-loading code uses the handlers for rotations, so we need valid handlers
|
|
|
|
// Insert dummy handlers:
|
2017-07-03 12:34:27 -04:00
|
|
|
for (size_t i = 0; i < BlockInfos.size(); i++)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
2017-07-03 12:34:27 -04:00
|
|
|
BlockInfos[i].m_Handler.reset(new cBlockHandler(static_cast<BLOCKTYPE>(i)));
|
2016-03-13 14:13:17 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-09-29 08:59:24 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-28 12:59:21 -04:00
|
|
|
cBoundingBox::cBoundingBox(double, double, double, double, double, double)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-03-13 14:13:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cBlockHandler::cBlockHandler(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-28 12:59:21 -04: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 14:13:17 -04:00
|
|
|
bool cBlockHandler::GetPlacementBlockTypeMeta(
|
2017-07-31 16:17:52 -04:00
|
|
|
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
|
2020-04-21 16:19:22 -04:00
|
|
|
const Vector3i a_BlockPos,
|
|
|
|
eBlockFace a_BlockFace,
|
|
|
|
const Vector3i a_CursorPos,
|
2016-03-13 14:13:17 -04:00
|
|
|
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
|
|
|
|
)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-17 05:36:37 -04:00
|
|
|
void cBlockHandler::OnUpdate(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, const Vector3i a_RelPos)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-31 16:17:52 -04:00
|
|
|
void cBlockHandler::OnPlacedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, const sSetBlock & a_BlockChange)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
void cBlockHandler::OnBroken(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, Vector3i a_BlockPos, BLOCKTYPE a_OldBlockType, NIBBLETYPE a_OldBlockMeta)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
cItems cBlockHandler::ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
2019-10-16 04:06:34 -04:00
|
|
|
return cItems();
|
2016-03-13 14:13:17 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-21 16:19:22 -04:00
|
|
|
bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockHandler::IsUseable()
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockHandler::IsClickedThrough(void)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-07 10:37:53 -04:00
|
|
|
bool cBlockHandler::DoesIgnoreBuildCollision(cChunkInterface & a_ChunkInterface, Vector3i a_Pos, cPlayer & a_Player, NIBBLETYPE a_Meta)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
return (m_BlockType == E_BLOCK_AIR);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockHandler::DoesDropOnUnsuitable(void)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
void cBlockHandler::Check(cChunkInterface & a_ChunkInterface, cBlockPluginInterface & a_PluginInterface, Vector3i a_RelPos, cChunk & a_Chunk)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColourID cBlockHandler::GetMapBaseColourID(NIBBLETYPE a_Meta)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-21 16:19:22 -04:00
|
|
|
bool cBlockHandler::IsInsideBlock(Vector3d a_Position, const NIBBLETYPE a_BlockMeta)
|
2016-03-13 14:13:17 -04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-24 05:58:06 -04:00
|
|
|
bool cBlockEntity::IsBlockEntityBlockType(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-29 08:59:24 -04:00
|
|
|
void cBlockEntity::SetPos(Vector3i a_NewPos)
|
2017-06-24 05:58:06 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 17:23:38 -04:00
|
|
|
OwnedBlockEntity cBlockEntity::Clone(Vector3i a_Pos)
|
2017-06-24 05:58:06 -04:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 17:23:38 -04:00
|
|
|
OwnedBlockEntity cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World)
|
2017-06-24 05:58:06 -04:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|