summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemPumpkin.h
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2021-12-02 00:31:10 +0100
committerGitHub <noreply@github.com>2021-12-02 00:31:10 +0100
commit3ff57559e36d3254c64e334fbe3bdd47398fe16f (patch)
tree30a73d405640285863bfa9932afbee482f36b50c /src/Items/ItemPumpkin.h
parentAdded ExperienceAmount variable to HOOK_PLAYER_FISHING and HOOK_PLAYER_FISHED (#5345) (diff)
downloadcuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.tar
cuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.tar.gz
cuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.tar.bz2
cuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.tar.lz
cuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.tar.xz
cuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.tar.zst
cuberite-3ff57559e36d3254c64e334fbe3bdd47398fe16f.zip
Diffstat (limited to '')
-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);