From b26f2a2c48204ea4b1db06627e8fec93f443e89a Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Mon, 7 Oct 2024 08:41:26 +0100 Subject: [PATCH] add frost_ocean and thin_ice --- biome_info.json | 3 ++- biomes.lua | 10 ++++++++-- decor.lua | 11 +++++++++++ water.lua | 42 +++++++++++++++++++++++++++++++++++++----- 4 files changed, 58 insertions(+), 8 deletions(-) diff --git a/biome_info.json b/biome_info.json index 4493a4e..ec9c3f4 100644 --- a/biome_info.json +++ b/biome_info.json @@ -20,7 +20,8 @@ {"name": "taiga_ocean", "heat_point": 25, "humidity_point": 70, "y_min": -255, "y_max": 3}, {"name": "taiga_under", "heat_point": 25, "humidity_point": 70, "y_min": -31000, "y_max": -256}, {"name": "frost_floatland", "heat_point": 5, "humidity_point": 60, "y_min": 1025, "y_max": 1750}, -{"name": "frost", "heat_point": 5, "humidity_point": 60, "y_min": 1, "y_max": 71}, +{"name": "frost", "heat_point": 5, "humidity_point": 60, "y_min": 2, "y_max": 71}, +{"name": "frost_ocean", "heat_point": 5, "humidity_point": 60, "y_min": -192, "y_max": 1}, {"name": "snowy_grassland", "heat_point": 15, "humidity_point": 58, "y_min": 3, "y_max": 30}, {"name": "snowy_grassland_ocean", "heat_point": 15, "humidity_point": 58, "y_min": 2, "y_max": -192}, {"name": "deciduous_forest", "heat_point": 60, "humidity_point": 68, "y_min": 3, "y_max": 91}, diff --git a/biomes.lua b/biomes.lua index 4fac480..918fe00 100644 --- a/biomes.lua +++ b/biomes.lua @@ -180,14 +180,20 @@ register_biome(ethereal.frost, { name = "frost_floatland", heat_point = 5, humidity_point = 60, y_min = 1025, y_max = 1750, node_top = "ethereal:crystal_dirt", depth_top = 1, - node_filler = "default:dirt", depth_filler = 1}) + node_filler = "default:dirt", depth_filler = 2}) register_biome(ethereal.frost, { name = "frost", - heat_point = 5, humidity_point = 60, y_min = 1, y_max = 71, + heat_point = 5, humidity_point = 60, y_min = 2, y_max = 71, node_top = "ethereal:crystal_dirt", depth_top = 1, node_filler = "default:dirt", depth_filler = 3}) +register_biome(ethereal.frost, { + name = "frost_ocean", + heat_point = 5, humidity_point = 60, y_min = -192, y_max = 1, + node_top = "default:silver_sand", depth_top = 1, + node_filler = "default:sand", depth_filler = 3}) + -- snowy grassland (inbetween frost and taiga/jumble) register_biome(1, { diff --git a/decor.lua b/decor.lua index 76f9edc..92fdf5d 100644 --- a/decor.lua +++ b/decor.lua @@ -13,6 +13,17 @@ local function register_decoration(enabled, def) minetest.register_decoration(def) end +-- think ice + +register_decoration(ethereal.frost, { + place_on = {"default:silver_sand"}, + fill_ratio = 1.0, + y_min = 0, y_max = 0, + decoration = "ethereal:thin_ice", + biomes = {"frost_ocean"}, + place_offset_y = 1 +}) + -- water pools in swamp areas register_decoration(1, { diff --git a/water.lua b/water.lua index f72c27f..5cc0ff6 100644 --- a/water.lua +++ b/water.lua @@ -1,6 +1,38 @@ local S = minetest.get_translator("ethereal") +-- 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", + 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}}, + }, + groups = {cracky = 3, cools_lava = 1, slippery = 3}, + 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 +}) + -- Ice Brick minetest.register_node("ethereal:icebrick", { @@ -43,13 +75,12 @@ minetest.register_craft({ } }) --- If Crystal Spike or Snow near Water, change Water to Ice +-- If Crystal Spike or Snowblock near Water, change Water to Ice minetest.register_abm({ label = "Ethereal freeze water", nodenames = { - "ethereal:crystal_spike", "default:snow", "default:snowblock", - "ethereal:snowbrick" + "ethereal:crystal_spike", "default:snowblock", "ethereal:snowbrick" }, neighbors = {"default:water_source", "default:river_water_source"}, interval = 15, @@ -72,7 +103,7 @@ minetest.register_abm({ minetest.register_abm({ label = "Ethereal melt snow/ice", nodenames = { - "default:ice", "default:snowblock", "default:snow", + "default:ice", "default:snowblock", "default:snow", "ethereal:thin_ice", "default:dirt_with_snow", "ethereal:snowbrick", "ethereal:icebrick" }, neighbors = { @@ -98,7 +129,8 @@ minetest.register_abm({ or node.name == "ethereal:snowbrick" then minetest.swap_node(pos, {name = water_node .. "_source"}) - elseif node.name == "default:snow" then + elseif node.name == "default:snow" + or node.name == "ethereal:thin_ice" then minetest.swap_node(pos, {name = water_node .. "_flowing"}) elseif node.name == "default:dirt_with_snow" then