The function on_place_bucket defined a couple of variables that were
used only once or in a redundant check. After removal of the redundant
check in a previous commit, all use-once variables can now be substituted
with their assignment expressions.
The function on_place_bucket contains the following logic:
if not a and not b then return x end
if a then
foo(a)
elseif b then
foo(b)
else
return x
end
The "if not a and not b then .." is removed because the case is handled
by the else case later on. This will allow some further simplifications.
Instead of directly accessing the group table in node definitions, use
the proper minetest.get_item_group accessor to test for "cauldron"
group.
Also adds local alias get_item_group for the global minetest call.
Two instances of add_node and add_item still used the full minetest
call, substitute the alias.
Added a set_node alias for several minetest.set_node calls.
When using a bucket of water on a cauldron, this would not fill the
cauldron as expected, but deposit a water source block on top of the
cauldron instead.
Applied patch from mineclone5 #38 (commit #
698c29733f06a7fcb7e755bf26ee46b33b00699b) from mineclone5 that fixes
this problem.
Implements a composter block with crafting recipe, and some more
uncraftable blocks representing various stages of filling.
Adds a list of items that can be used with the composter and the chances
of these items adding a layer to the composter.
Implements methods to add compostable items to the composter, to update
the composter to various levels of compost and to harvest an item of
bone meal when the composter is ready.
Textures were taken from XSSheep/Nova_Wostra Pixel Perfection texture
pack.
In Minetest 5.4.1, calling get_player_control() on a mob returned the
empty string. Minetest commit 5eb45e1ea03c6104f007efec6dd9c351f310193d
changed this, so now calling get_player_control() on a mob returns nil.
As mcl_boats defines boats that can have a player or a mob as a driver,
code like the following crashes with a changed get_player_control() API:
local ctrl = driver:get_player_control()
if ctrl.sneak then
detach_object(driver, true)
end
Furthermore, once a world has crashed, joining it near a mob that is the
driver of a boat with such control code immediately crashes again.
When I reported this bug to Minetest, several Minetest core developers
stated that they disliked the old API and proposed other return values
for calling a mob's get_player_control() function – all different from
the empty string. Since I have some doubts that this bug will be fixed
in Minetest 5.5.0, boat code must take into account a nil return value.
Minetest issue: https://github.com/minetest/minetest/issues/11989