mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 20:32:22 +01:00
enable [crops] planting.
This commit is contained in:
parent
8abd57146d
commit
dbb0d51de5
1
init.lua
1
init.lua
@ -32,6 +32,7 @@ digtron.builder_on_place_items = {
|
||||
-- Then a string prefix is checked, returning this value. Useful for enabling on_placed on a mod-wide basis.
|
||||
digtron.builder_on_place_prefixes = {
|
||||
["farming:"] = true,
|
||||
["crops:"] = true,
|
||||
}
|
||||
|
||||
-- Finally, items belonging to group "digtron_on_place" will have their on_place methods called.
|
||||
|
@ -99,7 +99,7 @@ digtron.item_place_node = function(itemstack, placer, place_to, param2)
|
||||
-- to know what to do in that case - if you're in creative_mode Digtron will place such items but it will think it failed and not
|
||||
-- deduct them from inventory no matter what Digtron's settings are. Unfortunate, but not very harmful and I have no workaround.
|
||||
local returnstack, success = def.on_place(ItemStack(itemstack), placer, pointed_thing)
|
||||
if returnstack:get_count() < itemstack:get_count() then success = true end -- some mods neglect to return a success condition
|
||||
if returnstack and returnstack:get_count() < itemstack:get_count() then success = true end -- some mods neglect to return a success condition
|
||||
if success then
|
||||
-- Override the param2 value to force it to be what Digtron wants
|
||||
local placed_node = minetest.get_node(place_to)
|
||||
|
Loading…
Reference in New Issue
Block a user