diff options
-rw-r--r-- | class_layout.lua | 4 | ||||
-rw-r--r-- | node_axle.lua | 8 | ||||
-rw-r--r-- | textures/digtron_builder.png | bin | 783 -> 835 bytes | |||
-rw-r--r-- | util_execute_cycle.lua | 10 |
4 files changed, 12 insertions, 10 deletions
diff --git a/class_layout.lua b/class_layout.lua index b7311c5..85beba3 100644 --- a/class_layout.lua +++ b/class_layout.lua @@ -15,7 +15,9 @@ local get_node_image = function(pos, node) local build_item = node_image.meta.inventory.main[1] if build_item ~= "" then local build_item_def = minetest.registered_nodes[ItemStack(build_item):get_name()] - node_image.build_item_paramtype2 = build_item_def.paramtype2 + if build_item_def ~= nil then + node_image.build_item_paramtype2 = build_item_def.paramtype2 + end end end return node_image diff --git a/node_axle.lua b/node_axle.lua index 9e62b07..ab36c97 100644 --- a/node_axle.lua +++ b/node_axle.lua @@ -36,10 +36,10 @@ minetest.register_node("digtron:axle", { -- Been too soon since last time the digtron rotated. return end - local image = digtron.get_layout_image(pos, clicker) - digtron.rotate_layout_image(image, node.param2) - if digtron.can_write_layout_image(image) then - digtron.write_layout_image(image) + local image = DigtronLayout.create(pos, clicker) + image:rotate_layout_image(node.param2) + if image:can_write_layout_image() then + image:write_layout_image() minetest.sound_play("whirr", {gain=1.0, pos=pos}) meta = minetest.get_meta(pos) diff --git a/textures/digtron_builder.png b/textures/digtron_builder.png Binary files differindex 446b76d..60fd68e 100644 --- a/textures/digtron_builder.png +++ b/textures/digtron_builder.png diff --git a/util_execute_cycle.lua b/util_execute_cycle.lua index 42bf410..316a003 100644 --- a/util_execute_cycle.lua +++ b/util_execute_cycle.lua @@ -221,11 +221,6 @@ digtron.execute_dig_cycle = function(pos, clicker) -- All tests passed, ready to go for real! minetest.sound_play("construction", {gain=1.0, pos=pos}) - -- store or drop the products of the digger heads - for _, itemname in pairs(items_dropped) do - digtron.place_in_inventory(itemname, layout.inventories, pos) - end - -- if the player is standing within the array or next to it, move him too. local move_player = move_player_test(layout, clicker) @@ -250,6 +245,11 @@ digtron.execute_dig_cycle = function(pos, clicker) clicker:moveto(digtron.find_new_pos(clicker:getpos(), facing), true) end + -- store or drop the products of the digger heads + for _, itemname in pairs(items_dropped) do + minetest.debug("placing in inventory", itemname) + digtron.place_in_inventory(itemname, layout.inventories, oldpos) + end local building_fuel_cost = 0 local strange_failure = false |