Map Tools updates: icons in inventory, code cleanup.

This commit is contained in:
Calinou 2014-05-01 21:35:59 +02:00
parent 9d900c28ed
commit 99d99961cf

197
init.lua
View File

@ -1,3 +1,5 @@
maptools_creative = 1 -- Set this to 0 if you want Map Tools nodes and items to appear in the creative inventory.
-- Load translation library if intllib is installed -- Load translation library if intllib is installed
local S local S
@ -11,19 +13,17 @@ end
dofile(minetest.get_modpath("maptools").."/aliases.lua") dofile(minetest.get_modpath("maptools").."/aliases.lua")
--[[ --[[
**** Map Tools by Calinou
Map Tools Licensed under the zlib license for code and CC BY-SA 3.0 for textures, see LICENSE.txt for info.
by Calinou
Licensed under the zlib/libpng license for code and CC BY-SA for textures, see LICENSE.txt for info.
****
--]] --]]
-- Redefine cloud so that admin pickaxe can mine it -- Redefine cloud so that the admin pickaxe can mine it.
minetest.register_node(":default:cloud", { minetest.register_node(":default:cloud", {
description = S("Cloud"), description = S("Cloud"),
tiles = {"default_cloud.png"}, tiles = {"default_cloud.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
@ -35,33 +35,37 @@ minetest.register_craft({
burntime = 1000000000, burntime = 1000000000,
}) })
-- Blocks -- Nodes
minetest.register_node("maptools:stone", { minetest.register_node("maptools:stone", {
description = S("Unbreakable Stone"), description = S("Unbreakable Stone"),
tiles = {"default_stone.png"}, tiles = {"default_steel_block.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("maptools:tree", { minetest.register_node("maptools:tree", {
description = S("Unbreakable Tree"), description = S("Unbreakable Tree"),
tiles = {"default_tree.png"}, tiles = {"default_tree.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
minetest.register_node("maptools:dirt", { minetest.register_node("maptools:dirt", {
description = S("Unbreakable Dirt"), description = S("Unbreakable Dirt"),
tiles = {"default_dirt.png"}, tiles = {"default_dirt.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_dirt_defaults(), sounds = default.node_sound_dirt_defaults(),
}) })
minetest.register_node("maptools:wood", { minetest.register_node("maptools:wood", {
description = S("Unbreakable Wooden Planks"), description = S("Unbreakable Wooden Planks"),
tiles = {"default_wood.png"}, tiles = {"default_wood.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -71,7 +75,8 @@ minetest.register_node("maptools:glass", {
tiles = {"default_glass.png"}, tiles = {"default_glass.png"},
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_glass_defaults(), sounds = default.node_sound_glass_defaults(),
}) })
@ -80,51 +85,59 @@ minetest.register_node("maptools:leaves", {
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
tiles = {"default_leaves.png"}, tiles = {"default_leaves.png"},
paramtype = "light", paramtype = "light",
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_leaves_defaults(), sounds = default.node_sound_leaves_defaults(),
}) })
minetest.register_node("maptools:sand", { minetest.register_node("maptools:sand", {
description = S("Unbreakable Sand"), description = S("Unbreakable Sand"),
tiles = {"default_sand.png"}, tiles = {"default_sand.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_sand_defaults(), sounds = default.node_sound_sand_defaults(),
}) })
minetest.register_node("maptools:gravel", { minetest.register_node("maptools:gravel", {
description = S("Unbreakable Gravel"), description = S("Unbreakable Gravel"),
tiles = {"default_gravel.png"}, tiles = {"default_gravel.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_gravel_footstep", gain=0.45}, footstep = {name="default_gravel_footstep", gain=0.35},
dug = {name="default_gravel_footstep", gain=0.6},
}), }),
}) })
minetest.register_node("maptools:desert_sand", { minetest.register_node("maptools:desert_sand", {
description = S("Unbreakable Desert Sand"), description = S("Unbreakable Desert Sand"),
tiles = {"default_desert_sand.png"}, tiles = {"default_desert_sand.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_sand_defaults(), sounds = default.node_sound_sand_defaults(),
}) })
minetest.register_node("maptools:sandstone", { minetest.register_node("maptools:sandstone", {
description = S("Unbreakable Sandstone"), description = S("Unbreakable Sandstone"),
tiles = {"default_sandstone.png"}, tiles = {"default_sandstone.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("maptools:desert_stone", { minetest.register_node("maptools:desert_stone", {
description = S("Unbreakable Desert Stone"), description = S("Unbreakable Desert Stone"),
tiles = {"default_desert_stone.png"}, tiles = {"default_desert_stone.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("maptools:grass", { minetest.register_node("maptools:grass", {
description = S("Unbreakable Dirt with Grass"), description = S("Unbreakable Dirt with Grass"),
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
@ -133,7 +146,8 @@ minetest.register_node("maptools:grass", {
minetest.register_node("maptools:fullgrass", { minetest.register_node("maptools:fullgrass", {
description = S("Unbreakable Full Grass"), description = S("Unbreakable Full Grass"),
tiles = {"default_grass.png"}, tiles = {"default_grass.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_dirt_defaults({ sounds = default.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.4}, footstep = {name="default_grass_footstep", gain=0.4},
}), }),
@ -142,52 +156,51 @@ minetest.register_node("maptools:fullgrass", {
minetest.register_node("maptools:cobble", { minetest.register_node("maptools:cobble", {
description = S("Unbreakable Cobblestone"), description = S("Unbreakable Cobblestone"),
tiles = {"default_cobble.png"}, tiles = {"default_cobble.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("maptools:mossycobble", { minetest.register_node("maptools:mossycobble", {
description = S("Unbreakable Mossy Cobblestone"), description = S("Unbreakable Mossy Cobblestone"),
tiles = {"default_mossycobble.png"}, tiles = {"default_mossycobble.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("maptools:brick", { minetest.register_node("maptools:brick", {
description = S("Unbreakable Brick"), description = S("Unbreakable Brick"),
tiles = {"default_brick.png"}, tiles = {"default_brick.png"},
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_stone_defaults(), sounds = default.node_sound_stone_defaults(),
}) })
minetest.register_node("maptools:playerclip", { minetest.register_node("maptools:playerclip", {
description = S("Player Clip"), description = S("Player Clip"),
inventory_image = "default_steel_block.png^dye_green.png",
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
pointable = false, pointable = false,
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
minetest.register_node("maptools:fullclip", { minetest.register_node("maptools:fullclip", {
description = S("Full Clip"), description = S("Full Clip"),
inventory_image = "default_steel_block.png^dye_blue.png",
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
}) groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
minetest.register_node("maptools:playerclip", {
description = S("Player Clip"),
drawtype = "airlike",
paramtype = "light",
pointable = false,
sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1},
}) })
minetest.register_node("maptools:fullclip_face", { minetest.register_node("maptools:fullclip_face", {
description = S("Full Clip Face"), description = S("Full Clip Face"),
inventory_image = "default_steel_block.png^dye_white.png",
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"invisible.png"}, tiles = {"invisible.png"},
paramtype = "light", paramtype = "light",
@ -197,11 +210,13 @@ minetest.register_node("maptools:fullclip_face", {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5},
}, },
groups = {unbreakable=1, not_in_creative_inventory=1, fall_damage_add_percent=-100}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative, fall_damage_add_percent=-100},
}) })
minetest.register_node("maptools:playerclip_bottom", { minetest.register_node("maptools:playerclip_bottom", {
description = S("Player Clip Bottom Face"), description = S("Player Clip Bottom Face"),
inventory_image = "default_steel_block.png^dye_orange.png",
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"invisible.png"}, tiles = {"invisible.png"},
pointable = false, pointable = false,
@ -211,11 +226,13 @@ minetest.register_node("maptools:playerclip_bottom", {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5},
}, },
groups = {unbreakable=1, not_in_creative_inventory=1, fall_damage_add_percent=-100}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative, fall_damage_add_percent=-100},
}) })
minetest.register_node("maptools:playerclip_top", { minetest.register_node("maptools:playerclip_top", {
description = S("Player Clip Top Face"), description = S("Player Clip Top Face"),
inventory_image = "default_steel_block.png^dye_yellow.png",
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"invisible.png"}, tiles = {"invisible.png"},
pointable = false, pointable = false,
@ -225,12 +242,14 @@ minetest.register_node("maptools:playerclip_top", {
type = "fixed", type = "fixed",
fixed = {-0.5, 0.4999, -0.5, 0.5, 0.5, 0.5}, fixed = {-0.5, 0.4999, -0.5, 0.5, 0.5, 0.5},
}, },
groups = {unbreakable=1, not_in_creative_inventory=1, fall_damage_add_percent=-100}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative, fall_damage_add_percent=-100},
}) })
for pusher_num=1,10,1 do for pusher_num=1,10,1 do
minetest.register_node("maptools:pusher_" .. pusher_num, { minetest.register_node("maptools:pusher_" .. pusher_num, {
description = S("Pusher: %s"):format(pusher_num), description = S("Pusher (%s)"):format(pusher_num),
inventory_image = "default_steel_block.png^default_apple.png",
drawtype = "nodebox", drawtype = "nodebox",
tiles = {"invisible.png"}, tiles = {"invisible.png"},
paramtype = "light", paramtype = "light",
@ -240,12 +259,14 @@ minetest.register_node("maptools:pusher_" .. pusher_num, {
type = "fixed", type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5}, fixed = {-0.5, -0.5, -0.5, 0.5, -0.4999, 0.5},
}, },
groups = {unbreakable=1, not_in_creative_inventory=1, fall_damage_add_percent=-100, bouncy=pusher_num*100}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative, fall_damage_add_percent=-100, bouncy=pusher_num*100},
}) })
end end
minetest.register_node("maptools:lightbulb", { minetest.register_node("maptools:lightbulb", {
description = S("Light Bulb"), description = S("Light Bulb"),
inventory_image = "default_steel_block.png^default_mese_crystal_fragment.png",
drawtype = "airlike", drawtype = "airlike",
walkable = false, walkable = false,
pointable = false, pointable = false,
@ -253,30 +274,36 @@ minetest.register_node("maptools:lightbulb", {
paramtype = "light", paramtype = "light",
buildable_to = true, buildable_to = true,
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
minetest.register_node("maptools:nobuild", { minetest.register_node("maptools:nobuild", {
description = S("Build Prevention"), description = S("Build Prevention"),
inventory_image = "default_steel_block.png^bones_bones.png",
drawtype = "airlike", drawtype = "airlike",
walkable = false, walkable = false,
pointable = false, pointable = false,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
minetest.register_node("maptools:nointeract", { minetest.register_node("maptools:nointeract", {
description = S("Interact Prevention"), description = S("Interact Prevention"),
inventory_image = "default_steel_block.png^default_scorched_stuff.png",
drawtype = "airlike", drawtype = "airlike",
walkable = false, walkable = false,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
minetest.register_node("maptools:climb", { minetest.register_node("maptools:climb", {
description = S("Climb Block"), description = S("Climb Block"),
inventory_image = "default_steel_block.png^default_ladder.png",
drawtype = "airlike", drawtype = "airlike",
walkable = false, walkable = false,
climbable = true, climbable = true,
@ -284,31 +311,36 @@ minetest.register_node("maptools:climb", {
buildable_to = true, buildable_to = true,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
for damage_num=1,5,1 do for damage_num=1,5,1 do
minetest.register_node("maptools:damage_" .. damage_num, { minetest.register_node("maptools:damage_" .. damage_num, {
description = S("Damaging Block: %s"):format(damage_num), description = S("Damaging Block (%s)"):format(damage_num),
inventory_image = "default_steel_block.png^farming_cotton_" .. damage_num .. ".png",
drawtype = "airlike", drawtype = "airlike",
walkable = false, walkable = false,
pointable = false, pointable = false,
damage_per_second = damage_num, damage_per_second = damage_num,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
end end
minetest.register_node("maptools:kill", { minetest.register_node("maptools:kill", {
description = S("Kill Block"), description = S("Kill Block"),
inventory_image = "default_steel_block.png^dye_black.png",
drawtype = "airlike", drawtype = "airlike",
walkable = false, walkable = false,
pointable = false, pointable = false,
damage_per_second = 20, damage_per_second = 20,
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
}) })
minetest.register_node("maptools:smoke", { minetest.register_node("maptools:smoke", {
@ -317,7 +349,8 @@ minetest.register_node("maptools:smoke", {
drawtype = "allfaces_optional", drawtype = "allfaces_optional",
walkable = false, walkable = false,
paramtype = "light", paramtype = "light",
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
post_effect_color = {a=127, r=127, g=127, b=127}, post_effect_color = {a=127, r=127, g=127, b=127},
}) })
@ -334,7 +367,8 @@ minetest.register_node("maptools:ladder", {
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
}, },
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sounds = default.node_sound_wood_defaults(), sounds = default.node_sound_wood_defaults(),
}) })
@ -348,8 +382,8 @@ minetest.register_node("maptools:permanent_fire", {
}}, }},
inventory_image = "fire_basic_flame.png", inventory_image = "fire_basic_flame.png",
light_source = 14, light_source = 14,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
drop = '', groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
damage_per_second = 4, damage_per_second = 4,
@ -365,19 +399,20 @@ minetest.register_node("maptools:fake_fire", {
}}, }},
inventory_image = "fire_basic_flame.png", inventory_image = "fire_basic_flame.png",
light_source = 14, light_source = 14,
groups = {unbreakable=1, not_in_creative_inventory=1}, drop = "",
drop = '', groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
}) })
minetest.register_node("maptools:igniter", { minetest.register_node("maptools:igniter", {
drawtype = "airlike", drawtype = "airlike",
inventory_image = "default_steel_block.png^crosshair.png",
description = S("Igniter"), description = S("Igniter"),
paramtype = "light", paramtype = "light",
inventory_image = "fire_basic_flame.png", inventory_image = "fire_basic_flame.png",
groups = {igniter=2, unbreakable=1, not_in_creative_inventory=1}, drop = "",
drop = '', groups = {igniter=2, unbreakable=1, not_in_creative_inventory = maptools_creative},
sunlight_propagates = true, sunlight_propagates = true,
pointable = false, pointable = false,
walkable = false, walkable = false,
@ -388,19 +423,19 @@ minetest.register_node("maptools:igniter", {
minetest.register_craftitem("maptools:copper_coin", { minetest.register_craftitem("maptools:copper_coin", {
description = S("Copper Coin"), description = S("Copper Coin"),
inventory_image = "maptools_copper_coin.png", inventory_image = "maptools_copper_coin.png",
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory = maptools_creative},
}) })
minetest.register_craftitem("maptools:silver_coin", { minetest.register_craftitem("maptools:silver_coin", {
description = S("Silver Coin"), description = S("Silver Coin"),
inventory_image = "maptools_silver_coin.png", inventory_image = "maptools_silver_coin.png",
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory = maptools_creative},
}) })
minetest.register_craftitem("maptools:gold_coin", { minetest.register_craftitem("maptools:gold_coin", {
description = S("Gold Coin"), description = S("Gold Coin"),
inventory_image = "maptools_gold_coin.png", inventory_image = "maptools_gold_coin.png",
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory = maptools_creative},
}) })
minetest.register_craftitem("maptools:infinitefuel", { minetest.register_craftitem("maptools:infinitefuel", {
@ -417,7 +452,7 @@ minetest.register_node("maptools:superapple", {
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
walkable = false, walkable = false,
groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory=1}, groups = {fleshy=3, dig_immediate=3, not_in_creative_inventory = maptools_creative},
on_use = minetest.item_eat(20), on_use = minetest.item_eat(20),
sounds = default.node_sound_defaults(), sounds = default.node_sound_defaults(),
}) })
@ -427,37 +462,37 @@ minetest.register_node("maptools:superapple", {
minetest.register_tool("maptools:pick_admin", { minetest.register_tool("maptools:pick_admin", {
description = S("Admin Pickaxe"), description = S("Admin Pickaxe"),
inventory_image = "maptools_adminpick.png", inventory_image = "maptools_adminpick.png",
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory = maptools_creative},
tool_capabilities = { tool_capabilities = {
full_punch_interval = 0, full_punch_interval = 0,
max_drop_level=3, max_drop_level = 3,
groupcaps= { groupcaps= {
unbreakable={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, unbreakable = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
fleshy = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, fleshy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
choppy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, choppy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
bendy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, bendy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
cracky={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, cracky = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
crumbly={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, crumbly = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
snappy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, snappy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
} }
}, },
}) })
minetest.register_tool("maptools:pick_admin_with_drops", { minetest.register_tool("maptools:pick_admin_with_drops", {
description = S("Admin Pickaxe With Drops"), description = S("Admin Pickaxe with Drops"),
inventory_image = "maptools_adminpick.png", inventory_image = "maptools_adminpick.png",
groups = {not_in_creative_inventory=1}, groups = {not_in_creative_inventory = maptools_creative},
tool_capabilities = { tool_capabilities = {
full_punch_interval = 0, full_punch_interval = 0,
max_drop_level=3, max_drop_level = 3,
groupcaps= { groupcaps= {
unbreakable={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, unbreakable = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
fleshy = {times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, fleshy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
choppy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, choppy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
bendy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, bendy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
cracky={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, cracky = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
crumbly={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, crumbly = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
snappy={times={[1]=0, [2]=0, [3]=0}, uses=0, maxlevel=3}, snappy = {times={[1]=0, [2]=0, [3]=0}, uses = 0, maxlevel = 3},
} }
}, },
}) })
@ -465,7 +500,7 @@ minetest.register_tool("maptools:pick_admin_with_drops", {
minetest.register_on_punchnode(function(pos, node, puncher) minetest.register_on_punchnode(function(pos, node, puncher)
if puncher:get_wielded_item():get_name() == "maptools:pick_admin" if puncher:get_wielded_item():get_name() == "maptools:pick_admin"
and minetest.env: get_node(pos).name ~= "air" then and minetest.env: get_node(pos).name ~= "air" then
minetest.env:remove_node(pos) minetest.env:remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes.
end end
end) end)