summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemPumpkin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Items/ItemPumpkin.h')
-rw-r--r--src/Items/ItemPumpkin.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Items/ItemPumpkin.h b/src/Items/ItemPumpkin.h
index cd17472b5..d467cd94f 100644
--- a/src/Items/ItemPumpkin.h
+++ b/src/Items/ItemPumpkin.h
@@ -8,7 +8,7 @@
-class cItemPumpkinHandler:
+class cItemPumpkinHandler final:
public cItemHandler
{
using Super = cItemHandler;
@@ -19,7 +19,7 @@ public:
private:
- virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) override
+ virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
{
// First try spawning a snow golem or an iron golem:
if (TrySpawnGolem(a_Player, a_PlacePosition))
@@ -39,7 +39,7 @@ private:
/** Spawns a snow / iron golem if the shape matches the recipe, supposing that the block placed at the specified coords is a pumpkin.
Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched. */
- bool TrySpawnGolem(cPlayer & a_Player, const Vector3i a_PumpkinPos)
+ bool TrySpawnGolem(cPlayer & a_Player, const Vector3i a_PumpkinPos) const
{
// A golem can't form with a pumpkin below level 2 or above level 255:
if ((a_PumpkinPos.y < 2) || (a_PumpkinPos.y >= cChunkDef::Height))
@@ -69,7 +69,7 @@ private:
/** Spawns a snow golem if the shape matches the recipe, supposing that the block placed at the specified coords is a pumpkin.
Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched.
Assumes that the block below the specified block has already been checked and is a snow block. */
- bool TrySpawnSnowGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos)
+ bool TrySpawnSnowGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos) const
{
ASSERT(a_PumpkinPos.y > 1);
ASSERT(a_World.GetBlock(a_PumpkinPos.addedY(-1)) == E_BLOCK_SNOW_BLOCK);
@@ -106,7 +106,7 @@ private:
/** Spawns an iron golem if the shape matches the recipe, supposing that the block placed at the specified coords is a pumpkin.
Returns true if the golem blocks are removed (for spawning), false if the recipe is not matched.
Assumes that the block below the specified block has already been checked and is an iron block. */
- bool TrySpawnIronGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos)
+ bool TrySpawnIronGolem(cWorld & a_World, cPlayer & a_Player, const Vector3i a_PumpkinPos) const
{
ASSERT(a_PumpkinPos.y > 1);
ASSERT(a_World.GetBlock(a_PumpkinPos.addedY(-1)) == E_BLOCK_IRON_BLOCK);