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
Owner
Problem

TRACKING ISSUE:

Mineclonia: #94
Mineclone2: MineClone2/MineClone2#682

Solution

This PR introduces uncarved (faceless) pumpkins to survival.

This is done by modifying map generation and growing mechanics to generate uncarved pumpkins.

Pumpkins without faces have been in the game for a while, but were only obtainable in creative.

The beloved carved pumpkins can be created by using the metal shears on an uncarved pumpkin.

Details

The original PR for this from @Athemis broke iron and snow golem spawning.

It also broke fully grown stems bending towards the pumpkin and away from it.

MineClone2/MineClone2#684

Testing Steps

Ensure that all of the following is true in both creative mode and survival mode:

  • Uncarved pumpkins are generated with mapgen v7 in survival (seed “PUMPKING”)
  • Uncarved pumpkin node can be harvested and drops uncarved pumpkin item.
  • Uncarved pumpkins grow from seeds.
  • When an uncarved pumpkin grows, the stem bends towards the uncarved pumpkin.
  • When an uncarved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight.
  • When an uncarved pumpkin connected to a stem is exploded, the stem becomes straight.
  • When an uncarved pumpkin is placed next to a straight stem, the stem curves.
  • When a carved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight.
  • When a carved pumpkin connected to a stem is exploded, the stem becomes straight.
  • When a melon connected to a stem is harvested by a player or a piston, the stem becomes straight.
  • When a melon connected to a stem is exploded, the stem becomes straight.
  • Using shears on the side of an uncarved pumpkin drops 4 pumpkin seeds and turns it into a carved pumpkin that has the face on that side. Any connected stems disconnect.
  • Using shears on a carved pumpkin does nothing.
  • Uncarved pumpkin can be crafted into 4 pumpkin seeds.
  • Carved pumpkin can not be crafted into 4 pumpkin seeds.
  • Pumpkin pie can be crafted with uncarved pumpkin, sugar, egg.
  • Pumpkin pie can not be crafted with carved pumpkin, sugar, egg.
  • Uncarved pumpkin can not be worn as armor on the head.
  • Carved pumpkin can be worn as armor on the head.
  • Placing two snow blocks above each other and putting an uncarved pumpkin on top of it does not spawn a snow golem.
  • Placing two snow blocks above each other and putting a carved pumpkin on top of it spawns a snow golem.
  • Placing two snow blocks above each other and putting an uncarved pumpkin on top of it and then shearing the uncarved pumpkin spawns a snow golem.
  • Placing 4 iron blocks in a T shape and putting an uncarved pumpkin on top of the middle one does not spawn an iron golem.
  • Placing 4 iron blocks in a T shape and putting a carved pumpkin on top of it does spawn an iron golem.
  • Placing 4 iron blocks in a T shape and putting an uncarved pumpkin on top of it and then shearing the uncarved pumpkin does spawn an iron golem.
  • Using shears on a snow golem drops a carved pumpkin and turns it into a pumpkin-less snow golem.
  • Using shears on a pumpkin-less snow golem does not drop a carved pumpkin.
  • Farmer villagers buy uncarved pumpkins.
To do
  • Fill out issue template
  • Write testing steps
  • Verify testing steps (as if)
##### Problem TRACKING ISSUE: Mineclonia: https://git.minetest.land/Mineclonia/Mineclonia/issues/94 Mineclone2: https://git.minetest.land/MineClone2/MineClone2/issues/682 ##### Solution This PR introduces uncarved (faceless) pumpkins to survival. This is done by modifying map generation and growing mechanics to generate uncarved pumpkins. Pumpkins without faces have been in the game for a while, but were only obtainable in creative. The beloved carved pumpkins can be created by using the metal shears on an uncarved pumpkin. ##### Details The original PR for this from @Athemis broke iron and snow golem spawning. It also broke fully grown stems bending towards the pumpkin and away from it. https://git.minetest.land/MineClone2/MineClone2/pulls/684 ##### Testing Steps Ensure that all of the following is true in both creative mode and survival mode: - Uncarved pumpkins are generated with mapgen v7 in survival (seed “PUMPKING”) - Uncarved pumpkin node can be harvested and drops uncarved pumpkin item. - Uncarved pumpkins grow from seeds. - When an uncarved pumpkin grows, the stem bends towards the uncarved pumpkin. - When an uncarved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight. - When an uncarved pumpkin connected to a stem is exploded, the stem becomes straight. - When an uncarved pumpkin is placed next to a straight stem, the stem curves. - When a carved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight. - When a carved pumpkin connected to a stem is exploded, the stem becomes straight. - When a melon connected to a stem is harvested by a player or a piston, the stem becomes straight. - When a melon connected to a stem is exploded, the stem becomes straight. - Using shears on the side of an uncarved pumpkin drops 4 pumpkin seeds and turns it into a carved pumpkin that has the face on that side. Any connected stems disconnect. - Using shears on a carved pumpkin does nothing. - Uncarved pumpkin can be crafted into 4 pumpkin seeds. - Carved pumpkin can not be crafted into 4 pumpkin seeds. - Pumpkin pie can be crafted with uncarved pumpkin, sugar, egg. - Pumpkin pie can not be crafted with carved pumpkin, sugar, egg. - Uncarved pumpkin can not be worn as armor on the head. - Carved pumpkin can be worn as armor on the head. - Placing two snow blocks above each other and putting an uncarved pumpkin on top of it does not spawn a snow golem. - Placing two snow blocks above each other and putting a carved pumpkin on top of it spawns a snow golem. - Placing two snow blocks above each other and putting an uncarved pumpkin on top of it and then shearing the uncarved pumpkin spawns a snow golem. - Placing 4 iron blocks in a T shape and putting an uncarved pumpkin on top of the middle one does not spawn an iron golem. - Placing 4 iron blocks in a T shape and putting a carved pumpkin on top of it does spawn an iron golem. - Placing 4 iron blocks in a T shape and putting an uncarved pumpkin on top of it and then shearing the uncarved pumpkin does spawn an iron golem. - Using shears on a snow golem drops a carved pumpkin and turns it into a pumpkin-less snow golem. - Using shears on a pumpkin-less snow golem does not drop a carved pumpkin. - Farmer villagers buy uncarved pumpkins. ##### To do - [x] Fill out issue template - [x] Write testing steps - [x] Verify testing steps (as if)
erlehmann force-pushed uncarved-pumpkin-4 from f4050434fe to abbb651847 2022-02-23 18:24:23 +01:00 Compare
erlehmann changed title from WIP: ITEMS/mcl_farming: Use uncarved pumpkin in survival to ITEMS/mcl_farming: Use uncarved pumpkin in survival 2022-02-23 18:57:55 +01:00
erlehmann added the
ready for review
label 2022-02-23 18:58:11 +01:00
Member
  • Uncarved pumpkins are generated with mapgen v7 in survival (seed “PUMPKING”)
  • Uncarved pumpkin node can be harvested and drops uncarved pumpkin item.
  • Uncarved pumpkins grow from seeds.
  • When an uncarved pumpkin grows, the stem bends towards the uncarved pumpkin.
  • When an uncarved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight.
  • When an uncarved pumpkin connected to a stem is exploded, the stem becomes straight.
  • When an uncarved pumpkin is placed next to a straight stem, the stem curves.
  • When a carved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight.
  • When a carved pumpkin connected to a stem is exploded, the stem becomes straight.
  • When a melon connected to a stem is harvested by a player or a piston, the stem becomes straight.
  • When a melon connected to a stem is exploded, the stem becomes straight.
  • Using shears on the side of an uncarved pumpkin drops 4 pumpkin seeds and turns it into a carved pumpkin that has the face on that side.
  • Using shears on a carved pumpkin does nothing.
  • Uncarved pumpkin can be crafted into 4 pumpkin seeds.
  • Carved pumpkin can not be crafted into 4 pumpkin seeds.
- [x] Uncarved pumpkins are generated with mapgen v7 in survival (seed “PUMPKING”) - [x] Uncarved pumpkin node can be harvested and drops uncarved pumpkin item. - [x] Uncarved pumpkins grow from seeds. - [x] When an uncarved pumpkin grows, the stem bends towards the uncarved pumpkin. - [x] When an uncarved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight. - [x] When an uncarved pumpkin connected to a stem is exploded, the stem becomes straight. - [x] When an uncarved pumpkin is placed next to a straight stem, the stem curves. - [x] When a carved pumpkin connected to a stem is harvested by a player or a piston, the stem becomes straight. - [x] When a carved pumpkin connected to a stem is exploded, the stem becomes straight. - [x] When a melon connected to a stem is harvested by a player or a piston, the stem becomes straight. - [x] When a melon connected to a stem is exploded, the stem becomes straight. - [x] Using shears on the side of an uncarved pumpkin drops 4 pumpkin seeds and turns it into a carved pumpkin that has the face on that side. - [x] Using shears on a carved pumpkin does nothing. - [x] Uncarved pumpkin can be crafted into 4 pumpkin seeds. - [x] Carved pumpkin can not be crafted into 4 pumpkin seeds.
Member

I stopped there because i have no idea what the itemstring for sugar is.

I have repeatedly asked to add these to testing instructions :/

I stopped there because i have no idea what the itemstring for sugar is. I have repeatedly asked to add these to testing instructions :/
Author
Owner

@cora thank you for testing. I will add the itemstrings now.

@cora thank you for testing. I will add the itemstrings now.
Member

let me know i guess :P

let me know i guess :P
cora removed the
ready for review
label 2022-02-27 16:08:33 +01:00
Member

:)

:)
Author
Owner

Here are the item strings:

  • uncarved pumpkin: mcl_farming:pumpkin
  • carved pumpkin: mcl_farming:pumpkin_face
  • pumpkin seeds: mcl_farming:pumpkin_seeds
  • TNT mcl_tnt:tnt
  • melon: mcl_farming:melon
  • melon seeds: mcl_farming:melon_seeds
  • shears: mcl_tools:shears
  • sugar: mcl_core:sugar
  • egg: mcl_throwing:egg
  • snow block: mcl_core:snowblock
  • iron block: mcl_core:ironblock
Here are the item strings: - uncarved pumpkin: `mcl_farming:pumpkin` - carved pumpkin: `mcl_farming:pumpkin_face` - pumpkin seeds: `mcl_farming:pumpkin_seeds` - TNT `mcl_tnt:tnt` - melon: `mcl_farming:melon` - melon seeds: `mcl_farming:melon_seeds` - shears: `mcl_tools:shears` - sugar: `mcl_core:sugar` - egg: `mcl_throwing:egg` - snow block: `mcl_core:snowblock` - iron block: `mcl_core:ironblock`
erlehmann force-pushed uncarved-pumpkin-4 from 6d8b212e69 to fdd3c5db86 2022-04-14 00:23:13 +02:00 Compare
Author
Owner

Rebased.

Rebased.
Member

aww you're back <3 i'll look at it soon.

aww you're back <3 i'll look at it soon.
Member

https://minecraft.fandom.com/wiki/Iron_Golem

Alternatively, the blocks can be placed in any order with an uncarved pumpkin; the player can shear the pumpkin to spawn the golem.

bug number 1: shearing a pumpkin in an iron golem arrangement should spawn a golem, but it does not.

bug number 2: when a stem is connected to an uncarved pumpkin, it should disconnect when you shear the pumpkin, but it does not.

https://minecraft.fandom.com/wiki/Iron_Golem > Alternatively, the blocks can be placed in any order with an uncarved pumpkin; the player can shear the pumpkin to spawn the golem. bug number 1: shearing a pumpkin in an iron golem arrangement should spawn a golem, but it does not. bug number 2: when a stem is connected to an uncarved pumpkin, it should disconnect when you shear the pumpkin, but it does not.
Author
Owner

@Li0n_2 also said that shearing should probably give only one seed. I agree with that: Getting more seeds but not having a pumpkin afterwards is a good tradeoff.

@Li0n_2 also said that shearing should probably give only one seed. I agree with that: Getting more seeds but not having a pumpkin afterwards is a good tradeoff.
erlehmann added 1 commit 2022-04-14 19:17:30 +02:00
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.
Author
Owner

@Li0n_2 it turned out that no callback actions were performed when the pumpkin was sheared. Please review the change in this commit and test if the bugs you found still happen: 7d2ef66175

@Li0n_2 it turned out that no callback actions were performed when the pumpkin was sheared. Please review the change in this commit and test if the bugs you found still happen: https://git.minetest.land/Mineclonia/Mineclonia/commit/7d2ef661751991831a655cab5d408006d1865600
Li0n_2 approved these changes 2022-04-16 00:30:54 +02:00
Li0n_2 left a comment
Member

I completed all the testing steps and found no bugs related to pumpkins.

I completed all the testing steps and found no bugs related to pumpkins.
erlehmann merged commit d2c335d8fb into master 2022-04-16 00:51:58 +02:00
This repo is archived. You cannot comment on pull requests.
No description provided.