[UPDATE] Commit before implements on_timer callback

This commit is contained in:
tacigar 2016-09-14 22:10:40 +09:00
parent 01b6843973
commit 6f31969aed

View File

@ -17,6 +17,7 @@
}, },
} }
-- can_dig is a common callback for the core writer.
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 inventory = meta:get_inventory() local inventory = meta:get_inventory()
@ -27,6 +28,12 @@
) )
end end
-- on_timer is a common callback for the core writer.
local function on_timer(pos, elapsed)
end
-- allow_metadata_inventory_put is a common callback for the core writer.
local function allow_metadata_inventory_put(pos, listname, index, stack, player) local function allow_metadata_inventory_put(pos, listname, index, stack, player)
local meta = minetest.get_meta(pos) local meta = minetest.get_meta(pos)
local inventory = meta:get_inventory() local inventory = meta:get_inventory()
@ -42,6 +49,7 @@
return 0 return 0
end end
-- allow_metadata_inventory_move is a common callback for the core writer.
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 inventory = meta:get_inventory() local inventory = meta:get_inventory()
@ -126,7 +134,10 @@
} }
local function allow_metadata_inventory_take(pos, listname, index, stack, player) local function allow_metadata_inventory_take(pos, listname, index, stack, player)
return stack:get_count() -- maybe add more. if listname == "core" then
return 0
end
return stack:get_count()
end end
minetest.register_node("maidroid_tool:core_writer_active", { minetest.register_node("maidroid_tool:core_writer_active", {