2015-06-18 17:30:41 -04:00
|
|
|
|
|
|
|
// Stubs.cpp
|
|
|
|
|
2016-01-01 15:05:09 -05:00
|
|
|
// 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
|
2015-06-18 17:30:41 -04:00
|
|
|
|
|
|
|
#include "Globals.h"
|
|
|
|
#include "BlockInfo.h"
|
2017-08-25 08:43:18 -04:00
|
|
|
#include "UUID.h"
|
2015-06-18 17:30:41 -04:00
|
|
|
#include "Bindings.h"
|
|
|
|
#include "Bindings/DeprecatedBindings.h"
|
2015-12-23 05:08:39 -05:00
|
|
|
#include "Bindings/LuaJson.h"
|
2017-08-25 08:43:18 -04:00
|
|
|
#include "Bindings/LuaState.h"
|
2015-06-18 17:30:41 -04:00
|
|
|
#include "Bindings/ManualBindings.h"
|
|
|
|
#include "BlockEntities/BlockEntity.h"
|
|
|
|
#include "Blocks/BlockHandler.h"
|
|
|
|
#include "Generating/ChunkDesc.h"
|
2017-01-17 16:38:04 -05:00
|
|
|
#include "DeadlockDetect.h"
|
2019-09-02 00:46:40 -04:00
|
|
|
#include "Entities/Entity.h"
|
|
|
|
#include "Mobs/Monster.h"
|
|
|
|
#include "Simulator/FluidSimulator.h"
|
|
|
|
#include "Simulator/FireSimulator.h"
|
|
|
|
#include "MobSpawner.h"
|
|
|
|
#include "ItemGrid.h"
|
2015-06-18 17:30:41 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// fwd:
|
|
|
|
struct lua_State;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Prototypes, needed by clang:
|
|
|
|
extern "C" int luaopen_lsqlite3(lua_State * a_LuaState);
|
|
|
|
extern "C" int luaopen_lxp(lua_State * a_LuaState);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cManualBindings::Bind(lua_State * a_LuaState)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void DeprecatedBindings::Bind(lua_State * a_LuaState)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-12-23 05:08:39 -05:00
|
|
|
void cLuaJson::Bind(cLuaState & a_LuaState)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-18 17:30:41 -04:00
|
|
|
int tolua_AllToLua_open(lua_State * a_LuaState)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" int luaopen_lsqlite3(lua_State * a_LuaState)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern "C" int luaopen_lxp(lua_State * a_LuaState)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-07-28 12:59:21 -04:00
|
|
|
cBoundingBox::cBoundingBox(double, double, double, double, double, double)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-18 17:30:41 -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);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-18 17:30:41 -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,
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-10-16 04:06:34 -04:00
|
|
|
void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, Vector3i a_BlockPos, eBlockFace a_WhichNeighbor)
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -04:00
|
|
|
{
|
2019-10-16 04:06:34 -04:00
|
|
|
return cItems();
|
2015-06-18 17:30:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-21 16:19:22 -04:00
|
|
|
bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk)
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -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)
|
2015-06-18 17:30:41 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-06-30 10:50:15 -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)
|
2015-11-10 08:02:07 -05:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 17:23:38 -04:00
|
|
|
OwnedBlockEntity cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World)
|
2015-06-18 17:30:41 -04:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-01-17 16:38:04 -05:00
|
|
|
|
|
|
|
void cDeadlockDetect::TrackCriticalSection(cCriticalSection & a_CS, const AString & a_Name)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cDeadlockDetect::UntrackCriticalSection(cCriticalSection & a_CS)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-06-24 05:58:06 -04:00
|
|
|
|
2019-09-29 08:59:24 -04:00
|
|
|
void cBlockEntity::SetPos(Vector3i a_NewPos)
|
2017-06-24 05:58:06 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cBlockEntity::IsBlockEntityBlockType(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-03 17:23:38 -04:00
|
|
|
OwnedBlockEntity cBlockEntity::Clone(Vector3i a_Pos)
|
2017-06-24 05:58:06 -04:00
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-08-25 08:43:18 -04:00
|
|
|
|
|
|
|
bool cLuaState::GetStackValue(int, cUUID *&)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cUUID::FromString(const AString&)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-09-02 00:46:40 -04:00
|
|
|
|
|
|
|
void cEntity::SetPosition(const Vector3d & a_Position)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cEntity::SetHealth(float a_NewHealth)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cMonster::eFamily cMonster::FamilyFromType(eMonsterType a_Type)
|
|
|
|
{
|
|
|
|
return cMonster::mfAmbient;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::unique_ptr<cMonster> cMonster::NewMonsterFromType(eMonsterType a_Type)
|
|
|
|
{
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cFluidSimulator::CanWashAway(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool cFireSimulator::DoesBurnForever(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cItemGrid::GenerateRandomLootWithBooks(const cLootProbab * a_LootProbabs, size_t a_CountLootProbabs, int a_NumSlots, int a_Seed)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::set<eMonsterType> cMobSpawner::GetAllowedMobTypes(EMCSBiome a_Biome)
|
|
|
|
{
|
|
|
|
return {};
|
|
|
|
}
|
2020-04-03 02:57:01 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cItem::cItem()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cItem::cItem(
|
|
|
|
short a_ItemType,
|
|
|
|
char a_ItemCount,
|
|
|
|
short a_ItemDamage,
|
|
|
|
const AString & a_Enchantments,
|
|
|
|
const AString & a_CustomName,
|
|
|
|
const AStringVector & a_LoreTable
|
|
|
|
)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void cItem::Empty()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
|
|
|
|
{
|
|
|
|
return new cBlockHandler(a_BlockType);
|
|
|
|
}
|