mirror of
https://github.com/enchant97/minetest_element_exchange.git
synced 2024-11-22 15:13:50 +01:00
convert tabs to spaces
This commit is contained in:
parent
6e8f243cef
commit
2c2a529876
@ -11,9 +11,9 @@ function get_element_deconstructor_formspec()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function can_dig(pos, player)
|
local function can_dig(pos, player)
|
||||||
local meta = minetest.get_meta(pos);
|
local meta = minetest.get_meta(pos);
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
return inv:is_empty("fuel") and inv:is_empty("dst")
|
return inv:is_empty("fuel") and inv:is_empty("dst")
|
||||||
end
|
end
|
||||||
|
|
||||||
local function on_timer(pos, elapsed)
|
local function on_timer(pos, elapsed)
|
||||||
@ -54,11 +54,11 @@ local function on_construct(pos)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||||
if minetest.is_protected(pos, player:get_player_name()) then
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
if listname == "dst" then
|
if listname == "dst" then
|
||||||
if stack:get_name() == "element_exchange:exchange_orb" then
|
if stack:get_name() == "element_exchange:exchange_orb" then
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
@ -71,17 +71,17 @@ local function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
|
local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
local stack = inv:get_stack(from_list, from_index)
|
local stack = inv:get_stack(from_list, from_index)
|
||||||
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
|
return allow_metadata_inventory_put(pos, to_list, to_index, stack, player)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
|
local function allow_metadata_inventory_take(pos, listname, index, stack, player)
|
||||||
if minetest.is_protected(pos, player:get_player_name()) then
|
if minetest.is_protected(pos, player:get_player_name()) then
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
return stack:get_count()
|
return stack:get_count()
|
||||||
end
|
end
|
||||||
|
|
||||||
local function on_blast(pos)
|
local function on_blast(pos)
|
||||||
@ -95,20 +95,20 @@ end
|
|||||||
|
|
||||||
minetest.register_node("element_exchange:element_deconstructor", {
|
minetest.register_node("element_exchange:element_deconstructor", {
|
||||||
description = "Element Deconstructor",
|
description = "Element Deconstructor",
|
||||||
groups = {cracky = 2},
|
groups = {cracky = 2},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
can_dig = can_dig,
|
can_dig = can_dig,
|
||||||
on_timer = on_timer,
|
on_timer = on_timer,
|
||||||
on_construct = on_construct,
|
on_construct = on_construct,
|
||||||
on_metadata_inventory_move = function(pos)
|
on_metadata_inventory_move = function(pos)
|
||||||
minetest.get_node_timer(pos):start(1.0)
|
minetest.get_node_timer(pos):start(1.0)
|
||||||
end,
|
end,
|
||||||
on_metadata_inventory_put = function(pos)
|
on_metadata_inventory_put = function(pos)
|
||||||
minetest.get_node_timer(pos):start(1.0)
|
minetest.get_node_timer(pos):start(1.0)
|
||||||
end,
|
end,
|
||||||
on_metadata_inventory_take = function(pos)
|
on_metadata_inventory_take = function(pos)
|
||||||
minetest.get_node_timer(pos):start(1.0)
|
minetest.get_node_timer(pos):start(1.0)
|
||||||
end,
|
end,
|
||||||
on_blast = on_blast,
|
on_blast = on_blast,
|
||||||
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||||
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||||
|
Loading…
Reference in New Issue
Block a user