mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Move scriptapi to separate folder (by sapier)
On the lua side, notably minetest.env:<function>(<args>) should now be replaced by minetest.<function>(<args>). The old way is and will stay supported for a long time. Also: Update and clean up lua_api.txt (by celeron55) Move EnvRef to lua and remove add_rat and add_firefly (by kahrl) Add separate src/util/CMakeLists.txt, other minor fixes (by kahrl)
This commit is contained in:
parent
865f380c91
commit
ab43377577
87 changed files with 6401 additions and 5584 deletions
|
@ -41,13 +41,13 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image)
|
|||
return
|
||||
end
|
||||
-- Check if pointing to a liquid
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
n = minetest.get_node(pointed_thing.under)
|
||||
if bucket.liquids[n.name] == nil then
|
||||
-- Not a liquid
|
||||
minetest.env:add_node(pointed_thing.above, {name=source})
|
||||
minetest.add_node(pointed_thing.above, {name=source})
|
||||
elseif n.name ~= source then
|
||||
-- It's a liquid
|
||||
minetest.env:add_node(pointed_thing.under, {name=source})
|
||||
minetest.add_node(pointed_thing.under, {name=source})
|
||||
end
|
||||
return {name="bucket:bucket_empty"}
|
||||
end
|
||||
|
@ -65,10 +65,10 @@ minetest.register_craftitem("bucket:bucket_empty", {
|
|||
return
|
||||
end
|
||||
-- Check if pointing to a liquid source
|
||||
n = minetest.env:get_node(pointed_thing.under)
|
||||
n = minetest.get_node(pointed_thing.under)
|
||||
liquiddef = bucket.liquids[n.name]
|
||||
if liquiddef ~= nil and liquiddef.source == n.name and liquiddef.itemname ~= nil then
|
||||
minetest.env:add_node(pointed_thing.under, {name="air"})
|
||||
minetest.add_node(pointed_thing.under, {name="air"})
|
||||
return {name=liquiddef.itemname}
|
||||
end
|
||||
end,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue