Skip to content
Permalink
Browse files

Add plantlike_rooted coral

  • Loading branch information...
Ezhh committed Nov 15, 2018
1 parent 5f61379 commit 21f5eaade052684d2694f6584496f8b5dc48d4ea
@@ -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
------
@@ -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
@@ -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"},
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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}

0 comments on commit 21f5eaa

Please sign in to comment.
You can’t perform that action at this time.