ITEMS/mcl_farming: Use uncarved pumpkin in survival #285

Merged
erlehmann merged 10 commits from uncarved-pumpkin-4 into master 2022-04-16 00:51:58 +02:00

10 Commits

Author SHA1 Message Date
Nils Dagsson Moskopp 7d2ef66175
Trigger node callbacks when pumpkin is sheared
The code for shearing a pumpkin used minetest.swap_node() to replace a
faceless pumpkin with a carved pumpkin. This did not trigger the node
callbacks of the carved pumpkin, which meant that shearing a pumpkin
would not check for the snow golem or iron golem spawn conditions.

This patch replaces minetest.swap_node() in the code for shearing a
pumpkin with minetest.set_node(), which does trigger the callbacks;
therefore snow and iron golems can now spawn as a pumpkin is carved.
2022-04-14 18:52:31 +02:00
Nils Dagsson Moskopp fdd3c5db86
Drop carved pumpkin when shearing snow golem 2022-04-14 00:23:01 +02:00
Nils Dagsson Moskopp c4912effaf
Disconnect gourd stems after destruct
While testing the previous commit, it became clear that gourd stems do
not disconnect properly if the gourd disappears while not being dug. A
simple method to create illegal curved stems was to explode the gourd.

This patch changes gourds so that the stem curves back after a gourd is
destroyed, regardless of reason. This hopefully makes curved stems that
are not connected to matching gourds a relict of the past.
2022-04-14 00:23:01 +02:00
Nils Dagsson Moskopp 1967e10a52
Disconnect stems from carved pumpkins after dig
Carved pumpkins can end up being connected to a stem – either if they
were grown in a previous version of MineClone2 or Mineclonia, or if a
player carves them before harvesting them. This patch makes sure that
stems turn into unconnected stems after such a carved pumpkin is dug.
2022-04-14 00:23:00 +02:00
Nils Dagsson Moskopp f8d55ee61b
Make villagers accept uncarved pumpkin in trades
As map generation and growing mechanics have been changed to generate
uncarved pumpkins instead of carved, requiring players to shear every
pumpkin before trading it with villagers seems like useless busywork.
2022-04-14 00:23:00 +02:00
Nils Dagsson Moskopp 3948a0e7af
Remove pumpkin pie recipe with carved pumpkin
Shearing an uncarved pumpkin turns it into a carved pumpkin and drops
four pumpkin seeds. As map generation and growing mechanics have been
changed to generate uncarved pumpkins instead of carved, preserving a
recipe to get pumpkin pie from carved pumpkins enabled players to get
both seeds and pumpkin pie from grown pumpkins, which was unintended.
2022-04-14 00:22:59 +02:00
Nils Dagsson Moskopp a44fd9c88b
Remove pumpkin seeds recipe with carved pumpkin
Shearing an uncarved pumpkin turns it into a carved pumpkin and drops
four pumpkin seeds. As map generation and growing mechanics have been
changed to generate uncarved pumpkins instead of carved, preserving a
recipe to get seeds from carved pumpkins enables players to get twice
the amount of seeds as intended. Because of this, the recipe must go.
2022-04-14 00:22:59 +02:00
Alexander Minges 6381d65dbb
Use correct location for pumpkin shearing sound
The code for turning an uncarved pumpkin into a carved pumpkin using
the shears was using “above” instead of “pointed_thing.above” as the
location for its sound. This resulted in a warning being logged when
shears were being used on a pumpkin. This patch rectifies the issue.
2022-04-14 00:22:59 +02:00
Alexander Minges 59b013f766
Grow uncarved pumpkin from seeds instead of carved
Carved pumpkin has to be explicitly registered as a separate node, as
registering a carved pumpkin node happened as a side effect of invoking
mcl_farming:add_gourd() for the carved pumpkin.

The iron / snow golem spawning checks that trigger whenever a carved
pumpkin is placed had to be moved out of the mcl_farming:add_gourd()
invocation to preserve the existing behaviour.

Note that uncarved pumpkin must not be registered as a separate node,
as invoking mcl_farming:add_gourd() for a registered node name leads to
stems not updating when an adjacent node is manually placed or mined.
2022-04-14 00:22:58 +02:00
Alexander Minges d59888c4df
Use uncarved pumpkin instead of carved in mapgen 2022-04-14 00:22:58 +02:00