1
0
mirror of https://github.com/minetest/minetest_game.git synced 2025-06-28 04:40:22 +02:00

Replace minetest.env: with minetest.

This commit is contained in:
PilzAdam
2013-05-25 00:40:03 +02:00
parent dfad095884
commit 31a74ede18
13 changed files with 169 additions and 169 deletions

View File

@ -47,7 +47,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
local place_liquid = function(pos, node, source, flowing, fullness)
if math.floor(fullness/128) == 1 or (not minetest.setting_getbool("liquid_finite")) then
minetest.env:add_node(pos, {name=source, param2=fullness})
minetest.add_node(pos, {name=source, param2=fullness})
return
elseif node.name == flowing then
fullness = fullness + node.param2
@ -56,14 +56,14 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
end
if fullness >= LIQUID_MAX then
minetest.env:add_node(pos, {name=source, param2=LIQUID_MAX})
minetest.add_node(pos, {name=source, param2=LIQUID_MAX})
else
minetest.env:add_node(pos, {name=flowing, param2=fullness})
minetest.add_node(pos, {name=flowing, param2=fullness})
end
end
-- Check if pointing to a buildable node
local node = minetest.env:get_node(pointed_thing.under)
local node = minetest.get_node(pointed_thing.under)
local fullness = tonumber(itemstack:get_metadata())
if not fullness then fullness = LIQUID_MAX end
@ -73,7 +73,7 @@ function bucket.register_liquid(source, flowing, itemname, inventory_image, name
else
-- not buildable to; place the liquid above
-- check if the node above can be replaced
local node = minetest.env:get_node(pointed_thing.above)
local node = minetest.get_node(pointed_thing.above)
if minetest.registered_nodes[node.name].buildable_to then
place_liquid(pointed_thing.above, node, source, flowing, fullness)
else
@ -98,12 +98,12 @@ minetest.register_craftitem("bucket:bucket_empty", {
return
end
-- Check if pointing to a liquid source
node = minetest.env:get_node(pointed_thing.under)
node = minetest.get_node(pointed_thing.under)
liquiddef = bucket.liquids[node.name]
if liquiddef ~= nil and liquiddef.itemname ~= nil and (node.name == liquiddef.source or
(node.name == liquiddef.flowing and minetest.setting_getbool("liquid_finite"))) then
minetest.env:add_node(pointed_thing.under, {name="air"})
minetest.add_node(pointed_thing.under, {name="air"})
if node.name == liquiddef.source then node.param2 = LIQUID_MAX end
return ItemStack({name = liquiddef.itemname, metadata = tostring(node.param2)})