1
0
Fork 0

Fix digging behaviour of command blocks

This commit is contained in:
Wuzzy 2017-05-23 23:10:32 +02:00
parent 7b424c5df0
commit 0397a8caaf
1 changed files with 4 additions and 8 deletions

View File

@ -129,10 +129,6 @@ local function commandblock_action_off(pos, node)
end end
end end
local function can_dig(pos, player)
return minetest.setting_getbool("creative_mode")
end
local on_rightclick = function(pos, node, player, itemstack, pointed_thing) local on_rightclick = function(pos, node, player, itemstack, pointed_thing)
-- Only allow access in Creative Mode -- Only allow access in Creative Mode
if not minetest.setting_getbool("creative_mode") then if not minetest.setting_getbool("creative_mode") then
@ -170,13 +166,13 @@ To execute the commands, supply the command block with redstone power once. To e
on_construct = construct, on_construct = construct,
is_ground_content = false, is_ground_content = false,
after_place_node = after_place, after_place_node = after_place,
can_dig = can_dig,
on_rightclick = on_rightclick, on_rightclick = on_rightclick,
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
mesecons = {effector = { mesecons = {effector = {
action_on = commandblock_action_on action_on = commandblock_action_on
}}, }},
mcl_blast_resistance = 18000000, _mcl_blast_resistance = 18000000,
_mcl_hardness = -1,
}) })
minetest.register_node("mesecons_commandblock:commandblock_on", { minetest.register_node("mesecons_commandblock:commandblock_on", {
@ -187,13 +183,13 @@ minetest.register_node("mesecons_commandblock:commandblock_on", {
on_construct = construct, on_construct = construct,
is_ground_content = false, is_ground_content = false,
after_place_node = after_place, after_place_node = after_place,
can_dig = can_dig,
on_rightclick = on_rightclick, on_rightclick = on_rightclick,
sounds = mcl_sounds.node_sound_stone_defaults(), sounds = mcl_sounds.node_sound_stone_defaults(),
mesecons = {effector = { mesecons = {effector = {
action_off = commandblock_action_off action_off = commandblock_action_off
}}, }},
mcl_blast_resistance = 18000000, _mcl_blast_resistance = 18000000,
_mcl_hardness = -1,
}) })
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)