--[[ Copyright © 2012-2020 Hugo Locurcio and contributors. Copyright © 2024 Runxi Yu Licensed under the zlib license. See LICENSE.md for more information. --]] rxmin = {} local modpath = minetest.get_modpath("rxmin") local S = minetest.get_translator("rxmin") rxmin.drop_msg = function(itemstack, player) local name = player:get_player_name() minetest.chat_send_player(name, S("[rxmin] tools/nodes do not drop!")) end local pick_admin_toolcaps = { full_punch_interval = 0.1, max_drop_level = 3, groupcaps = { unbreakable = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, fleshy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, choppy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, bendy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, cracky = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, crumbly = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, snappy = {times = {[1] = 0, [2] = 0, [3] = 0}, uses = 0, maxlevel = 5}, }, damage_groups = {fleshy = 1000}, } minetest.register_tool("rxmin:pick_admin", { description = S("Admin Pickaxe"), range = 20, inventory_image = "rxmin_adminpick.png", groups = {not_in_creative_inventory = 0}, tool_capabilities = pick_admin_toolcaps, on_drop = rxmin.drop_msg, }) minetest.register_tool("rxmin:pick_admin_with_drops", { description = S("Admin Pickaxe with Drops"), range = 20, inventory_image = "rxmin_adminpick_with_drops.png", groups = {not_in_creative_inventory = 0}, tool_capabilities = pick_admin_toolcaps, on_drop = rxmin.drop_msg, }) minetest.register_on_punchnode(function(pos, node, puncher) if puncher:get_wielded_item():get_name() == "rxmin:pick_admin" and minetest.get_node(pos).name ~= "air" then minetest.log( "action", puncher:get_player_name() .. " digs " .. minetest.get_node(pos).name .. " at " .. minetest.pos_to_string(pos) .. " using an Admin Pickaxe." ) -- The node is removed directly, which means it even works -- on non-empty containers and group-less nodes minetest.remove_node(pos) -- Run node update actions like falling nodes minetest.check_for_falling(pos) end end) minetest.register_alias("adminpick", "rxmin:pick_admin") minetest.register_alias("adminpickdrops", "rxmin:pick_admin_with_drops") function node_sound_stone_defaults(tbl) tbl = tbl or {} tbl.footstep = tbl.footstep or {name = "default_hard_footstep", gain = 0.2} tbl.dug = tbl.dug or {name = "default_hard_footstep", gain = 1.0} tbl.place = tbl.place or {name = "default_place_node_hard", gain = 1.0} return tbl end minetest.register_node(":default:mese", { description = S("Mese Block"), tiles = {"default_mese_block.png"}, paramtype = "light", groups = {cracky = 1, level = 2}, sounds = node_sound_stone_defaults(), light_source = 3, }) minetest.register_alias("mesecons_gamecompat:mese", "default:mese")