diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2015-05-09 23:15:54 -0700 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2015-05-09 23:15:54 -0700 |
commit | c210807fe440522bd2d368e22db26ecd8686aaf3 (patch) | |
tree | 7b18e6b3ec8aed4652d400f6db556372725a99ea | |
parent | 6c32b3c6c1e41f010d560617eed31075a92370d3 (diff) |
Add particles showing plants being watered.
Supposed to be a visual reinforcement that water actually
made it to the plant. The particles are drops of water
that fall down from the plant that was watered.
-rw-r--r-- | init.lua | 22 | ||||
-rw-r--r-- | textures/crops_watering.png | bin | 0 -> 117 bytes |
2 files changed, 21 insertions, 1 deletions
@@ -163,7 +163,7 @@ crops.particles = function(pos, flag) texture = "crops_wither.png", vertical = true, } - else + elseif flag == 1 then -- soak (1) p = { amount = 8 * crops.settings.interval, @@ -182,6 +182,24 @@ crops.particles = function(pos, flag) texture = "crops_soak.png", vertical = false, } + else -- watering (2) + p = { + amount = 30, + time = 3, + minpos = { x = pos.x - 0.4, y = pos.y - 0.4, z = pos.z - 0.4 }, + maxpos = { x = pos.x + 0.4, y = pos.y + 0.4, z = pos.z + 0.4 }, + minvel = { x = 0, y = 0.0, z = 0 }, + maxvel = { x = 0, y = 0.0, z = 0 }, + minacc = { x = 0, y = -9.81, z = 0 }, + maxacc = { x = 0, y = -9.81, z = 0 }, + minexptime = 2, + maxexptime = 2, + minsize = 1, + maxsize = 3, + collisiondetection = false, + texture = "crops_watering.png", + vertical = true, + } end minetest.add_particlespawner(p) end @@ -196,6 +214,7 @@ minetest.register_tool("crops:watering_can", { tool_capabilities = {}, on_use = function(itemstack, user, pointed_thing) local pos = pointed_thing.under + local ppos = pos if pos == nil then return itemstack end @@ -222,6 +241,7 @@ minetest.register_tool("crops:watering_can", { if wear == 65534 then return itemstack end + crops.particles(ppos, 2) water = math.min(water + crops.settings.watercan, crops.settings.watercan_max) meta:set_int("crops_water", water) diff --git a/textures/crops_watering.png b/textures/crops_watering.png Binary files differnew file mode 100644 index 0000000..a63053e --- /dev/null +++ b/textures/crops_watering.png |