Add diggable controller in MineClone2-derived games

This commit is contained in:
Nils Dagsson Moskopp 2021-08-29 00:35:48 +02:00
parent bcf4633457
commit e0b96e3307
Signed by: erlehmann
GPG Key ID: A3BC671C35191080
1 changed files with 6 additions and 0 deletions

View File

@ -37,6 +37,9 @@ end
dofile(minetest.get_modpath(minetest.get_current_modname()).."/api.lua")
local ctrl_groups = {choppy=2, oddly_breakable_by_hand=2}
if has_mcl then
ctrl_groups = {axey=2, handy=1}
end
local has_worldedit = minetest.global_exists("worldedit")
local is_singleplayer = minetest.is_singleplayer()
local control_textures = {
@ -381,6 +384,9 @@ minetest.register_node("meshnode:controller", {
paramtype2 = "facedir",
tiles = control_textures,
groups = ctrl_groups,
-- _mcl_hardness is needed so that the controller is not
-- diggable without a delay in MineClone2-derived games.
_mcl_hardness = 1,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local inv = meta:get_inventory()