[Mod] cottages [cottages] (medieval, farming, country life)

Re: [Mod] cottages [cottages] (medieval, farming, country li

Postby h-v-smacker » Sun Mar 17, 2019 5:15 pm

Hey Sokomine, I found a pitchfork duplication situation with cottages: try sticking a pitchfork in the ground through, say, a grass node (the regular grass, which spreads). The result would be that you'll have the pitchfork replacing the grass, and yet the pitchfork in your hand will remain. I found that it is because the pointed_thing points to different nodes (1 node height difference) in those cases, and therefore the "find placed pitchfork at pos" test fails with grass (it looks where there is air in that case). So far I resolved the issue with simply looking for a pitchfork in ±1 node area (above and below the initial target, that is):

Code: Select all
      minetest.rotate_and_place(ItemStack("cottages:pitchfork_placed"), placer, pointed_thing)
      -- did the placing succeed?
      if not minetest.find_nodes_in_area({x=pos.x, y=pos.y-1, z=pos.z},
                                         {x=pos.x, y=pos.y+1, z=pos.z},
                                         {"cottages:pitchfork_placed"})[1] then
         return nil
Posts: 65
Joined: Wed Nov 29, 2017 11:04 pm
GitHub: h-v-smacker
In-game: Smacker

Return to Mod Releases

Who is online

Users browsing this forum: Google Bot [Bot] and 0 guests