Use _mcl_redstone prefix instead of _redstone
This commit is contained in:
parent
291ade53c5
commit
ab1ed3036a
@ -6,7 +6,7 @@ mcl_buttons = {}
|
||||
function mcl_buttons.push_button(pos, node)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
minetest.set_node(pos, {name="mcl_buttons:button_"..def._mcl_button_basename.."_on", param2=node.param2})
|
||||
minetest.sound_play(def._redstone_push_sound, {pos=pos}, true)
|
||||
minetest.sound_play(def._mcl_redstone_push_sound, {pos=pos}, true)
|
||||
end
|
||||
|
||||
local function on_button_place(itemstack, placer, pointed_thing)
|
||||
@ -104,8 +104,8 @@ function mcl_buttons.register_button(basename, def)
|
||||
_mcl_hardness = 0.5,
|
||||
_mcl_button_basename = basename,
|
||||
_mcl_burntime = burntime,
|
||||
_redstone_push_sound = push_sound or "mesecons_button_push",
|
||||
_redstone = {
|
||||
_mcl_redstone_push_sound = push_sound or "mesecons_button_push",
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node)
|
||||
return true
|
||||
end,
|
||||
@ -144,7 +144,7 @@ function mcl_buttons.register_button(basename, def)
|
||||
groups = table.merge(commdef.groups, {button=2, button_on=1, not_in_creative_inventory=1}),
|
||||
drop = "mcl_buttons:button_"..basename.."_off",
|
||||
_doc_items_create_entry = false,
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return 15, node.param2 == minetest.dir_to_wallmounted(dir)
|
||||
end,
|
||||
|
@ -211,7 +211,7 @@ local commdef = {
|
||||
show_formspec(pos, player)
|
||||
end,
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
@ -161,7 +161,7 @@ for _, mode in pairs{"comp", "sub"} do
|
||||
_redstone_comparator_mode = mode,
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
on_rotate = screwdriver.disallow,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
@ -41,7 +41,7 @@ local commdef = {
|
||||
end,
|
||||
_mcl_blast_resistance = 0.2,
|
||||
_mcl_hardness = 0.2,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -57,7 +57,7 @@ minetest.register_node("mcl_daylight_detector:daylight_detector", table.merge(co
|
||||
_doc_items_longdesc = S("Daylight detectors are redstone components which provide redstone power when they are in sunlight and no power otherwise. They can also be inverted.").."\n"..
|
||||
S("In inverted state, they provide redstone power when they are not in sunlight and no power otherwise."),
|
||||
_doc_items_usagehelp = S("Use the daylight detector to toggle its state."),
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return node.param2, false
|
||||
end,
|
||||
@ -73,7 +73,7 @@ minetest.register_node("mcl_daylight_detector:daylight_detector_inverted", table
|
||||
groups = table.merge(commdef.groups, {not_in_creative_inventory=1}),
|
||||
description=S("Inverted Daylight Sensor"),
|
||||
_doc_items_create_entry = false,
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return 15 - node.param2
|
||||
end,
|
||||
|
@ -239,7 +239,7 @@ local commdef = {
|
||||
on_rotate = screwdriver.rotate_simple,
|
||||
_mcl_blast_resistance = 3.5,
|
||||
_mcl_hardness = 3.5,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
@ -51,7 +51,7 @@ local commdef = {
|
||||
on_rotate = on_rotate,
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -151,7 +151,7 @@ minetest.register_node("mcl_lever:lever_on", table.merge(commdef, {
|
||||
minetest.set_node(pos, {name="mcl_lever:lever_off", param2=node.param2})
|
||||
minetest.sound_play("mesecons_button_push", {pos=pos, max_hear_distance=16, pitch=0.9}, true)
|
||||
end,
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return 15, minetest.facedir_to_dir(node.param2) == dir
|
||||
end,
|
||||
|
@ -168,7 +168,7 @@ minetest.register_node("mcl_noteblock:noteblock", {
|
||||
noteblock_play(pos, node.param2 % 32)
|
||||
end,
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
@ -84,7 +84,7 @@ local commdef = {
|
||||
timer:start(mcl_vars.redstone_tick)
|
||||
end
|
||||
end,
|
||||
_redstone = {},
|
||||
_mcl_redstone = {},
|
||||
}
|
||||
local commdef_off = table.merge(commdef, {
|
||||
groups = table.merge(commdef.groups, {observer=1}),
|
||||
@ -96,7 +96,7 @@ local commdef_off = table.merge(commdef, {
|
||||
local commdef_on = table.merge(commdef, {
|
||||
_doc_items_create_entry = false,
|
||||
groups = table.merge(commdef.groups, {observer=2}),
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
init = function(pos, node)
|
||||
local ndef = minetest.registered_nodes[node.name]
|
||||
return {
|
||||
@ -123,7 +123,7 @@ minetest.register_node("mcl_observers:observer_off", table.merge(commdef_off, {
|
||||
after_place_node = observer_orientate,
|
||||
_observer_on = "mcl_observers:observer_on",
|
||||
_observer_off = "mcl_observers:observer_off",
|
||||
_redstone = table.merge(commdef_off._redstone, {
|
||||
_mcl_redstone = table.merge(commdef_off._mcl_redstone, {
|
||||
connects_to = function(node, dir)
|
||||
local dir2 = -minetest.facedir_to_dir(node.param2)
|
||||
return dir2 == dir
|
||||
@ -140,7 +140,7 @@ minetest.register_node("mcl_observers:observer_on", table.merge(commdef_on, {
|
||||
},
|
||||
_observer_on = "mcl_observers:observer_on",
|
||||
_observer_off = "mcl_observers:observer_off",
|
||||
_redstone = table.merge(commdef_on._redstone, {
|
||||
_mcl_redstone = table.merge(commdef_on._mcl_redstone, {
|
||||
connects_to = function(node, dir)
|
||||
local dir2 = -minetest.facedir_to_dir(node.param2)
|
||||
return dir2 == dir
|
||||
@ -172,7 +172,7 @@ minetest.register_node("mcl_observers:observer_down_on", table.merge(commdef_on,
|
||||
},
|
||||
_observer_on = "mcl_observers:observer_down_on",
|
||||
_observer_off = "mcl_observers:observer_down_off",
|
||||
_redstone = table.merge(commdef_on._redstone, {
|
||||
_mcl_redstone = table.merge(commdef_on._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return dir.y > 0 and 15 or 0
|
||||
end,
|
||||
@ -199,7 +199,7 @@ minetest.register_node("mcl_observers:observer_up_on", table.merge(commdef_on, {
|
||||
},
|
||||
_observer_on = "mcl_observers:observer_up_on",
|
||||
_observer_off = "mcl_observers:observer_up_off",
|
||||
_redstone = table.merge(commdef_on._redstone, {
|
||||
_mcl_redstone = table.merge(commdef_on._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return dir.y < 0 and 15 or 0
|
||||
end,
|
||||
|
@ -165,7 +165,7 @@ function mcl_redstone.register_pressure_plate(basename, description, textures_of
|
||||
_mcl_burntime = burntime,
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node)
|
||||
return true
|
||||
end,
|
||||
@ -187,7 +187,7 @@ function mcl_redstone.register_pressure_plate(basename, description, textures_of
|
||||
tiles = textures_on,
|
||||
description = "",
|
||||
_doc_items_create_entry = false,
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
get_power = function(pos, dir)
|
||||
return dir.y ~= 1 and 15 or 0, dir.y < 0
|
||||
end,
|
||||
|
@ -5,9 +5,9 @@ This mods adds an API for defining custom redstone components.
|
||||
## Example
|
||||
|
||||
Here is an example from the redstone torch. The relevant parts for
|
||||
`mcl_redstone` is in the `_redstone` field. It defines `get_power` to make the
|
||||
torch emit power to all surrounding nodes except the node it is wallmounted on.
|
||||
The node above the torch is strongly powered indicated by the `dir.y > 0`
|
||||
`mcl_redstone` is in the `_mcl_redstone` field. It defines `get_power` to make
|
||||
the torch emit power to all surrounding nodes except the node it is wallmounted
|
||||
on. The node above the torch is strongly powered indicated by the `dir.y > 0`
|
||||
return. It also defines `update` to make the torch turn off if the node it is
|
||||
wallmounted on is powered.
|
||||
|
||||
@ -15,7 +15,7 @@ wallmounted on is powered.
|
||||
minetest.override_item("mcl_redstone_torch:redstone_torch_on", {
|
||||
paramtype2 = "wallmounted",
|
||||
[...]
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -42,7 +42,7 @@ always return `0`).
|
||||
minetest.override_item("mcl_redstone_torch:redstone_torch_off", {
|
||||
paramtype2 = "wallmounted",
|
||||
[...]
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -60,8 +60,8 @@ minetest.override_item("mcl_redstone_torch:redstone_torch_off", {
|
||||
|
||||
## Redstone definition
|
||||
|
||||
The `_redstone` field of node definitions is what defines a node as a redstone
|
||||
component.
|
||||
The `_mcl_redstone` field of node definitions is what defines a node as a
|
||||
redstone component.
|
||||
|
||||
```lua
|
||||
{
|
||||
|
@ -258,8 +258,8 @@ function update_neighbours(pos, oldnode)
|
||||
local node = minetest.get_node(pos)
|
||||
local ndef = minetest.registered_nodes[node.name]
|
||||
local oldndef = oldnode and minetest.registered_nodes[oldnode.name]
|
||||
local get_power = ndef and ndef._redstone and ndef._redstone.get_power
|
||||
local old_get_power = oldndef and oldndef._redstone and oldndef._redstone.get_power
|
||||
local get_power = ndef and ndef._mcl_redstone and ndef._mcl_redstone.get_power
|
||||
local old_get_power = oldndef and oldndef._mcl_redstone and oldndef._mcl_redstone.get_power
|
||||
|
||||
local function update_wire(pos, oldpower, dirs)
|
||||
if oldpower then
|
||||
@ -404,31 +404,31 @@ minetest.register_on_mods_loaded(function()
|
||||
})
|
||||
end
|
||||
|
||||
if ndef._redstone then
|
||||
local init = ndef._redstone.init or ndef._redstone.update
|
||||
get_power_tab[name] = ndef._redstone.get_power
|
||||
if ndef._mcl_redstone then
|
||||
local init = ndef._mcl_redstone.init or ndef._mcl_redstone.update
|
||||
get_power_tab[name] = ndef._mcl_redstone.get_power
|
||||
init_tab[name] = init
|
||||
update_tab[name] = ndef._redstone.update
|
||||
update_tab[name] = ndef._mcl_redstone.update
|
||||
|
||||
local old_construct = ndef.on_construct
|
||||
local old_destruct = ndef.after_destruct
|
||||
minetest.override_item(name, {
|
||||
groups = table.merge(ndef.groups, {
|
||||
redstone_init = init and 1,
|
||||
redstone_get_power = ndef._redstone.get_power and 1,
|
||||
redstone_get_power = ndef._mcl_redstone.get_power and 1,
|
||||
}),
|
||||
on_construct = function(pos)
|
||||
if old_construct then
|
||||
old_construct(pos)
|
||||
end
|
||||
if ndef._redstone.connects_to then
|
||||
if ndef._mcl_redstone.connects_to then
|
||||
mcl_redstone._connect_with_wires(pos)
|
||||
end
|
||||
mcl_redstone._schedule_event(0, -1, pos, function()
|
||||
if init then
|
||||
call_init(pos)
|
||||
end
|
||||
if ndef._redstone.get_power then
|
||||
if ndef._mcl_redstone.get_power then
|
||||
update_neighbours(pos)
|
||||
end
|
||||
end)
|
||||
@ -437,10 +437,10 @@ minetest.register_on_mods_loaded(function()
|
||||
if old_destruct then
|
||||
old_destruct(pos, oldnode)
|
||||
end
|
||||
if ndef._redstone.connects_to then
|
||||
if ndef._mcl_redstone.connects_to then
|
||||
mcl_redstone._connect_with_wires(pos)
|
||||
end
|
||||
if ndef._redstone.get_power then
|
||||
if ndef._mcl_redstone.get_power then
|
||||
update_neighbours(pos, oldnode)
|
||||
end
|
||||
end,
|
||||
|
@ -145,7 +145,7 @@ local function update_wire(pos)
|
||||
local pos2 = pos:add(entry.dir)
|
||||
local node2 = minetest.get_node(pos2)
|
||||
local ndef2 = minetest.registered_nodes[node2.name]
|
||||
local redstone = ndef2._redstone
|
||||
local redstone = ndef2._mcl_redstone
|
||||
local connects_to = redstone and redstone.connects_to
|
||||
|
||||
if connects_to and connects_to(node2, -entry.dir) then
|
||||
|
@ -9,7 +9,7 @@ local commdef = {
|
||||
sounds = mcl_sounds.node_sound_glass_defaults(),
|
||||
_mcl_blast_resistance = 0.3,
|
||||
_mcl_hardness = 0.3,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
@ -39,7 +39,7 @@ end
|
||||
|
||||
for _, name in pairs({ "mcl_redstone_torch:redstone_torch_off", "mcl_redstone_torch:redstone_torch_off_wall" }) do
|
||||
minetest.override_item(name, {
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if mcl_redstone.get_power(pos, minetest.wallmounted_to_dir(node.param2)) == 0 then
|
||||
if handle_burnout(pos) then
|
||||
@ -48,7 +48,7 @@ for _, name in pairs({ "mcl_redstone_torch:redstone_torch_off", "mcl_redstone_to
|
||||
|
||||
local ndef = minetest.registered_nodes[node.name]
|
||||
return {
|
||||
name = ndef._redstone_torch_on,
|
||||
name = ndef._mcl_redstone_torch_on,
|
||||
param2 = node.param2,
|
||||
}
|
||||
end
|
||||
@ -59,7 +59,7 @@ end
|
||||
|
||||
for _, name in pairs({ "mcl_redstone_torch:redstone_torch_on", "mcl_redstone_torch:redstone_torch_on_wall" }) do
|
||||
minetest.override_item(name, {
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -72,7 +72,7 @@ for _, name in pairs({ "mcl_redstone_torch:redstone_torch_on", "mcl_redstone_tor
|
||||
|
||||
local ndef = minetest.registered_nodes[node.name]
|
||||
return {
|
||||
name = ndef._redstone_torch_off,
|
||||
name = ndef._mcl_redstone_torch_off,
|
||||
param2 = node.param2,
|
||||
}
|
||||
end
|
||||
@ -83,8 +83,8 @@ end
|
||||
|
||||
for _, name in pairs({ "mcl_redstone_torch:redstone_torch_on_wall", "mcl_redstone_torch:redstone_torch_off_wall" }) do
|
||||
minetest.override_item(name, {
|
||||
_redstone_torch_on = "mcl_redstone_torch:redstone_torch_on_wall",
|
||||
_redstone_torch_off = "mcl_redstone_torch:redstone_torch_off_wall",
|
||||
_mcl_redstone_torch_on = "mcl_redstone_torch:redstone_torch_on_wall",
|
||||
_mcl_redstone_torch_off = "mcl_redstone_torch:redstone_torch_off_wall",
|
||||
})
|
||||
end
|
||||
|
||||
@ -104,7 +104,7 @@ minetest.register_node("mcl_redstone_torch:redstoneblock", {
|
||||
groups = {pickaxey=1},
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
is_ground_content = false,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
get_power = function()
|
||||
return 15, false
|
||||
end,
|
||||
|
@ -63,7 +63,7 @@ local commdef = {
|
||||
drop = "mcl_repeaters:repeater_off_1",
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
on_rotate = screwdriver.disallow,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
local fourdir = minetest.dir_to_fourdir(dir)
|
||||
return node.param2 % 4 == fourdir or (node.param2 + 2) % 4 == fourdir
|
||||
@ -130,7 +130,7 @@ for delay = 1, 4 do
|
||||
end
|
||||
local ndef = minetest.registered_nodes[node.name]
|
||||
local next_setting = delay % 4 + 1
|
||||
local powered = ndef._redstone and ndef._redstone.get_power and "on" or "off"
|
||||
local powered = ndef._mcl_redstone and ndef._mcl_redstone.get_power and "on" or "off"
|
||||
|
||||
minetest.set_node(pos, {
|
||||
name = "mcl_repeaters:repeater_"..powered.."_"..tostring(next_setting),
|
||||
@ -177,7 +177,7 @@ for delay = 1, 4 do
|
||||
"mesecons_delayer_ends_on.png",
|
||||
},
|
||||
groups = table.merge(normaldef.groups, {redstone_repeater_on = 1, not_in_creative_inventory = 1}),
|
||||
_redstone = table.merge(normaldef._redstone, {
|
||||
_mcl_redstone = table.merge(normaldef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
local fourdir = minetest.dir_to_fourdir(dir)
|
||||
if not fourdir or dir.y ~= 0 then
|
||||
@ -230,7 +230,7 @@ minetest.register_node("mcl_repeaters:repeater_on_locked", table.merge(lockeddef
|
||||
"mesecons_delayer_end_locked_on.png",
|
||||
},
|
||||
groups = table.merge(lockeddef.groups, {redstone_repeater_on = 1}),
|
||||
_redstone = table.merge(lockeddef._redstone, {
|
||||
_mcl_redstone = table.merge(lockeddef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
local fourdir = minetest.dir_to_fourdir(dir)
|
||||
if not fourdir or dir.y ~= 0 then
|
||||
|
@ -17,7 +17,7 @@ local commdef = {
|
||||
}),
|
||||
_mcl_blast_resistance = 0.5,
|
||||
_mcl_hardness = 0.5,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function()
|
||||
return true
|
||||
end,
|
||||
@ -48,7 +48,7 @@ minetest.register_node("mcl_target:target_on", table.merge(commdef, {
|
||||
minetest.set_node(pos, {name="mcl_target:target_off"})
|
||||
end
|
||||
end,
|
||||
_redstone = table.merge(commdef._redstone, {
|
||||
_mcl_redstone = table.merge(commdef._mcl_redstone, {
|
||||
get_power = function(node, dir)
|
||||
return 15, false
|
||||
end,
|
||||
|
@ -178,7 +178,7 @@ local normaldef = table.merge(commdef, {
|
||||
})
|
||||
|
||||
local offdef = {
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
local dir = -minetest.facedir_to_dir(node.param2)
|
||||
if powered_facing_dir(pos, dir) then
|
||||
@ -194,7 +194,7 @@ local ondef = {
|
||||
selection_box = piston_on_box,
|
||||
after_destruct = piston_remove_pusher,
|
||||
on_rotate = false,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
local dir = -minetest.facedir_to_dir(node.param2)
|
||||
if not powered_facing_dir(pos, dir) then
|
||||
@ -217,7 +217,7 @@ local pusherdef = {
|
||||
sounds = mcl_sounds.node_sound_wood_defaults(),
|
||||
_mcl_blast_resistance = 0.5,
|
||||
on_rotate = false,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
-- It is possible for a piston to extend just before server
|
||||
-- shutdown. To avoid circuits stopping because of that we
|
||||
-- update all neighbouring nodes during loading as if a
|
||||
@ -373,7 +373,7 @@ local offupdef = table.merge(offdef, {
|
||||
sounds = mcl_sounds.node_sound_stone_defaults({
|
||||
footstep = mcl_sounds.node_sound_wood_defaults().footstep
|
||||
}),
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if powered_facing_dir(pos, vector.new(0, 1, 0)) then
|
||||
piston_on(pos, node)
|
||||
@ -386,7 +386,7 @@ local onupdef = table.merge(ondef, {
|
||||
node_box = piston_up_on_box,
|
||||
selection_box = piston_up_on_box,
|
||||
sounds = mcl_sounds.node_sound_stone_defaults(),
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if not powered_facing_dir(pos, vector.new(0, 1, 0)) then
|
||||
piston_off(pos, node)
|
||||
@ -531,7 +531,7 @@ local pistonspec_normal_down = {
|
||||
}
|
||||
|
||||
local offdowndef = table.merge(offdef, {
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if powered_facing_dir(pos, vector.new(0, -1, 0)) then
|
||||
piston_on(pos, node)
|
||||
@ -543,7 +543,7 @@ local offdowndef = table.merge(offdef, {
|
||||
local ondowndef = table.merge(ondef, {
|
||||
node_box = piston_down_on_box,
|
||||
selection_box = piston_down_on_box,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if not powered_facing_dir(pos, vector.new(0, -1, 0)) then
|
||||
piston_off(pos, node)
|
||||
|
@ -46,7 +46,7 @@ minetest.register_node("mcl_bells:bell", {
|
||||
_mcl_hardness = 5,
|
||||
on_rightclick = mcl_bells.ring_once,
|
||||
use_texture_alpha = "clip",
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
local oldpowered = node.param2 ~= 0
|
||||
local powered = mcl_redstone.get_power(pos) ~= 0
|
||||
|
@ -584,7 +584,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
|
||||
on_destruct = function(pos)
|
||||
close_forms(canonical_basename, pos)
|
||||
end,
|
||||
_redstone = redstone,
|
||||
_mcl_redstone = redstone,
|
||||
on_rotate = simple_rotate,
|
||||
})
|
||||
|
||||
@ -761,7 +761,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
|
||||
player_chest_open(clicker, pos, left_name, left_textures, node.param2, true, "default_chest",
|
||||
"mcl_chests_chest")
|
||||
end,
|
||||
_redstone = redstone,
|
||||
_mcl_redstone = redstone,
|
||||
on_rotate = no_rotate,
|
||||
})
|
||||
|
||||
@ -930,7 +930,7 @@ local function register_chest(basename, desc, longdesc, usagehelp, tt_help, tile
|
||||
player_chest_open(clicker, pos_other, left_name, left_textures, node.param2, true, "default_chest",
|
||||
"mcl_chests_chest")
|
||||
end,
|
||||
_redstone = redstone,
|
||||
_mcl_redstone = redstone,
|
||||
on_rotate = no_rotate,
|
||||
})
|
||||
|
||||
|
@ -120,7 +120,7 @@ for n, desc in pairs(n_desc) do
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 3,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node)
|
||||
return true
|
||||
end,
|
||||
@ -151,7 +151,7 @@ for n, desc in pairs(n_desc) do
|
||||
sounds = mcl_sounds.node_sound_metal_defaults(),
|
||||
_mcl_blast_resistance = 6,
|
||||
_mcl_hardness = 3,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node)
|
||||
return true
|
||||
end,
|
||||
|
@ -333,7 +333,7 @@ function mcl_doors:register_door(name, def)
|
||||
return true
|
||||
end,
|
||||
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = redstone_connects_to,
|
||||
update = redstone_update_bottom,
|
||||
init = function() end,
|
||||
@ -414,7 +414,7 @@ function mcl_doors:register_door(name, def)
|
||||
return true
|
||||
end,
|
||||
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = redstone_connects_to,
|
||||
update = redstone_update_top,
|
||||
init = function() end,
|
||||
@ -496,7 +496,7 @@ function mcl_doors:register_door(name, def)
|
||||
return true
|
||||
end,
|
||||
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = redstone_connects_to,
|
||||
update = redstone_update_bottom,
|
||||
init = function() end,
|
||||
@ -577,7 +577,7 @@ function mcl_doors:register_door(name, def)
|
||||
return true
|
||||
end,
|
||||
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = redstone_connects_to,
|
||||
update = redstone_update_top,
|
||||
init = function() end,
|
||||
|
@ -144,7 +144,7 @@ function mcl_doors:register_trapdoor(name, def)
|
||||
fixed = {
|
||||
{-8/16, -8/16, -8/16, 8/16, -5/16, 8/16},},
|
||||
},
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if mcl_redstone.get_power(pos) ~= 0 then
|
||||
punch(pos)
|
||||
@ -230,7 +230,7 @@ function mcl_doors:register_trapdoor(name, def)
|
||||
fixed = {-0.5, -0.5, 5/16, 0.5, 0.5, 0.5}
|
||||
},
|
||||
on_rightclick = on_rightclick,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
update = function(pos, node)
|
||||
if mcl_redstone.get_power(pos) == 0 then
|
||||
punch(pos)
|
||||
|
@ -165,7 +165,7 @@ def_hopper_enabled.on_place = function(itemstack, placer, pointed_thing)
|
||||
itemstack:set_name("mcl_hoppers:hopper")
|
||||
return itemstack
|
||||
end
|
||||
def_hopper_enabled._redstone = {
|
||||
def_hopper_enabled._mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -186,7 +186,7 @@ def_hopper_disabled.inventory_image = nil
|
||||
def_hopper_disabled._doc_items_create_entry = false
|
||||
def_hopper_disabled.groups.not_in_creative_inventory = 1
|
||||
def_hopper_disabled.drop = "mcl_hoppers:hopper"
|
||||
def_hopper_disabled._redstone = {
|
||||
def_hopper_disabled._mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -301,7 +301,7 @@ local def_hopper_side = {
|
||||
|
||||
local def_hopper_side_enabled = table.copy(def_hopper_side)
|
||||
def_hopper_side_enabled.description = S("Side Hopper")
|
||||
def_hopper_side_enabled._redstone = {
|
||||
def_hopper_side_enabled._mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
@ -316,7 +316,7 @@ minetest.register_node("mcl_hoppers:hopper_side", def_hopper_side_enabled)
|
||||
|
||||
local def_hopper_side_disabled = table.copy(def_hopper_side)
|
||||
def_hopper_side_disabled.description = S("Disabled Side Hopper")
|
||||
def_hopper_side_disabled._redstone = {
|
||||
def_hopper_side_disabled._mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
@ -63,7 +63,7 @@ rod_def_a.tiles = { "mcl_lightning_rods_rod.png^[brighten" }
|
||||
|
||||
rod_def_a.groups.not_in_creative_inventory = 1
|
||||
|
||||
rod_def_a._redstone = {
|
||||
rod_def_a._mcl_redstone = {
|
||||
get_power = function(node, dir)
|
||||
return 15
|
||||
end,
|
||||
|
@ -97,7 +97,7 @@ minetest.register_node("mcl_tnt:tnt", {
|
||||
tnt.ignite(arrowent._stuckin)
|
||||
end
|
||||
end,
|
||||
_redstone = {
|
||||
_mcl_redstone = {
|
||||
connects_to = function(node, dir)
|
||||
return true
|
||||
end,
|
||||
|
Loading…
x
Reference in New Issue
Block a user