summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-09-20 15:50:52 +0200
committerGitHub <noreply@github.com>2020-09-20 15:50:52 +0200
commit68cced73afe546328cf94ed07c57deee47bfadec (patch)
tree88be88e3fd4a208b9849e526f1877caa44058ab5 /src/Entities
parentAdded armor and shulker box cleaning (#4875) (diff)
downloadcuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.gz
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.bz2
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.lz
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.xz
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.zst
cuberite-68cced73afe546328cf94ed07c57deee47bfadec.zip
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Pawn.cpp2
-rw-r--r--src/Entities/Player.cpp6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index 550d86e35..9857fa29c 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -370,7 +370,7 @@ void cPawn::HandleFalling(void)
}
/* If the block is solid, and the blockhandler confirms the block to be inside, we're officially on the ground. */
- if ((cBlockInfo::IsSolid(BlockType)) && (cBlockInfo::GetHandler(BlockType)->IsInsideBlock(CrossTestPosition - BlockTestPosition, BlockMeta)))
+ if ((cBlockInfo::IsSolid(BlockType)) && (cBlockHandler::For(BlockType).IsInsideBlock(CrossTestPosition - BlockTestPosition, BlockMeta)))
{
OnGround = true;
}
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index d9353f67f..95b231d04 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -2849,11 +2849,10 @@ bool cPlayer::DoesPlacingBlocksIntersectEntity(const sSetBlockVector & a_Blocks)
bool HasInitializedBounds = false;
for (auto blk: a_Blocks)
{
- cBlockHandler * BlockHandler = cBlockInfo::GetHandler(blk.m_BlockType);
int x = blk.GetX();
int y = blk.GetY();
int z = blk.GetZ();
- cBoundingBox BlockBox = BlockHandler->GetPlacementCollisionBox(
+ cBoundingBox BlockBox = cBlockHandler::For(blk.m_BlockType).GetPlacementCollisionBox(
m_World->GetBlock(x - 1, y, z),
m_World->GetBlock(x + 1, y, z),
(y == 0) ? E_BLOCK_AIR : m_World->GetBlock(x, y - 1, z),
@@ -2941,8 +2940,7 @@ bool cPlayer::PlaceBlocks(const sSetBlockVector & a_Blocks)
m_World->PlaceBlock(blk.GetAbsolutePos(), blk.m_BlockType, blk.m_BlockMeta);
// Notify the blockhandlers:
- cBlockHandler * newBlock = BlockHandler(blk.m_BlockType);
- newBlock->OnPlacedByPlayer(ChunkInterface, *m_World, *this, blk);
+ cBlockHandler::For(blk.m_BlockType).OnPlacedByPlayer(ChunkInterface, *m_World, *this, blk);
// Call the "placed" hooks:
pm->CallHookPlayerPlacedBlock(*this, blk);