diff --git a/mods/default/README.txt b/mods/default/README.txt index 486379be..a5346976 100644 --- a/mods/default/README.txt +++ b/mods/default/README.txt @@ -239,6 +239,11 @@ Krock (CC0 1.0): default_glass.png default_glass_detail.png +Topywo (CC BY-SA 3.0) + default_coral_cyan.png + default_coral_green.png + default_coral_pink.png + Sounds ------ diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua index d53467d3..b92e12ef 100644 --- a/mods/default/mapgen.lua +++ b/mods/default/mapgen.lua @@ -2167,15 +2167,17 @@ function default.register_decorations() minetest.register_decoration({ name = "default:corals", - deco_type = "schematic", + deco_type = "simple", place_on = {"default:sand"}, + place_offset_y = -1, + sidelen = 4, noise_params = { - offset = -0.15, - scale = 0.1, - spread = {x = 100, y = 100, z = 100}, + offset = -4, + scale = 4, + spread = {x = 50, y = 50, z = 50}, seed = 7013, octaves = 3, - persist = 1, + persist = 0.7, }, biomes = { "desert_ocean", @@ -2184,9 +2186,12 @@ function default.register_decorations() }, y_max = -2, y_min = -8, - schematic = minetest.get_modpath("default") .. "/schematics/corals.mts", - flags = "place_center_x, place_center_z", - rotation = "random", + flags = "force_placement", + decoration = { + "default:coral_green", "default:coral_pink", + "default:coral_cyan", "default:coral_brown", + "default:coral_orange", "default:coral_skeleton", + }, }) -- Kelp diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua index 4f186e1c..3c2836d9 100644 --- a/mods/default/nodes.lua +++ b/mods/default/nodes.lua @@ -1910,6 +1910,159 @@ minetest.register_node("default:sand_with_kelp", { -- Corals -- +minetest.register_node("default:coral_green", { + description = "Green Coral", + drawtype = "plantlike_rooted", + waving = 1, + paramtype = "light", + tiles = {"default_coral_skeleton.png"}, + special_tiles = {{name = "default_coral_green.png", tileable_vertical = true}}, + inventory_image = "default_coral_green.png", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16}, + }, + }, + node_dig_prediction = "default:coral_skeleton", + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" or not placer then + return itemstack + end + + local player_name = placer:get_player_name() + local pos_under = pointed_thing.under + local pos_above = pointed_thing.above + + if minetest.get_node(pos_under).name ~= "default:coral_skeleton" or + minetest.get_node(pos_above).name ~= "default:water_source" then + return itemstack + end + + if minetest.is_protected(pos_under, player_name) or + minetest.is_protected(pos_above, player_name) then + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos_under, player_name) + return itemstack + end + + minetest.set_node(pos_under, {name = "default:coral_green"}) + if not (creative and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + + return itemstack + end, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) + +minetest.register_node("default:coral_pink", { + description = "Pink Coral", + drawtype = "plantlike_rooted", + waving = 1, + paramtype = "light", + tiles = {"default_coral_skeleton.png"}, + special_tiles = {{name = "default_coral_pink.png", tileable_vertical = true}}, + inventory_image = "default_coral_pink.png", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16}, + }, + }, + node_dig_prediction = "default:coral_skeleton", + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" or not placer then + return itemstack + end + + local player_name = placer:get_player_name() + local pos_under = pointed_thing.under + local pos_above = pointed_thing.above + + if minetest.get_node(pos_under).name ~= "default:coral_skeleton" or + minetest.get_node(pos_above).name ~= "default:water_source" then + return itemstack + end + + if minetest.is_protected(pos_under, player_name) or + minetest.is_protected(pos_above, player_name) then + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos_under, player_name) + return itemstack + end + + minetest.set_node(pos_under, {name = "default:coral_pink"}) + if not (creative and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + + return itemstack + end, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) + +minetest.register_node("default:coral_cyan", { + description = "Cyan Coral", + drawtype = "plantlike_rooted", + waving = 1, + paramtype = "light", + tiles = {"default_coral_skeleton.png"}, + special_tiles = {{name = "default_coral_cyan.png", tileable_vertical = true}}, + inventory_image = "default_coral_cyan.png", + groups = {snappy = 3}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + {-4/16, 0.5, -4/16, 4/16, 1.5, 4/16}, + }, + }, + node_dig_prediction = "default:coral_skeleton", + node_placement_prediction = "", + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" or not placer then + return itemstack + end + + local player_name = placer:get_player_name() + local pos_under = pointed_thing.under + local pos_above = pointed_thing.above + + if minetest.get_node(pos_under).name ~= "default:coral_skeleton" or + minetest.get_node(pos_above).name ~= "default:water_source" then + return itemstack + end + + if minetest.is_protected(pos_under, player_name) or + minetest.is_protected(pos_above, player_name) then + minetest.chat_send_player(player_name, "Node is protected") + minetest.record_protection_violation(pos_under, player_name) + return itemstack + end + + minetest.set_node(pos_under, {name = "default:coral_cyan"}) + if not (creative and creative.is_enabled_for(player_name)) then + itemstack:take_item() + end + + return itemstack + end, + after_destruct = function(pos, oldnode) + minetest.set_node(pos, {name = "default:coral_skeleton"}) + end, +}) + minetest.register_node("default:coral_brown", { description = "Brown Coral", tiles = {"default_coral_brown.png"}, diff --git a/mods/default/schematics/corals.mts b/mods/default/schematics/corals.mts deleted file mode 100644 index e1bd7ded..00000000 Binary files a/mods/default/schematics/corals.mts and /dev/null differ diff --git a/mods/default/textures/default_coral_cyan.png b/mods/default/textures/default_coral_cyan.png new file mode 100644 index 00000000..11cc7bfd Binary files /dev/null and b/mods/default/textures/default_coral_cyan.png differ diff --git a/mods/default/textures/default_coral_green.png b/mods/default/textures/default_coral_green.png new file mode 100644 index 00000000..847c5721 Binary files /dev/null and b/mods/default/textures/default_coral_green.png differ diff --git a/mods/default/textures/default_coral_pink.png b/mods/default/textures/default_coral_pink.png new file mode 100644 index 00000000..62d70c6e Binary files /dev/null and b/mods/default/textures/default_coral_pink.png differ diff --git a/schematic_tables.txt b/schematic_tables.txt index 261dcf19..bd101e71 100644 --- a/schematic_tables.txt +++ b/schematic_tables.txt @@ -2083,44 +2083,6 @@ mts_save("papyrus", { }) --- Corals - -local C = {name = "default:coral_brown", prob = 255, force_place = true} -local c = {name = "default:coral_brown", prob = 191, force_place = true} -local O = {name = "default:coral_orange", prob = 255, force_place = true} -local o = {name = "default:coral_orange", prob = 191, force_place = true} -local X = {name = "default:coral_skeleton", prob = 255, force_place = true} -local x = {name = "default:coral_skeleton", prob = 63, force_place = true} - -mts_save("corals", { - size = {x = 5, y = 3, z = 5}, - data = { - _, _, _, _, _, - o, C, O, c, _, - _, C, x, _, _, - - _, _, X, _, _, - C, O, O, C, o, - c, c, O, o, x, - - _, X, X, X, _, - c, C, C, O, O, - O, C, O, C, c, - - _, _, X, _, _, - x, O, C, O, C, - _, x, C, O, _, - - _, _, _, _, _, - _, o, O, C, c, - _, _, o, _, _, - }, - yslice_prob = { - {ypos = 2, prob = 127}, - } -}) - - -- Bush local L = {name = "default:bush_leaves", prob = 255}