minetest.env:* --> minetest.*
| | |
| | | legacy_facedir_simple = true, |
| | | sounds = default.node_sound_stone_defaults(), |
| | | 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("infotext", machine_name) |
| | | local inv = meta:get_inventory() |
| | |
| | | interval = 1, |
| | | chance = 1, |
| | | 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_demand = meta:get_int("MV_EU_demand") |
| | | |
| | |
| | | local S = technic.getter |
| | | |
| | | local function inject_items (pos) |
| | | local meta=minetest.env:get_meta(pos) |
| | | local meta=minetest.get_meta(pos) |
| | | local inv = meta:get_inventory() |
| | | local mode=meta:get_string("mode") |
| | | if mode=="single items" then |
| | |
| | | tube = {connect_sides={bottom=1}}, |
| | | sounds = default.node_sound_wood_defaults(), |
| | | 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")) |
| | | local inv = meta:get_inventory() |
| | | inv:set_size("main", 8*4) |
| | |
| | | set_injector_formspec(meta) |
| | | end, |
| | | can_dig = function(pos,player) |
| | | local meta = minetest.env:get_meta(pos); |
| | | local meta = minetest.get_meta(pos); |
| | | local inv = meta:get_inventory() |
| | | return inv:is_empty("main") |
| | | end, |
| | | 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_stack then meta:set_string("mode", "whole stacks") end |
| | | set_injector_formspec(meta) |
| | |
| | | fixed = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, |
| | | }, |
| | | 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_float("active", false) |
| | | end, |
| | |
| | | minetest.record_protection_violation(pos, player:get_player_name()) |
| | | return |
| | | 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 == "default:lava_source" 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_flowing" 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.remove_node(pos) return end |
| | | minetest.node_dig(pos,node,player) |
| | | end |
| | | |
| | |
| | | end |
| | | |
| | | 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] |
| | | return nodedef and nodedef.pointable |
| | | end |