aboutsummaryrefslogtreecommitdiff
path: root/games/devtest/mods/bucket
diff options
context:
space:
mode:
authorWuzzy <wuzzy2@mail.ru>2020-05-26 00:17:52 +0200
committerGitHub <noreply@github.com>2020-05-26 00:17:52 +0200
commit083b285f4319c470f307f0b52f03a2fb68facd38 (patch)
treebdd02540ad58756a38606f03a995ab837a176709 /games/devtest/mods/bucket
parentb546e8938d41aa9e3101fb9d4d5b02924ed73b60 (diff)
downloadminetest-083b285f4319c470f307f0b52f03a2fb68facd38.tar.gz
minetest-083b285f4319c470f307f0b52f03a2fb68facd38.tar.bz2
minetest-083b285f4319c470f307f0b52f03a2fb68facd38.zip
Rename “Minimal development test” to “Development Test” (#9928)
Diffstat (limited to 'games/devtest/mods/bucket')
-rw-r--r--games/devtest/mods/bucket/init.lua26
-rw-r--r--games/devtest/mods/bucket/mod.conf2
-rw-r--r--games/devtest/mods/bucket/textures/bucket.pngbin0 -> 163 bytes
-rw-r--r--games/devtest/mods/bucket/textures/bucket_lava.pngbin0 -> 168 bytes
-rw-r--r--games/devtest/mods/bucket/textures/bucket_water.pngbin0 -> 168 bytes
5 files changed, 28 insertions, 0 deletions
diff --git a/games/devtest/mods/bucket/init.lua b/games/devtest/mods/bucket/init.lua
new file mode 100644
index 000000000..3189d4aa6
--- /dev/null
+++ b/games/devtest/mods/bucket/init.lua
@@ -0,0 +1,26 @@
+-- Bucket: Punch liquid source or flowing liquid to collect it
+
+minetest.register_tool("bucket:bucket", {
+ description = "Bucket",
+ inventory_image = "bucket.png",
+ stack_max = 1,
+ liquids_pointable = true,
+ groups = { disable_repair = 1 },
+ on_use = function(itemstack, user, pointed_thing)
+ -- Must be pointing to node
+ if pointed_thing.type ~= "node" then
+ return
+ end
+ -- Check if pointing to a liquid
+ local n = minetest.get_node(pointed_thing.under)
+ local def = minetest.registered_nodes[n.name]
+ if def ~= nil and (def.liquidtype == "source" or def.liquidtype == "flowing") then
+ minetest.add_node(pointed_thing.under, {name="air"})
+ local inv = user:get_inventory()
+ if inv then
+ inv:add_item("main", ItemStack(n.name))
+ end
+ end
+ end,
+})
+
diff --git a/games/devtest/mods/bucket/mod.conf b/games/devtest/mods/bucket/mod.conf
new file mode 100644
index 000000000..d14deb4ea
--- /dev/null
+++ b/games/devtest/mods/bucket/mod.conf
@@ -0,0 +1,2 @@
+name = bucket
+description = Minimal bucket to pick up liquids
diff --git a/games/devtest/mods/bucket/textures/bucket.png b/games/devtest/mods/bucket/textures/bucket.png
new file mode 100644
index 000000000..677952875
--- /dev/null
+++ b/games/devtest/mods/bucket/textures/bucket.png
Binary files differ
diff --git a/games/devtest/mods/bucket/textures/bucket_lava.png b/games/devtest/mods/bucket/textures/bucket_lava.png
new file mode 100644
index 000000000..dfcae65fb
--- /dev/null
+++ b/games/devtest/mods/bucket/textures/bucket_lava.png
Binary files differ
diff --git a/games/devtest/mods/bucket/textures/bucket_water.png b/games/devtest/mods/bucket/textures/bucket_water.png
new file mode 100644
index 000000000..e164b0a50
--- /dev/null
+++ b/games/devtest/mods/bucket/textures/bucket_water.png
Binary files differ