summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockIce.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-08-01 12:25:06 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-04 19:15:18 +0200
commitc3d6afe47e8e50f9b029caf012c69d1e6ee4e76a (patch)
tree26ac0ff00942aef4deafdc2048f8c14a168f4f93 /src/Blocks/BlockIce.h
parentOnBroken/OnPlaced are for entity actions (diff)
downloadcuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar
cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.gz
cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.bz2
cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.lz
cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.xz
cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.tar.zst
cuberite-c3d6afe47e8e50f9b029caf012c69d1e6ee4e76a.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockIce.h19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/Blocks/BlockIce.h b/src/Blocks/BlockIce.h
index 5e2fd9dbb..a4372d0ea 100644
--- a/src/Blocks/BlockIce.h
+++ b/src/Blocks/BlockIce.h
@@ -19,10 +19,6 @@ public:
{
}
-
-
-
-
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
{
// Only drop self when using silk-touch:
@@ -36,10 +32,6 @@ public:
}
}
-
-
-
-
virtual void OnBroken(
cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface,
Vector3i a_BlockPos,
@@ -51,19 +43,14 @@ public:
{
return;
}
- auto blockTypeBelow = a_ChunkInterface.GetBlock(a_BlockPos.addedY(-1));
- if (cBlockInfo::FullyOccupiesVoxel(blockTypeBelow) || IsBlockLiquid(blockTypeBelow))
+
+ const auto Below = a_ChunkInterface.GetBlock(a_BlockPos.addedY(-1));
+ if (cBlockInfo::FullyOccupiesVoxel(Below) || IsBlockLiquid(Below))
{
- // Setting air with FastSetBlock prevents SetBlock recursively calling OnBroken.
- a_ChunkInterface.FastSetBlock(a_BlockPos, E_BLOCK_AIR, 0);
a_ChunkInterface.SetBlock(a_BlockPos, E_BLOCK_WATER, 0);
}
}
-
-
-
-
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);