Merge pull request 'add mycelium townaura particles' (#2946) from mycelium_aura_particle into master

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/2946
Reviewed-by: cora <cora@noreply.git.minetest.land>
This commit is contained in:
cora 2022-11-14 01:48:08 +00:00
commit c21527d207
2 changed files with 39 additions and 1 deletions

View File

@ -434,7 +434,7 @@ minetest.register_node("mcl_core:mycelium", {
tiles = {"mcl_core_mycelium_top.png", "default_dirt.png", {name="mcl_core_mycelium_side.png", tileable_vertical=false}},
is_ground_content = true,
stack_max = 64,
groups = { handy = 1, shovely = 1, dirt = 2, spreading_dirt_type = 1, enderman_takable = 1, building_block = 1, soil_sapling = 2, path_creation_possible=1},
groups = { handy = 1, shovely = 1, dirt = 2, spreading_dirt_type = 1, enderman_takable = 1, building_block = 1, soil_sapling = 2, path_creation_possible=1, mycelium=1},
drop = "mcl_core:dirt",
sounds = mcl_sounds.node_sound_dirt_defaults({
footstep = {name="default_grass_footstep", gain=0.1},
@ -448,6 +448,44 @@ minetest.register_node("mcl_core:mycelium", {
})
mcl_core.register_snowed_node("mcl_core:mycelium_snow", "mcl_core:mycelium", nil, nil, false, S("Mycelium with Snow"))
local PARTICLE_ABM_DISTANCE = 16
--if minetest.settings:get("mcl_node_particles") == "full" then
minetest.register_abm({
label = "Townaura particles",
nodenames = {"group:mycelium"},
interval = 2,
chance = 30,
action = function(pos, node)
local player_near = false
for _,player in pairs(minetest.get_connected_players()) do
if vector.distance(player:get_pos(), pos) < PARTICLE_ABM_DISTANCE then
player_near = true
end
end
if player_near then
local apos = {x=pos.x-2, y=pos.y+0.51, z=pos.z-2}
local apos2 = {x=pos.x+2, y=pos.y+0.51, z=pos.z+2}
local acc = { x = 0, y = 0, z = 0 }
minetest.add_particlespawner({
time = 2,
amount = 5,
minpos = apos,
maxpos = apos2,
minvel = vector.new(-3/10, 0, -3/10),
maxvel = vector.new(3/10, 10/60, 3/10),
minacc = acc,
expirationtime = 4,
collisiondetection = true,
collision_removal = true,
size = 1,
texture = "mcl_core_mycelium_particle.png",
})
end
end,
})
--end
minetest.register_node("mcl_core:podzol", {
description = S("Podzol"),
_doc_items_longdesc = S("Podzol is a type of dirt found in taiga forests. Only a few plants are able to survive on it."),

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB