Add basic screwdriver support

Wuzzy 2017-12-05 14:09:39 +01:00
parent 2b9f37b3e8
commit 320567e1f2
33 changed files with 144 additions and 5 deletions

@ -1,3 +1,4 @@
mesecons
mcl_sounds
doc?
screwdriver?

@ -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

@ -8,3 +8,4 @@ mcl_nether
3d_armor_stand
3d_armor
doc?
screwdriver?

@ -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

@ -2,3 +2,4 @@ mcl_init
mesecons
mcl_util
doc?
screwdriver?

@ -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

@ -1,2 +1,3 @@
mesecons
doc?
screwdriver?

@ -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

@ -2,3 +2,4 @@ mesecons
mesecons_mvps
mcl_mobitems
doc?
screwdriver?

@ -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,
})

@ -1,2 +1,3 @@
mcl_core
mcl_sounds
screwdriver?

@ -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({

@ -2,3 +2,4 @@ mcl_sounds
mcl_core
mcl_hunger
mcl_death_messages
screwdriver?

@ -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"

@ -3,3 +3,4 @@ mcl_core?
mcl_wool?
mcl_cauldrons?
doc?
screwdriver?

@ -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

@ -4,3 +4,4 @@ mcl_sounds
mcl_end
mesecons
doc?
screwdriver?

@ -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)

@ -1,3 +1,4 @@
mcl_core
mcl_sounds
mcl_dye
screwdriver?

@ -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

@ -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

@ -1,3 +1,4 @@
mcl_core
mcl_sounds
doc?
screwdriver?

@ -1,3 +1,4 @@
mcl_core
mcl_sounds
doc?
screwdriver?

@ -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,

@ -4,3 +4,4 @@ mcl_sounds
mcl_craftguide
mcl_achievements
doc?
screwdriver?

@ -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({

@ -1 +1,2 @@
mcl_sounds
screwdriver?

@ -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,
})

@ -2,3 +2,4 @@ mcl_core
mcl_sounds
mcl_util
doc?
screwdriver?

@ -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,

@ -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,
}

@ -3,3 +3,4 @@ mcl_core
mcl_sounds
mcl_stairs
doc_identifier?
screwdriver?

@ -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", {