Skip to content

Commit

Permalink
Merge pull request #205 from dacmot/main
Browse files Browse the repository at this point in the history
Fix vegetables planting not using any items
  • Loading branch information
dacmot authored Jul 27, 2024
2 parents 45cb8e5 + 03362e7 commit d9fb91e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions mods/libs/whynot_awards/custom_triggers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ if (minetest.get_modpath("farming") and minetest.global_exists("farming") and fa
minetest.override_item(name, {
on_use = function(itemstack, user, pointed_thing)
awards.notify_plow_soil(user)
return base_on_use(itemstack, user, pointed_thing)
if base_on_use then
return base_on_use(itemstack, user, pointed_thing)
else
return nil
end
end
})
end
Expand All @@ -287,9 +291,13 @@ if (minetest.get_modpath("farming") and minetest.global_exists("farming") and fa
local base_on_place = reg_item.on_place
minetest.override_item(seed_name, {
on_place = function(itemstack, placer, pointed_thing)
base_on_place(itemstack, placer, pointed_thing)
awards.notify_place(placer, itemstack:get_name())
check_action_with_item_in_collection("plant_crops", "place", itemstack:get_name(), registered_seeds, placer)
if base_on_place then
return base_on_place(itemstack, placer, pointed_thing)
else
return itemstack:take_item(1)
end
end
})
end
Expand Down

0 comments on commit d9fb91e

Please sign in to comment.