2016-05-17 23:40:05 +03:00
|
|
|
|
2016-06-09 17:08:34 +03:00
|
|
|
local S = ethereal.intllib
|
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
-- Ice Brick
|
|
|
|
minetest.register_node("ethereal:icebrick", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Ice Brick"),
|
2014-11-09 22:17:41 +03:00
|
|
|
tiles = {"brick_ice.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
freezemelt = "default:water_source",
|
2015-06-24 12:00:12 +03:00
|
|
|
is_ground_content = false,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {cracky = 3, melts = 1},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_glass_defaults(),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'ethereal:icebrick 4',
|
|
|
|
recipe = {
|
|
|
|
{'default:ice', 'default:ice'},
|
|
|
|
{'default:ice', 'default:ice'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- Snow Brick
|
|
|
|
minetest.register_node("ethereal:snowbrick", {
|
2016-06-09 17:08:34 +03:00
|
|
|
description = S("Snow Brick"),
|
2014-11-09 22:17:41 +03:00
|
|
|
tiles = {"brick_snow.png"},
|
|
|
|
paramtype = "light",
|
|
|
|
freezemelt = "default:water_source",
|
2015-06-24 12:00:12 +03:00
|
|
|
is_ground_content = false,
|
2015-07-04 14:22:39 +03:00
|
|
|
groups = {crumbly = 3, melts = 1},
|
2014-11-09 22:17:41 +03:00
|
|
|
sounds = default.node_sound_dirt_defaults({
|
2015-07-04 14:22:39 +03:00
|
|
|
footstep = {name="default_snow_footstep", gain = 0.25},
|
|
|
|
dug = {name="default_snow_footstep", gain = 0.75},
|
2014-11-09 22:17:41 +03:00
|
|
|
}),
|
|
|
|
})
|
|
|
|
|
|
|
|
minetest.register_craft({
|
|
|
|
output = 'ethereal:snowbrick 4',
|
|
|
|
recipe = {
|
|
|
|
{'default:snowblock', 'default:snowblock'},
|
|
|
|
{'default:snowblock', 'default:snowblock'},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
-- If Crystal Spike, Crystal Dirt, Snow near Water, change Water to Ice
|
|
|
|
minetest.register_abm({
|
2015-07-04 14:22:39 +03:00
|
|
|
nodenames = {
|
|
|
|
"ethereal:crystal_spike", "default:snow", "default:snowblock",
|
|
|
|
"ethereal:snowbrick"
|
|
|
|
},
|
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,
|
2014-11-09 22:17:41 +03:00
|
|
|
action = function(pos, node)
|
2015-11-16 00:17:28 +03:00
|
|
|
local water = minetest.find_nodes_in_area_under_air(
|
2015-07-04 14:22:39 +03:00
|
|
|
{x = pos.x - 1, y = pos.y - 1, z = pos.z - 1},
|
|
|
|
{x = pos.x + 1, y = pos.y + 1, z = pos.z + 1},
|
2015-07-15 19:32:19 +03:00
|
|
|
{"default:water_source", "default:river_water_source"})
|
2015-11-17 23:35:10 +03:00
|
|
|
|
|
|
|
if water and #water > 0 then
|
2016-01-09 15:25:33 +03:00
|
|
|
minetest.swap_node(water[1], {name = "default:ice"})
|
2014-11-09 22:17:41 +03:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
-- If Heat Source near Ice or Snow then melt
|
|
|
|
minetest.register_abm({
|
2015-07-04 14:22:39 +03:00
|
|
|
nodenames = {
|
|
|
|
"default:ice", "default:snowblock", "default:snow",
|
|
|
|
"default:dirt_with_snow", "ethereal:snowbrick", "ethereal:icebrick"
|
|
|
|
},
|
|
|
|
neighbors = {
|
|
|
|
"fire:basic_fire", "default:lava_source", "default:lava_flowing",
|
|
|
|
"default:furnace_active", "default:torch"
|
|
|
|
},
|
2015-04-11 12:26:30 +03:00
|
|
|
interval = 5,
|
2015-11-14 13:21:06 +03:00
|
|
|
chance = 4,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
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
|
2016-01-09 15:25:33 +03:00
|
|
|
minetest.swap_node(pos, {name = water_node.."_source"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-04-11 12:26:30 +03:00
|
|
|
elseif node.name == "default:snow" then
|
2016-01-09 15:25:33 +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
|
|
|
|
2014-11-09 22:17:41 +03:00
|
|
|
nodeupdate(pos)
|
|
|
|
end,
|
|
|
|
})
|
|
|
|
|
|
|
|
-- If Water Source near Dry Dirt, change to normal Dirt
|
|
|
|
minetest.register_abm({
|
2015-11-23 12:59:18 +03:00
|
|
|
nodenames = {"ethereal:dry_dirt", "default:dirt_with_dry_grass"},
|
2014-11-09 22:17:41 +03:00
|
|
|
neighbors = {"group:water"},
|
|
|
|
interval = 15,
|
|
|
|
chance = 2,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2015-11-27 12:19:32 +03:00
|
|
|
action = function(pos, node)
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-11-23 12:59:18 +03:00
|
|
|
if node == "ethereal:dry_dirt" then
|
2016-01-09 15:25:33 +03:00
|
|
|
minetest.swap_node(pos, {name = "default:dirt"})
|
2015-11-23 12:59:18 +03:00
|
|
|
else
|
2016-01-09 15:25:33 +03:00
|
|
|
minetest.swap_node(pos, {name = "ethereal:green_dirt"})
|
2015-11-23 12:59:18 +03:00
|
|
|
end
|
2014-11-09 22:17:41 +03:00
|
|
|
end,
|
|
|
|
})
|
2014-12-29 14:03:11 +03:00
|
|
|
|
2015-04-11 12:26:30 +03:00
|
|
|
-- If torch touching water then drop as item
|
2015-03-01 14:20:12 +03:00
|
|
|
minetest.register_abm({
|
|
|
|
nodenames = {"default:torch"},
|
2015-04-11 12:26:30 +03:00
|
|
|
neighbors = {"group:water"},
|
|
|
|
interval = 5,
|
2015-03-01 14:20:12 +03:00
|
|
|
chance = 1,
|
2015-11-07 23:50:50 +03:00
|
|
|
catch_up = false,
|
2015-03-01 14:20:12 +03:00
|
|
|
action = function(pos, node)
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-07-04 14:22:39 +03:00
|
|
|
local num = #minetest.find_nodes_in_area(
|
|
|
|
{x = pos.x - 1, y = pos.y, z = pos.z},
|
|
|
|
{x = pos.x + 1, y = pos.y, z = pos.z},
|
|
|
|
{"group:water"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-07-04 14:22:39 +03:00
|
|
|
num = num + #minetest.find_nodes_in_area(
|
|
|
|
{x = pos.x, y = pos.y, z = pos.z - 1},
|
|
|
|
{x = pos.x, y = pos.y, z = pos.z + 1},
|
|
|
|
{"group:water"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-07-04 14:22:39 +03:00
|
|
|
num = num + #minetest.find_nodes_in_area(
|
|
|
|
{x = pos.x, y = pos.y + 1, z = pos.z},
|
|
|
|
{x = pos.x, y = pos.y + 1, z = pos.z},
|
|
|
|
{"group:water"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-04-11 12:26:30 +03:00
|
|
|
if num > 0 then
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2016-05-17 23:40:05 +03:00
|
|
|
minetest.swap_node(pos, {name = "air"})
|
2016-01-21 17:59:28 +03:00
|
|
|
|
2015-05-08 22:36:32 +03:00
|
|
|
minetest.add_item(pos, {name = node.name})
|
2015-03-01 14:20:12 +03:00
|
|
|
end
|
|
|
|
end,
|
2016-01-09 15:25:33 +03:00
|
|
|
})
|