From 75cfe51b5493b3b7ae680482f54f55aa37eb4e01 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 22 May 2017 22:43:25 +0200 Subject: [PATCH] Move bubble particle spawner to playerplus --- mods/PLAYER/mcl_player/depends.txt | 1 - mods/PLAYER/mcl_player/init.lua | 27 --------------------------- mods/PLAYER/playerplus/depends.txt | 1 + mods/PLAYER/playerplus/init.lua | 21 +++++++++++++++++++++ 4 files changed, 22 insertions(+), 28 deletions(-) delete mode 100644 mods/PLAYER/mcl_player/depends.txt diff --git a/mods/PLAYER/mcl_player/depends.txt b/mods/PLAYER/mcl_player/depends.txt deleted file mode 100644 index 746a634e05..0000000000 --- a/mods/PLAYER/mcl_player/depends.txt +++ /dev/null @@ -1 +0,0 @@ -mcl_particles diff --git a/mods/PLAYER/mcl_player/init.lua b/mods/PLAYER/mcl_player/init.lua index 567216cb70..d4373f3214 100644 --- a/mods/PLAYER/mcl_player/init.lua +++ b/mods/PLAYER/mcl_player/init.lua @@ -202,33 +202,6 @@ minetest.register_globalstep(function(dtime) player_set_animation(player, "stand", animation_speed_mod) end - -- Spawn bubble particles when underwater - - local pos = player:getpos() - local head_pos = { - x = math.floor(pos.x+0.5), - y = math.ceil(pos.y+1.0), - z = math.floor(pos.z+0.5) - } - - if minetest.get_item_group(minetest.get_node(head_pos).name, "water") ~= 0 then - minetest.add_particlespawner({ - amount = 2, - time = 0.15, - minpos = { x = -0.25, y = 0.3, z = -0.25 }, - maxpos = { x = 0.25, y = 0.7, z = 0.75 }, - attached = player, - minvel = {x = -0.2, y = 0, z = -0.2}, - maxvel = {x = 0.5, y = 0, z = 0.5}, - minacc = {x = -0.4, y = 4, z = -0.4}, - maxacc = {x = 0.5, y = 1, z = 0.5}, - minexptime = 0.3, - maxexptime = 0.8, - minsize = 0.7, - maxsize = 2.4, - texture = "mcl_particles_bubble.png" - }) - end end end end) diff --git a/mods/PLAYER/playerplus/depends.txt b/mods/PLAYER/playerplus/depends.txt index 5ba88b430c..d76b6ecef9 100644 --- a/mods/PLAYER/playerplus/depends.txt +++ b/mods/PLAYER/playerplus/depends.txt @@ -1,5 +1,6 @@ mcl_init mcl_util mcl_core +mcl_particles mcl_hunger 3d_armor? diff --git a/mods/PLAYER/playerplus/init.lua b/mods/PLAYER/playerplus/init.lua index 6bf43da2a4..48ad8fd379 100644 --- a/mods/PLAYER/playerplus/init.lua +++ b/mods/PLAYER/playerplus/init.lua @@ -139,6 +139,27 @@ minetest.register_globalstep(function(dtime) end end + -- Spawn bubble particles when underwater + + if minetest.get_item_group(playerplus[name].nod_head, "water") ~= 0 then + minetest.add_particlespawner({ + amount = 10, + time = 0.15, + minpos = { x = -0.25, y = 0.3, z = -0.25 }, + maxpos = { x = 0.25, y = 0.7, z = 0.75 }, + attached = player, + minvel = {x = -0.2, y = 0, z = -0.2}, + maxvel = {x = 0.5, y = 0, z = 0.5}, + minacc = {x = -0.4, y = 4, z = -0.4}, + maxacc = {x = 0.5, y = 1, z = 0.5}, + minexptime = 0.3, + maxexptime = 0.8, + minsize = 0.7, + maxsize = 2.4, + texture = "mcl_particles_bubble.png" + }) + end + -- Show positions of barriers when player is wielding a barrier if player:get_wielded_item():get_name() == "mcl_core:barrier" then local pos = vector.round(player:getpos())