forked from mff/maptools
Log node removals with the Admin Pickaxe, code cleanup, Map Tools nodes and the Admin Pick can aim from far away.
This commit is contained in:
parent
8c8de1893b
commit
617388cd09
70
init.lua
70
init.lua
|
@ -39,6 +39,7 @@ minetest.register_craft({
|
|||
|
||||
minetest.register_node("maptools:stone", {
|
||||
description = S("Unbreakable Stone"),
|
||||
range = 12,
|
||||
tiles = {"default_stone.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -47,6 +48,7 @@ minetest.register_node("maptools:stone", {
|
|||
|
||||
minetest.register_node("maptools:tree", {
|
||||
description = S("Unbreakable Tree"),
|
||||
range = 12,
|
||||
tiles = {"default_tree.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -55,6 +57,7 @@ minetest.register_node("maptools:tree", {
|
|||
|
||||
minetest.register_node("maptools:dirt", {
|
||||
description = S("Unbreakable Dirt"),
|
||||
range = 12,
|
||||
tiles = {"default_dirt.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -63,6 +66,7 @@ minetest.register_node("maptools:dirt", {
|
|||
|
||||
minetest.register_node("maptools:wood", {
|
||||
description = S("Unbreakable Wooden Planks"),
|
||||
range = 12,
|
||||
tiles = {"default_wood.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -71,6 +75,7 @@ minetest.register_node("maptools:wood", {
|
|||
|
||||
minetest.register_node("maptools:glass", {
|
||||
description = S("Unbreakable Glass"),
|
||||
range = 12,
|
||||
drawtype = "glasslike",
|
||||
tiles = {"default_glass.png"},
|
||||
paramtype = "light",
|
||||
|
@ -82,6 +87,7 @@ minetest.register_node("maptools:glass", {
|
|||
|
||||
minetest.register_node("maptools:leaves", {
|
||||
description = S("Unbreakable Leaves"),
|
||||
range = 12,
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"default_leaves.png"},
|
||||
paramtype = "light",
|
||||
|
@ -92,6 +98,7 @@ minetest.register_node("maptools:leaves", {
|
|||
|
||||
minetest.register_node("maptools:sand", {
|
||||
description = S("Unbreakable Sand"),
|
||||
range = 12,
|
||||
tiles = {"default_sand.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -100,6 +107,7 @@ minetest.register_node("maptools:sand", {
|
|||
|
||||
minetest.register_node("maptools:gravel", {
|
||||
description = S("Unbreakable Gravel"),
|
||||
range = 12,
|
||||
tiles = {"default_gravel.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -111,6 +119,7 @@ minetest.register_node("maptools:gravel", {
|
|||
|
||||
minetest.register_node("maptools:desert_sand", {
|
||||
description = S("Unbreakable Desert Sand"),
|
||||
range = 12,
|
||||
tiles = {"default_desert_sand.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -119,6 +128,7 @@ minetest.register_node("maptools:desert_sand", {
|
|||
|
||||
minetest.register_node("maptools:sandstone", {
|
||||
description = S("Unbreakable Sandstone"),
|
||||
range = 12,
|
||||
tiles = {"default_sandstone.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -127,6 +137,7 @@ minetest.register_node("maptools:sandstone", {
|
|||
|
||||
minetest.register_node("maptools:desert_stone", {
|
||||
description = S("Unbreakable Desert Stone"),
|
||||
range = 12,
|
||||
tiles = {"default_desert_stone.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -135,6 +146,7 @@ minetest.register_node("maptools:desert_stone", {
|
|||
|
||||
minetest.register_node("maptools:grass", {
|
||||
description = S("Unbreakable Dirt with Grass"),
|
||||
range = 12,
|
||||
tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -145,6 +157,7 @@ minetest.register_node("maptools:grass", {
|
|||
|
||||
minetest.register_node("maptools:fullgrass", {
|
||||
description = S("Unbreakable Full Grass"),
|
||||
range = 12,
|
||||
tiles = {"default_grass.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -155,6 +168,7 @@ minetest.register_node("maptools:fullgrass", {
|
|||
|
||||
minetest.register_node("maptools:cobble", {
|
||||
description = S("Unbreakable Cobblestone"),
|
||||
range = 12,
|
||||
tiles = {"default_cobble.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -163,6 +177,7 @@ minetest.register_node("maptools:cobble", {
|
|||
|
||||
minetest.register_node("maptools:mossycobble", {
|
||||
description = S("Unbreakable Mossy Cobblestone"),
|
||||
range = 12,
|
||||
tiles = {"default_mossycobble.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -171,6 +186,7 @@ minetest.register_node("maptools:mossycobble", {
|
|||
|
||||
minetest.register_node("maptools:brick", {
|
||||
description = S("Unbreakable Brick"),
|
||||
range = 12,
|
||||
tiles = {"default_brick.png"},
|
||||
drop = "",
|
||||
groups = {unbreakable=1, not_in_creative_inventory = maptools_creative},
|
||||
|
@ -179,6 +195,7 @@ minetest.register_node("maptools:brick", {
|
|||
|
||||
minetest.register_node("maptools:playerclip", {
|
||||
description = S("Player Clip"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^dye_green.png",
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
|
@ -190,6 +207,7 @@ minetest.register_node("maptools:playerclip", {
|
|||
|
||||
minetest.register_node("maptools:fullclip", {
|
||||
description = S("Full Clip"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^dye_blue.png",
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
|
@ -200,6 +218,7 @@ minetest.register_node("maptools:fullclip", {
|
|||
|
||||
minetest.register_node("maptools:fullclip_face", {
|
||||
description = S("Full Clip Face"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^dye_white.png",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"invisible.png"},
|
||||
|
@ -216,6 +235,7 @@ minetest.register_node("maptools:fullclip_face", {
|
|||
|
||||
minetest.register_node("maptools:playerclip_bottom", {
|
||||
description = S("Player Clip Bottom Face"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^dye_orange.png",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"invisible.png"},
|
||||
|
@ -232,6 +252,7 @@ minetest.register_node("maptools:playerclip_bottom", {
|
|||
|
||||
minetest.register_node("maptools:playerclip_top", {
|
||||
description = S("Player Clip Top Face"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^dye_yellow.png",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"invisible.png"},
|
||||
|
@ -249,6 +270,7 @@ minetest.register_node("maptools:playerclip_top", {
|
|||
for pusher_num=1,10,1 do
|
||||
minetest.register_node("maptools:pusher_" .. pusher_num, {
|
||||
description = S("Pusher (%s)"):format(pusher_num),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^default_apple.png",
|
||||
drawtype = "nodebox",
|
||||
tiles = {"invisible.png"},
|
||||
|
@ -266,6 +288,7 @@ end
|
|||
|
||||
minetest.register_node("maptools:lightbulb", {
|
||||
description = S("Light Bulb"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^default_mese_crystal_fragment.png",
|
||||
drawtype = "airlike",
|
||||
walkable = false,
|
||||
|
@ -280,6 +303,7 @@ minetest.register_node("maptools:lightbulb", {
|
|||
|
||||
minetest.register_node("maptools:nobuild", {
|
||||
description = S("Build Prevention"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^bones_bones.png",
|
||||
drawtype = "airlike",
|
||||
walkable = false,
|
||||
|
@ -292,6 +316,7 @@ minetest.register_node("maptools:nobuild", {
|
|||
|
||||
minetest.register_node("maptools:nointeract", {
|
||||
description = S("Interact Prevention"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^default_scorched_stuff.png",
|
||||
drawtype = "airlike",
|
||||
walkable = false,
|
||||
|
@ -303,6 +328,7 @@ minetest.register_node("maptools:nointeract", {
|
|||
|
||||
minetest.register_node("maptools:climb", {
|
||||
description = S("Climb Block"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^default_ladder.png",
|
||||
drawtype = "airlike",
|
||||
walkable = false,
|
||||
|
@ -318,6 +344,7 @@ minetest.register_node("maptools:climb", {
|
|||
for damage_num=1,5,1 do
|
||||
minetest.register_node("maptools:damage_" .. damage_num, {
|
||||
description = S("Damaging Block (%s)"):format(damage_num),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^farming_cotton_" .. damage_num .. ".png",
|
||||
drawtype = "airlike",
|
||||
walkable = false,
|
||||
|
@ -332,6 +359,7 @@ end
|
|||
|
||||
minetest.register_node("maptools:kill", {
|
||||
description = S("Kill Block"),
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^dye_black.png",
|
||||
drawtype = "airlike",
|
||||
walkable = false,
|
||||
|
@ -345,6 +373,7 @@ minetest.register_node("maptools:kill", {
|
|||
|
||||
minetest.register_node("maptools:smoke", {
|
||||
description = S("Smoke Block"),
|
||||
range = 12,
|
||||
tiles = {"maptools_smoke.png"},
|
||||
drawtype = "allfaces_optional",
|
||||
walkable = false,
|
||||
|
@ -356,6 +385,7 @@ minetest.register_node("maptools:smoke", {
|
|||
|
||||
minetest.register_node("maptools:ladder", {
|
||||
description = S("Fake Ladder"),
|
||||
range = 12,
|
||||
drawtype = "signlike",
|
||||
tiles = {"default_ladder.png"},
|
||||
inventory_image = "default_ladder.png",
|
||||
|
@ -374,6 +404,7 @@ minetest.register_node("maptools:ladder", {
|
|||
|
||||
minetest.register_node("maptools:permanent_fire", {
|
||||
description = S("Permanent Fire"),
|
||||
range = 12,
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {{
|
||||
|
@ -391,6 +422,7 @@ minetest.register_node("maptools:permanent_fire", {
|
|||
|
||||
minetest.register_node("maptools:fake_fire", {
|
||||
description = S("Fake Fire"),
|
||||
range = 12,
|
||||
drawtype = "plantlike",
|
||||
paramtype = "light",
|
||||
tiles = {{
|
||||
|
@ -407,6 +439,7 @@ minetest.register_node("maptools:fake_fire", {
|
|||
|
||||
minetest.register_node("maptools:igniter", {
|
||||
drawtype = "airlike",
|
||||
range = 12,
|
||||
inventory_image = "default_steel_block.png^crosshair.png",
|
||||
description = S("Igniter"),
|
||||
paramtype = "light",
|
||||
|
@ -461,45 +494,48 @@ minetest.register_node("maptools:superapple", {
|
|||
|
||||
minetest.register_tool("maptools:pick_admin", {
|
||||
description = S("Admin Pickaxe"),
|
||||
range = 12,
|
||||
inventory_image = "maptools_adminpick.png",
|
||||
groups = {not_in_creative_inventory = maptools_creative},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0,
|
||||
full_punch_interval = 0.1,
|
||||
max_drop_level = 3,
|
||||
groupcaps= {
|
||||
unbreakable = {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},
|
||||
bendy = {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},
|
||||
snappy = {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},
|
||||
choppy = {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},
|
||||
crumbly = {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", {
|
||||
description = S("Admin Pickaxe with Drops"),
|
||||
range = 12,
|
||||
inventory_image = "maptools_adminpick.png",
|
||||
groups = {not_in_creative_inventory = maptools_creative},
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0,
|
||||
full_punch_interval = 0.1,
|
||||
max_drop_level = 3,
|
||||
groupcaps= {
|
||||
unbreakable = {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},
|
||||
bendy = {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},
|
||||
snappy = {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},
|
||||
choppy = {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},
|
||||
crumbly = {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_on_punchnode(function(pos, node, puncher)
|
||||
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.log("action", minetest.env:get_node(pos).name .. " was removed using an Admin Pickaxe.")
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user