diff options
Diffstat (limited to 'src')
121 files changed, 192 insertions, 166 deletions
diff --git a/src/Bindings/LuaServerHandle.cpp b/src/Bindings/LuaServerHandle.cpp index d32b8fe03..357d31bd5 100644 --- a/src/Bindings/LuaServerHandle.cpp +++ b/src/Bindings/LuaServerHandle.cpp @@ -22,7 +22,6 @@ cLuaServerHandle::cLuaServerHandle(UInt16 a_Port, cLuaState::cTableRefPtr && a_C - cLuaServerHandle::~cLuaServerHandle() { // If the server handle is still open, close it explicitly: diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp index 0a7579ed8..7ec099982 100644 --- a/src/Bindings/LuaState.cpp +++ b/src/Bindings/LuaState.cpp @@ -50,7 +50,6 @@ extern "C" - const cLuaState::cRet cLuaState::Return = {}; const cLuaState::cNil cLuaState::Nil = {}; @@ -58,7 +57,6 @@ const cLuaState::cNil cLuaState::Nil = {}; - //////////////////////////////////////////////////////////////////////////////// // cCanonLuaStates: @@ -135,6 +133,7 @@ void cLuaStateTracker::Add(cLuaState & a_LuaState) + void cLuaStateTracker::Del(cLuaState & a_LuaState) { auto & Instance = Get(); diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp index 519023fa6..90251a4b2 100644 --- a/src/Bindings/ManualBindings.cpp +++ b/src/Bindings/ManualBindings.cpp @@ -2454,6 +2454,7 @@ static int tolua_cClientHandle_IsUUIDOnline(lua_State * tolua_S) + static int tolua_cMobHeadEntity_SetOwner(lua_State * tolua_S) { // Check params: @@ -3493,7 +3494,6 @@ static int tolua_cHopperEntity_GetOutputBlockPos(lua_State * tolua_S) - static int tolua_cBoundingBox_CalcLineIntersection(lua_State * a_LuaState) { /* Function signatures: diff --git a/src/Bindings/ManualBindings_BlockArea.cpp b/src/Bindings/ManualBindings_BlockArea.cpp index 126b35386..72d9f7497 100644 --- a/src/Bindings/ManualBindings_BlockArea.cpp +++ b/src/Bindings/ManualBindings_BlockArea.cpp @@ -15,7 +15,6 @@ - /** Reads params that together form a Cuboid. These can be: - 6 numbers (MinX, MaxX, MinY, MaxY, MinZ, MaxZ) diff --git a/src/Bindings/ManualBindings_World.cpp b/src/Bindings/ManualBindings_World.cpp index e98e13c47..f5b846dde 100644 --- a/src/Bindings/ManualBindings_World.cpp +++ b/src/Bindings/ManualBindings_World.cpp @@ -620,7 +620,6 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S) - static int tolua_cWorld_TryGetHeight(lua_State * tolua_S) { /* Exported manually, because tolua would require the out-only param a_Height to be used when calling diff --git a/src/Bindings/Plugin.cpp b/src/Bindings/Plugin.cpp index 2f2771e38..de82fbca2 100644 --- a/src/Bindings/Plugin.cpp +++ b/src/Bindings/Plugin.cpp @@ -51,6 +51,7 @@ AString cPlugin::GetLocalFolder(void) const + void cPlugin::SetLoadError(const AString & a_LoadError) { m_Status = cPluginManager::psError; diff --git a/src/Bindings/PluginManager.cpp b/src/Bindings/PluginManager.cpp index 4cbc36767..257ad7c07 100644 --- a/src/Bindings/PluginManager.cpp +++ b/src/Bindings/PluginManager.cpp @@ -479,6 +479,7 @@ bool cPluginManager::CallHookEntityTeleport(cEntity & a_Entity, const Vector3d & + bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_World) { return GenericCallHook(HOOK_ENTITY_CHANGING_WORLD, [&](cPlugin * a_Plugin) @@ -491,6 +492,7 @@ bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_ + bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_World) { return GenericCallHook(HOOK_ENTITY_CHANGED_WORLD, [&](cPlugin * a_Plugin) @@ -503,6 +505,7 @@ bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_W + bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result) { // Output the command being executed to log (for troubleshooting deadlocks-in-commands): @@ -643,6 +646,7 @@ bool cPluginManager::CallHookLogin(cClientHandle & a_Client, UInt32 a_ProtocolVe + bool cPluginManager::CallHookLoginForge(cClientHandle & a_Client, AStringMap & a_Mods) { return GenericCallHook(HOOK_LOGIN_FORGE, [&](cPlugin * a_Plugin) @@ -1068,6 +1072,7 @@ bool cPluginManager::CallHookSpawnedEntity(cWorld & a_World, cEntity & a_Entity) + bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monster) { return GenericCallHook(HOOK_SPAWNED_MONSTER, [&](cPlugin * a_Plugin) @@ -1080,6 +1085,7 @@ bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monst + bool cPluginManager::CallHookSpawningEntity(cWorld & a_World, cEntity & a_Entity) { return GenericCallHook(HOOK_SPAWNING_ENTITY, [&](cPlugin * a_Plugin) diff --git a/src/BiomeDef.cpp b/src/BiomeDef.cpp index fac28f13f..bef808ef2 100644 --- a/src/BiomeDef.cpp +++ b/src/BiomeDef.cpp @@ -190,6 +190,7 @@ bool IsBiomeVeryCold(EMCSBiome a_Biome) + bool IsBiomeCold(EMCSBiome a_Biome) { switch (a_Biome) diff --git a/src/BlockArea.cpp b/src/BlockArea.cpp index a991c9ed5..a870a7624 100644 --- a/src/BlockArea.cpp +++ b/src/BlockArea.cpp @@ -629,17 +629,6 @@ void cBlockArea::DumpToRawFile(const AString & a_FileName) - - - - - - - - - - - void cBlockArea::Crop(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ) { if ( @@ -2272,7 +2261,6 @@ NIBBLETYPE cBlockArea::GetNibble(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBL - void cBlockArea::CropBlockTypes(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ) { int NewSizeX = GetSizeX() - a_AddMinX - a_SubMaxX; @@ -2963,6 +2951,7 @@ void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer) + void cBlockArea::cChunkReader::BlockEntity(cBlockEntity * a_BlockEntity) { if (!m_Area.HasBlockEntities()) diff --git a/src/BlockEntities/BrewingstandEntity.cpp b/src/BlockEntities/BrewingstandEntity.cpp index 94fcdcbe6..c743783e6 100644 --- a/src/BlockEntities/BrewingstandEntity.cpp +++ b/src/BlockEntities/BrewingstandEntity.cpp @@ -11,13 +11,6 @@ - - - - - - - cBrewingstandEntity::cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World): Super(a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World), m_IsDestroyed(false), @@ -160,7 +153,6 @@ bool cBrewingstandEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) - bool cBrewingstandEntity::UsedBy(cPlayer * a_Player) { cWindow * Window = GetWindow(); @@ -207,7 +199,6 @@ void cBrewingstandEntity::BroadcastProgress(short a_ProgressbarID, short a_Value - void cBrewingstandEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) { Super::OnSlotChanged(a_ItemGrid, a_SlotNum); diff --git a/src/BlockEntities/ChestEntity.cpp b/src/BlockEntities/ChestEntity.cpp index beffa84de..c650eb530 100644 --- a/src/BlockEntities/ChestEntity.cpp +++ b/src/BlockEntities/ChestEntity.cpp @@ -31,6 +31,7 @@ cChestEntity::cChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_ + cChestEntity::~cChestEntity() { if (m_Neighbour != nullptr) diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp index 6b9862a99..3342ac1ed 100644 --- a/src/BlockEntities/CommandBlockEntity.cpp +++ b/src/BlockEntities/CommandBlockEntity.cpp @@ -29,7 +29,6 @@ cCommandBlockEntity::cCommandBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo - bool cCommandBlockEntity::UsedBy(cPlayer * a_Player) { // Nothing to do diff --git a/src/BlockEntities/DispenserEntity.cpp b/src/BlockEntities/DispenserEntity.cpp index cf2b2f71b..249952c7a 100644 --- a/src/BlockEntities/DispenserEntity.cpp +++ b/src/BlockEntities/DispenserEntity.cpp @@ -290,6 +290,8 @@ UInt32 cDispenserEntity::SpawnProjectileFromDispenser(int a_BlockX, int a_BlockY + + Vector3d cDispenserEntity::GetShootVector(NIBBLETYPE a_Meta) { switch (a_Meta & E_META_DROPSPENSER_FACING_MASK) diff --git a/src/BlockEntities/FurnaceEntity.cpp b/src/BlockEntities/FurnaceEntity.cpp index 0813927f2..ea58cc4fd 100644 --- a/src/BlockEntities/FurnaceEntity.cpp +++ b/src/BlockEntities/FurnaceEntity.cpp @@ -11,7 +11,6 @@ - enum { PROGRESSBAR_FUEL = 0, @@ -282,7 +281,6 @@ void cFurnaceEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) - void cFurnaceEntity::UpdateInput(void) { if (!m_Contents.GetSlot(fsInput).IsEqual(m_LastInput)) diff --git a/src/BlockEntities/MobHeadEntity.cpp b/src/BlockEntities/MobHeadEntity.cpp index 5438bbb26..a63edcc01 100644 --- a/src/BlockEntities/MobHeadEntity.cpp +++ b/src/BlockEntities/MobHeadEntity.cpp @@ -40,6 +40,7 @@ void cMobHeadEntity::CopyFrom(const cBlockEntity & a_Src) + bool cMobHeadEntity::UsedBy(cPlayer * a_Player) { UNUSED(a_Player); diff --git a/src/BlockID.cpp b/src/BlockID.cpp index acba8db27..399f9c3f6 100644 --- a/src/BlockID.cpp +++ b/src/BlockID.cpp @@ -234,6 +234,7 @@ int BlockStringToType(const AString & a_BlockTypeString) + bool StringToItem(const AString & a_ItemTypeString, cItem & a_Item) { AString ItemName = TrimString(a_ItemTypeString); diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp index fe4460cad..b8cc26f11 100644 --- a/src/BlockInfo.cpp +++ b/src/BlockInfo.cpp @@ -11,6 +11,9 @@ void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler) } + + + cBlockInfo::cBlockInfoArray::cBlockInfoArray() { cBlockInfoArray & Info = *this; diff --git a/src/Blocks/BlockDoor.cpp b/src/Blocks/BlockDoor.cpp index 77b18a508..a0c112723 100644 --- a/src/Blocks/BlockDoor.cpp +++ b/src/Blocks/BlockDoor.cpp @@ -149,6 +149,8 @@ NIBBLETYPE cBlockDoorHandler::MetaRotateCW(NIBBLETYPE a_Meta) + + NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta) { /* @@ -181,6 +183,8 @@ NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta) + + NIBBLETYPE cBlockDoorHandler::MetaMirrorYZ(NIBBLETYPE a_Meta) { // Top bit (0x08) contains door panel type (Top / Bottom panel) Only Bottom panels contain position data diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index fb097c395..e4cf182d2 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -91,7 +91,6 @@ - /* // Tests the meta rotation and mirroring. // Note that the cMetaRotator needs to have its assert paths disabled for this test to work! @@ -577,6 +576,7 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac + bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk) { return true; diff --git a/src/Blocks/ChunkInterface.cpp b/src/Blocks/ChunkInterface.cpp index 44119a0d8..6aa8fbf4f 100644 --- a/src/Blocks/ChunkInterface.cpp +++ b/src/Blocks/ChunkInterface.cpp @@ -28,7 +28,6 @@ NIBBLETYPE cChunkInterface::GetBlockMeta(Vector3i a_Pos) - bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) { return m_ChunkMap->GetBlockTypeMeta(a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta); @@ -38,7 +37,6 @@ bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType, - /** Sets the block at the specified coords to the specified value. Full processing, incl. updating neighbors, is performed. */ @@ -72,7 +70,6 @@ void cChunkInterface::FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLO - void cChunkInterface::FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta); @@ -82,7 +79,6 @@ void cChunkInterface::FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType - bool cChunkInterface::UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) { return m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ); @@ -92,7 +88,6 @@ bool cChunkInterface::UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_Blo - bool cChunkInterface::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback) { return m_ChunkMap->ForEachChunkInRect(a_MinChunkX, a_MaxChunkX, a_MinChunkZ, a_MaxChunkZ, a_Callback); @@ -102,7 +97,6 @@ bool cChunkInterface::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a - bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes) { return m_ChunkMap->WriteBlockArea(a_Area, a_MinBlockX, a_MinBlockY, a_MinBlockZ, a_DataTypes); @@ -112,7 +106,6 @@ bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a - bool cChunkInterface::DigBlock(cWorldInterface & a_WorldInterface, int a_X, int a_Y, int a_Z) { cBlockHandler * Handler = cBlockInfo::GetHandler(GetBlock({a_X, a_Y, a_Z})); diff --git a/src/Blocks/GetHandlerCompileTimeTemplate.h b/src/Blocks/GetHandlerCompileTimeTemplate.h index 3466b5426..deebd4030 100644 --- a/src/Blocks/GetHandlerCompileTimeTemplate.h +++ b/src/Blocks/GetHandlerCompileTimeTemplate.h @@ -12,7 +12,6 @@ class cBlockPistonHandler; - template<BLOCKTYPE T> class GetHandlerCompileTime; @@ -20,8 +19,6 @@ class GetHandlerCompileTime; - - template<> class GetHandlerCompileTime<E_BLOCK_TORCH> { @@ -33,7 +30,6 @@ public: - template<> class GetHandlerCompileTime<E_BLOCK_LEVER> { @@ -45,7 +41,6 @@ public: - template<> class GetHandlerCompileTime<E_BLOCK_STONE_BUTTON> { @@ -57,7 +52,6 @@ public: - template<> class GetHandlerCompileTime<E_BLOCK_TRIPWIRE_HOOK> { @@ -69,7 +63,6 @@ public: - template<> class GetHandlerCompileTime<E_BLOCK_WOODEN_DOOR> { @@ -81,7 +74,6 @@ public: - template<> class GetHandlerCompileTime<E_BLOCK_PISTON> { diff --git a/src/BrewingRecipes.cpp b/src/BrewingRecipes.cpp index 292fc7005..3f5173d3d 100644 --- a/src/BrewingRecipes.cpp +++ b/src/BrewingRecipes.cpp @@ -11,9 +11,6 @@ - - - cBrewingRecipes::cBrewingRecipes() { ReloadRecipes(); @@ -197,7 +194,6 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_ - bool cBrewingRecipes::IsIngredient(const cItem & a_Ingredient) const { // Check for gunpowder diff --git a/src/Broadcaster.cpp b/src/Broadcaster.cpp index 7ea3476b3..c6054da99 100644 --- a/src/Broadcaster.cpp +++ b/src/Broadcaster.cpp @@ -365,6 +365,7 @@ void cWorld::BroadcastEntityVelocity(const cEntity & a_Entity, const cClientHand + void cWorld::BroadcastEntityAnimation(const cEntity & a_Entity, Int8 a_Animation, const cClientHandle * a_Exclude) { ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client) @@ -417,7 +418,6 @@ void cWorld::BroadcastParticleEffect(const AString & a_ParticleName, const Vecto - void cWorld::BroadcastPlayerListAddPlayer(const cPlayer & a_Player, const cClientHandle * a_Exclude) { ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client) diff --git a/src/ByteBuffer.cpp b/src/ByteBuffer.cpp index 2fecc7817..246b075fb 100644 --- a/src/ByteBuffer.cpp +++ b/src/ByteBuffer.cpp @@ -645,7 +645,6 @@ bool cByteBuffer::WriteBEDouble(double a_Value) - bool cByteBuffer::WriteBool(bool a_Value) { CHECK_THREAD diff --git a/src/CheckBasicStyle.lua b/src/CheckBasicStyle.lua index 6cd499fd1..4376d460a 100755 --- a/src/CheckBasicStyle.lua +++ b/src/CheckBasicStyle.lua @@ -44,11 +44,6 @@ local g_IgnoredFiles = "Bindings/Bindings.h", "Bindings/Bindings.cpp", "Bindings/LuaState_Implementation.cpp", - "LeakFinder.cpp", - "LeakFinder.h", - "MersenneTwister.h", - "StackWalker.cpp", - "StackWalker.h", } --- The list of files not to be processed, as a dictionary (filename => true), built from g_IgnoredFiles @@ -241,6 +236,9 @@ local function ProcessFile(a_FileName) local lineCounter = 1 local lastIndentLevel = 0 local isLastLineControl = false + local lastNonEmptyLine = 0 + local isAfterFunction = false + local isSourceFile = a_FileName:match("%.cpp") all = all:gsub("\r\n", "\n") -- normalize CRLF into LF-only string.gsub(all .. "\n", "[^\n]*\n", -- Iterate over each line, while preserving empty lines function(a_Line) @@ -296,6 +294,26 @@ local function ProcessFile(a_FileName) lineWithSpace:find("^%s+else //") or lineWithSpace:find("^%s+do %b()") + + -- Check that exactly 5 empty lines are left beteen functions and no more than 5 elsewhere + if not(a_Line:find("^\n")) then + local numEmptyLines = (lineCounter - lastNonEmptyLine) - 1 + + local isStartOfFunction = ( + isAfterFunction and + a_Line:find("^[%s%w]") + ) + + if (isSourceFile and isStartOfFunction and (numEmptyLines ~= 5)) then + ReportViolation(a_FileName, lineCounter - 1, 1, 1, "Leave exactly 5 empty lines between functions (found " .. numEmptyLines ..")") + elseif (numEmptyLines > 5) then + ReportViolation(a_FileName, lineCounter - 1, 1, 1, "Leave at most 5 consecutive empty lines (found " .. numEmptyLines .. ")") + end + + lastNonEmptyLine = lineCounter + isAfterFunction = (a_Line == "}\n") + end + lineCounter = lineCounter + 1 end ) diff --git a/src/Chunk.cpp b/src/Chunk.cpp index b980ab3ed..f4af65b60 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -511,6 +511,7 @@ void cChunk::Stay(bool a_Stay) + void cChunk::CollectMobCensus(cMobCensus & toFill) { toFill.CollectSpawnableChunk(*this); @@ -541,6 +542,7 @@ void cChunk::CollectMobCensus(cMobCensus & toFill) + void cChunk::GetThreeRandomNumbers(int & a_X, int & a_Y, int & a_Z, int a_MaxX, int a_MaxY, int a_MaxZ) { ASSERT( @@ -2291,6 +2293,7 @@ bool cChunk::DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBloc + bool cChunk::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCallback a_Callback) { return GenericDoWithBlockEntityAt<cBeaconEntity, @@ -2301,6 +2304,7 @@ bool cChunk::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCal + bool cChunk::DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback a_Callback) { return GenericDoWithBlockEntityAt<cBedEntity, @@ -2311,6 +2315,7 @@ bool cChunk::DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback + bool cChunk::DoWithBrewingstandAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBrewingstandCallback a_Callback) { return GenericDoWithBlockEntityAt<cBrewingstandEntity, @@ -2474,7 +2479,6 @@ void cChunk::GetBlockInfo(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE - bool cChunk::GetChunkAndRelByAbsolute(const Vector3d & a_Position, cChunk ** a_Chunk, Vector3i & a_Rel) { return GetChunkAndRelByAbsolute(Vector3i(FloorC(a_Position.x), FloorC(a_Position.y), FloorC(a_Position.z)), a_Chunk, a_Rel); @@ -2499,6 +2503,9 @@ bool cChunk::GetChunkAndRelByAbsolute(const Vector3i & a_Position, cChunk ** a_C } + + + cChunk * cChunk::GetNeighborChunk(int a_BlockX, int a_BlockZ) { // Convert coords to relative, then call the relative version: diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index f25f675dc..a095880c3 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -575,6 +575,7 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src) + void cChunkData::SetMetas(const NIBBLETYPE * a_Src) { ASSERT(a_Src != nullptr); @@ -643,6 +644,7 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src) + void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src) { if (a_Src == nullptr) diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp index a8b1eff05..4936b11eb 100644 --- a/src/ChunkMap.cpp +++ b/src/ChunkMap.cpp @@ -306,6 +306,9 @@ bool cChunkMap::DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback a_Callbac } + + + bool cChunkMap::DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback) { int ChunkX, ChunkZ; @@ -316,6 +319,7 @@ bool cChunkMap::DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback) + void cChunkMap::WakeUpSimulators(Vector3i a_Block) { cCSLock Lock(m_CSChunks); @@ -1678,6 +1682,7 @@ bool cChunkMap::DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurna + bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback a_Callback) { int ChunkX, ChunkZ; @@ -1695,6 +1700,7 @@ bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNot + bool cChunkMap::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback a_Callback) { int ChunkX, ChunkZ; @@ -2134,6 +2140,7 @@ void cChunkMap::SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ) + void cChunkMap::CollectMobCensus(cMobCensus & a_ToFill) { cCSLock Lock(m_CSChunks); @@ -2153,7 +2160,6 @@ void cChunkMap::CollectMobCensus(cMobCensus & a_ToFill) - void cChunkMap::SpawnMobs(cMobSpawner & a_MobSpawner) { cCSLock Lock(m_CSChunks); @@ -2313,7 +2319,6 @@ void cChunkMap::SetChunkAlwaysTicked(int a_ChunkX, int a_ChunkZ, bool a_AlwaysTi - void cChunkMap::TrackInDeadlockDetect(cDeadlockDetect & a_DeadlockDetect, const AString & a_WorldName) { a_DeadlockDetect.TrackCriticalSection(m_CSChunks, Printf("World %s chunkmap", a_WorldName.c_str())); diff --git a/src/ChunkSender.cpp b/src/ChunkSender.cpp index d5aed1a48..c5d56f354 100644 --- a/src/ChunkSender.cpp +++ b/src/ChunkSender.cpp @@ -56,7 +56,6 @@ public: - //////////////////////////////////////////////////////////////////////////////// // cChunkSender: @@ -122,7 +121,6 @@ void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a - void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cChunkClientHandles a_Clients) { { @@ -279,6 +277,7 @@ void cChunkSender::BlockEntity(cBlockEntity * a_Entity) + void cChunkSender::Entity(cEntity *) { // Nothing needed yet, perhaps in the future when we save entities into chunks we'd like to send them upon load, too ;) diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 80819cb61..8e5381e1d 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -51,7 +51,6 @@ static const std::chrono::milliseconds PING_TIME_MS = std::chrono::milliseconds( - int cClientHandle::s_ClientCount = 0; @@ -2705,6 +2704,7 @@ void cClientHandle::SendPickupSpawn(const cPickup & a_Pickup) + void cClientHandle::SendPaintingSpawn(const cPainting & a_Painting) { m_Protocol->SendPaintingSpawn(a_Painting); @@ -3088,6 +3088,7 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) + void cClientHandle::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity) { m_Protocol->SendUpdateBlockEntity(a_BlockEntity); @@ -3120,6 +3121,7 @@ void cClientHandle::SendUseBed(const cEntity & a_Entity, int a_BlockX, int a_Blo + void cClientHandle::SendWeather(eWeather a_Weather) { m_Protocol->SendWeather(a_Weather); diff --git a/src/CommandOutput.h b/src/CommandOutput.h index 8ae50d221..033a3cbaa 100644 --- a/src/CommandOutput.h +++ b/src/CommandOutput.h @@ -46,7 +46,6 @@ class cNullCommandOutputCallback : - /** Accumulates all command output into a string. */ class cStringAccumCommandOutputCallback: public cCommandOutputCallback diff --git a/src/CraftingRecipes.cpp b/src/CraftingRecipes.cpp index f59f49c11..a2a257a40 100644 --- a/src/CraftingRecipes.cpp +++ b/src/CraftingRecipes.cpp @@ -358,6 +358,7 @@ void cCraftingRecipes::LoadRecipes(void) + void cCraftingRecipes::ClearRecipes(void) { for (cRecipes::iterator itr = m_Recipes.begin(); itr != m_Recipes.end(); ++itr) diff --git a/src/Cuboid.cpp b/src/Cuboid.cpp index 7dc39f364..930ee6c0e 100644 --- a/src/Cuboid.cpp +++ b/src/Cuboid.cpp @@ -89,7 +89,6 @@ void cCuboid::Move(int a_OfsX, int a_OfsY, int a_OfsZ) - void cCuboid::Expand(int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ) { if (p1.x < p2.x) diff --git a/src/Defines.h b/src/Defines.h index 758c416e8..1b17b6913 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -12,7 +12,6 @@ typedef std::vector<int> cSlotNums; - // tolua_begin /** Experience Orb setup */ diff --git a/src/Enchantments.cpp b/src/Enchantments.cpp index 0047d09b8..1a6f72c9e 100644 --- a/src/Enchantments.cpp +++ b/src/Enchantments.cpp @@ -148,7 +148,6 @@ void cEnchantments::SetLevel(int a_EnchantmentID, unsigned int a_Level) - void cEnchantments::Clear(void) { m_Enchantments.clear(); diff --git a/src/Entities/ArrowEntity.h b/src/Entities/ArrowEntity.h index 6e4644190..4d4891ce4 100644 --- a/src/Entities/ArrowEntity.h +++ b/src/Entities/ArrowEntity.h @@ -15,7 +15,6 @@ - // tolua_begin class cArrowEntity : diff --git a/src/Entities/Boat.cpp b/src/Entities/Boat.cpp index 20947dc44..7a6d0d620 100644 --- a/src/Entities/Boat.cpp +++ b/src/Entities/Boat.cpp @@ -29,6 +29,7 @@ cBoat::cBoat(Vector3d a_Pos, eMaterial a_Material) : + void cBoat::SpawnOn(cClientHandle & a_ClientHandle) { a_ClientHandle.SendSpawnVehicle(*this, 1); @@ -153,6 +154,7 @@ void cBoat::HandleSpeedFromAttachee(float a_Forward, float a_Sideways) + void cBoat::SetLastDamage(int TimeSinceLastHit) { m_LastDamage = TimeSinceLastHit; diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index a71c68708..b8ec005bd 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -185,6 +185,7 @@ void cEntity::WrapHeadYaw(void) + void cEntity::WrapRotation(void) { m_Rot.x = NormalizeAngleDegrees(m_Rot.x); @@ -194,6 +195,7 @@ void cEntity::WrapRotation(void) + void cEntity::WrapSpeed(void) { m_Speed.x = Clamp(m_Speed.x, -78.0, 78.0); @@ -264,7 +266,6 @@ void cEntity::DestroyNoScheduling(bool a_ShouldBroadcast) - void cEntity::TakeDamage(cEntity & a_Attacker) { int RawDamage = a_Attacker.GetRawDamageAgainst(*this); @@ -590,6 +591,7 @@ int cEntity::GetRawDamageAgainst(const cEntity & a_Receiver) + void cEntity::ApplyArmorDamage(int DamageBlocked) { // cEntities don't necessarily have armor to damage. @@ -681,7 +683,6 @@ int cEntity::GetEnchantmentCoverAgainst(const cEntity * a_Attacker, eDamageType - float cEntity::GetEnchantmentBlastKnockbackReduction() { UInt32 MaxLevel = 0; @@ -707,7 +708,6 @@ float cEntity::GetEnchantmentBlastKnockbackReduction() - int cEntity::GetArmorCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_Damage) { // Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover @@ -1323,6 +1323,7 @@ void cEntity::DetectCacti(void) + void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown, bool a_ShouldSendRespawn) { m_NewWorld = a_World; @@ -1335,6 +1336,7 @@ void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool + bool cEntity::DetectPortal() { // If somebody scheduled a world change with ScheduleMoveToWorld, change worlds now. @@ -1961,6 +1963,7 @@ void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude) + cEntity * cEntity::GetAttached() { return m_AttachedTo; @@ -2107,6 +2110,7 @@ void cEntity::SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ) + void cEntity::SetSpeedX(double a_SpeedX) { SetSpeed(a_SpeedX, m_Speed.y, m_Speed.z); @@ -2115,6 +2119,7 @@ void cEntity::SetSpeedX(double a_SpeedX) + void cEntity::SetSpeedY(double a_SpeedY) { SetSpeed(m_Speed.x, a_SpeedY, m_Speed.z); @@ -2123,6 +2128,7 @@ void cEntity::SetSpeedY(double a_SpeedY) + void cEntity::SetSpeedZ(double a_SpeedZ) { SetSpeed(m_Speed.x, m_Speed.y, a_SpeedZ); @@ -2140,6 +2146,7 @@ void cEntity::SetWidth(double a_Width) + void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ) { DoSetSpeed(m_Speed.x + a_AddSpeedX, m_Speed.y + a_AddSpeedY, m_Speed.z + a_AddSpeedZ); @@ -2248,6 +2255,7 @@ void cEntity::AddLeashedMob(cMonster * a_Monster) + void cEntity::RemoveLeashedMob(cMonster * a_Monster) { ASSERT(a_Monster->GetLeashedTo() == this); @@ -2262,7 +2270,6 @@ void cEntity::RemoveLeashedMob(cMonster * a_Monster) - float cEntity::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower) { double EntitySize = m_Width * m_Width * m_Height; diff --git a/src/Entities/ExpOrb.cpp b/src/Entities/ExpOrb.cpp index dd16a4762..ecc2860b0 100644 --- a/src/Entities/ExpOrb.cpp +++ b/src/Entities/ExpOrb.cpp @@ -82,6 +82,10 @@ void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) } } + + + + bool cExpOrb::DoTakeDamage(TakeDamageInfo & a_TDI) { if (a_TDI.DamageType == dtCactusContact) diff --git a/src/Entities/ItemFrame.cpp b/src/Entities/ItemFrame.cpp index 6317eba85..a231ebaa3 100644 --- a/src/Entities/ItemFrame.cpp +++ b/src/Entities/ItemFrame.cpp @@ -52,7 +52,6 @@ void cItemFrame::OnRightClicked(cPlayer & a_Player) - void cItemFrame::KilledBy(TakeDamageInfo & a_TDI) { if (m_Item.IsEmpty()) diff --git a/src/Entities/LeashKnot.cpp b/src/Entities/LeashKnot.cpp index 971032329..59f08d271 100644 --- a/src/Entities/LeashKnot.cpp +++ b/src/Entities/LeashKnot.cpp @@ -80,7 +80,6 @@ void cLeashKnot::TiePlayersLeashedMobs(cPlayer & a_Player, bool a_ShouldBroadcas - void cLeashKnot::KilledBy(TakeDamageInfo & a_TDI) { super::KilledBy(a_TDI); @@ -115,6 +114,7 @@ void cLeashKnot::SpawnOn(cClientHandle & a_ClientHandle) + void cLeashKnot::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { m_TicksAlive++; diff --git a/src/Entities/Minecart.cpp b/src/Entities/Minecart.cpp index 4de53d716..1c1cc484e 100644 --- a/src/Entities/Minecart.cpp +++ b/src/Entities/Minecart.cpp @@ -109,6 +109,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) : + void cMinecart::SpawnOn(cClientHandle & a_ClientHandle) { a_ClientHandle.SendSpawnVehicle(*this, 10, static_cast<char>(m_Payload)); // 10 = Minecarts @@ -403,6 +404,7 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::millisecon + void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta) { // If the rail is powered set to speed up else slow down. @@ -580,6 +582,7 @@ void cMinecart::HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::mi + void cMinecart::HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt) { HandleRailPhysics(a_RailMeta & 0x07, a_Dt); @@ -869,6 +872,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta) + bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta) { cMinecartCollisionCallback MinecartCollisionCallback( diff --git a/src/Entities/Painting.cpp b/src/Entities/Painting.cpp index d73c2a245..507c911af 100644 --- a/src/Entities/Painting.cpp +++ b/src/Entities/Painting.cpp @@ -20,7 +20,6 @@ cPainting::cPainting(const AString & a_Name, eBlockFace a_Direction, double a_X, - void cPainting::SpawnOn(cClientHandle & a_Client) { super::SpawnOn(a_Client); diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp index 0f18ebe66..a24b9d94c 100644 --- a/src/Entities/Player.cpp +++ b/src/Entities/Player.cpp @@ -984,6 +984,7 @@ void cPlayer::SetFlying(bool a_IsFlying) + void cPlayer::ApplyArmorDamage(int a_DamageBlocked) { short ArmorDamage = static_cast<short>(std::max(a_DamageBlocked / 4, 1)); @@ -1247,6 +1248,7 @@ double cPlayer::GetEyeHeight(void) const + Vector3d cPlayer::GetEyePosition(void) const { return Vector3d( GetPosX(), m_Stance, GetPosZ()); @@ -1282,6 +1284,7 @@ bool cPlayer::IsGameModeAdventure(void) const + bool cPlayer::IsGameModeSpectator(void) const { return (GetEffectiveGameMode() == gmSpectator); @@ -2979,6 +2982,7 @@ void cPlayer::FreezeInternal(const Vector3d & a_Location, bool a_ManuallyFrozen) + float cPlayer::GetLiquidHeightPercent(NIBBLETYPE a_Meta) { if (a_Meta >= 8) @@ -3073,7 +3077,6 @@ float cPlayer::GetPlayerRelativeBlockHardness(BLOCKTYPE a_Block) - float cPlayer::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower) { if ( diff --git a/src/Entities/TNTEntity.cpp b/src/Entities/TNTEntity.cpp index 26217cfcd..f83384649 100644 --- a/src/Entities/TNTEntity.cpp +++ b/src/Entities/TNTEntity.cpp @@ -19,6 +19,7 @@ cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) : + void cTNTEntity::SpawnOn(cClientHandle & a_ClientHandle) { a_ClientHandle.SendSpawnObject(*this, 50, 1, 0, 0); // 50 means TNT diff --git a/src/Generating/BioGen.cpp b/src/Generating/BioGen.cpp index 17f778c4a..09631d098 100644 --- a/src/Generating/BioGen.cpp +++ b/src/Generating/BioGen.cpp @@ -382,6 +382,7 @@ void cBioGenDistortedVoronoi::InitializeBiomeGen(cIniFile & a_IniFile) + void cBioGenDistortedVoronoi::Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ) { double NoiseX = m_Noise.CubicNoise3D(static_cast<float>(a_BlockX / m_CellSize), static_cast<float>(a_BlockZ / m_CellSize), 1000); diff --git a/src/Generating/Caves.cpp b/src/Generating/Caves.cpp index 7057cd349..240248b5a 100644 --- a/src/Generating/Caves.cpp +++ b/src/Generating/Caves.cpp @@ -609,7 +609,6 @@ cStructGenWormNestCaves::cCaveSystem::~cCaveSystem() - void cStructGenWormNestCaves::cCaveSystem::DrawIntoChunk(cChunkDesc & a_ChunkDesc) { int ChunkX = a_ChunkDesc.GetChunkX(); @@ -701,7 +700,6 @@ cGridStructGen::cStructurePtr cStructGenWormNestCaves::CreateStructure(int a_Gri - //////////////////////////////////////////////////////////////////////////////// // cStructGenMarbleCaves: diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp index 451451fd3..e5d213fe6 100644 --- a/src/Generating/ChunkDesc.cpp +++ b/src/Generating/ChunkDesc.cpp @@ -124,6 +124,7 @@ void cChunkDesc::SetBiome(int a_RelX, int a_RelZ, EMCSBiome a_BiomeID) + EMCSBiome cChunkDesc::GetBiome(int a_RelX, int a_RelZ) { return cChunkDef::GetBiome(m_BiomeMap, a_RelX, a_RelZ); @@ -268,6 +269,7 @@ bool cChunkDesc::IsUsingDefaultFinish(void) const + void cChunkDesc::WriteBlockArea(const cBlockArea & a_BlockArea, int a_RelX, int a_RelY, int a_RelZ, cBlockArea::eMergeStrategy a_MergeStrategy) { m_BlockArea.Merge(a_BlockArea, a_RelX, a_RelY, a_RelZ, a_MergeStrategy); diff --git a/src/Generating/ChunkGenerator.cpp b/src/Generating/ChunkGenerator.cpp index 3ac128c46..103920498 100644 --- a/src/Generating/ChunkGenerator.cpp +++ b/src/Generating/ChunkGenerator.cpp @@ -282,6 +282,7 @@ void cChunkGenerator::Execute(void) + void cChunkGenerator::DoGenerate(int a_ChunkX, int a_ChunkZ) { ASSERT(m_PluginInterface != nullptr); diff --git a/src/Generating/CompoGenBiomal.cpp b/src/Generating/CompoGenBiomal.cpp index f2835dfe1..624885ede 100644 --- a/src/Generating/CompoGenBiomal.cpp +++ b/src/Generating/CompoGenBiomal.cpp @@ -156,7 +156,6 @@ static cPattern::BlockInfo tbOFOrangeClay[] = - //////////////////////////////////////////////////////////////////////////////// // Individual patterns to use: diff --git a/src/Generating/DungeonRoomsFinisher.cpp b/src/Generating/DungeonRoomsFinisher.cpp index 2b4b94993..06d45ce8c 100644 --- a/src/Generating/DungeonRoomsFinisher.cpp +++ b/src/Generating/DungeonRoomsFinisher.cpp @@ -283,7 +283,6 @@ protected: - //////////////////////////////////////////////////////////////////////////////// // cDungeonRoomsFinisher: @@ -308,7 +307,6 @@ cDungeonRoomsFinisher::cDungeonRoomsFinisher(cTerrainShapeGenPtr a_ShapeGen, int - cDungeonRoomsFinisher::cStructurePtr cDungeonRoomsFinisher::CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ) { // Select a random room size in each direction: diff --git a/src/Generating/HeiGen.cpp b/src/Generating/HeiGen.cpp index 42df16e73..20e8b966f 100644 --- a/src/Generating/HeiGen.cpp +++ b/src/Generating/HeiGen.cpp @@ -295,7 +295,6 @@ bool cHeiGenMultiCache::GetHeightAt(int a_ChunkX, int a_ChunkZ, int a_RelX, int - //////////////////////////////////////////////////////////////////////////////// // cHeiGenClassic: diff --git a/src/Generating/IntGen.h b/src/Generating/IntGen.h index 794fbfc0e..ae46b2de2 100644 --- a/src/Generating/IntGen.h +++ b/src/Generating/IntGen.h @@ -174,7 +174,6 @@ protected: - /** Generates a 2D array of random integers in the specified range [0 .. Range). */ template <int Range, int SizeX, int SizeZ = SizeX> class cIntGenChoice : @@ -206,7 +205,6 @@ public: - /** Decides between the ocean and landmass biomes. Has a threshold (in percent) of how much land, the larger the threshold, the more land. Generates 0 for ocean, biome group ID for landmass. */ @@ -1117,7 +1115,6 @@ protected: - /** Adds a "rare" flag to random biome groups, based on the given chance. */ template <int SizeX, int SizeZ = SizeX> class cIntGenRareBiomeGroups: diff --git a/src/Generating/Noise3DGenerator.cpp b/src/Generating/Noise3DGenerator.cpp index 6d07ce67e..4972a0505 100644 --- a/src/Generating/Noise3DGenerator.cpp +++ b/src/Generating/Noise3DGenerator.cpp @@ -783,6 +783,7 @@ void cBiomalNoise3DComposable::GetBiomeParams(EMCSBiome a_Biome, NOISE_DATATYPE + void cBiomalNoise3DComposable::GenShape(int a_ChunkX, int a_ChunkZ, cChunkDesc::Shape & a_Shape) { GenerateNoiseArrayIfNeeded(a_ChunkX, a_ChunkZ); diff --git a/src/Generating/PieceStructuresGen.cpp b/src/Generating/PieceStructuresGen.cpp index 2dae8c295..c1648e258 100644 --- a/src/Generating/PieceStructuresGen.cpp +++ b/src/Generating/PieceStructuresGen.cpp @@ -14,7 +14,6 @@ - class cPieceStructuresGen::cGen: public cGridStructGen { @@ -119,7 +118,6 @@ protected: - //////////////////////////////////////////////////////////////////////////////// // cPieceStructuresGen: diff --git a/src/Generating/Prefab.cpp b/src/Generating/Prefab.cpp index 818b8254c..1f2b5c916 100644 --- a/src/Generating/Prefab.cpp +++ b/src/Generating/Prefab.cpp @@ -137,6 +137,7 @@ void cPrefab::Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const + void cPrefab::Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumRotations) const { // Draw the basic image: diff --git a/src/Generating/ProtIntGen.h b/src/Generating/ProtIntGen.h index 08143cf6d..24cdafa15 100644 --- a/src/Generating/ProtIntGen.h +++ b/src/Generating/ProtIntGen.h @@ -106,7 +106,6 @@ protected: - /** Generates a 2D array of random integers in the specified range [0 .. Range). */ class cProtIntGenChoice : public cProtIntGenWithNoise @@ -141,7 +140,6 @@ protected: - /** Decides between the ocean and landmass biomes. Has a threshold (in percent) of how much land, the larger the threshold, the more land. Generates 0 for ocean, biome group ID for landmass. */ @@ -1366,7 +1364,6 @@ protected: - /** Adds a "rare" flag to random biome groups, based on the given chance. */ class cProtIntGenRareBiomeGroups: public cProtIntGenWithNoise diff --git a/src/Generating/Ravines.cpp b/src/Generating/Ravines.cpp index 1dd58a7b8..f1d5fdb23 100644 --- a/src/Generating/Ravines.cpp +++ b/src/Generating/Ravines.cpp @@ -99,7 +99,6 @@ cGridStructGen::cStructurePtr cStructGenRavines::CreateStructure(int a_GridX, in - //////////////////////////////////////////////////////////////////////////////// // cStructGenRavines::cRavine diff --git a/src/Generating/Ravines.h b/src/Generating/Ravines.h index 5353978d0..bcfdcc0d2 100644 --- a/src/Generating/Ravines.h +++ b/src/Generating/Ravines.h @@ -35,4 +35,3 @@ protected: - diff --git a/src/Generating/StructGen.h b/src/Generating/StructGen.h index a9ada6c1e..15671453a 100644 --- a/src/Generating/StructGen.h +++ b/src/Generating/StructGen.h @@ -106,7 +106,6 @@ protected: - class cStructGenDirectOverhangs : public cFinishGen { diff --git a/src/HTTP/HTTPMessage.h b/src/HTTP/HTTPMessage.h index 55e44fa93..be767a55a 100644 --- a/src/HTTP/HTTPMessage.h +++ b/src/HTTP/HTTPMessage.h @@ -13,7 +13,6 @@ - class cHTTPMessage { public: diff --git a/src/HTTP/HTTPMessageParser.cpp b/src/HTTP/HTTPMessageParser.cpp index 10d3d4ad9..18d2968b5 100644 --- a/src/HTTP/HTTPMessageParser.cpp +++ b/src/HTTP/HTTPMessageParser.cpp @@ -119,6 +119,7 @@ void cHTTPMessageParser::Reset(void) + size_t cHTTPMessageParser::ParseFirstLine(void) { auto idxLineEnd = m_Buffer.find("\r\n"); @@ -136,6 +137,7 @@ size_t cHTTPMessageParser::ParseFirstLine(void) + size_t cHTTPMessageParser::ParseBody(const char * a_Data, size_t a_Size) { if (m_TransferEncodingParser == nullptr) diff --git a/src/HTTP/HTTPServer.h b/src/HTTP/HTTPServer.h index a70d41069..fe9f091dc 100644 --- a/src/HTTP/HTTPServer.h +++ b/src/HTTP/HTTPServer.h @@ -27,7 +27,6 @@ class cSslConfig; - class cHTTPServer { public: diff --git a/src/HTTP/HTTPServerConnection.cpp b/src/HTTP/HTTPServerConnection.cpp index 494aa42c6..8c1afb1f0 100644 --- a/src/HTTP/HTTPServerConnection.cpp +++ b/src/HTTP/HTTPServerConnection.cpp @@ -142,7 +142,6 @@ void cHTTPServerConnection::OnRemoteClosed(void) - void cHTTPServerConnection::OnError(int a_ErrorCode, const AString & a_ErrorMsg) { OnRemoteClosed(); diff --git a/src/HTTP/NameValueParser.cpp b/src/HTTP/NameValueParser.cpp index ca5c4baab..d62d05929 100644 --- a/src/HTTP/NameValueParser.cpp +++ b/src/HTTP/NameValueParser.cpp @@ -10,7 +10,6 @@ - // DEBUG: Self-test #if 0 diff --git a/src/Inventory.cpp b/src/Inventory.cpp index 9cfc17452..d8b67835e 100644 --- a/src/Inventory.cpp +++ b/src/Inventory.cpp @@ -101,6 +101,8 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int + + int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks) { cItem ToAdd(a_Item); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 14b25d2b7..812003cbb 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -709,7 +709,6 @@ bool cItemHandler::IsPlaceable(void) - bool cItemHandler::CanRepairWithRawMaterial(short a_ItemType) { UNUSED(a_ItemType); @@ -840,10 +839,6 @@ cItemHandler::FoodInfo cItemHandler::GetFoodInfo(const cItem * a_Item) - - - - float cItemHandler::GetBlockBreakingStrength(BLOCKTYPE a_Block) { return 1.0f; diff --git a/src/LightingThread.cpp b/src/LightingThread.cpp index c83589965..8c445c8e4 100644 --- a/src/LightingThread.cpp +++ b/src/LightingThread.cpp @@ -12,7 +12,6 @@ - /** Chunk data callback that takes the chunk data and puts them into cLightingThread's m_BlockTypes[] / m_HeightMap[]: */ class cReader : public cChunkDataCallback @@ -231,7 +230,6 @@ void cLightingThread::Execute(void) - void cLightingThread::LightChunk(cLightingChunkStay & a_Item) { // If the chunk is already lit, skip it (report as success): diff --git a/src/LineBlockTracer.cpp b/src/LineBlockTracer.cpp index e194ae653..d8386574b 100644 --- a/src/LineBlockTracer.cpp +++ b/src/LineBlockTracer.cpp @@ -13,7 +13,6 @@ - cLineBlockTracer::cLineBlockTracer(cWorld & a_World, cCallbacks & a_Callbacks) : super(a_World, a_Callbacks), m_StartX(0.0), diff --git a/src/Map.cpp b/src/Map.cpp index 87cc9bfdf..5a0a4ea7c 100644 --- a/src/Map.cpp +++ b/src/Map.cpp @@ -199,7 +199,6 @@ eDimension cMap::GetDimension(void) const - void cMap::Resize(unsigned int a_Width, unsigned int a_Height) { if ((m_Width == a_Width) && (m_Height == a_Height)) @@ -333,6 +332,7 @@ const cMapDecorator cMap::CreateDecorator(const cEntity * a_TrackedEntity) + unsigned int cMap::GetPixelWidth(void) const { return static_cast<unsigned int>(pow(2.0, static_cast<double>(m_Scale))); diff --git a/src/MemorySettingsRepository.cpp b/src/MemorySettingsRepository.cpp index 21b4c769c..d42fbed30 100644 --- a/src/MemorySettingsRepository.cpp +++ b/src/MemorySettingsRepository.cpp @@ -33,6 +33,7 @@ bool cMemorySettingsRepository::HasValue(const AString & a_KeyName, const AStrin + int cMemorySettingsRepository::AddKeyName(const AString & a_keyname) { m_Map.emplace(a_keyname, std::unordered_multimap<AString, sValue>{}); @@ -70,7 +71,6 @@ bool cMemorySettingsRepository::DeleteKeyComment(const AString & keyname, const - void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value) { if (m_Writable) @@ -82,6 +82,7 @@ void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AStri + void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, Int64 a_Value) { if (m_Writable) @@ -201,6 +202,7 @@ Int64 cMemorySettingsRepository::GetValueSetI(const AString & a_KeyName, const A + bool cMemorySettingsRepository::GetValueSetB(const AString & a_KeyName, const AString & a_ValueName, const bool defValue) { auto outerIter = m_Map.find(a_KeyName); @@ -253,6 +255,7 @@ bool cMemorySettingsRepository::SetValue (const AString & a_KeyName, const AStri + bool cMemorySettingsRepository::SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists) { if (!m_Writable) @@ -305,6 +308,10 @@ bool cMemorySettingsRepository::DeleteValue(const AString & a_KeyName, const ASt return true; } + + + + bool cMemorySettingsRepository::Flush() { return true; diff --git a/src/MobProximityCounter.cpp b/src/MobProximityCounter.cpp index 47d585954..488b6c3dd 100644 --- a/src/MobProximityCounter.cpp +++ b/src/MobProximityCounter.cpp @@ -36,6 +36,10 @@ void cMobProximityCounter::CollectMob(cEntity & a_Monster, cChunk & a_Chunk, dou } + + + + void cMobProximityCounter::convertMaps() { for (tMonsterToDistance::const_iterator itr = m_MonsterToDistance.begin(); itr != m_MonsterToDistance.end(); ++itr) @@ -44,6 +48,10 @@ void cMobProximityCounter::convertMaps() } } + + + + cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDistances(double a_DistanceMin, double a_DistanceMax) { sIterablePair toReturn; diff --git a/src/Mobs/AggressiveMonster.cpp b/src/Mobs/AggressiveMonster.cpp index fec14e6e9..9b13615de 100644 --- a/src/Mobs/AggressiveMonster.cpp +++ b/src/Mobs/AggressiveMonster.cpp @@ -36,7 +36,6 @@ void cAggressiveMonster::InStateChasing(std::chrono::milliseconds a_Dt, cChunk & - void cAggressiveMonster::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk) { if (!a_Player->CanMobsTarget()) diff --git a/src/Mobs/Chicken.cpp b/src/Mobs/Chicken.cpp index 242fe5aa0..1810a295f 100644 --- a/src/Mobs/Chicken.cpp +++ b/src/Mobs/Chicken.cpp @@ -7,8 +7,6 @@ - - cChicken::cChicken(void) : super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.4, 0.7), m_EggDropTimer(0) @@ -20,6 +18,7 @@ cChicken::cChicken(void) : + void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { super::Tick(a_Dt, a_Chunk); diff --git a/src/Mobs/Cow.cpp b/src/Mobs/Cow.cpp index 003159959..fbfa3bf22 100644 --- a/src/Mobs/Cow.cpp +++ b/src/Mobs/Cow.cpp @@ -8,8 +8,6 @@ - - cCow::cCow(void) : super("Cow", mtCow, "entity.cow.hurt", "entity.cow.death", 0.9, 1.3) { diff --git a/src/Mobs/Enderman.cpp b/src/Mobs/Enderman.cpp index 71ba4e79a..ff4ad4f69 100644 --- a/src/Mobs/Enderman.cpp +++ b/src/Mobs/Enderman.cpp @@ -97,6 +97,7 @@ void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer) + void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk) { if (GetTarget() != nullptr) diff --git a/src/Mobs/MagmaCube.cpp b/src/Mobs/MagmaCube.cpp index 4d70a0291..4247cbe1f 100644 --- a/src/Mobs/MagmaCube.cpp +++ b/src/Mobs/MagmaCube.cpp @@ -27,6 +27,8 @@ void cMagmaCube::GetDrops(cItems & a_Drops, cEntity * a_Killer) + + AString cMagmaCube::GetSizeName(int a_Size) { if (a_Size == 1) diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 0d6b8e777..3c202d693 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -1079,7 +1079,6 @@ int cMonster::GetSpawnDelay(cMonster::eFamily a_MobFamily) - /** Sets the target. */ void cMonster::SetTarget (cPawn * a_NewTarget) { @@ -1347,6 +1346,7 @@ void cMonster::HandleDaylightBurning(cChunk & a_Chunk, bool WouldBurn) + bool cMonster::WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk) { // If the Y coord is out of range, return the most logical result without considering anything else: diff --git a/src/Mobs/Mooshroom.cpp b/src/Mobs/Mooshroom.cpp index a468a7282..8be0c44dd 100644 --- a/src/Mobs/Mooshroom.cpp +++ b/src/Mobs/Mooshroom.cpp @@ -8,11 +8,6 @@ - - - - - cMooshroom::cMooshroom(void) : super("Mooshroom", mtMooshroom, "entity.cow.hurt", "entity.cow.death", 0.9, 1.3) { diff --git a/src/Mobs/Path.cpp b/src/Mobs/Path.cpp index 9c423684f..fa57fa1ca 100644 --- a/src/Mobs/Path.cpp +++ b/src/Mobs/Path.cpp @@ -66,6 +66,10 @@ cPath::cPath( ProcessCell(GetCell(m_Source), nullptr, 0); } + + + + cPath::cPath() : m_IsValid(false) { @@ -73,6 +77,8 @@ cPath::cPath() : m_IsValid(false) + + ePathFinderStatus cPath::CalculationStep(cChunk & a_Chunk) { m_Chunk = &a_Chunk; diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp index 26462ba31..9c5ec8c39 100644 --- a/src/Mobs/Villager.cpp +++ b/src/Mobs/Villager.cpp @@ -182,6 +182,7 @@ void cVillager::HandleFarmerTryHarvestCrops() + void cVillager::HandleFarmerPlaceCrops() { // Check if there is still farmland at the spot where the crops were. diff --git a/src/Mobs/Wolf.cpp b/src/Mobs/Wolf.cpp index ffeb8cf90..401175bf0 100644 --- a/src/Mobs/Wolf.cpp +++ b/src/Mobs/Wolf.cpp @@ -88,6 +88,10 @@ void cWolf::NotifyAlliesOfFight(cPawn * a_Opponent) ); } + + + + bool cWolf::Attack(std::chrono::milliseconds a_Dt) { UNUSED(a_Dt); @@ -384,6 +388,8 @@ void cWolf::TickFollowPlayer() + + void cWolf::InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) { if (!IsTame()) diff --git a/src/NetherPortalScanner.cpp b/src/NetherPortalScanner.cpp index d329200d9..cd1a0a62c 100644 --- a/src/NetherPortalScanner.cpp +++ b/src/NetherPortalScanner.cpp @@ -9,7 +9,6 @@ - const double cNetherPortalScanner::OutOffset = 2; const double cNetherPortalScanner::AcrossOffset = 0.5; diff --git a/src/OSSupport/Event.cpp b/src/OSSupport/Event.cpp index be2803451..4a16ddee7 100644 --- a/src/OSSupport/Event.cpp +++ b/src/OSSupport/Event.cpp @@ -62,6 +62,7 @@ void cEvent::Set(void) + void cEvent::SetAll(void) { { diff --git a/src/OSSupport/File.cpp b/src/OSSupport/File.cpp index bb33dc732..d9b3d86d3 100644 --- a/src/OSSupport/File.cpp +++ b/src/OSSupport/File.cpp @@ -213,7 +213,6 @@ long cFile::Seek (int iPosition) - long cFile::Tell (void) const { ASSERT(IsOpen()); diff --git a/src/OSSupport/Network.h b/src/OSSupport/Network.h index babf0c078..3c4470848 100644 --- a/src/OSSupport/Network.h +++ b/src/OSSupport/Network.h @@ -29,7 +29,6 @@ typedef std::shared_ptr<cX509Cert> cX509CertPtr; - /** Interface that provides the methods available on a single TCP connection. */ class cTCPLink { diff --git a/src/OSSupport/TCPLinkImpl.cpp b/src/OSSupport/TCPLinkImpl.cpp index 496e264be..d7edc68cd 100644 --- a/src/OSSupport/TCPLinkImpl.cpp +++ b/src/OSSupport/TCPLinkImpl.cpp @@ -235,7 +235,6 @@ void cTCPLinkImpl::Close(void) - AString cTCPLinkImpl::StartTLSClient( cX509CertPtr a_OwnCert, cCryptoKeyPtr a_OwnPrivKey diff --git a/src/OSSupport/WinStackWalker.cpp b/src/OSSupport/WinStackWalker.cpp index b9a8be39f..1a95b2907 100644 --- a/src/OSSupport/WinStackWalker.cpp +++ b/src/OSSupport/WinStackWalker.cpp @@ -715,6 +715,7 @@ WinStackWalker::WinStackWalker(DWORD dwProcessId, HANDLE hProcess) + WinStackWalker::WinStackWalker(int options, LPCSTR szSymPath, DWORD dwProcessId, HANDLE hProcess) { this->m_options = options; diff --git a/src/OverridesSettingsRepository.cpp b/src/OverridesSettingsRepository.cpp index 607f7c5d0..fc189e5e4 100644 --- a/src/OverridesSettingsRepository.cpp +++ b/src/OverridesSettingsRepository.cpp @@ -20,6 +20,7 @@ bool cOverridesSettingsRepository::KeyExists(const AString a_keyName) const + bool cOverridesSettingsRepository::HasValue(const AString & a_KeyName, const AString & a_ValueName) const { return m_Overrides->HasValue(a_KeyName, a_ValueName) || m_Main->HasValue(a_KeyName, a_ValueName); @@ -260,6 +261,8 @@ bool cOverridesSettingsRepository::DeleteValue(const AString & a_KeyName, const + + bool cOverridesSettingsRepository::Flush() { return m_Overrides->Flush() && m_Main->Flush(); diff --git a/src/ProbabDistrib.cpp b/src/ProbabDistrib.cpp index fbc025eae..b074bf058 100644 --- a/src/ProbabDistrib.cpp +++ b/src/ProbabDistrib.cpp @@ -20,7 +20,6 @@ cProbabDistrib::cProbabDistrib(int a_MaxValue) : - void cProbabDistrib::SetPoints(const cProbabDistrib::cPoints & a_Points) { ASSERT(!a_Points.empty()); diff --git a/src/Protocol/ForgeHandshake.cpp b/src/Protocol/ForgeHandshake.cpp index b6f7a7c94..8c16d4f0c 100644 --- a/src/Protocol/ForgeHandshake.cpp +++ b/src/Protocol/ForgeHandshake.cpp @@ -181,6 +181,7 @@ AStringMap cForgeHandshake::ParseModList(const char * a_Data, size_t a_Size) + void cForgeHandshake::HandleClientHello(cClientHandle * a_Client, const char * a_Data, size_t a_Size) { if (a_Size == 2) @@ -201,6 +202,7 @@ void cForgeHandshake::HandleClientHello(cClientHandle * a_Client, const char * a + void cForgeHandshake::HandleModList(cClientHandle * a_Client, const char * a_Data, size_t a_Size) { LOGD("Received ModList"); @@ -248,6 +250,7 @@ void cForgeHandshake::HandleModList(cClientHandle * a_Client, const char * a_Dat + void cForgeHandshake::HandleHandshakeAck(cClientHandle * a_Client, const char * a_Data, size_t a_Size) { if (a_Size != 2) diff --git a/src/Protocol/MojangAPI.cpp b/src/Protocol/MojangAPI.cpp index 5aa7f58db..fdaec346f 100644 --- a/src/Protocol/MojangAPI.cpp +++ b/src/Protocol/MojangAPI.cpp @@ -38,7 +38,6 @@ const int MAX_PER_QUERY = 100; - /** Returns the CA certificates that should be trusted for Mojang-related connections. */ static cX509CertPtr GetCACerts(void) { diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp index 27ed2e6ad..c10d43e3e 100644 --- a/src/Protocol/ProtocolRecognizer.cpp +++ b/src/Protocol/ProtocolRecognizer.cpp @@ -191,6 +191,7 @@ void cProtocolRecognizer::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSe + void cProtocolRecognizer::SendCameraSetTo(const cEntity & a_Entity) { ASSERT(m_Protocol != nullptr); @@ -288,6 +289,7 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason) + void cProtocolRecognizer::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ) { ASSERT(m_Protocol != nullptr); @@ -438,7 +440,6 @@ void cProtocolRecognizer::SendHeldItemChange(int a_ItemIndex) - void cProtocolRecognizer::SendHideTitle(void) { ASSERT(m_Protocol != nullptr); diff --git a/src/Protocol/Protocol_1_11.cpp b/src/Protocol/Protocol_1_11.cpp index ebbcbade2..f0f7f855a 100644 --- a/src/Protocol/Protocol_1_11.cpp +++ b/src/Protocol/Protocol_1_11.cpp @@ -520,7 +520,6 @@ void cProtocol_1_11_0::WriteBlockEntity(cPacketizer & a_Pkt, const cBlockEntity - void cProtocol_1_11_0::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks) { ASSERT(m_State == 3); // In game mode? @@ -536,7 +535,6 @@ void cProtocol_1_11_0::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int - void cProtocol_1_11_0::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer) { int BlockX, BlockY, BlockZ; diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp index 5055526df..2101fa6f1 100644 --- a/src/Protocol/Protocol_1_8.cpp +++ b/src/Protocol/Protocol_1_8.cpp @@ -710,6 +710,7 @@ void cProtocol_1_8_0::SendLogin(const cPlayer & a_Player, const cWorld & a_World + void cProtocol_1_8_0::SendLoginSuccess(void) { ASSERT(m_State == 2); // State: login? @@ -1550,6 +1551,7 @@ void cProtocol_1_8_0::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) + void cProtocol_1_8_0::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity) { ASSERT(m_State == 3); // In game mode? @@ -2060,6 +2062,7 @@ void cProtocol_1_8_0::AddReceivedData(const char * a_Data, size_t a_Size) + bool cProtocol_1_8_0::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) { switch (m_State) diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 73b81580e..95406613c 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -649,7 +649,6 @@ void cProtocol_1_9_0::SendHeldItemChange(int a_ItemIndex) - void cProtocol_1_9_0::SendHideTitle(void) { ASSERT(m_State == 3); // In game mode? @@ -751,6 +750,7 @@ void cProtocol_1_9_0::SendLogin(const cPlayer & a_Player, const cWorld & a_World + void cProtocol_1_9_0::SendLoginSuccess(void) { ASSERT(m_State == 2); // State: login? @@ -1597,6 +1597,7 @@ void cProtocol_1_9_0::SendUnloadChunk(int a_ChunkX, int a_ChunkZ) + void cProtocol_1_9_0::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity) { ASSERT(m_State == 3); // In game mode? @@ -2107,6 +2108,7 @@ void cProtocol_1_9_0::AddReceivedData(const char * a_Data, size_t a_Size) + bool cProtocol_1_9_0::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType) { switch (m_State) diff --git a/src/RankManager.cpp b/src/RankManager.cpp index 53083fa7a..87e538d28 100644 --- a/src/RankManager.cpp +++ b/src/RankManager.cpp @@ -770,7 +770,6 @@ std::vector<cUUID> cRankManager::GetAllPlayerUUIDs(void) - AStringVector cRankManager::GetAllRanks(void) { ASSERT(m_IsInitialized); @@ -2202,7 +2201,6 @@ bool cRankManager::UpdatePlayerName(const cUUID & a_PlayerUUID, const AString & - bool cRankManager::AreDBTablesEmpty(void) { return ( @@ -2275,6 +2273,7 @@ void cRankManager::CreateDefaults(void) + bool cRankManager::DoesColumnExist(const char * a_TableName, const char * a_ColumnName) { try diff --git a/src/Scoreboard.cpp b/src/Scoreboard.cpp index e2687e7af..7a6ed8867 100644 --- a/src/Scoreboard.cpp +++ b/src/Scoreboard.cpp @@ -249,6 +249,7 @@ void cTeam::Reset(void) + void cTeam::SetDisplayName(const AString & a_Name) { m_DisplayName = a_Name; diff --git a/src/Server.cpp b/src/Server.cpp index 89dccb1f1..207e42569 100644 --- a/src/Server.cpp +++ b/src/Server.cpp @@ -260,6 +260,7 @@ void cServer::UnregisterForgeMod(const AString & a_ModName, UInt32 a_ProtocolVer + AStringMap & cServer::RegisteredForgeMods(const UInt32 a_Protocol) { auto it = m_ForgeModsByVersion.find(a_Protocol); @@ -277,6 +278,7 @@ AStringMap & cServer::RegisteredForgeMods(const UInt32 a_Protocol) + const AStringMap & cServer::GetRegisteredForgeMods(const UInt32 a_Protocol) { return RegisteredForgeMods(a_Protocol); @@ -285,6 +287,7 @@ const AStringMap & cServer::GetRegisteredForgeMods(const UInt32 a_Protocol) + bool cServer::IsPlayerInQueue(AString a_Username) { cCSLock Lock(m_CSClients); diff --git a/src/SetChunkData.cpp b/src/SetChunkData.cpp index 1fdc2e775..fad61ef1a 100644 --- a/src/SetChunkData.cpp +++ b/src/SetChunkData.cpp @@ -127,7 +127,6 @@ void cSetChunkData::CalculateHeightMap(void) - void cSetChunkData::RemoveInvalidBlockEntities(void) { for (cBlockEntities::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end();) diff --git a/src/Simulator/FloodyFluidSimulator.cpp b/src/Simulator/FloodyFluidSimulator.cpp index 76f1502ff..8d5a3a8ae 100644 --- a/src/Simulator/FloodyFluidSimulator.cpp +++ b/src/Simulator/FloodyFluidSimulator.cpp @@ -145,6 +145,7 @@ void cFloodyFluidSimulator::SpreadXZ(cChunk * a_Chunk, int a_RelX, int a_RelY, i + bool cFloodyFluidSimulator::CheckTributaries(cChunk * a_Chunk, int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_MyMeta) { // If we have a section above, check if there's fluid above this block that would feed it: diff --git a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp index 966ee28ca..87853f0ff 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp +++ b/src/Simulator/IncrementalRedstoneSimulator/IncrementalRedstoneSimulator.cpp @@ -52,7 +52,6 @@ const cRedstoneHandler * cIncrementalRedstoneSimulator::GetComponentHandler(BLOC - std::unique_ptr<cRedstoneHandler> cIncrementalRedstoneSimulator::CreateComponent(BLOCKTYPE a_BlockType) { switch (a_BlockType) diff --git a/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h b/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h index 6c6fa48d7..7c967af9c 100644 --- a/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h +++ b/src/Simulator/IncrementalRedstoneSimulator/RedstoneLampHandler.h @@ -5,7 +5,6 @@ - class cRedstoneLampHandler : public cRedstoneHandler { public: diff --git a/src/SpawnPrepare.cpp b/src/SpawnPrepare.cpp index 3e56c721b..d861a498d 100644 --- a/src/SpawnPrepare.cpp +++ b/src/SpawnPrepare.cpp @@ -48,8 +48,6 @@ cSpawnPrepare::cSpawnPrepare(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChu - - void cSpawnPrepare::PrepareChunks(cWorld & a_World, int a_SpawnChunkX, int a_SpawnChunkZ, int a_PrepareDistance) { diff --git a/src/Statistics.cpp b/src/Statistics.cpp index f29532619..b14d4ccdf 100644 --- a/src/Statistics.cpp +++ b/src/Statistics.cpp @@ -80,7 +80,6 @@ cStatInfo cStatInfo::ms_Info[statCount] = - cStatInfo::cStatInfo() : m_Type(statInvalid) , m_Depends(statInvalid) diff --git a/src/Statistics.h b/src/Statistics.h index d70a2aeab..675c7fcfe 100644 --- a/src/Statistics.h +++ b/src/Statistics.h @@ -84,7 +84,6 @@ enum eStatistic - /** Class used to store and query statistic-related information. */ class cStatInfo { diff --git a/src/Stopwatch.h b/src/Stopwatch.h index af0a5108f..b7c8e50c7 100644 --- a/src/Stopwatch.h +++ b/src/Stopwatch.h @@ -7,7 +7,6 @@ - #pragma once diff --git a/src/StringUtils.cpp b/src/StringUtils.cpp index 08dd4774a..ca9d4b587 100644 --- a/src/StringUtils.cpp +++ b/src/StringUtils.cpp @@ -93,6 +93,7 @@ AStringVector StringSplit(const AString & str, const AString & delim) + AStringVector StringSplitWithQuotes(const AString & str, const AString & delim) { AStringVector results; @@ -185,6 +186,7 @@ AString StringJoin(const AStringVector & a_Strings, const AString & a_Delimeter) + AStringVector StringSplitAndTrim(const AString & str, const AString & delim) { AStringVector results; @@ -205,6 +207,7 @@ AStringVector StringSplitAndTrim(const AString & str, const AString & delim) + AString TrimString(const AString & str) { size_t len = str.length(); @@ -346,6 +349,7 @@ void ReplaceString(AString & iHayStack, const AString & iNeedle, const AString & + AString & RawBEToUTF8(const char * a_RawData, size_t a_NumShorts, AString & a_UTF8) { a_UTF8.clear(); @@ -360,6 +364,7 @@ AString & RawBEToUTF8(const char * a_RawData, size_t a_NumShorts, AString & a_UT + AString UnicodeCharToUtf8(unsigned a_UnicodeChar) { if (a_UnicodeChar < 0x80) @@ -610,7 +615,6 @@ are equivalent to the following loop: - #define HEX(x) static_cast<char>((x) > 9 ? (x) + 'A' - 10 : (x) + '0') /** @@ -1052,6 +1056,10 @@ AString StringsConcat(const AStringVector & a_Strings, char a_Separator) return res; } + + + + bool StringToFloat(const AString & a_String, float & a_Num) { char *err; diff --git a/src/StringUtils.h b/src/StringUtils.h index 1c6cdf509..3751d9946 100644 --- a/src/StringUtils.h +++ b/src/StringUtils.h @@ -21,7 +21,6 @@ typedef std::map<AString, AString> AStringMap; - /** Output the formatted text into the string. Returns a_Dst. */ extern AString & Printf(AString & a_Dst, const char * format, fmt::ArgList args); diff --git a/src/Tracer.cpp b/src/Tracer.cpp index 5bf50bbfc..91a89f96c 100644 --- a/src/Tracer.cpp +++ b/src/Tracer.cpp @@ -304,6 +304,7 @@ static int LinesCross(float x0, float y0, float x1, float y1, float x2, float y2 + // intersect3D_SegmentPlane(): intersect a segment and a plane // Input: a_Ray = a segment, and a_Plane = a plane = {Point V0; Vector n;} // Output: *I0 = the intersect point (when it exists) diff --git a/src/UI/EnchantingWindow.cpp b/src/UI/EnchantingWindow.cpp index 4c5bcbfd5..5ac75a2da 100644 --- a/src/UI/EnchantingWindow.cpp +++ b/src/UI/EnchantingWindow.cpp @@ -44,7 +44,6 @@ void cEnchantingWindow::SetProperty(short a_Property, short a_Value, cPlayer & a - void cEnchantingWindow::SetProperty(short a_Property, short a_Value) { if ((a_Property < 0) || (static_cast<size_t>(a_Property) >= ARRAYCOUNT(m_PropertyValue))) diff --git a/src/UI/SlotArea.cpp b/src/UI/SlotArea.cpp index b43da1162..d6b870d0e 100644 --- a/src/UI/SlotArea.cpp +++ b/src/UI/SlotArea.cpp @@ -587,7 +587,6 @@ void cSlotAreaCrafting::OnPlayerRemoved(cPlayer & a_Player) - void cSlotAreaCrafting::SetSlot(int a_SlotNum, cPlayer & a_Player, const cItem & a_Item) { // Update the recipe after setting the slot, if the slot is not the result slot: @@ -614,6 +613,7 @@ void cSlotAreaCrafting::DistributeStack(cItem & a_ItemStack, cPlayer & a_Player, + void cSlotAreaCrafting::ClickedResult(cPlayer & a_Player) { cItem & DraggingItem = a_Player.GetDraggingItem(); @@ -757,6 +757,7 @@ cCraftingRecipe & cSlotAreaCrafting::GetRecipeForPlayer(cPlayer & a_Player) + void cSlotAreaCrafting::HandleCraftItem(const cItem & a_Result, cPlayer & a_Player) { switch (a_Result.m_ItemType) @@ -1225,6 +1226,7 @@ cSlotAreaBeacon::~cSlotAreaBeacon() + bool cSlotAreaBeacon::IsPlaceableItem(short a_ItemType) { switch (a_ItemType) @@ -2191,6 +2193,9 @@ void cSlotAreaBrewingstand::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum) } + + + //////////////////////////////////////////////////////////////////////////////// // cSlotAreaMinecartWithChest: diff --git a/src/Vector3.h b/src/Vector3.h index 7c37c2601..cb39a6cde 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -362,7 +362,6 @@ public: - template <> inline Vector3<int> Vector3<int>::Floor(void) const { return *this; diff --git a/src/World.cpp b/src/World.cpp index c88db0a7e..e7184c96b 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -1272,6 +1272,7 @@ void cWorld::TickQueuedTasks(void) + void cWorld::TickClients(float a_Dt) { cClientHandlePtrs RemoveClients; @@ -2338,6 +2339,7 @@ UInt32 cWorld::SpawnBoat(Vector3d a_Pos, cBoat::eMaterial a_Material) + UInt32 cWorld::SpawnPrimedTNT(Vector3d a_Pos, int a_FuseTicks, double a_InitialVelocityCoeff) { auto TNT = cpp14::make_unique<cTNTEntity>(a_Pos, a_FuseTicks); @@ -3264,18 +3266,6 @@ OwnedEntity cWorld::RemoveEntity(cEntity & a_Entity) -/* -unsigned int cWorld::GetNumPlayers(void) -{ - cCSLock Lock(m_CSPlayers); - return m_Players.size(); -} -*/ - - - - - size_t cWorld::GetNumChunks(void) const { return m_ChunkMap->GetNumChunks(); @@ -3383,6 +3373,7 @@ UInt32 cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, eMonsterTyp + UInt32 cWorld::SpawnMobFinalize(std::unique_ptr<cMonster> a_Monster) { ASSERT(a_Monster != nullptr); @@ -3611,7 +3602,6 @@ cFluidSimulator * cWorld::InitializeFluidSimulator(cIniFile & a_IniFile, const c - void cWorld::AddQueuedPlayers(void) { ASSERT(m_TickThread.IsCurrentThread()); diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp index eb04e54e2..f53dba68b 100644 --- a/src/WorldStorage/NBTChunkSerializer.cpp +++ b/src/WorldStorage/NBTChunkSerializer.cpp @@ -883,6 +883,10 @@ void cNBTChunkSerializer::AddItemFrameEntity(cItemFrame * a_ItemFrame) m_Writer.EndCompound(); } + + + + void cNBTChunkSerializer::AddLeashKnotEntity(cLeashKnot * a_LeashKnot) { m_Writer.BeginCompound(""); @@ -892,6 +896,9 @@ void cNBTChunkSerializer::AddLeashKnotEntity(cLeashKnot * a_LeashKnot) } + + + void cNBTChunkSerializer::AddPaintingEntity(cPainting * a_Painting) { m_Writer.BeginCompound(""); diff --git a/src/WorldStorage/SchematicFileSerializer.cpp b/src/WorldStorage/SchematicFileSerializer.cpp index e72f58fa3..37d5a0c77 100644 --- a/src/WorldStorage/SchematicFileSerializer.cpp +++ b/src/WorldStorage/SchematicFileSerializer.cpp @@ -50,7 +50,6 @@ bool cSchematicFileSerializer::LoadFromSchematicFile(cBlockArea & a_BlockArea, c - bool cSchematicFileSerializer::LoadFromSchematicString(cBlockArea & a_BlockArea, const AString & a_SchematicData) { // Uncompress the data: @@ -105,7 +104,6 @@ bool cSchematicFileSerializer::SaveToSchematicFile(const cBlockArea & a_BlockAre - bool cSchematicFileSerializer::SaveToSchematicString(const cBlockArea & a_BlockArea, AString & a_Out) { // Serialize into NBT data: diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp index 048220a31..30e90f536 100755 --- a/src/WorldStorage/WSSAnvil.cpp +++ b/src/WorldStorage/WSSAnvil.cpp @@ -75,7 +75,6 @@ Since only the header is actually in the memory, this number can be high, but st - //////////////////////////////////////////////////////////////////////////////// // cWSSAnvil: @@ -476,6 +475,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, const cParsedNBT + void cWSSAnvil::CopyNBTData(const cParsedNBT & a_NBT, int a_Tag, const AString & a_ChildName, char * a_Destination, size_t a_Length) { int Child = a_NBT.FindChildByName(a_Tag, a_ChildName); @@ -2081,6 +2081,7 @@ void cWSSAnvil::LoadArrowFromNBT(cEntityList & a_Entities, const cParsedNBT & a_ + void cWSSAnvil::LoadSplashPotionFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_TagIdx) { std::unique_ptr<cSplashPotionEntity> SplashPotion = cpp14::make_unique<cSplashPotionEntity>(nullptr, 0, 0, 0, Vector3d(0, 0, 0), cItem()); diff --git a/src/mbedTLS++/BlockingSslClientSocket.cpp b/src/mbedTLS++/BlockingSslClientSocket.cpp index e8f616258..c3d928fe0 100644 --- a/src/mbedTLS++/BlockingSslClientSocket.cpp +++ b/src/mbedTLS++/BlockingSslClientSocket.cpp @@ -161,7 +161,6 @@ bool cBlockingSslClientSocket::Connect(const AString & a_ServerName, UInt16 a_Po - void cBlockingSslClientSocket::SetExpectedPeerName(AString a_ExpectedPeerName) { ASSERT(!m_IsConnected); // Must be called before connect @@ -236,7 +235,6 @@ bool cBlockingSslClientSocket::Send(const void * a_Data, size_t a_NumBytes) - int cBlockingSslClientSocket::Receive(void * a_Data, size_t a_MaxBytes) { // Even if m_IsConnected is false (socket disconnected), the SSL context may have more data in the queue diff --git a/src/mbedTLS++/CallbackSslContext.cpp b/src/mbedTLS++/CallbackSslContext.cpp index b3e08a2cd..8dc8486d3 100644 --- a/src/mbedTLS++/CallbackSslContext.cpp +++ b/src/mbedTLS++/CallbackSslContext.cpp @@ -10,7 +10,6 @@ - cCallbackSslContext::cCallbackSslContext(void) : m_Callbacks(nullptr) { diff --git a/src/mbedTLS++/CryptoKey.cpp b/src/mbedTLS++/CryptoKey.cpp index b0c0da167..d9f04e20f 100644 --- a/src/mbedTLS++/CryptoKey.cpp +++ b/src/mbedTLS++/CryptoKey.cpp @@ -104,7 +104,6 @@ int cCryptoKey::Encrypt(const Byte * a_PlainData, size_t a_PlainLength, Byte * a - int cCryptoKey::ParsePublic(const void * a_Data, size_t a_NumBytes) { ASSERT(!IsValid()); // Cannot parse a second key @@ -116,7 +115,6 @@ int cCryptoKey::ParsePublic(const void * a_Data, size_t a_NumBytes) - int cCryptoKey::ParsePrivate(const void * a_Data, size_t a_NumBytes, const AString & a_Password) { ASSERT(!IsValid()); // Cannot parse a second key diff --git a/src/mbedTLS++/Sha1Checksum.cpp b/src/mbedTLS++/Sha1Checksum.cpp index 9671b8d2b..f55df025a 100644 --- a/src/mbedTLS++/Sha1Checksum.cpp +++ b/src/mbedTLS++/Sha1Checksum.cpp @@ -49,7 +49,6 @@ public: - //////////////////////////////////////////////////////////////////////////////// // cSha1Checksum: @@ -126,7 +125,6 @@ void cSha1Checksum::DigestToJava(const Checksum & a_Digest, AString & a_Out) - void cSha1Checksum::Restart(void) { mbedtls_sha1_starts(&m_Sha1); |