add missing cold_star node and timer function

This commit is contained in:
tenplus1 2024-07-19 15:01:32 +01:00
parent 2fe08e41eb
commit 74440f12cb
2 changed files with 35 additions and 13 deletions

View File

@ -9,9 +9,9 @@ local function nssm_register_noneatcraftitems (name, descr)
}) })
end end
nssm_register_noneatcraftitems ("masticone_core","Masticone Core") nssm_register_noneatcraftitems ("masticone_core", "Masticone Core")
nssm_register_noneatcraftitems ("berinhog_horn","Berinhog Horn") nssm_register_noneatcraftitems ("berinhog_horn", "Berinhog Horn")
nssm_register_noneatcraftitems ("earth_heart","Earth Heart") nssm_register_noneatcraftitems ("earth_heart", "Earth Heart")
minetest.register_craftitem(":nssm:cold_stars", { minetest.register_craftitem(":nssm:cold_stars", {
@ -28,10 +28,11 @@ minetest.register_craftitem(":nssm:cold_stars", {
local dz = math.random(-20, 20) local dz = math.random(-20, 20)
local pos1 = {x = pos1.x + dx, y = pos1.y + dy, z = pos1.z + dz} local pos1 = {x = pos1.x + dx, y = pos1.y + dy, z = pos1.z + dz}
if not minetest.is_protected(pos, "") if not minetest.is_protected(pos1, "")
or not minetest.get_item_group(minetest.get_node(pos).name, "unbreakable") == 1 then or not minetest.get_item_group(
minetest.set_node(pos1, {name = "nssm:cold_star"}) minetest.get_node(pos1).name, "unbreakable") == 1 then
minetest.get_node_timer(pos1):start(400)
minetest.set_node(pos1, {name="nssm:cold_star"})
end end
end end
@ -45,12 +46,34 @@ minetest.register_craftitem(":nssm:cold_stars", {
-- nodes -- nodes
minetest.register_node(":nssm:cold_star", {
drawtype = "plantlike",
tiles = {"cold_star.png"},
light_source = 13,
walkable = false,
paramtype = "light",
pointable = false,
buildable_to = true,
sunlight_propagates = true,
groups = {not_in_creative_inventory = 1},
drop = {},
on_construct = function(pos)
minetest.get_node_timer(pos):start(400)
end,
on_timer = function(pos)
minetest.remove_node(pos)
end,
on_blast = function() end,
})
minetest.register_node(":nssm:crystal_gas", { minetest.register_node(":nssm:crystal_gas", {
description = "Crystal Gas", description = "Crystal Gas",
drawtype = "airlike", drawtype = "airlike",
paramtype = "light", paramtype = "light",
walkable = false, walkable = false,
-- sunlight_propagates = true,
pointable = false, pointable = false,
diggable = false, diggable = false,
buildable_to = true, buildable_to = true,
@ -89,8 +112,8 @@ minetest.register_node(":nssm:mud", {
inventory_image = "mude.png", inventory_image = "mude.png",
tiles = { tiles = {
{ {
name="mud_animated.png", name = "mud_animated.png",
animation={ animation = {
type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 16.0 type = "vertical_frames", aspect_w = 16, aspect_h = 16, length = 16.0
} }
} }
@ -103,7 +126,7 @@ minetest.register_node(":nssm:mud", {
drowning = 0, drowning = 0,
liquid_renewable = false, liquid_renewable = false,
liquidtype = "source", liquidtype = "source",
liquid_range= 0, liquid_range = 0,
liquid_alternative_flowing = "nssm:mud", liquid_alternative_flowing = "nssm:mud",
liquid_alternative_source = "nssm:mud", liquid_alternative_source = "nssm:mud",
liquid_viscosity = 10, liquid_viscosity = 10,
@ -162,7 +185,7 @@ local function nssm_register_egg(name, descr)
local pos1 = minetest.get_pointed_thing_position(pointed_thing, true) local pos1 = minetest.get_pointed_thing_position(pointed_thing, true)
pos1.y=pos1.y + 1.5 pos1.y = pos1.y + 1.5
core.after(0.1, function() core.after(0.1, function()
minetest.add_entity(pos1, "nssm:" .. name) minetest.add_entity(pos1, "nssm:" .. name)
@ -216,4 +239,3 @@ nssm_register_egg("pumpkid", "Pumpkid")
nssm_register_egg("salamander", "Salamander") nssm_register_egg("salamander", "Salamander")
nssm_register_egg("flust", "Flust") nssm_register_egg("flust", "Flust")
nssm_register_egg("pelagia", "Pelagia") nssm_register_egg("pelagia", "Pelagia")

BIN
textures/cold_star.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 798 B