From 320567e1f2f27002641bcefaf4011324e7739f1d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Tue, 5 Dec 2017 14:09:39 +0100 Subject: [PATCH] Add basic screwdriver support --- .../REDSTONE/mcl_comparators/depends.txt | 1 + mods/ITEMS/REDSTONE/mcl_comparators/init.lua | 8 ++++++- .../ITEMS/REDSTONE/mcl_dispensers/depends.txt | 1 + mods/ITEMS/REDSTONE/mcl_dispensers/init.lua | 8 ++++++- mods/ITEMS/REDSTONE/mcl_droppers/depends.txt | 1 + mods/ITEMS/REDSTONE/mcl_droppers/init.lua | 8 ++++++- .../REDSTONE/mesecons_delayer/depends.txt | 1 + mods/ITEMS/REDSTONE/mesecons_delayer/init.lua | 11 +++++++-- .../REDSTONE/mesecons_pistons/depends.txt | 1 + mods/ITEMS/REDSTONE/mesecons_pistons/init.lua | 23 +++++++++++++++++++ mods/ITEMS/itemframes/depends.txt | 1 + mods/ITEMS/itemframes/init.lua | 6 +++++ mods/ITEMS/mcl_anvils/depends.txt | 1 + mods/ITEMS/mcl_anvils/init.lua | 3 +++ mods/ITEMS/mcl_banners/depends.txt | 1 + mods/ITEMS/mcl_banners/init.lua | 6 +++++ mods/ITEMS/mcl_chests/depends.txt | 1 + mods/ITEMS/mcl_chests/init.lua | 10 ++++++++ mods/ITEMS/mcl_colorblocks/depends.txt | 1 + mods/ITEMS/mcl_colorblocks/init.lua | 5 ++++ mods/ITEMS/mcl_doors/api_trapdoors.lua | 7 ++++++ mods/ITEMS/mcl_doors/depends.txt | 1 + mods/ITEMS/mcl_fences/depends.txt | 1 + mods/ITEMS/mcl_fences/init.lua | 7 ++++++ mods/ITEMS/mcl_furnaces/depends.txt | 1 + mods/ITEMS/mcl_furnaces/init.lua | 7 ++++++ mods/ITEMS/mcl_heads/depends.txt | 1 + mods/ITEMS/mcl_heads/init.lua | 6 +++++ mods/ITEMS/mcl_hoppers/depends.txt | 1 + mods/ITEMS/mcl_hoppers/init.lua | 6 +++++ mods/ITEMS/mcl_signs/init.lua | 6 +++++ .../3d_armor_stand/depends.txt | 1 + .../minetest-3d_armor/3d_armor_stand/init.lua | 6 +++++ 33 files changed, 144 insertions(+), 5 deletions(-) diff --git a/mods/ITEMS/REDSTONE/mcl_comparators/depends.txt b/mods/ITEMS/REDSTONE/mcl_comparators/depends.txt index 93f3c0133a..2cc05ce78a 100644 --- a/mods/ITEMS/REDSTONE/mcl_comparators/depends.txt +++ b/mods/ITEMS/REDSTONE/mcl_comparators/depends.txt @@ -1,3 +1,4 @@ mesecons mcl_sounds doc? +screwdriver? diff --git a/mods/ITEMS/REDSTONE/mcl_comparators/init.lua b/mods/ITEMS/REDSTONE/mcl_comparators/init.lua index 352b9a5bc3..a4fef7b5fe 100644 --- a/mods/ITEMS/REDSTONE/mcl_comparators/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_comparators/init.lua @@ -196,6 +196,11 @@ local groups = { attached_node = 1, } +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + for _, mode in pairs{"comp", "sub"} do for _, state in pairs{mesecon.state.on, mesecon.state.off} do local state_str = state_strs[state] @@ -255,7 +260,8 @@ for _, state in pairs{mesecon.state.on, mesecon.state.off} do rules = comparator_get_input_rules, action_change = update_self, } - } + }, + on_rotate = on_rotate, } if mode == "comp" and state == mesecon.state.off then diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt b/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt index 75ae982c64..c17d2db096 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/depends.txt @@ -8,3 +8,4 @@ mcl_nether 3d_armor_stand 3d_armor doc? +screwdriver? diff --git a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua index 725e549c87..b49c8ddce5 100644 --- a/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_dispensers/init.lua @@ -26,6 +26,11 @@ local setup_dispenser = function(pos) inv:set_size("main", 9) end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple +end + -- Shared core definition table local dispenserdef = { is_ground_content = false, @@ -363,7 +368,8 @@ local dispenserdef = { end end, rules = mesecon.rules.alldirs, - }} + }}, + on_rotate = on_rotate, } -- Horizontal dispenser diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt b/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt index 492dd65372..d8d7ca50fb 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt +++ b/mods/ITEMS/REDSTONE/mcl_droppers/depends.txt @@ -2,3 +2,4 @@ mcl_init mesecons mcl_util doc? +screwdriver? diff --git a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua index ded1c4a6c5..3d0e519258 100644 --- a/mods/ITEMS/REDSTONE/mcl_droppers/init.lua +++ b/mods/ITEMS/REDSTONE/mcl_droppers/init.lua @@ -26,6 +26,11 @@ local setup_dropper = function(pos) inv:set_size("main", 9) end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple +end + -- Shared core definition table local dropperdef = { is_ground_content = false, @@ -91,7 +96,8 @@ local dropperdef = { end end, rules = mesecon.rules.alldirs, - }} + }}, + on_rotate = on_rotate, } -- Horizontal dropper diff --git a/mods/ITEMS/REDSTONE/mesecons_delayer/depends.txt b/mods/ITEMS/REDSTONE/mesecons_delayer/depends.txt index 4fdbda79fa..14ced9309c 100644 --- a/mods/ITEMS/REDSTONE/mesecons_delayer/depends.txt +++ b/mods/ITEMS/REDSTONE/mesecons_delayer/depends.txt @@ -1,2 +1,3 @@ mesecons doc? +screwdriver? diff --git a/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua b/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua index 3fb2fec570..32e934bd14 100644 --- a/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_delayer/init.lua @@ -95,6 +95,11 @@ else help = false end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), { description = "Redstone Repeater", inventory_image = icon, @@ -156,7 +161,8 @@ minetest.register_node("mesecons_delayer:delayer_off_"..tostring(i), { rules = delayer_get_input_rules, action_on = delayer_activate } - } + }, + on_rotate = on_rotate, }) @@ -215,7 +221,8 @@ minetest.register_node("mesecons_delayer:delayer_on_"..tostring(i), { rules = delayer_get_input_rules, action_off = delayer_deactivate } - } + }, + on_rotate = on_rotate, }) end diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/depends.txt b/mods/ITEMS/REDSTONE/mesecons_pistons/depends.txt index 9455a4a746..c19acf4b95 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/depends.txt +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/depends.txt @@ -2,3 +2,4 @@ mesecons mesecons_mvps mcl_mobitems doc? +screwdriver? diff --git a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua index ef61fdfcda..765da55f47 100644 --- a/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua +++ b/mods/ITEMS/REDSTONE/mesecons_pistons/init.lua @@ -173,6 +173,11 @@ local pistonspec_normal = { local usagehelp_piston = "This block can have one of 6 possible orientations. On placement, the pusher will face you." +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + -- offstate minetest.register_node("mesecons_pistons:piston_normal_off", { description = "Piston", @@ -200,6 +205,7 @@ minetest.register_node("mesecons_pistons:piston_normal_off", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- onstate @@ -230,6 +236,7 @@ minetest.register_node("mesecons_pistons:piston_normal_on", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- pusher @@ -254,6 +261,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_normal", { node_box = piston_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, + on_rotate = on_rotate, }) -- Sticky ones @@ -296,6 +304,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_off", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- onstate @@ -326,6 +335,7 @@ minetest.register_node("mesecons_pistons:piston_sticky_on", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- pusher @@ -350,6 +360,7 @@ minetest.register_node("mesecons_pistons:piston_pusher_sticky", { node_box = piston_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, + on_rotate = on_rotate, }) -- @@ -406,6 +417,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_off", { sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- onstate @@ -436,6 +448,7 @@ minetest.register_node("mesecons_pistons:piston_up_normal_on", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- pusher @@ -460,6 +473,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_normal", { node_box = piston_up_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, + on_rotate = on_rotate, }) @@ -499,6 +513,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_off", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- onstate @@ -529,6 +544,7 @@ minetest.register_node("mesecons_pistons:piston_up_sticky_on", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- pusher @@ -553,6 +569,7 @@ minetest.register_node("mesecons_pistons:piston_up_pusher_sticky", { node_box = piston_up_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, + on_rotate = on_rotate, }) -- @@ -611,6 +628,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_off", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- onstate @@ -641,6 +659,7 @@ minetest.register_node("mesecons_pistons:piston_down_normal_on", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- pusher @@ -665,6 +684,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_normal", { node_box = piston_down_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, + on_rotate = on_rotate, }) -- Sticky @@ -701,6 +721,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_off", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- onstate @@ -731,6 +752,7 @@ minetest.register_node("mesecons_pistons:piston_down_sticky_on", { }}, _mcl_blast_resistance = 2.5, _mcl_hardness = 0.5, + on_rotate = on_rotate, }) -- pusher @@ -755,6 +777,7 @@ minetest.register_node("mesecons_pistons:piston_down_pusher_sticky", { node_box = piston_down_pusher_box, sounds = mcl_sounds.node_sound_wood_defaults(), _mcl_blast_resistance = 2.5, + on_rotate = on_rotate, }) diff --git a/mods/ITEMS/itemframes/depends.txt b/mods/ITEMS/itemframes/depends.txt index 97bf510696..0b5088e3ce 100644 --- a/mods/ITEMS/itemframes/depends.txt +++ b/mods/ITEMS/itemframes/depends.txt @@ -1,2 +1,3 @@ mcl_core mcl_sounds +screwdriver? diff --git a/mods/ITEMS/itemframes/init.lua b/mods/ITEMS/itemframes/init.lua index 5e004aebf9..3ff96a3330 100644 --- a/mods/ITEMS/itemframes/init.lua +++ b/mods/ITEMS/itemframes/init.lua @@ -87,6 +87,11 @@ local drop_item = function(pos, node, meta) remove_item(pos, node) end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + minetest.register_node("itemframes:frame",{ description = "Item Frame", _doc_items_longdesc = "Item frames are decorative blocks in which items can be placed.", @@ -138,6 +143,7 @@ minetest.register_node("itemframes:frame",{ local meta = minetest.get_meta(pos) return player:get_player_name() == meta:get_string("owner") end, + on_rotate = on_rotate, }) minetest.register_craft({ diff --git a/mods/ITEMS/mcl_anvils/depends.txt b/mods/ITEMS/mcl_anvils/depends.txt index e2d61eb34a..38406b9100 100644 --- a/mods/ITEMS/mcl_anvils/depends.txt +++ b/mods/ITEMS/mcl_anvils/depends.txt @@ -2,3 +2,4 @@ mcl_sounds mcl_core mcl_hunger mcl_death_messages +screwdriver? diff --git a/mods/ITEMS/mcl_anvils/init.lua b/mods/ITEMS/mcl_anvils/init.lua index c3c68f98a7..e2d667089f 100644 --- a/mods/ITEMS/mcl_anvils/init.lua +++ b/mods/ITEMS/mcl_anvils/init.lua @@ -18,6 +18,9 @@ local anvildef = { _mcl_blast_resistance = 6000, _mcl_hardness = 5, } +if minetest.get_modpath("screwdriver") then + anvildef.on_rotate = screwdriver.rotate_simple +end local anvildef0 = table.copy(anvildef) anvildef0.description = "Anvil" diff --git a/mods/ITEMS/mcl_banners/depends.txt b/mods/ITEMS/mcl_banners/depends.txt index fea9f0e450..d7ac71050c 100644 --- a/mods/ITEMS/mcl_banners/depends.txt +++ b/mods/ITEMS/mcl_banners/depends.txt @@ -3,3 +3,4 @@ mcl_core? mcl_wool? mcl_cauldrons? doc? +screwdriver? diff --git a/mods/ITEMS/mcl_banners/init.lua b/mods/ITEMS/mcl_banners/init.lua index 91535064a9..672ae28e87 100644 --- a/mods/ITEMS/mcl_banners/init.lua +++ b/mods/ITEMS/mcl_banners/init.lua @@ -96,6 +96,11 @@ local make_banner_texture = function(base_color, layers) end end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + -- Banner nodes. -- These are an invisible nodes which are only used to destroy the banner entity. -- All the important banner information (such as color) is stored in the entity. @@ -147,6 +152,7 @@ minetest.register_node("mcl_banners:hanging_banner", { on_destruct = on_destruct_hanging_banner, _mcl_hardness = 1, _mcl_blast_resistance = 5, + on_rotate = on_rotate, }) for colorid, colortab in pairs(mcl_banners.colors) do diff --git a/mods/ITEMS/mcl_chests/depends.txt b/mods/ITEMS/mcl_chests/depends.txt index 0d2cf39707..cd00aa229c 100644 --- a/mods/ITEMS/mcl_chests/depends.txt +++ b/mods/ITEMS/mcl_chests/depends.txt @@ -4,3 +4,4 @@ mcl_sounds mcl_end mesecons doc? +screwdriver? diff --git a/mods/ITEMS/mcl_chests/init.lua b/mods/ITEMS/mcl_chests/init.lua index 982c6669a4..b9fde03f9a 100644 --- a/mods/ITEMS/mcl_chests/init.lua +++ b/mods/ITEMS/mcl_chests/init.lua @@ -7,6 +7,12 @@ else drop = "mcl_chests:"..drop end +local no_rotate, simple_rotate +if minetest.get_modpath("screwdriver") then + no_rotate = screwdriver.disallow + simple_rotate = screwdriver.rotate_simple +end + minetest.register_node("mcl_chests:"..basename, { description = desc, _doc_items_longdesc = longdesc, @@ -116,6 +122,7 @@ minetest.register_node("mcl_chests:"..basename, { end end, mesecons = mesecons, + on_rotate = simple_rotate, }) minetest.register_node("mcl_chests:"..basename.."_left", { @@ -230,6 +237,7 @@ minetest.register_node("mcl_chests:"..basename.."_left", { end end, mesecons = mesecons, + on_rotate = no_rotate, }) minetest.register_node("mcl_chests:"..basename.."_right", { @@ -345,6 +353,7 @@ minetest.register_node("mcl_chests:"..basename.."_right", { end end, mesecons = mesecons, + on_rotate = no_rotate, }) if minetest.get_modpath("doc") then @@ -546,6 +555,7 @@ minetest.register_node("mcl_chests:ender_chest", { end, _mcl_blast_resistance = 3000, _mcl_hardness = 22.5, + on_rotate = simple_rotate, }) minetest.register_on_joinplayer(function(player) diff --git a/mods/ITEMS/mcl_colorblocks/depends.txt b/mods/ITEMS/mcl_colorblocks/depends.txt index e9446535ec..7f3fdc37e8 100644 --- a/mods/ITEMS/mcl_colorblocks/depends.txt +++ b/mods/ITEMS/mcl_colorblocks/depends.txt @@ -1,3 +1,4 @@ mcl_core mcl_sounds mcl_dye +screwdriver? diff --git a/mods/ITEMS/mcl_colorblocks/init.lua b/mods/ITEMS/mcl_colorblocks/init.lua index a59050376e..57e96e4d7b 100644 --- a/mods/ITEMS/mcl_colorblocks/init.lua +++ b/mods/ITEMS/mcl_colorblocks/init.lua @@ -44,6 +44,10 @@ minetest.register_craft({ cooktime = 10, }) +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple +end for _, row in ipairs(block.dyes) do local name = row[1] @@ -124,6 +128,7 @@ for _, row in ipairs(block.dyes) do sounds = mcl_sounds.node_sound_stone_defaults(), _mcl_blast_resistance = 7, _mcl_hardness = 1.4, + on_rotate = on_rotate, }) -- Crafting recipes diff --git a/mods/ITEMS/mcl_doors/api_trapdoors.lua b/mods/ITEMS/mcl_doors/api_trapdoors.lua index c8fbe4b914..6c3e9bcbc2 100644 --- a/mods/ITEMS/mcl_doors/api_trapdoors.lua +++ b/mods/ITEMS/mcl_doors/api_trapdoors.lua @@ -17,6 +17,11 @@ end ---- Trapdoor ---- +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple +end + function mcl_doors:register_trapdoor(name, def) local groups = table.copy(def.groups) if groups == nil then @@ -123,6 +128,7 @@ function mcl_doors:register_trapdoor(name, def) return minetest.item_place(itemstack, placer, pointed_thing, param2) end, on_rightclick = on_rightclick, + on_rotate = on_rotate, }) -- Open trapdoor @@ -156,6 +162,7 @@ function mcl_doors:register_trapdoor(name, def) punch(pos) end), }}, + on_rotate = on_rotate, }) if minetest.get_modpath("doc") then diff --git a/mods/ITEMS/mcl_doors/depends.txt b/mods/ITEMS/mcl_doors/depends.txt index d66b23e8eb..1e75cae160 100644 --- a/mods/ITEMS/mcl_doors/depends.txt +++ b/mods/ITEMS/mcl_doors/depends.txt @@ -1,3 +1,4 @@ mcl_core mcl_sounds doc? +screwdriver? diff --git a/mods/ITEMS/mcl_fences/depends.txt b/mods/ITEMS/mcl_fences/depends.txt index cbc0405cc0..217875c561 100644 --- a/mods/ITEMS/mcl_fences/depends.txt +++ b/mods/ITEMS/mcl_fences/depends.txt @@ -1,3 +1,4 @@ mcl_core mcl_sounds doc? +screwdriver? diff --git a/mods/ITEMS/mcl_fences/init.lua b/mods/ITEMS/mcl_fences/init.lua index 9b9e1a19f6..7556767f5d 100644 --- a/mods/ITEMS/mcl_fences/init.lua +++ b/mods/ITEMS/mcl_fences/init.lua @@ -111,6 +111,11 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups, meta2:set_int("state", state2) end + local on_rotate + if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple + end + local cgroups = table.copy(groups) if cgroups == nil then cgroups = {} end cgroups.fence_gate = 1 @@ -157,6 +162,7 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups, punch_gate(pos, node) end), }}, + on_rotate = on_rotate, sounds = sounds, _mcl_blast_resistance = blast_resistance, _mcl_hardness = hardness, @@ -215,6 +221,7 @@ mcl_fences.register_fence_gate = function(id, fence_gate_name, texture, groups, punch_gate(pos, node) end), }}, + on_rotate = on_rotate, on_rightclick = function(pos, node, clicker) punch_gate(pos, node) end, diff --git a/mods/ITEMS/mcl_furnaces/depends.txt b/mods/ITEMS/mcl_furnaces/depends.txt index ccdc96050d..441fdfde68 100644 --- a/mods/ITEMS/mcl_furnaces/depends.txt +++ b/mods/ITEMS/mcl_furnaces/depends.txt @@ -4,3 +4,4 @@ mcl_sounds mcl_craftguide mcl_achievements doc? +screwdriver? diff --git a/mods/ITEMS/mcl_furnaces/init.lua b/mods/ITEMS/mcl_furnaces/init.lua index b6481e528a..a519a3d7f1 100644 --- a/mods/ITEMS/mcl_furnaces/init.lua +++ b/mods/ITEMS/mcl_furnaces/init.lua @@ -281,6 +281,11 @@ local function furnace_node_timer(pos, elapsed) return result end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple +end + minetest.register_node("mcl_furnaces:furnace", { description = "Furnace", _doc_items_longdesc = "Furnaces cook or smelt several items, using a furnace fuel, into something else.", @@ -336,6 +341,7 @@ minetest.register_node("mcl_furnaces:furnace", { on_receive_fields = receive_fields, _mcl_blast_resistance = 17.5, _mcl_hardness = 3.5, + on_rotate = on_rotate, }) minetest.register_node("mcl_furnaces:furnace_active", { @@ -378,6 +384,7 @@ minetest.register_node("mcl_furnaces:furnace_active", { on_receive_fields = receive_fields, _mcl_blast_resistance = 17.5, _mcl_hardness = 3.5, + on_rotate = on_rotate, }) minetest.register_craft({ diff --git a/mods/ITEMS/mcl_heads/depends.txt b/mods/ITEMS/mcl_heads/depends.txt index 3d96266de1..976f16ae63 100644 --- a/mods/ITEMS/mcl_heads/depends.txt +++ b/mods/ITEMS/mcl_heads/depends.txt @@ -1 +1,2 @@ mcl_sounds +screwdriver? diff --git a/mods/ITEMS/mcl_heads/init.lua b/mods/ITEMS/mcl_heads/init.lua index 524526b547..88ba0c644d 100644 --- a/mods/ITEMS/mcl_heads/init.lua +++ b/mods/ITEMS/mcl_heads/init.lua @@ -1,6 +1,11 @@ -- Heads system local function addhead(name, texture, desc, longdesc) + local on_rotate + if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple + end + minetest.register_node("mcl_heads:"..name, { description = desc, _doc_items_longdesc = longdesc, @@ -37,6 +42,7 @@ local function addhead(name, texture, desc, longdesc) sounds = mcl_sounds.node_sound_defaults({ footstep = {name="default_hard_footstep", gain=0.3} }), + on_rotate = on_rotate, _mcl_blast_resistance = 5, _mcl_hardness = 1, }) diff --git a/mods/ITEMS/mcl_hoppers/depends.txt b/mods/ITEMS/mcl_hoppers/depends.txt index 22e30070b4..dbefba4386 100644 --- a/mods/ITEMS/mcl_hoppers/depends.txt +++ b/mods/ITEMS/mcl_hoppers/depends.txt @@ -2,3 +2,4 @@ mcl_core mcl_sounds mcl_util doc? +screwdriver? diff --git a/mods/ITEMS/mcl_hoppers/init.lua b/mods/ITEMS/mcl_hoppers/init.lua index 935426399b..fa62f3c5e2 100644 --- a/mods/ITEMS/mcl_hoppers/init.lua +++ b/mods/ITEMS/mcl_hoppers/init.lua @@ -143,6 +143,11 @@ Hoppers interact with containers the following way: _mcl_hardness = 3, }) +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.rotate_simple +end + minetest.register_node("mcl_hoppers:hopper_side", { description = "Hopper (Side)", _doc_items_create_entry = false, @@ -213,6 +218,7 @@ minetest.register_node("mcl_hoppers:hopper_side", { minetest.log("action", player:get_player_name().. " takes stuff from mcl_hoppers at "..minetest.pos_to_string(pos)) end, + on_rotate = on_rotate, sounds = mcl_sounds.node_sound_metal_defaults(), _mcl_blast_resistance = 24, _mcl_hardness = 3, diff --git a/mods/ITEMS/mcl_signs/init.lua b/mods/ITEMS/mcl_signs/init.lua index f35a98d79e..978f73fde4 100644 --- a/mods/ITEMS/mcl_signs/init.lua +++ b/mods/ITEMS/mcl_signs/init.lua @@ -371,6 +371,10 @@ minetest.register_node("mcl_signs:wall_sign", { _mcl_blast_resistance = 5, }) +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end -- Standing sign nodes. -- 4 rotations at 0°, 22.5°, 45° and 67.5°. @@ -400,6 +404,8 @@ local ssign = { on_punch = function(pos, node, puncher) update_sign(pos) end, + + on_rotate = on_rotate, _mcl_hardness = 1, _mcl_blast_resistance = 5, } diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor_stand/depends.txt b/mods/ITEMS/minetest-3d_armor/3d_armor_stand/depends.txt index 6fec7760a4..3998650d38 100644 --- a/mods/ITEMS/minetest-3d_armor/3d_armor_stand/depends.txt +++ b/mods/ITEMS/minetest-3d_armor/3d_armor_stand/depends.txt @@ -3,3 +3,4 @@ mcl_core mcl_sounds mcl_stairs doc_identifier? +screwdriver? diff --git a/mods/ITEMS/minetest-3d_armor/3d_armor_stand/init.lua b/mods/ITEMS/minetest-3d_armor/3d_armor_stand/init.lua index 65407ff4a0..1a25dc6881 100644 --- a/mods/ITEMS/minetest-3d_armor/3d_armor_stand/init.lua +++ b/mods/ITEMS/minetest-3d_armor/3d_armor_stand/init.lua @@ -81,6 +81,11 @@ local drop_armor = function(pos) end end +local on_rotate +if minetest.get_modpath("screwdriver") then + on_rotate = screwdriver.disallow +end + -- FIXME: The armor stand should be an entity minetest.register_node("3d_armor_stand:armor_stand", { description = "Armor Stand", @@ -201,6 +206,7 @@ minetest.register_node("3d_armor_stand:armor_stand", { update_entity(pos) end, pos) end, + on_rotate = on_rotate, }) minetest.register_entity("3d_armor_stand:armor_entity", {