mirror of
https://github.com/minetest-mods/technic.git
synced 2025-01-02 18:57:34 +01:00
minetest.env:* --> minetest.*
This commit is contained in:
parent
dd30838245
commit
a413904ecd
@ -32,7 +32,7 @@ minetest.register_node("technic:coal_alloy_furnace", {
|
|||||||
legacy_facedir_simple = true,
|
legacy_facedir_simple = true,
|
||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", formspec)
|
meta:set_string("formspec", formspec)
|
||||||
meta:set_string("infotext", machine_name)
|
meta:set_string("infotext", machine_name)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
@ -149,7 +149,7 @@ minetest.register_abm({
|
|||||||
interval = 1,
|
interval = 1,
|
||||||
chance = 1,
|
chance = 1,
|
||||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local eu_input = meta:get_int("MV_EU_input")
|
local eu_input = meta:get_int("MV_EU_input")
|
||||||
local eu_demand = meta:get_int("MV_EU_demand")
|
local eu_demand = meta:get_int("MV_EU_demand")
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
local S = technic.getter
|
local S = technic.getter
|
||||||
|
|
||||||
local function inject_items (pos)
|
local function inject_items (pos)
|
||||||
local meta=minetest.env:get_meta(pos)
|
local meta=minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local mode=meta:get_string("mode")
|
local mode=meta:get_string("mode")
|
||||||
if mode=="single items" then
|
if mode=="single items" then
|
||||||
@ -69,7 +69,7 @@ minetest.register_node("technic:injector", {
|
|||||||
tube = {connect_sides={bottom=1}},
|
tube = {connect_sides={bottom=1}},
|
||||||
sounds = default.node_sound_wood_defaults(),
|
sounds = default.node_sound_wood_defaults(),
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("infotext", S("Self-Contained Injector"))
|
meta:set_string("infotext", S("Self-Contained Injector"))
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
inv:set_size("main", 8*4)
|
inv:set_size("main", 8*4)
|
||||||
@ -77,12 +77,12 @@ minetest.register_node("technic:injector", {
|
|||||||
set_injector_formspec(meta)
|
set_injector_formspec(meta)
|
||||||
end,
|
end,
|
||||||
can_dig = function(pos,player)
|
can_dig = function(pos,player)
|
||||||
local meta = minetest.env:get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("main")
|
return inv:is_empty("main")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formanme, fields, sender)
|
on_receive_fields = function(pos, formanme, fields, sender)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
if fields.mode_item then meta:set_string("mode", "single items") end
|
if fields.mode_item then meta:set_string("mode", "single items") end
|
||||||
if fields.mode_stack then meta:set_string("mode", "whole stacks") end
|
if fields.mode_stack then meta:set_string("mode", "whole stacks") end
|
||||||
set_injector_formspec(meta)
|
set_injector_formspec(meta)
|
||||||
|
@ -60,7 +60,7 @@ minetest.register_node("technic:supply_converter", {
|
|||||||
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
||||||
},
|
},
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.env:get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("infotext", S("Supply Converter"))
|
meta:set_string("infotext", S("Supply Converter"))
|
||||||
meta:set_float("active", false)
|
meta:set_float("active", false)
|
||||||
end,
|
end,
|
||||||
|
@ -51,12 +51,12 @@ local function drill_dig_it0 (pos,player)
|
|||||||
minetest.record_protection_violation(pos, player:get_player_name())
|
minetest.record_protection_violation(pos, player:get_player_name())
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local node=minetest.env:get_node(pos)
|
local node=minetest.get_node(pos)
|
||||||
if node.name == "air" or node.name == "ignore" then return end
|
if node.name == "air" or node.name == "ignore" then return end
|
||||||
if node.name == "default:lava_source" then return end
|
if node.name == "default:lava_source" then return end
|
||||||
if node.name == "default:lava_flowing" then return end
|
if node.name == "default:lava_flowing" then return end
|
||||||
if node.name == "default:water_source" then minetest.env:remove_node(pos) return end
|
if node.name == "default:water_source" then minetest.remove_node(pos) return end
|
||||||
if node.name == "default:water_flowing" then minetest.env:remove_node(pos) return end
|
if node.name == "default:water_flowing" then minetest.remove_node(pos) return end
|
||||||
minetest.node_dig(pos,node,player)
|
minetest.node_dig(pos,node,player)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ local function drill_dig_it(pos, player, mode)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function pos_is_pointable(pos)
|
local function pos_is_pointable(pos)
|
||||||
local node = minetest.env:get_node(pos)
|
local node = minetest.get_node(pos)
|
||||||
local nodedef = minetest.registered_nodes[node.name]
|
local nodedef = minetest.registered_nodes[node.name]
|
||||||
return nodedef and nodedef.pointable
|
return nodedef and nodedef.pointable
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user