Skip to content

MTG compatible screwdriver API #405

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions technic/helpers.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ function technic.swap_node(pos, name)
end
end

-- MTG compatible screwdriver API nodedef.on_rotate compatibility
function technic.on_rotate(pos, node, user, mode, new_param2)
node.param2 = new_param2
minetest.swap_node(pos, node)
pipeworks.scan_for_tube_objects(pos)
return true
end

function technic.set_charge(stack, charge)
local wear_factor = stack:get_definition().technic_wear_factor
if wear_factor then
Expand Down
1 change: 1 addition & 0 deletions technic/machines/HV/quarry.lua
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ minetest.register_node("technic:quarry", {
action = digiline_action,
}
},
on_rotate = technic.on_rotate,
})

minetest.register_craft({
Expand Down
3 changes: 2 additions & 1 deletion technic/machines/MV/tool_workshop.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ minetest.register_node("technic:tool_workshop", {
},
technic_run = run,
after_place_node = pipeworks.after_place,
after_dig_node = technic.machine_after_dig_node
after_dig_node = technic.machine_after_dig_node,
on_rotate = technic.on_rotate,
})

technic.register_machine("MV", "technic:tool_workshop", technic.receiver)
Expand Down
2 changes: 2 additions & 0 deletions technic/machines/other/coal_alloy_furnace.lua
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ minetest.register_node("technic:coal_alloy_furnace", {
on_metadata_inventory_move = technic.machine_on_inventory_move,
on_metadata_inventory_put = technic.machine_on_inventory_put,
on_metadata_inventory_take = technic.machine_on_inventory_take,
on_rotate = technic.on_rotate,
})

minetest.register_node("technic:coal_alloy_furnace_active", {
Expand All @@ -98,6 +99,7 @@ minetest.register_node("technic:coal_alloy_furnace_active", {
on_metadata_inventory_move = technic.machine_on_inventory_move,
on_metadata_inventory_put = technic.machine_on_inventory_put,
on_metadata_inventory_take = technic.machine_on_inventory_take,
on_rotate = technic.on_rotate,
})

minetest.register_abm({
Expand Down
2 changes: 2 additions & 0 deletions technic/machines/register/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ function technic.register_generator(data)
local percent = math.floor(burn_time / burn_totaltime * 100)
update_generator_formspec(meta, desc, percent, form_buttons)
end,
on_rotate = technic.on_rotate,
})

minetest.register_node("technic:"..ltier.."_generator_active", {
Expand Down Expand Up @@ -286,6 +287,7 @@ function technic.register_generator(data)

update_generator_formspec(meta, desc, percent, form_buttons)
end,
on_rotate = technic.on_rotate,
})

technic.register_machine(tier, "technic:"..ltier.."_generator", technic.producer)
Expand Down
2 changes: 2 additions & 0 deletions technic/machines/register/machine_base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ function technic.register_base_machine(nodename, data)
end
meta:set_string("formspec", formspec..form_buttons)
end,
on_rotate = technic.on_rotate,
})

minetest.register_node(colon..nodename.."_active",{
Expand Down Expand Up @@ -290,6 +291,7 @@ function technic.register_base_machine(nodename, data)
end
meta:set_string("formspec", formspec..form_buttons)
end,
on_rotate = technic.on_rotate,
})

technic.register_machine(tier, nodename, technic.receiver)
Expand Down
Loading