1
0
Fork 0
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:
sapier 2013-05-25 00:51:02 +02:00 committed by Kahrl
parent 865f380c91
commit ab43377577
87 changed files with 6401 additions and 5584 deletions

View file

@ -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,