Replace on_rotate_horiz with on_rotate and paramtype2 = "4dir"

This raises the minimal Luanti/Minetest version to 5.7.0.
This commit is contained in:
The4codeblocks 2025-05-02 13:33:46 -05:00 committed by SmallJoker
parent b79962402b
commit 27072542cf
8 changed files with 20 additions and 18 deletions

View File

@ -99,8 +99,9 @@ do
offstate = "mesecons:test_conductor_rot_off",
}}
mesecon.register_node("mesecons:test_conductor_rot", {
paramtype2 = "4dir",
description = "Rotatable Test Conductor",
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
}, {mesecons = off_spec}, {mesecons = on_spec})
end

View File

@ -17,6 +17,7 @@ function mesecon.on_rotate(pos, node, _, _, new_param2)
end
-- An on_rotate callback for components which stay horizontal.
-- Deprecated. Use paramtype2 = "4dir" instead.
function mesecon.on_rotate_horiz(pos, node, user, mode, new_param2)
if not minetest.global_exists("screwdriver") or mode ~= screwdriver.ROTATE_FACE then
return false

View File

@ -18,7 +18,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
{ name = "jeija_insulated_wire_ends_on.png", backface_culling = true },
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -33,7 +33,7 @@ minetest.register_node("mesecons_extrawires:corner_on", {
offstate = "mesecons_extrawires:corner_off"
}},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
minetest.register_node("mesecons_extrawires:corner_off", {
@ -45,7 +45,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
{ name = "jeija_insulated_wire_ends_off.png", backface_culling = true },
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -59,7 +59,7 @@ minetest.register_node("mesecons_extrawires:corner_off", {
onstate = "mesecons_extrawires:corner_on"
}},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
minetest.register_craft({

View File

@ -41,7 +41,7 @@ for k, state in ipairs(doublecorner_states) do
{ name = "jeija_insulated_wire_ends_" .. w2 .. ".png", backface_culling = true },
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -56,7 +56,7 @@ for k, state in ipairs(doublecorner_states) do
},
},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
end

View File

@ -29,7 +29,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
"jeija_insulated_wire_ends_on.png"
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -45,7 +45,7 @@ minetest.register_node("mesecons_extrawires:tjunction_on", {
offstate = "mesecons_extrawires:tjunction_off"
}},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
minetest.register_node("mesecons_extrawires:tjunction_off", {
@ -60,7 +60,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
"jeija_insulated_wire_ends_off.png"
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -75,7 +75,7 @@ minetest.register_node("mesecons_extrawires:tjunction_off", {
onstate = "mesecons_extrawires:tjunction_on"
}},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
minetest.register_craft({

View File

@ -89,7 +89,7 @@ local function register_gate(name, inputnumber, assess, recipe, description)
description = description,
inventory_image = "jeija_gate_off.png^jeija_gate_"..name..".png",
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
drawtype = "nodebox",
drop = basename.."_off",
@ -102,7 +102,7 @@ local function register_gate(name, inputnumber, assess, recipe, description)
offstate = basename.."_off",
inputnumber = inputnumber,
after_dig_node = mesecon.do_cooldown,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
},{
tiles = {
"jeija_microcontroller_bottom.png^".."jeija_gate_off.png^"..

View File

@ -17,7 +17,7 @@ minetest.register_node("mesecons_insulated:insulated_on", {
"jeija_insulated_wire_sides_on.png"
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -39,7 +39,7 @@ minetest.register_node("mesecons_insulated:insulated_on", {
rules = insulated_wire_get_rules
}},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
minetest.register_node("mesecons_insulated:insulated_off", {
@ -54,7 +54,7 @@ minetest.register_node("mesecons_insulated:insulated_off", {
"jeija_insulated_wire_sides_off.png"
},
paramtype = "light",
paramtype2 = "facedir",
paramtype2 = "4dir",
is_ground_content = false,
walkable = false,
sunlight_propagates = true,
@ -75,7 +75,7 @@ minetest.register_node("mesecons_insulated:insulated_off", {
rules = insulated_wire_get_rules
}},
on_blast = mesecon.on_blastnode,
on_rotate = mesecon.on_rotate_horiz,
on_rotate = mesecon.on_rotate,
})
minetest.register_craft({

View File

@ -1,5 +1,5 @@
name = mesecons
description = Mod that implements a ton of items related to digital circuitry.
min_minetest_version = 5.0
min_minetest_version = 5.7.0
author = Jeija
title = Mesecons