diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2021-03-15 03:28:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-15 03:28:18 +0100 |
commit | 45591cbe7bef4c54c241a286ece07bc4ade4489e (patch) | |
tree | a6b2b8a7e8c2d2986612e70cd904f5446b82e2d6 /src/World.cpp | |
parent | Fixed some death messages showing up even when they are disabled. (#5153) (diff) | |
download | cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.gz cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.bz2 cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.lz cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.xz cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.tar.zst cuberite-45591cbe7bef4c54c241a286ece07bc4ade4489e.zip |
Diffstat (limited to 'src/World.cpp')
-rw-r--r-- | src/World.cpp | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/src/World.cpp b/src/World.cpp index d2aab1ac4..3e00e2fd5 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -755,7 +755,7 @@ bool cWorld::CanSpawnAt(double a_X, double & a_Y, double a_Z) for (int PotentialY = HighestSpawnPoint; PotentialY > LowestSpawnPoint; --PotentialY) { - BLOCKTYPE HeadBlock = GetBlock(static_cast<int>(a_X), PotentialY, static_cast<int>(a_Z)); + BLOCKTYPE HeadBlock = GetBlock({ static_cast<int>(a_X), PotentialY, static_cast<int>(a_Z) }); // Is this block safe for spawning if (HeadBlock != E_BLOCK_AIR) @@ -763,7 +763,7 @@ bool cWorld::CanSpawnAt(double a_X, double & a_Y, double a_Z) continue; } - BLOCKTYPE BodyBlock = GetBlock(static_cast<int>(a_X), PotentialY - 1, static_cast<int>(a_Z)); + BLOCKTYPE BodyBlock = GetBlock({ static_cast<int>(a_X), PotentialY - 1, static_cast<int>(a_Z) }); // Is this block safe for spawning if (BodyBlock != E_BLOCK_AIR) @@ -771,7 +771,7 @@ bool cWorld::CanSpawnAt(double a_X, double & a_Y, double a_Z) continue; } - BLOCKTYPE FloorBlock = GetBlock(static_cast<int>(a_X), PotentialY - 2, static_cast<int>(a_Z)); + BLOCKTYPE FloorBlock = GetBlock({ static_cast<int>(a_X), PotentialY - 2, static_cast<int>(a_Z) }); // Early out - Is the floor block air if (FloorBlock == E_BLOCK_AIR) @@ -835,7 +835,7 @@ bool cWorld::CheckPlayerSpawnPoint(int a_PosX, int a_PosY, int a_PosZ) const int XPos = a_PosX + SurroundingCoords[CoordIndex].x; const int ZPos = a_PosZ + SurroundingCoords[CoordIndex].z; - const BLOCKTYPE BlockType = GetBlock(XPos, a_PosY, ZPos); + const BLOCKTYPE BlockType = GetBlock({ XPos, a_PosY, ZPos }); if (cBlockInfo::IsSolid(BlockType) || IsBlockLiquid(BlockType)) { return false; @@ -1295,16 +1295,6 @@ void cWorld::WakeUpSimulators(Vector3i a_Block) -void cWorld::WakeUpSimulatorsInArea(int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ) -{ - LOGWARNING("cWorld::WakeUpSimulatorsInArea(int, int, int) is deprecated, use cWorld::WakeUpSimulatorsInArea(Vector3i) instead."); - WakeUpSimulatorsInArea(cCuboid({a_MinBlockX, a_MinBlockY, a_MinBlockZ}, {a_MaxBlockX, a_MaxBlockY, a_MaxBlockZ})); -} - - - - - void cWorld::WakeUpSimulatorsInArea(const cCuboid & a_Area) { m_SimulatorManager->WakeUp(a_Area); @@ -2684,7 +2674,7 @@ bool cWorld::IsTrapdoorOpen(int a_BlockX, int a_BlockY, int a_BlockZ) { BLOCKTYPE Block; NIBBLETYPE Meta; - GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, Block, Meta); + GetBlockTypeMeta({ a_BlockX, a_BlockY, a_BlockZ }, Block, Meta); if ((Block != E_BLOCK_TRAPDOOR) && (Block != E_BLOCK_IRON_TRAPDOOR)) { return false; @@ -2701,7 +2691,7 @@ bool cWorld::SetTrapdoorOpen(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_Op { BLOCKTYPE Block; NIBBLETYPE Meta; - GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, Block, Meta); + GetBlockTypeMeta({ a_BlockX, a_BlockY, a_BlockZ }, Block, Meta); if ((Block != E_BLOCK_TRAPDOOR) && (Block != E_BLOCK_IRON_TRAPDOOR)) { return false; @@ -2710,8 +2700,8 @@ bool cWorld::SetTrapdoorOpen(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_Op bool IsOpen = (Meta & 0x4) != 0; if (a_Open != IsOpen) { - SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, Meta ^ 0x4); - BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_WOODEN_TRAPDOOR_OPEN, {a_BlockX, a_BlockY, a_BlockZ}, 0); + SetBlockMeta({ a_BlockX, a_BlockY, a_BlockZ }, Meta ^ 0x4); + BroadcastSoundParticleEffect(EffectID::SFX_RANDOM_WOODEN_TRAPDOOR_OPEN, { a_BlockX, a_BlockY, a_BlockZ }, 0); return true; } return false; @@ -2950,10 +2940,10 @@ void cWorld::QueueBlockForTick(int a_BlockX, int a_BlockY, int a_BlockZ, int a_T bool cWorld::IsBlockDirectlyWatered(int a_BlockX, int a_BlockY, int a_BlockZ) { return ( - IsBlockWater(GetBlock(a_BlockX - 1, a_BlockY, a_BlockZ)) || - IsBlockWater(GetBlock(a_BlockX + 1, a_BlockY, a_BlockZ)) || - IsBlockWater(GetBlock(a_BlockX, a_BlockY, a_BlockZ - 1)) || - IsBlockWater(GetBlock(a_BlockX, a_BlockY, a_BlockZ + 1)) + IsBlockWater(GetBlock({ a_BlockX - 1, a_BlockY, a_BlockZ })) || + IsBlockWater(GetBlock({ a_BlockX + 1, a_BlockY, a_BlockZ })) || + IsBlockWater(GetBlock({ a_BlockX, a_BlockY, a_BlockZ - 1 })) || + IsBlockWater(GetBlock({ a_BlockX, a_BlockY, a_BlockZ + 1 })) ); } |