summaryrefslogtreecommitdiff
path: root/maptools/tools.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 20:02:19 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 21:09:33 -0400
commitda66780a569712c23ae4f2996cfb4608a9f9d69d (patch)
tree217556029a78bc23ad4564720afc86de97228a04 /maptools/tools.lua
parent615b22df4d423aded3613db7716943a2f389b047 (diff)
downloaddreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.gz
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.bz2
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.xz
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.zip
copy all standard Dreambuilder mods in from the old subgame
(exactly as last supplied there, updates to these mods will follow later)
Diffstat (limited to 'maptools/tools.lua')
-rw-r--r--maptools/tools.lua61
1 files changed, 61 insertions, 0 deletions
diff --git a/maptools/tools.lua b/maptools/tools.lua
new file mode 100644
index 0000000..6ce8b6c
--- /dev/null
+++ b/maptools/tools.lua
@@ -0,0 +1,61 @@
+--[[
+Map Tools: tool definitions
+
+Copyright (c) 2012-2015 Calinou and contributors.
+Licensed under the zlib license. See LICENSE.md for more information.
+--]]
+
+local S = maptools.intllib
+
+maptools.creative = maptools.config["hide_from_creative_inventory"]
+
+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.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},
+ },
+ damage_groups = {fleshy = 1000},
+ },
+})
+
+minetest.register_tool("maptools:pick_admin_with_drops", {
+ description = S("Admin Pickaxe with Drops"),
+ range = 12,
+ inventory_image = "maptools_adminpick_with_drops.png",
+ groups = {not_in_creative_inventory = maptools.creative},
+ tool_capabilities = {
+ full_punch_interval = 0.35,
+ 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},
+ },
+ damage_groups = {fleshy = 1000},
+ },
+})
+
+minetest.register_on_punchnode(function(pos, node, puncher)
+ if puncher:get_wielded_item():get_name() == "maptools: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.")
+ minetest.remove_node(pos) -- The node is removed directly, which means it even works on non-empty containers and group-less nodes.
+ nodeupdate(pos) -- Run node update actions like falling nodes.
+ end
+end)