mirror of
https://github.com/tacigar/maidroid.git
synced 2025-01-10 08:10:17 +01:00
[UPDATE] Commit before implementing core writer callbacks
This commit is contained in:
parent
72f08d1611
commit
99fd18ec0d
@ -15,8 +15,21 @@
|
|||||||
{ 0.375, 0.1875, 0.0625, 0.4375, 0.375, 0.125},
|
{ 0.375, 0.1875, 0.0625, 0.4375, 0.375, 0.125},
|
||||||
{ -0.375, -0.5, -0.375, 0.375, -0.25, 0.375},
|
{ -0.375, -0.5, -0.375, 0.375, -0.25, 0.375},
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
|
function allow_metadata_inventory_put(pos, listname, index, stack, player)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
function allow_metadata_inventory_take(pos, listname, index, stack, player)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
(function() -- register a definition of an inactive core writer.
|
||||||
local tiles = {
|
local tiles = {
|
||||||
"maidroid_tool_core_writer_top.png",
|
"maidroid_tool_core_writer_top.png",
|
||||||
"maidroid_tool_core_writer_bottom.png",
|
"maidroid_tool_core_writer_bottom.png",
|
||||||
@ -26,6 +39,24 @@
|
|||||||
"maidroid_tool_core_writer_front.png",
|
"maidroid_tool_core_writer_front.png",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local formspec_string = "size[8,9]"
|
||||||
|
.. "list[current_player;main;0,5;8,1;]"
|
||||||
|
.. "list[current_player;main;0,6.2;8,3;8]"
|
||||||
|
|
||||||
|
function on_construct(pos)
|
||||||
|
local meta = minetest.get_meta(pos)
|
||||||
|
meta:set_string("formspec", formspec_string)
|
||||||
|
|
||||||
|
local inventory = meta:get_inventory()
|
||||||
|
inventory:set_size("core", 1)
|
||||||
|
inventory:set_size("fuel", 1)
|
||||||
|
inventory:set_size("dye", 1)
|
||||||
|
end
|
||||||
|
|
||||||
|
function on_metadata_inventory_move = function(pos)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
minetest.register_node("maidroid_tool:core_writer", {
|
minetest.register_node("maidroid_tool:core_writer", {
|
||||||
description = "maidroid tool : core writer",
|
description = "maidroid tool : core writer",
|
||||||
drawtype = "nodebox",
|
drawtype = "nodebox",
|
||||||
@ -36,9 +67,20 @@
|
|||||||
sounds = default.node_sound_stone_defaults(),
|
sounds = default.node_sound_stone_defaults(),
|
||||||
node_box = node_box,
|
node_box = node_box,
|
||||||
tiles = tiles,
|
tiles = tiles,
|
||||||
|
can_dig = can_dig,
|
||||||
|
on_construct = on_construct,
|
||||||
|
on_metadata_inventory_move = on_metadata_inventory_move,
|
||||||
|
allow_metadata_inventory_put = allow_metadata_inventory_put,
|
||||||
|
allow_metadata_inventory_move = allow_metadata_inventory_move,
|
||||||
|
allow_metadata_inventory_take = allow_metadata_inventory_take,
|
||||||
})
|
})
|
||||||
end) ();
|
end) ();
|
||||||
|
|
||||||
|
(function () -- register a definition of an active core writer.
|
||||||
|
|
||||||
|
end) ();
|
||||||
|
end) ();
|
||||||
|
|
||||||
-- register a definition of a core entity.
|
-- register a definition of a core entity.
|
||||||
(function()
|
(function()
|
||||||
local node_box = {
|
local node_box = {
|
||||||
@ -84,9 +126,4 @@ end) ();
|
|||||||
self.object:setyaw(yaw + 0.1)
|
self.object:setyaw(yaw + 0.1)
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
|
end) ();
|
||||||
minetest.register_on_punchnode(function(pos, node, puncher, pointed_thing)
|
|
||||||
minetest.add_entity(pointed_thing.above, "maidroid_tool:core_entity")
|
|
||||||
end)
|
|
||||||
|
|
||||||
end) ()
|
|
||||||
|
Loading…
Reference in New Issue
Block a user