2016-05-17 23:40:05 +03:00
|
|
|
|
2024-08-16 13:05:33 +03:00
|
|
|
local S = minetest.get_translator("ethereal")
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2024-10-07 10:41:26 +03:00
|
|
|
-- Thin Ice
|
|
|
|
|
|
|
|
minetest.register_node("ethereal:thin_ice", {
|
|
|
|
description = S("Thin Ice"),
|
|
|
|
tiles = {"default_ice.png^[opacity:80"},
|
|
|
|
inventory_image = "default_ice.png^[opacity:80",
|
|
|
|
wield_image = "default_ice.png^[opacity:80",
|
|
|
|
use_texture_alpha = "blend",
|
|
|
|
is_ground_content = false,
|
|
|
|
paramtype = "light",
|
|
|
|
drawtype = "nodebox",
|
2024-10-07 14:33:54 +03:00
|
|
|
drop = {},
|
2024-10-07 10:41:26 +03:00
|
|
|
node_box = {
|
|
|
|
type = "fixed", fixed = {{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}},
|
|
|
|
},
|
|
|
|
collision_box = {
|
|
|
|
type = "fixed", fixed = {{-0.5, -0.5, -0.5, 0.5, -0.25, 0.5}},
|
|
|
|
},
|
2024-10-07 14:33:54 +03:00
|
|
|
groups = {cracky = 3, crumbly = 3, cools_lava = 1, slippery = 3},
|
2024-10-07 10:41:26 +03:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
|
|
|
|
on_walk_over = function(pos, node, player)
|
|
|
|
|
|
|
|
if math.random(50) == 13 then -- ice breaks if player unlucky
|
|
|
|
|
|
|
|
minetest.sound_play("default_ice_dug",
|
|
|
|
{pos = pos, gain = 0.5, pitch = 1.4, max_hear_distance = 5}, true)
|
|
|
|
|
|
|
|
minetest.remove_node(pos)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
-- Ice Brick
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_node("ethereal:icebrick", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Ice Brick"),
|
2021-04-02 23:06:43 +03:00
|
|
|
tiles = {"ethereal_brick_ice.png"},
|
2014-11-09 22:17:41 +03:00
|
|
|
paramtype = "light",
|
2015-06-24 12:00:12 +03:00
|
|
|
is_ground_content = false,
|
2024-07-12 15:54:05 +03:00
|
|
|
groups = {cracky = 3, puts_out_fire = 1, cools_lava = 1, slippery = 3},
|
2021-04-02 23:06:43 +03:00
|
|
|
sounds = default.node_sound_glass_defaults()
|
2014-11-09 22:17:41 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2019-08-05 10:57:49 +03:00
|
|
|
output = "ethereal:icebrick 4",
|
2014-11-09 22:17:41 +03:00
|
|
|
recipe = {
|
2019-08-05 10:57:49 +03:00
|
|
|
{"default:ice", "default:ice"},
|
2021-04-02 23:06:43 +03:00
|
|
|
{"default:ice", "default:ice"}
|
2014-11-09 22:17:41 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Snow Brick
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_node("ethereal:snowbrick", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Snow Brick"),
|
2021-04-02 23:06:43 +03:00
|
|
|
tiles = {"ethereal_brick_snow.png"},
|
2014-11-09 22:17:41 +03:00
|
|
|
paramtype = "light",
|
2015-06-24 12:00:12 +03:00
|
|
|
is_ground_content = false,
|
2016-12-06 13:48:31 +03:00
|
|
|
groups = {crumbly = 3, puts_out_fire = 1, cools_lava = 1},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_dirt_defaults({
|
2016-12-01 12:41:23 +03:00
|
|
|
footstep = {name = "default_snow_footstep", gain = 0.15},
|
|
|
|
dug = {name = "default_snow_footstep", gain = 0.2},
|
2021-04-02 23:06:43 +03:00
|
|
|
dig = {name = "default_snow_footstep", gain = 0.2}
|
|
|
|
})
|
2014-11-09 22:17:41 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
2019-08-05 10:57:49 +03:00
|
|
|
output = "ethereal:snowbrick 4",
|
2014-11-09 22:17:41 +03:00
|
|
|
recipe = {
|
2019-08-05 10:57:49 +03:00
|
|
|
{"default:snowblock", "default:snowblock"},
|
2021-04-02 23:06:43 +03:00
|
|
|
{"default:snowblock", "default:snowblock"}
|
2014-11-09 22:17:41 +03:00
|
|
|
}
|
|
|
|
})
|
|
|
|
|
2024-10-07 10:41:26 +03:00
|
|
|
-- If Crystal Spike or Snowblock near Water, change Water to Ice
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_abm({
|
2016-08-19 19:22:09 +03:00
|
|
|
label = "Ethereal freeze water",
|
2015-07-04 14:22:39 +03:00
|
|
|
nodenames = {
|
2024-10-07 10:41:26 +03:00
|
|
|
"ethereal:crystal_spike", "default:snowblock", "ethereal:snowbrick"
|
2015-07-04 14:22:39 +03:00
|
|
|
},
|
2015-07-15 19:32:19 +03:00
|
|
|
neighbors = {"default:water_source", "default:river_water_source"},
|
2014-11-09 22:17:41 +03:00
|
|
|
interval = 15,
|
2015-11-14 13:21:06 +03:00
|
|
|
chance = 4,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
action = function(pos, node)
|
2016-08-19 19:22:09 +03:00
|
|
|
|
|
|
|
local near = minetest.find_node_near(pos, 1,
|
2024-08-16 13:05:33 +03:00
|
|
|
{"default:water_source", "default:river_water_source"})
|
2015-11-17 23:35:10 +03:00
|
|
|
|
2016-08-19 19:22:09 +03:00
|
|
|
if near then
|
|
|
|
minetest.swap_node(near, {name = "default:ice"})
|
2014-11-09 22:17:41 +03:00
|
|
|
end
|
2022-09-30 19:26:44 +03:00
|
|
|
end
|
2014-11-09 22:17:41 +03:00
|
|
|
})
|
|
|
|
|
2018-07-25 22:02:48 +03:00
|
|
|
-- If Heat Source near Ice or Snow then melt.
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_abm({
|
2016-08-19 19:22:09 +03:00
|
|
|
label = "Ethereal melt snow/ice",
|
2015-07-04 14:22:39 +03:00
|
|
|
nodenames = {
|
2024-10-07 10:41:26 +03:00
|
|
|
"default:ice", "default:snowblock", "default:snow", "ethereal:thin_ice",
|
2015-07-04 14:22:39 +03:00
|
|
|
"default:dirt_with_snow", "ethereal:snowbrick", "ethereal:icebrick"
|
|
|
|
},
|
|
|
|
neighbors = {
|
2022-02-10 12:26:33 +03:00
|
|
|
"fire:basic_flame", "default:lava_source", "default:lava_flowing",
|
2018-07-25 22:00:49 +03:00
|
|
|
"default:furnace_active", "default:torch", "default:torch_wall",
|
2024-10-29 16:03:35 +03:00
|
|
|
"default:torch_ceiling", "fire:permanent_flame"
|
2015-07-04 14:22:39 +03:00
|
|
|
},
|
2024-09-26 11:02:13 +03:00
|
|
|
interval = 7,
|
2015-11-14 13:21:06 +03:00
|
|
|
chance = 4,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2015-11-27 12:19:32 +03:00
|
|
|
action = function(pos, node)
|
|
|
|
|
|
|
|
local water_node = "default:water"
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-11-27 12:19:32 +03:00
|
|
|
if pos.y > 2 then
|
|
|
|
water_node = "default:river_water"
|
|
|
|
end
|
|
|
|
|
2015-07-04 14:22:39 +03:00
|
|
|
if node.name == "default:ice"
|
|
|
|
or node.name == "default:snowblock"
|
|
|
|
or node.name == "ethereal:icebrick"
|
|
|
|
or node.name == "ethereal:snowbrick" then
|
2022-09-30 19:26:44 +03:00
|
|
|
minetest.swap_node(pos, {name = water_node .. "_source"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2024-10-07 10:41:26 +03:00
|
|
|
elseif node.name == "default:snow"
|
|
|
|
or node.name == "ethereal:thin_ice" then
|
2022-09-30 19:26:44 +03:00
|
|
|
minetest.swap_node(pos, {name = water_node .. "_flowing"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
elseif node.name == "default:dirt_with_snow" then
|
2016-01-09 15:25:33 +03:00
|
|
|
minetest.swap_node(pos, {name = "default:dirt_with_grass"})
|
2014-11-09 22:17:41 +03:00
|
|
|
end
|
2015-11-27 12:19:32 +03:00
|
|
|
|
2017-01-12 13:44:35 +03:00
|
|
|
ethereal.check_falling(pos)
|
2022-09-30 19:26:44 +03:00
|
|
|
end
|
2014-11-09 22:17:41 +03:00
|
|
|
})
|
|
|
|
|
|
|
|
-- If Water Source near Dry Dirt, change to normal Dirt
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
minetest.register_abm({
|
2016-08-19 19:22:09 +03:00
|
|
|
label = "Ethereal wet dry dirt",
|
2019-10-09 16:40:29 +03:00
|
|
|
nodenames = {
|
|
|
|
"ethereal:dry_dirt", "default:dirt_with_dry_grass",
|
|
|
|
"default:dry_dirt", "default:dry_dirt_with_dry_grass"
|
|
|
|
},
|
2014-11-09 22:17:41 +03:00
|
|
|
neighbors = {"group:water"},
|
|
|
|
interval = 15,
|
2024-09-26 11:02:13 +03:00
|
|
|
chance = 3,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2022-09-30 19:26:44 +03:00
|
|
|
|
2015-11-27 12:19:32 +03:00
|
|
|
action = function(pos, node)
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2024-09-26 11:02:13 +03:00
|
|
|
if node.name == "ethereal:dry_dirt" or node.name == "default:dry_dirt" then
|
2016-01-09 15:25:33 +03:00
|
|
|
minetest.swap_node(pos, {name = "default:dirt"})
|
2022-02-10 12:26:33 +03:00
|
|
|
elseif node.name == "default:dirt_with_dry_grass" then
|
|
|
|
minetest.swap_node(pos, {name = "default:dirt_with_grass"})
|
2015-11-23 12:59:18 +03:00
|
|
|
else
|
2020-04-30 16:07:12 +03:00
|
|
|
minetest.swap_node(pos, {name = "default:dirt_with_dry_grass"})
|
2015-11-23 12:59:18 +03:00
|
|
|
end
|
2022-02-10 12:26:33 +03:00
|
|
|
end
|
2014-11-09 22:17:41 +03:00
|
|
|
})
|
2014-12-29 14:03:11 +03:00
|
|
|
|
2021-04-02 13:08:37 +03:00
|
|
|
-- when enabled, drop torches that are touching water
|
2024-08-16 13:05:33 +03:00
|
|
|
|
2021-04-02 13:08:37 +03:00
|
|
|
if ethereal.torchdrop == true and not minetest.get_modpath("real_torch") then
|
2017-02-28 18:28:36 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
minetest.register_abm({
|
|
|
|
label = "Ethereal drop torch",
|
|
|
|
nodenames = {"default:torch", "default:torch_wall", "default:torch_ceiling"},
|
|
|
|
neighbors = {"group:water"},
|
|
|
|
interval = 5,
|
|
|
|
chance = 1,
|
|
|
|
catch_up = false,
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
action = function(pos, node)
|
2017-03-01 23:28:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
local num = #minetest.find_nodes_in_area(
|
2024-08-16 13:05:33 +03:00
|
|
|
{x = pos.x - 1, y = pos.y, z = pos.z},
|
|
|
|
{x = pos.x + 1, y = pos.y, z = pos.z}, {"group:water"})
|
2017-03-01 23:28:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
if num == 0 then
|
2017-03-01 23:28:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
num = num + #minetest.find_nodes_in_area(
|
2024-08-16 13:05:33 +03:00
|
|
|
{x = pos.x, y = pos.y, z = pos.z - 1},
|
|
|
|
{x = pos.x, y = pos.y, z = pos.z + 1}, {"group:water"})
|
2022-09-30 19:26:44 +03:00
|
|
|
end
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
if num == 0 then
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
num = num + #minetest.find_nodes_in_area(
|
2024-08-16 13:05:33 +03:00
|
|
|
{x = pos.x, y = pos.y + 1, z = pos.z},
|
|
|
|
{x = pos.x, y = pos.y + 1, z = pos.z}, {"group:water"})
|
2022-09-30 19:26:44 +03:00
|
|
|
end
|
2017-03-01 23:28:28 +03:00
|
|
|
|
2022-09-30 19:26:44 +03:00
|
|
|
if num > 0 then
|
|
|
|
|
|
|
|
minetest.set_node(pos, {name = "air"})
|
|
|
|
|
|
|
|
minetest.sound_play("fire_extinguish_flame",
|
|
|
|
{pos = pos, gain = 0.2, max_hear_distance = 10}, true)
|
|
|
|
|
|
|
|
minetest.add_item(pos, {name = "default:torch"})
|
|
|
|
end
|
2015-03-01 14:20:12 +03:00
|
|
|
end
|
2022-09-30 19:26:44 +03:00
|
|
|
})
|
2016-12-01 12:41:23 +03:00
|
|
|
end
|