mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-02-23 15:30:22 +01:00
made the pit plasma abm much more selective to reduce cpu load
This commit is contained in:
parent
b4a4d54877
commit
b6ffd7fc97
10
df_underworld_items/dependencies.lua
Normal file
10
df_underworld_items/dependencies.lua
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
df_underworld_items.abm_neighbors = {}
|
||||||
|
|
||||||
|
-- common nodes that can be found next to pit plasma, triggering matter degradation
|
||||||
|
-- don't trigger on air, that's for sparkle generation
|
||||||
|
df_underworld_items.abm_neighbors.pit_plasma = {"group:stone", "df_underworld_items:glow_amethyst", "group:lava", "group:water"}
|
||||||
|
|
||||||
|
-- This stuff should only be used during initialization
|
||||||
|
minetest.after(0, function()
|
||||||
|
df_underworld_items.node_name = nil
|
||||||
|
end)
|
@ -127,6 +127,7 @@ if df_underworld_items.config.destructive_pit_plasma then
|
|||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "glowing pit matter degradation",
|
label = "glowing pit matter degradation",
|
||||||
nodenames = {"group:pit_plasma"},
|
nodenames = {"group:pit_plasma"},
|
||||||
|
neighbors = df_underworld_items.abm_neighbors.pit_plasma,
|
||||||
interval = 2,
|
interval = 2,
|
||||||
chance = 30,
|
chance = 30,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
@ -157,19 +158,18 @@ if df_underworld_items.config.destructive_pit_plasma then
|
|||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
else
|
end
|
||||||
minetest.register_abm({
|
minetest.register_abm({
|
||||||
label = "glowing pit sparkle",
|
label = "glowing pit sparkle",
|
||||||
nodenames = {"group:pit_plasma"},
|
nodenames = {"group:pit_plasma"},
|
||||||
neighbors = {"air"},
|
neighbors = {"air"},
|
||||||
interval = 2,
|
interval = 2,
|
||||||
chance = 30,
|
chance = 30,
|
||||||
catch_up = false,
|
catch_up = false,
|
||||||
action = function(pos)
|
action = function(pos)
|
||||||
local air_pos = minetest.find_node_near(pos, 1, "air")
|
local air_pos = minetest.find_node_near(pos, 1, "air")
|
||||||
if air_pos then
|
if air_pos then
|
||||||
sparkle(air_pos)
|
sparkle(air_pos)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
@ -5,6 +5,7 @@ df_underworld_items.S = minetest.get_translator(modname)
|
|||||||
local modpath = minetest.get_modpath(modname)
|
local modpath = minetest.get_modpath(modname)
|
||||||
|
|
||||||
dofile(modpath.."/config.lua")
|
dofile(modpath.."/config.lua")
|
||||||
|
dofile(modpath.."/dependencies.lua")
|
||||||
dofile(modpath.."/doc.lua")
|
dofile(modpath.."/doc.lua")
|
||||||
|
|
||||||
dofile(modpath.."/crystals_amethyst.lua")
|
dofile(modpath.."/crystals_amethyst.lua")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user