summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemHandler.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2017-07-07 16:37:53 +0200
committerLukas Pioch <lukas@zgow.de>2017-07-07 16:37:53 +0200
commitbbf5bec817c6c9824155c15d34806db152d5ed43 (patch)
tree80f9532ae5814da4c168dbf7138ea9a289fc4a8c /src/Items/ItemHandler.cpp
parentAdded bed entity (#3823) (diff)
downloadcuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.tar
cuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.tar.gz
cuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.tar.bz2
cuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.tar.lz
cuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.tar.xz
cuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.tar.zst
cuberite-bbf5bec817c6c9824155c15d34806db152d5ed43.zip
Diffstat (limited to 'src/Items/ItemHandler.cpp')
-rw-r--r--src/Items/ItemHandler.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp
index 8e3d79506..b430e83ef 100644
--- a/src/Items/ItemHandler.cpp
+++ b/src/Items/ItemHandler.cpp
@@ -357,14 +357,11 @@ bool cItemHandler::OnPlayerPlace(
NIBBLETYPE ClickedBlockMeta;
a_World.GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, ClickedBlock, ClickedBlockMeta);
+ cChunkInterface ChunkInterface(a_World.GetChunkMap());
// Check if the block ignores build collision (water, grass etc.):
- if (
- BlockHandler(ClickedBlock)->DoesIgnoreBuildCollision() ||
- BlockHandler(ClickedBlock)->DoesIgnoreBuildCollision(&a_Player, ClickedBlockMeta)
- )
+ if (BlockHandler(ClickedBlock)->DoesIgnoreBuildCollision(ChunkInterface, { a_BlockX, a_BlockY, a_BlockZ }, a_Player, ClickedBlockMeta))
{
- cChunkInterface ChunkInterface(a_World.GetChunkMap());
BlockHandler(ClickedBlock)->OnDestroyedByPlayer(ChunkInterface, a_World, &a_Player, a_BlockX, a_BlockY, a_BlockZ);
}
else
@@ -383,10 +380,7 @@ bool cItemHandler::OnPlayerPlace(
// Clicked on side of block, make sure that placement won't be cancelled if there is a slab able to be double slabbed.
// No need to do combinability (dblslab) checks, client will do that here.
- if (
- !BlockHandler(PlaceBlock)->DoesIgnoreBuildCollision() &&
- !BlockHandler(PlaceBlock)->DoesIgnoreBuildCollision(&a_Player, PlaceMeta)
- )
+ if (!BlockHandler(PlaceBlock)->DoesIgnoreBuildCollision(ChunkInterface, { a_BlockX, a_BlockY, a_BlockZ }, a_Player, PlaceMeta))
{
// Tried to place a block into another?
// Happens when you place a block aiming at side of block with a torch on it or stem beside it