init.lua 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817
  1. -- default support (for use with MineClone2 and other [games]
  2. default = default or {
  3. node_sound_stone_defaults = function(table) end,
  4. node_sound_wood_defaults = function(table) end,
  5. gui_bg = "",
  6. gui_bg_img = "",
  7. gui_slots = ""
  8. }
  9. -- Load support for intllib.
  10. local MP = minetest.get_modpath(minetest.get_current_modname())
  11. local F = minetest.formspec_escape
  12. local S = minetest.get_translator and minetest.get_translator("protector") or
  13. dofile(MP .. "/intllib.lua")
  14. -- Load support for factions
  15. local factions_available = minetest.global_exists("factions")
  16. protector = {
  17. mod = "redo",
  18. modpath = MP,
  19. intllib = S
  20. }
  21. local protector_max_share_count = 12
  22. -- get minetest.conf settings
  23. local protector_radius = tonumber(minetest.settings:get("protector_radius")) or 5
  24. local protector_flip = minetest.settings:get_bool("protector_flip") or false
  25. local protector_hurt = tonumber(minetest.settings:get("protector_hurt")) or 0
  26. local protector_spawn = tonumber(minetest.settings:get("protector_spawn")
  27. or minetest.settings:get("protector_pvp_spawn")) or 0
  28. local protector_show = tonumber(minetest.settings:get("protector_show_interval")) or 5
  29. local protector_recipe = minetest.settings:get_bool("protector_recipe") ~= false
  30. local protector_msg = minetest.settings:get_bool("protector_msg") ~= false
  31. -- radius limiter (minetest cannot handle node volume of more than 4096000)
  32. if protector_radius > 22 then protector_radius = 22 end
  33. -- get static spawn position
  34. local statspawn = minetest.string_to_pos(minetest.settings:get("static_spawnpoint"))
  35. or {x = 0, y = 2, z = 0}
  36. -- return list of members as a table
  37. local get_member_list = function(meta)
  38. return meta:get_string("members"):split(" ")
  39. end
  40. -- write member list table in protector meta as string
  41. local set_member_list = function(meta, list)
  42. meta:set_string("members", table.concat(list, " "))
  43. end
  44. -- check for owner name
  45. local is_owner = function(meta, name)
  46. return name == meta:get_string("owner")
  47. end
  48. -- check for member name
  49. local is_member = function(meta, name)
  50. if factions_available
  51. and meta:get_int("faction_members") == 1 then
  52. if factions.version == nil then
  53. -- backward compatibility
  54. if factions.get_player_faction(name) ~= nil
  55. and factions.get_player_faction(meta:get_string("owner")) ==
  56. factions.get_player_faction(name) then
  57. return true
  58. end
  59. else
  60. -- is member if player and owner share at least one faction
  61. local owner_factions = factions.get_player_factions(name)
  62. local owner = meta:get_string("owner")
  63. if owner_factions ~= nil and owner_factions ~= false then
  64. for _, f in ipairs(owner_factions) do
  65. if factions.player_is_in_faction(f, owner) then
  66. return true
  67. end
  68. end
  69. end
  70. end
  71. end
  72. for _, n in pairs(get_member_list(meta)) do
  73. if n == name then
  74. return true
  75. end
  76. end
  77. return false
  78. end
  79. -- add player name to table as member
  80. local add_member = function(meta, name)
  81. -- Validate player name for MT compliance
  82. if name ~= string.match(name, "[%w_-]+") then
  83. return
  84. end
  85. -- Constant (20) defined by player.h
  86. if name:len() > 25 then
  87. return
  88. end
  89. -- does name already exist?
  90. if is_owner(meta, name)
  91. or is_member(meta, name) then
  92. return
  93. end
  94. local list = get_member_list(meta)
  95. if #list >= protector_max_share_count then
  96. return
  97. end
  98. table.insert(list, name)
  99. set_member_list(meta, list)
  100. end
  101. -- remove player name from table
  102. local del_member = function(meta, name)
  103. local list = get_member_list(meta)
  104. for i, n in pairs(list) do
  105. if n == name then
  106. table.remove(list, i)
  107. break
  108. end
  109. end
  110. set_member_list(meta, list)
  111. end
  112. -- protector interface
  113. local protector_formspec = function(meta)
  114. local formspec = "size[8,7]"
  115. .. default.gui_bg
  116. .. default.gui_bg_img
  117. .. "label[2.5,0;" .. F(S("-- Protector interface --")) .. "]"
  118. .. "label[0,1;" .. F(S("PUNCH node to show protected area")) .. "]"
  119. .. "label[0,2;" .. F(S("Members:")) .. "]"
  120. .. "button_exit[2.5,6.2;3,0.5;close_me;" .. F(S("Close")) .. "]"
  121. .. "field_close_on_enter[protector_add_member;false]"
  122. local members = get_member_list(meta)
  123. local npp = protector_max_share_count -- max users added to protector list
  124. local i = 0
  125. local checkbox_faction = false
  126. -- Display the checkbox only if the owner is member of at least 1 faction
  127. if factions_available then
  128. if factions.version == nil then
  129. -- backward compatibility
  130. if factions.get_player_faction(meta:get_string("owner")) then
  131. checkbox_faction = true
  132. end
  133. else
  134. local player_factions = factions.get_player_factions(meta:get_string("owner"))
  135. if player_factions ~= nil and #player_factions >= 1 then
  136. checkbox_faction = true
  137. end
  138. end
  139. end
  140. if checkbox_faction then
  141. formspec = formspec .. "checkbox[0,5;faction_members;"
  142. .. F(S("Allow faction access"))
  143. .. ";" .. (meta:get_int("faction_members") == 1 and
  144. "true" or "false") .. "]"
  145. if npp > 8 then
  146. npp = 8
  147. end
  148. end
  149. for n = 1, #members do
  150. if i < npp then
  151. -- show username
  152. formspec = formspec .. "button[" .. (i % 4 * 2)
  153. .. "," .. math.floor(i / 4 + 3)
  154. .. ";1.5,.5;protector_member;" .. F(members[n]) .. "]"
  155. -- username remove button
  156. .. "button[" .. (i % 4 * 2 + 1.25) .. ","
  157. .. math.floor(i / 4 + 3)
  158. .. ";.75,.5;protector_del_member_" .. F(members[n]) .. ";X]"
  159. end
  160. i = i + 1
  161. end
  162. if i < npp then
  163. -- user name entry field
  164. formspec = formspec .. "field[" .. (i % 4 * 2 + 1 / 3) .. ","
  165. .. (math.floor(i / 4 + 3) + 1 / 3)
  166. .. ";1.433,.5;protector_add_member;;]"
  167. -- username add button
  168. .."button[" .. (i % 4 * 2 + 1.25) .. ","
  169. .. math.floor(i / 4 + 3) .. ";.75,.5;protector_submit;+]"
  170. end
  171. return formspec
  172. end
  173. -- check if pos is inside a protected spawn area
  174. local inside_spawn = function(pos, radius)
  175. if protector_spawn <= 0 then
  176. return false
  177. end
  178. if pos.x < statspawn.x + radius
  179. and pos.x > statspawn.x - radius
  180. and pos.y < statspawn.y + radius
  181. and pos.y > statspawn.y - radius
  182. and pos.z < statspawn.z + radius
  183. and pos.z > statspawn.z - radius then
  184. return true
  185. end
  186. return false
  187. end
  188. -- show protection message if enabled
  189. local show_msg = function(player, msg)
  190. -- if messages disabled or no player name provided
  191. if protector_msg == false or not player or player == "" then
  192. return
  193. end
  194. minetest.chat_send_player(player, msg)
  195. end
  196. -- Infolevel:
  197. -- 0 for no info
  198. -- 1 for "This area is owned by <owner> !" if you can't dig
  199. -- 2 for "This area is owned by <owner>.
  200. -- 3 for checking protector overlaps
  201. protector.can_dig = function(r, pos, digger, onlyowner, infolevel)
  202. if not digger or not pos then
  203. return false
  204. end
  205. -- protector_bypass privileged users can override protection
  206. if infolevel == 1
  207. and minetest.check_player_privs(digger, {protection_bypass = true}) then
  208. return true
  209. end
  210. -- infolevel 3 is only used to bypass priv check, change to 1 now
  211. if infolevel == 3 then infolevel = 1 end
  212. -- is spawn area protected ?
  213. if inside_spawn(pos, protector_spawn) then
  214. show_msg(digger,
  215. S("Spawn @1 has been protected up to a @2 block radius.",
  216. minetest.pos_to_string(statspawn), protector_spawn))
  217. return false
  218. end
  219. -- find the protector nodes
  220. local pos = minetest.find_nodes_in_area(
  221. {x = pos.x - r, y = pos.y - r, z = pos.z - r},
  222. {x = pos.x + r, y = pos.y + r, z = pos.z + r},
  223. {"protector:protect", "protector:protect2", "protector:protect_hidden"})
  224. local meta, owner, members
  225. for n = 1, #pos do
  226. meta = minetest.get_meta(pos[n])
  227. owner = meta:get_string("owner") or ""
  228. members = meta:get_string("members") or ""
  229. -- node change and digger isn't owner
  230. if infolevel == 1 and owner ~= digger then
  231. -- and you aren't on the member list
  232. if onlyowner or not is_member(meta, digger) then
  233. show_msg(digger,
  234. S("This area is owned by @1", owner) .. "!")
  235. return false
  236. end
  237. end
  238. -- when using protector as tool, show protector information
  239. if infolevel == 2 then
  240. minetest.chat_send_player(digger,
  241. S("This area is owned by @1", owner) .. ".")
  242. minetest.chat_send_player(digger,
  243. S("Protection located at: @1", minetest.pos_to_string(pos[n])))
  244. if members ~= "" then
  245. minetest.chat_send_player(digger, S("Members: @1.", members))
  246. end
  247. return false
  248. end
  249. end
  250. -- show when you can build on unprotected area
  251. if infolevel == 2 then
  252. if #pos < 1 then
  253. minetest.chat_send_player(digger, S("This area is not protected."))
  254. end
  255. minetest.chat_send_player(digger, S("You can build here."))
  256. end
  257. return true
  258. end
  259. -- add protector hurt and flip to protection violation function
  260. minetest.register_on_protection_violation(function(pos, name)
  261. local player = minetest.get_player_by_name(name)
  262. if player and player:is_player() then
  263. -- hurt player if protection violated
  264. if protector_hurt > 0 and player:get_hp() > 0 then
  265. -- This delay fixes item duplication bug (thanks luk3yx)
  266. minetest.after(0.1, function(player)
  267. player:set_hp(player:get_hp() - protector_hurt)
  268. end, player)
  269. end
  270. -- flip player when protection violated
  271. if protector_flip then
  272. -- yaw + 180°
  273. local yaw = player:get_look_horizontal() + math.pi
  274. if yaw > 2 * math.pi then
  275. yaw = yaw - 2 * math.pi
  276. end
  277. player:set_look_horizontal(yaw)
  278. -- invert pitch
  279. player:set_look_vertical(-player:get_look_vertical())
  280. -- if digging below player, move up to avoid falling through hole
  281. local pla_pos = player:get_pos()
  282. if pos.y < pla_pos.y then
  283. player:set_pos({
  284. x = pla_pos.x,
  285. y = pla_pos.y + 0.8,
  286. z = pla_pos.z
  287. })
  288. end
  289. end
  290. end
  291. end)
  292. local old_is_protected = minetest.is_protected
  293. -- check for protected area, return true if protected and digger isn't on list
  294. function minetest.is_protected(pos, digger)
  295. digger = digger or "" -- nil check
  296. -- is area protected against digger?
  297. if not protector.can_dig(protector_radius, pos, digger, false, 1) then
  298. return true
  299. end
  300. -- otherwise can dig or place
  301. return old_is_protected(pos, digger)
  302. end
  303. -- make sure protection block doesn't overlap another protector's area
  304. local check_overlap = function(itemstack, placer, pointed_thing)
  305. if pointed_thing.type ~= "node" then
  306. return itemstack
  307. end
  308. local pos = pointed_thing.above
  309. local name = placer:get_player_name()
  310. -- make sure protector doesn't overlap onto protected spawn area
  311. if inside_spawn(pos, protector_spawn + protector_radius) then
  312. minetest.chat_send_player(name,
  313. S("Spawn @1 has been protected up to a @2 block radius.",
  314. minetest.pos_to_string(statspawn), protector_spawn))
  315. return itemstack
  316. end
  317. -- make sure protector doesn't overlap any other player's area
  318. if not protector.can_dig(protector_radius * 2, pos, name, true, 3) then
  319. minetest.chat_send_player(name,
  320. S("Overlaps into above players protected area"))
  321. return itemstack
  322. end
  323. return minetest.item_place(itemstack, placer, pointed_thing)
  324. end
  325. -- remove protector display entities
  326. local del_display = function(pos)
  327. local objects = minetest.get_objects_inside_radius(pos, 0.5)
  328. for _, v in ipairs(objects) do
  329. if v and v:get_luaentity()
  330. and v:get_luaentity().name == "protector:display" then
  331. v:remove()
  332. end
  333. end
  334. end
  335. -- temporary pos store
  336. local player_pos = {}
  337. -- protection node
  338. minetest.register_node("protector:protect", {
  339. description = S("Protection Block") .. " (" .. S("USE for area check") .. ")",
  340. drawtype = "nodebox",
  341. tiles = {
  342. "default_stone.png^protector_overlay.png",
  343. "default_stone.png^protector_overlay.png",
  344. "default_stone.png^protector_overlay.png^protector_logo.png"
  345. },
  346. sounds = default.node_sound_stone_defaults(),
  347. groups = {dig_immediate = 2, unbreakable = 1},
  348. is_ground_content = false,
  349. paramtype = "light",
  350. light_source = 4,
  351. node_box = {
  352. type = "fixed",
  353. fixed = {
  354. {-0.5 ,-0.5, -0.5, 0.5, 0.5, 0.5}
  355. }
  356. },
  357. on_place = check_overlap,
  358. after_place_node = function(pos, placer)
  359. local meta = minetest.get_meta(pos)
  360. meta:set_string("owner", placer:get_player_name() or "")
  361. meta:set_string("members", "")
  362. meta:set_string("infotext",
  363. S("Protection (owned by @1)", meta:get_string("owner")))
  364. end,
  365. on_use = function(itemstack, user, pointed_thing)
  366. if pointed_thing.type ~= "node" then
  367. return
  368. end
  369. protector.can_dig(protector_radius, pointed_thing.under,
  370. user:get_player_name(), false, 2)
  371. end,
  372. on_rightclick = function(pos, node, clicker, itemstack)
  373. local meta = minetest.get_meta(pos)
  374. local name = clicker:get_player_name()
  375. if meta
  376. and protector.can_dig(1, pos, name, true, 1) then
  377. player_pos[name] = pos
  378. minetest.show_formspec(name, "protector:node", protector_formspec(meta))
  379. end
  380. end,
  381. on_punch = function(pos, node, puncher)
  382. if minetest.is_protected(pos, puncher:get_player_name()) then
  383. return
  384. end
  385. minetest.add_entity(pos, "protector:display")
  386. end,
  387. can_dig = function(pos, player)
  388. return player and protector.can_dig(1, pos, player:get_player_name(), true, 1)
  389. end,
  390. on_blast = function() end,
  391. after_destruct = del_display
  392. })
  393. -- default recipe and alternative for MineClone2
  394. if protector_recipe then
  395. if minetest.registered_items["default:stone"] then
  396. minetest.register_craft({
  397. output = "protector:protect",
  398. recipe = {
  399. {"default:stone", "default:stone", "default:stone"},
  400. {"default:stone", "default:gold_ingot", "default:stone"},
  401. {"default:stone", "default:stone", "default:stone"}
  402. }
  403. })
  404. else
  405. minetest.register_craft({
  406. output = "protector:protect",
  407. recipe = {
  408. {"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"},
  409. {"mcl_core:stone", "mcl_core:gold_ingot", "mcl_core:stone"},
  410. {"mcl_core:stone", "mcl_core:stone", "mcl_core:stone"}
  411. }
  412. })
  413. end
  414. end
  415. -- protection logo
  416. minetest.register_node("protector:protect2", {
  417. description = S("Protection Logo") .. " (" .. S("USE for area check") .. ")",
  418. tiles = {"protector_logo.png"},
  419. wield_image = "protector_logo.png",
  420. inventory_image = "protector_logo.png",
  421. sounds = default.node_sound_stone_defaults(),
  422. groups = {dig_immediate = 2, unbreakable = 1},
  423. use_texture_alpha = "clip",
  424. paramtype = "light",
  425. paramtype2 = "wallmounted",
  426. legacy_wallmounted = true,
  427. light_source = 4,
  428. drawtype = "nodebox",
  429. sunlight_propagates = true,
  430. walkable = true,
  431. node_box = {
  432. type = "wallmounted",
  433. wall_top = {-0.375, 0.4375, -0.5, 0.375, 0.5, 0.5},
  434. wall_bottom = {-0.375, -0.5, -0.5, 0.375, -0.4375, 0.5},
  435. wall_side = {-0.5, -0.5, -0.375, -0.4375, 0.5, 0.375}
  436. },
  437. selection_box = {type = "wallmounted"},
  438. on_place = check_overlap,
  439. after_place_node = function(pos, placer)
  440. local meta = minetest.get_meta(pos)
  441. meta:set_string("owner", placer:get_player_name() or "")
  442. meta:set_string("members", "")
  443. meta:set_string("infotext",
  444. S("Protection (owned by @1)", meta:get_string("owner")))
  445. end,
  446. on_use = function(itemstack, user, pointed_thing)
  447. if pointed_thing.type ~= "node" then
  448. return
  449. end
  450. protector.can_dig(protector_radius, pointed_thing.under,
  451. user:get_player_name(), false, 2)
  452. end,
  453. on_rightclick = function(pos, node, clicker, itemstack)
  454. local meta = minetest.get_meta(pos)
  455. local name = clicker:get_player_name()
  456. if meta
  457. and protector.can_dig(1, pos, name, true, 1) then
  458. player_pos[name] = pos
  459. minetest.show_formspec(name, "protector:node", protector_formspec(meta))
  460. end
  461. end,
  462. on_punch = function(pos, node, puncher)
  463. if minetest.is_protected(pos, puncher:get_player_name()) then
  464. return
  465. end
  466. minetest.add_entity(pos, "protector:display")
  467. end,
  468. can_dig = function(pos, player)
  469. return player and protector.can_dig(1, pos, player:get_player_name(), true, 1)
  470. end,
  471. on_blast = function() end,
  472. after_destruct = del_display
  473. })
  474. -- recipes to switch between protectors
  475. minetest.register_craft({
  476. output = "protector:protect",
  477. recipe = {{"protector:protect2"}}
  478. })
  479. minetest.register_craft({
  480. output = "protector:protect2",
  481. recipe = {{"protector:protect"}}
  482. })
  483. -- check formspec buttons or when name entered
  484. minetest.register_on_player_receive_fields(function(player, formname, fields)
  485. if formname ~= "protector:node" then
  486. return
  487. end
  488. local name = player:get_player_name()
  489. local pos = player_pos[name]
  490. if not name or not pos then
  491. return
  492. end
  493. local add_member_input = fields.protector_add_member
  494. -- reset formspec until close button pressed
  495. if (fields.close_me or fields.quit)
  496. and (not add_member_input or add_member_input == "") then
  497. player_pos[name] = nil
  498. return
  499. end
  500. -- only owner can add names
  501. if not protector.can_dig(1, pos, player:get_player_name(), true, 1) then
  502. return
  503. end
  504. -- are we adding member to a protection node ? (csm protection)
  505. local nod = minetest.get_node(pos).name
  506. if nod ~= "protector:protect"
  507. and nod ~= "protector:protect2" then
  508. player_pos[name] = nil
  509. return
  510. end
  511. local meta = minetest.get_meta(pos)
  512. if not meta then
  513. return
  514. end
  515. -- add faction members
  516. if factions_available and fields.faction_members ~= nil then
  517. meta:set_int("faction_members", fields.faction_members == "true" and 1 or 0)
  518. end
  519. -- add member [+]
  520. if add_member_input then
  521. for _, i in pairs(add_member_input:split(" ")) do
  522. add_member(meta, i)
  523. end
  524. end
  525. -- remove member [x]
  526. for field, value in pairs(fields) do
  527. if string.sub(field, 0,
  528. string.len("protector_del_member_")) == "protector_del_member_" then
  529. del_member(meta,
  530. string.sub(field,string.len("protector_del_member_") + 1))
  531. end
  532. end
  533. minetest.show_formspec(name, formname, protector_formspec(meta))
  534. end)
  535. -- display entity shown when protector node is punched
  536. minetest.register_entity("protector:display", {
  537. physical = false,
  538. collisionbox = {0, 0, 0, 0, 0, 0},
  539. visual = "wielditem",
  540. -- wielditem seems to be scaled to 1.5 times original node size
  541. visual_size = {x = 0.67, y = 0.67},
  542. textures = {"protector:display_node"},
  543. timer = 0,
  544. glow = 10,
  545. on_step = function(self, dtime)
  546. self.timer = self.timer + dtime
  547. -- remove after set number of seconds
  548. if self.timer > protector_show then
  549. self.object:remove()
  550. end
  551. end
  552. })
  553. -- Display-zone node, Do NOT place the display as a node,
  554. -- it is made to be used as an entity (see above)
  555. local x = protector_radius
  556. minetest.register_node("protector:display_node", {
  557. tiles = {"protector_display.png"},
  558. use_texture_alpha = "clip",
  559. walkable = false,
  560. drawtype = "nodebox",
  561. node_box = {
  562. type = "fixed",
  563. fixed = {
  564. -- sides
  565. {-(x+.55), -(x+.55), -(x+.55), -(x+.45), (x+.55), (x+.55)},
  566. {-(x+.55), -(x+.55), (x+.45), (x+.55), (x+.55), (x+.55)},
  567. {(x+.45), -(x+.55), -(x+.55), (x+.55), (x+.55), (x+.55)},
  568. {-(x+.55), -(x+.55), -(x+.55), (x+.55), (x+.55), -(x+.45)},
  569. -- top
  570. {-(x+.55), (x+.45), -(x+.55), (x+.55), (x+.55), (x+.55)},
  571. -- bottom
  572. {-(x+.55), -(x+.55), -(x+.55), (x+.55), -(x+.45), (x+.55)},
  573. -- middle (surround protector)
  574. {-.55,-.55,-.55, .55,.55,.55}
  575. }
  576. },
  577. selection_box = {
  578. type = "regular",
  579. },
  580. paramtype = "light",
  581. groups = {dig_immediate = 3, not_in_creative_inventory = 1},
  582. drop = ""
  583. })
  584. dofile(MP .. "/doors_chest.lua")
  585. dofile(MP .. "/pvp.lua")
  586. dofile(MP .. "/admin.lua")
  587. dofile(MP .. "/tool.lua")
  588. dofile(MP .. "/hud.lua")
  589. dofile(MP .. "/lucky_block.lua")
  590. -- stop mesecon pistons from pushing protectors
  591. if minetest.get_modpath("mesecons_mvps") then
  592. mesecon.register_mvps_stopper("protector:protect")
  593. mesecon.register_mvps_stopper("protector:protect2")
  594. mesecon.register_mvps_stopper("protector:chest")
  595. end
  596. print ("[MOD] Protector Redo loaded")