- Delete useless files/mods
- Add builtin_falling (by Davedevils) for an amazing bugfix - Tweak node.lua from the subgame MFF and « sea » mod for builtin_falling - Remove news.lua from _misc - Remove _misc_me (empty now) - Add a new mod named « news » and tweak this mod, it works now, add texture for the news (Thank you Davedevils)
@ -320,6 +320,23 @@ minetest.register_node("default:sand", {
|
||||
},
|
||||
groups = {crumbly = 3, falling_node = 1, sand = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("default:desert_sand", {
|
||||
@ -334,6 +351,23 @@ minetest.register_node("default:desert_sand", {
|
||||
},
|
||||
groups = {crumbly = 3, falling_node = 1, sand = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("default:gravel", {
|
||||
@ -348,6 +382,23 @@ minetest.register_node("default:gravel", {
|
||||
},
|
||||
},
|
||||
sounds = default.node_sound_gravel_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("default:sandstone", {
|
||||
|
0
mods/_misc/aliases.lua
Normal file → Executable file
@ -1,63 +0,0 @@
|
||||
future_ban_list = {}
|
||||
|
||||
local file = io.open(minetest.get_worldpath().."/future_banlist.txt", "r")
|
||||
if file then
|
||||
future_ban_list = minetest.deserialize(file:read("*all"))
|
||||
file:close()
|
||||
if not future_ban_list then
|
||||
future_ban_list = {}
|
||||
end
|
||||
end
|
||||
|
||||
local function save_file()
|
||||
local file = io.open(minetest.get_worldpath().."/future_banlist.txt", "w")
|
||||
if file then
|
||||
file:write(minetest.serialize(future_ban_list))
|
||||
file:close()
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_chatcommand("future_ban", {
|
||||
params = "<playername> | leave playername out to see the future ban list",
|
||||
description = "The player will be banned when trying to join",
|
||||
privs = {ban=true},
|
||||
func = function(name, param)
|
||||
if param == "" then
|
||||
minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
|
||||
return
|
||||
end
|
||||
if not minetest.env:get_player_by_name(param) then
|
||||
table.insert(future_ban_list, param)
|
||||
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||
minetest.log("action", name .. " added " .. param .. " to future ban list.")
|
||||
save_file()
|
||||
return
|
||||
end
|
||||
if not minetest.ban_player(param) then
|
||||
table.insert(future_ban_list, param)
|
||||
minetest.chat_send_player(name, desc .. " to future ban list added.")
|
||||
minetest.log("action", name .. " added " .. desc .. " to future ban list.")
|
||||
save_file()
|
||||
else
|
||||
local desc = minetest.get_ban_description(param)
|
||||
minetest.chat_send_player(name, "Banned " .. desc .. ".")
|
||||
minetest.log("action", name .. " bans " .. desc .. ".")
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local name = player:get_player_name()
|
||||
for i,n in ipairs(future_ban_list) do
|
||||
if n == name then
|
||||
if not minetest.ban_player(name) then
|
||||
minetest.chat_send_player(name, "Failed to ban player " .. name .. " (from future ban list).")
|
||||
else
|
||||
local desc = minetest.get_ban_description(name)
|
||||
minetest.log("action", desc .. " banned (from future ban list).")
|
||||
table.remove(future_ban_list, i)
|
||||
save_file()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
@ -1,25 +0,0 @@
|
||||
-- This allows me to chat and use basic commands without being in-game
|
||||
-- Based on the External Command mod by Menche
|
||||
|
||||
minetest.register_globalstep(
|
||||
function(dtime)
|
||||
f = (io.open(minetest.get_worldpath("external_cmd").."/message", "r"))
|
||||
if f ~= nil then
|
||||
local message = f:read("*line")
|
||||
f:close()
|
||||
os.remove(minetest.get_worldpath("external_cmd").."/message")
|
||||
if message ~= nil then
|
||||
local cmd, param = string.match(message, "^/([^ ]+) *(.*)")
|
||||
if not param then
|
||||
param = ""
|
||||
end
|
||||
local cmd_def = minetest.chatcommands[cmd]
|
||||
if cmd_def then
|
||||
cmd_def.func("CraigyDavi", param)
|
||||
else
|
||||
minetest.chat_send_all("<CraigyDavi> "..message)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
)
|
0
mods/_misc/chatcommands.lua
Normal file → Executable file
@ -1,15 +0,0 @@
|
||||
local chatlog = minetest.get_worldpath().."/chatlog.txt"
|
||||
monthfirst = true -- Wheter the 1st of Feb should be 1/2/13(monthfirst = true) or 2/1/13(monthfirst = false)
|
||||
|
||||
|
||||
function playerspeak(name,msg)
|
||||
f = io.open(chatlog, "a")
|
||||
if monthfirst then
|
||||
f:write(os.date("(%m/%d/%y %X) ["..name.."]: "..msg.."\n"))
|
||||
else
|
||||
f:write(os.date("(%d/%m/%y %X) ["..name.."]: "..msg.."\n"))
|
||||
end
|
||||
f:close()
|
||||
end
|
||||
|
||||
minetest.register_on_chat_message(playerspeak)
|
@ -2,39 +2,18 @@
|
||||
-- Server Misc Mod --
|
||||
---------------------
|
||||
|
||||
-- Seen
|
||||
--dofile(minetest.get_modpath("_misc").."/seen.lua")
|
||||
|
||||
-- Nodename HUD
|
||||
--dofile(minetest.get_modpath("_misc").."/nodename_hud.lua")
|
||||
|
||||
-- Give initial stuff
|
||||
dofile(minetest.get_modpath("_misc").."/give_initial_stuff.lua")
|
||||
|
||||
-- Chat Commands
|
||||
dofile(minetest.get_modpath("_misc").."/chatcommands.lua")
|
||||
|
||||
-- News
|
||||
--dofile(minetest.get_modpath("_misc").."/news.lua")
|
||||
|
||||
-- Rules
|
||||
dofile(minetest.get_modpath("_misc").."/rules.lua")
|
||||
|
||||
-- Aliases
|
||||
dofile(minetest.get_modpath("_misc").."/aliases.lua")
|
||||
|
||||
-- Chatlog
|
||||
--dofile(minetest.get_modpath("_misc").."/chatlog.lua")
|
||||
|
||||
-- Username filter
|
||||
-- dofile(minetest.get_modpath("_misc").."/username_filter.lua")
|
||||
|
||||
-- Ban
|
||||
--dofile(minetest.get_modpath("_misc").."/ban.lua")
|
||||
|
||||
-- Chat Offline
|
||||
--dofile(minetest.get_modpath("_misc").."/chat_offline.lua")
|
||||
|
||||
-- No Interact Messages
|
||||
dofile(minetest.get_modpath("_misc").."/nointeract_messages.lua")
|
||||
|
||||
|
@ -1,48 +0,0 @@
|
||||
local news = {}
|
||||
|
||||
news.path = minetest.get_worldpath()
|
||||
|
||||
function news.formspec(player,article)
|
||||
|
||||
if ( article == "" or article == nil ) then
|
||||
article = "news.txt"
|
||||
else
|
||||
article = "news_"..article..".txt"
|
||||
end
|
||||
|
||||
local newsfile = io.open(news.path.."/"..article,"r")
|
||||
|
||||
local formspec = "size[12,10]"
|
||||
|
||||
if newsfile ~= nil then
|
||||
local newscontent = newsfile:read("*a")
|
||||
formspec = formspec.."textarea[.25,.25;12,10;news;;"..newscontent.."]"
|
||||
else
|
||||
formspec = formspec.."label[.25,.25;Article does not exist]"
|
||||
end
|
||||
formspec = formspec.."button_exit[.25,9;2,1;exit;Fermer"
|
||||
if ( newsfile ~= nil ) then
|
||||
newsfile:close()
|
||||
end
|
||||
return formspec
|
||||
end
|
||||
|
||||
function news.show_formspec(player)
|
||||
local name = player:get_player_name()
|
||||
minetest.show_formspec(name,"news",news.formspec(player))
|
||||
minetest.log('action','Showing formspec to '..name)
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand("news",{
|
||||
params = "<article>",
|
||||
description="Montre les news du serveur",
|
||||
func = function (name,params)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
minetest.show_formspec(name,"news",news.formspec(player,params))
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function (player)
|
||||
minetest.after(5,news.show_formspec,player)
|
||||
end)
|
@ -1,53 +0,0 @@
|
||||
local wield={}
|
||||
local huds={}
|
||||
local dtimes={}
|
||||
local dlimit=60
|
||||
local airhudmod = minetest.get_modpath("4air")
|
||||
|
||||
local function get_desc(item)
|
||||
if minetest.registered_nodes[item] then return minetest.registered_nodes[item]["description"] end
|
||||
if minetest.registered_items[item] then return minetest.registered_items[item]["description"] end
|
||||
if minetest.registered_craftitems[item] then return minetest.registered_craftitems[item]["description"] end
|
||||
if minetest.registered_tools[item] then return minetest.registered_tools[item]["description"] end
|
||||
return ""
|
||||
end
|
||||
|
||||
minetest.register_globalstep(function(dtime)
|
||||
local players = minetest.get_connected_players()
|
||||
for i,player in ipairs(players) do
|
||||
local pll = player:get_player_name()
|
||||
local wstack = player:get_wielded_item():get_name()
|
||||
local shift = player:get_player_control()['sneak']
|
||||
local meta = player:get_wielded_item():get_metadata()
|
||||
local desc
|
||||
if not shift then
|
||||
desc = wstack
|
||||
else
|
||||
desc = wstack
|
||||
end
|
||||
if dtimes[pll] then dtimes[pll]=dtimes[pll]+dtime else dtimes[pll]=0 end
|
||||
if dtimes[pll]>dlimit then
|
||||
if huds[pll] then player:hud_remove(huds[pll]) end
|
||||
dtimes[pll]=dlimit+1
|
||||
end
|
||||
if wstack ~= wield[pll] then
|
||||
wield[pll]=wstack
|
||||
dtimes[pll]=0
|
||||
if huds[pll]
|
||||
then
|
||||
player:hud_remove(huds[pll])
|
||||
end
|
||||
local off = {x=0, y=-70}
|
||||
if airhudmod then off.y=off.y-20 end
|
||||
huds[pll] = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
position = {x=0.5, y=1},
|
||||
offset = off,
|
||||
alignment = {x=0, y=0},
|
||||
number = 0xFFFFFF ,
|
||||
text = desc,
|
||||
})
|
||||
end
|
||||
|
||||
end
|
||||
end)
|
@ -1,211 +0,0 @@
|
||||
seendebug = true
|
||||
local last_time = os.time()
|
||||
local save_interval = 60
|
||||
|
||||
if minetest.setting_get("seen.save_interval") ~= nil then
|
||||
local save_int = minetest.setting_get("seen.save_interval")
|
||||
if tonumber(save_int) > 20 then
|
||||
save_interval = save_int
|
||||
end
|
||||
end
|
||||
|
||||
local function save_data(sett, data)
|
||||
if sett ~= nil then
|
||||
data_ser = minetest.serialize(data)
|
||||
sett:set("data", data_ser)
|
||||
sett:write()
|
||||
else
|
||||
minetest.chat_send_all("Seen Mod: Saving data failed. Please shout at the server admin!")
|
||||
end
|
||||
end
|
||||
|
||||
local function load_data(sett, field)
|
||||
local loaded = sett:get("data")
|
||||
local def = sett:get("default")
|
||||
if loaded ~= nil then
|
||||
local data = minetest.deserialize(loaded)
|
||||
else
|
||||
local data = {}
|
||||
end
|
||||
end
|
||||
|
||||
local function relative_time (time)
|
||||
local diff = os.time() - time
|
||||
if diff == 0 then
|
||||
return "now"
|
||||
elseif diff > 0 then
|
||||
local day_diff = math.floor(diff/86400)
|
||||
if day_diff == 0 then
|
||||
if diff < 60 then
|
||||
return "a few seconds ago"
|
||||
end
|
||||
if diff < 120 then
|
||||
return "1 minute ago."
|
||||
end
|
||||
if diff < 3600 then
|
||||
return tostring(math.floor(diff/60)).." minutes ago"
|
||||
end
|
||||
if diff < 7200 then
|
||||
return "1 hour ago"
|
||||
end
|
||||
if diff < 86400 then
|
||||
return tostring(math.floor(diff/3600)).." hours ago"
|
||||
end
|
||||
end
|
||||
if day_diff == 1 then
|
||||
return "yesterday"
|
||||
end
|
||||
if day_diff < 7 then
|
||||
return tostring(day_diff).." days ago"
|
||||
end
|
||||
if day_diff < 31 then
|
||||
return tostring(math.ceil(day_diff/7)).." weeks ago"
|
||||
end
|
||||
if day_diff < 60 then
|
||||
return "last month"
|
||||
end
|
||||
return os.date("%B %Y", time)
|
||||
else
|
||||
local diff = math.abs(diff)
|
||||
local day_diff = math.floor(diff/86400)
|
||||
if day_diff == 0 then
|
||||
if diff < 120 then
|
||||
return "in a minute"
|
||||
end
|
||||
if diff < 3600 then
|
||||
return "in "..tostring(math.floor(diff/60)).." minutes"
|
||||
end
|
||||
if diff < 7200 then
|
||||
return "in an hour"
|
||||
end
|
||||
if diff < 86400 then
|
||||
return "in "..tostring(math.floor(diff/3600)).." hours"
|
||||
end
|
||||
end
|
||||
if day_diff == 1 then
|
||||
return "tomorrow"
|
||||
end
|
||||
if day_diff < 4 then
|
||||
return os.date("%A", time)
|
||||
end
|
||||
if day_diff < 7 + (7 - tonumber(os.date("%w"))) then
|
||||
return "next week"
|
||||
end
|
||||
if math.ceil (day_diff / 7) < 4 then
|
||||
return "in "..tostring(math.ceil(day_diff/7)).." weeks"
|
||||
end
|
||||
if tonumber(os.date("%m", time)) == tonumber(os.date("%m")) + 1 then
|
||||
return "next month"
|
||||
end
|
||||
return os.date("%B %Y", time);
|
||||
end
|
||||
end
|
||||
|
||||
local function print_r(tab,com)
|
||||
if seendebug == true then
|
||||
print("DEBUG: "..com)
|
||||
table.foreach(tab, print)
|
||||
print("-----")
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local function debug(var, com)
|
||||
if seendebug == true then
|
||||
print("DEBUG: "..com)
|
||||
print(var)
|
||||
minetest.chat_send_all("DEBUG: "..var.."// "..com)
|
||||
print("-----")
|
||||
return true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
local config_file = minetest.get_worldpath().."/seen.txt"
|
||||
--in case of not existant config file, it
|
||||
--will create it
|
||||
local file_desc = io.open(config_file, "a")
|
||||
file_desc:close()
|
||||
|
||||
--create config instance
|
||||
local config = Settings(config_file)
|
||||
local data
|
||||
local seens = {}
|
||||
|
||||
data = config:get("data")
|
||||
if data ~= nil then
|
||||
seens = minetest.deserialize(data)
|
||||
for _, player in pairs( minetest.get_connected_players() ) do
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
end
|
||||
else
|
||||
seens = {}
|
||||
for _, player in pairs( minetest.get_connected_players() ) do
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
end
|
||||
end
|
||||
save_data(config, seens)
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
save_data(config, seens)
|
||||
return true
|
||||
end)
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
save_data(config, seens)
|
||||
return true
|
||||
end)
|
||||
|
||||
minetest.register_on_leaveplayer(function(player)
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
save_data(config, seens)
|
||||
return true
|
||||
end)
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
for _, player in pairs( minetest.get_connected_players() ) do
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
end
|
||||
save_data(config, seens)
|
||||
return true
|
||||
end)
|
||||
|
||||
minetest.register_globalstep(function ( dtime )
|
||||
if os.time() >= last_time then
|
||||
last_time = os.time() + save_interval
|
||||
for _, player in pairs( minetest.get_connected_players() ) do
|
||||
name = player:get_player_name()
|
||||
seens[name] = os.time()
|
||||
end
|
||||
save_data(config, seens)
|
||||
end
|
||||
end);
|
||||
|
||||
minetest.register_chatcommand("seen", {
|
||||
params = "<name>",
|
||||
description = "Recherche quand un joueur etait en ligne pour la derniere fois.",
|
||||
func = function(name, param)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
if param ~= nil and param ~= "" then
|
||||
if seens[param] ~= nil then
|
||||
minetest.chat_send_player(name, param.." etait en ligne pour la derniere fois "..relative_time(seens[param]))
|
||||
else
|
||||
minetest.chat_send_player(name, "Il n'y a aucune donnees sur "..param..". Peut-etre que l'identifiant n'est pas correcte ?")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
@ -1,34 +0,0 @@
|
||||
-- By VanessaE, sfan5, and kaeza.
|
||||
|
||||
local disallowed = {
|
||||
["guest"] = "Les comptes Guest/invités sont désactivés sur ce serveur. "..
|
||||
"S'il vous plaît, choisissez un nom d'utilisateur correcte et réessayez.",
|
||||
["^[0-9]+$"] = "Les identifiants contenant uniquement des chiffres sont désactivés sur ce serveur. "..
|
||||
"S'il vous plaît, choisissez un nom d'utilisateur correcte et réessayez.",
|
||||
["[0-9].-[0-9].-[0-9].-[0-9].-[0-9]"] = "Trop de chiffres dans votre identifiant. "..
|
||||
"S'il vous plaît, réessayez avec moins de 5 chiffres dans votre identifiant.",
|
||||
["[4a]dm[1il]n"] = "Ce nom d'utilisateur est désactivé pour des raisons évidentes. "..
|
||||
"Merci de choisir un autre nom d'utilisateur."
|
||||
}
|
||||
|
||||
|
||||
|
||||
minetest.register_on_prejoinplayer(function(name, ip)
|
||||
local lname = name:lower()
|
||||
for re, reason in pairs(disallowed) do
|
||||
if lname:find(re) then
|
||||
return reason
|
||||
end
|
||||
end
|
||||
|
||||
if #name < 2 then
|
||||
return "Identifiant trop court. "..
|
||||
"S'il vous plaît, choisissez un identifiant avec au moins 2 lettres et réessayez."
|
||||
end
|
||||
|
||||
if #name > 18 then
|
||||
return "Identifiant trop long. "..
|
||||
"S'il vous plaît, choisissez un identifiant avec moins de 18 caractères."
|
||||
end
|
||||
|
||||
end)
|
53
mods/news/init.lua
Normal file
@ -0,0 +1,53 @@
|
||||
local news = {}
|
||||
|
||||
local path = minetest.get_worldpath()
|
||||
|
||||
local function formspec(player,article)
|
||||
|
||||
--if ( article == "" or article == nil ) then
|
||||
article = "news.txt" -- vu qu'il s'en sert pas
|
||||
--else
|
||||
-- article = "news_"..article..".txt"
|
||||
--end
|
||||
|
||||
local newsfile = io.open(path.."/"..article,"r")
|
||||
|
||||
local formspec = "size[12,10;]"
|
||||
formspec = formspec.."background[-0.22,-0.25;13,11;background.jpg]"
|
||||
|
||||
if newsfile ~= nil then
|
||||
local newscontent = newsfile:read("*a")
|
||||
formspec = formspec.."textarea[.50,.50;12,10;news;;"..minetest.formspec_escape(newscontent).."]"
|
||||
else
|
||||
formspec = formspec.."label[.50,.50;Pas d'article pour le moment]"
|
||||
end
|
||||
formspec = formspec.."button_exit[5,9.25;2,1;exit;Fermer"
|
||||
if ( newsfile ~= nil ) then
|
||||
newsfile:close()
|
||||
end
|
||||
return formspec
|
||||
end
|
||||
|
||||
local function show_formspec(player)
|
||||
local name = player:get_player_name()
|
||||
minetest.show_formspec(name,"news",formspec(player))
|
||||
minetest.log('action','Showing formspec to '..name)
|
||||
end
|
||||
|
||||
|
||||
minetest.register_chatcommand("news",{
|
||||
params = "<article>",
|
||||
description="Montre les news du serveur",
|
||||
func = function (name,params)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
minetest.show_formspec(name,"news",formspec(player,params))
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_joinplayer(function (player)
|
||||
minetest.after(6,show_formspec,player)
|
||||
end)
|
||||
|
||||
minetest.register_on_newplayer(function(player)
|
||||
minetest.after(8,show_formspec,player)
|
||||
end)
|
BIN
mods/news/textures/background.jpg
Normal file
After Width: | Height: | Size: 201 KiB |
0
mods/sea/LICENSE AND README.txt
Executable file → Normal file
0
mods/sea/clams/depends.txt
Executable file → Normal file
36
mods/sea/clams/init.lua
Executable file → Normal file
@ -17,6 +17,23 @@ minetest.register_node("clams:sandalgae", {
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("clams:dirtalgae", {
|
||||
@ -45,6 +62,23 @@ minetest.register_node("clams:sandalgaeused", {
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("clams:dirtalgaeused", {
|
||||
@ -389,4 +423,4 @@ minetest.register_alias("shells_dye:yellowlightglass","clams:yellowlightglass")
|
||||
minetest.register_alias("shells_dye:redlightglass","clams:redlightglass")
|
||||
minetest.register_alias("shells_dye:bluelightglass","clams:bluelightglass")
|
||||
minetest.register_alias("shells_dye:whitelightglass","clams:whitelightglass")
|
||||
minetest.register_alias("shells_dye:blacklightglass","clams:blacklightglass")
|
||||
minetest.register_alias("shells_dye:blacklightglass","clams:blacklightglass")
|
||||
|
420
mods/sea/clams/init.lua~
Normal file
@ -0,0 +1,420 @@
|
||||
-- NODES
|
||||
|
||||
minetest.register_node("clams:sandalgae", {
|
||||
description = "Sandalgae",
|
||||
tiles = {"default_sand.png^clams_algae.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1},
|
||||
drop = {
|
||||
items = {
|
||||
{
|
||||
items = {'"clams:collectedalgae" 4'},
|
||||
},
|
||||
{
|
||||
items = {'clams:sandalgaeused'},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("clams:dirtalgae", {
|
||||
description = "Dirtalgae",
|
||||
tiles = {"default_dirt.png^clams_algae.png"},
|
||||
paramtype = "light",
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
drop = {
|
||||
items = {
|
||||
{
|
||||
items = {'"clams:collectedalgae" 4'},
|
||||
},
|
||||
{
|
||||
items = {'clams:dirtalgaeused'},
|
||||
}
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_dirt_defaults,
|
||||
})
|
||||
|
||||
minetest.register_node("clams:sandalgaeused", {
|
||||
description = "Used sandalgae",
|
||||
tiles = {"default_sand.png^clams_algaeused.png"},
|
||||
inventory_image = {"default_sand.png^clams_algaeused.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("clams:dirtalgaeused", {
|
||||
description = "Used dirtalgae",
|
||||
tiles = {"default_dirt.png^clams_algaeused.png"},
|
||||
inventory_image = {"default_dirt.png^clams_algaeused.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-- ENTITIES
|
||||
|
||||
|
||||
-- The registration of the entities' code is copied from celeron55's mob (the DM's fireball)
|
||||
|
||||
|
||||
minetest.register_entity("clams:whiteshell", {
|
||||
description="White shell",
|
||||
hp_max = 15,
|
||||
physical = true,
|
||||
collisionbox = {-0.2,-0.2,-0.2, 0.2,0.2,0.2},
|
||||
visual = "sprite",
|
||||
visual_size = {x=0.5, y=0.5},
|
||||
textures = {"clams_whiteshell.png^[makealpha:128,128,0"},
|
||||
spritediv = {x=1, y=3},
|
||||
initial_sprite_basepos = {x=0, y=0},
|
||||
drops = {
|
||||
{name = "clams:crushedwhite", chance = 1, min = 1, max = 4},
|
||||
},
|
||||
|
||||
phase = 0,
|
||||
phasetimer = 0,
|
||||
|
||||
on_activate = function(self, staticdata)
|
||||
minetest.log("whiteshell activated!")
|
||||
end,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
self.phasetimer = self.phasetimer + dtime
|
||||
if self.phasetimer > 2.0 then
|
||||
self.phasetimer = self.phasetimer - 2.0
|
||||
self.phase = self.phase + 1
|
||||
if self.phase >= 3 then
|
||||
self.phase = 0
|
||||
end
|
||||
self.object:setsprite({x=0, y=self.phase})
|
||||
phasearmor = {
|
||||
[0]={fleshy=0},
|
||||
[1]={fleshy=30},
|
||||
[2]={fleshy=70}
|
||||
}
|
||||
self.object:set_armor_groups(phasearmor[self.phase])
|
||||
end
|
||||
end,
|
||||
|
||||
on_punch = function(self, hitter)
|
||||
if self.object:get_hp() <= 0 then
|
||||
if hitter and hitter:is_player() and hitter:get_inventory() then
|
||||
for _,drop in ipairs(self.drops) do
|
||||
if math.random(1, drop.chance) == 1 then
|
||||
hitter:get_inventory():add_item("main", ItemStack(drop.name.." "..math.random(drop.min, drop.max)))
|
||||
end
|
||||
end
|
||||
else
|
||||
for _,drop in ipairs(self.drops) do
|
||||
if math.random(1, drop.chance) == 1 then
|
||||
for i=1,math.random(drop.min, drop.max) do
|
||||
local obj = minetest.add_item(self.object:getpos(), drop.name)
|
||||
if obj then
|
||||
obj:get_luaentity().collect = true
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
x = -x
|
||||
end
|
||||
local z = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
z = -z
|
||||
end
|
||||
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- CRAFT ITEMS
|
||||
|
||||
|
||||
minetest.register_craftitem("clams:collectedalgae", {
|
||||
description = "Collected algae",
|
||||
inventory_image = "clams_collectedalgae.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("clams:crushedwhite", {
|
||||
description = "Crushed white shell",
|
||||
inventory_image = "clams_crushedwhite.png",
|
||||
})
|
||||
|
||||
|
||||
-- ALGAE GENERATION
|
||||
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "clams:sandalgae",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 9*9*9,
|
||||
clust_num_ores = 16,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -60,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "clams:dirtalgae",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 9*9*9,
|
||||
clust_num_ores = 16,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -60,
|
||||
})
|
||||
|
||||
|
||||
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
|
||||
if maxp.y < height_min or minp.y > height_max then
|
||||
return
|
||||
end
|
||||
local y_min = math.max(minp.y, height_min)
|
||||
local y_max = math.min(maxp.y, height_max)
|
||||
if chunk_size >= y_max - y_min + 1 then
|
||||
return
|
||||
end
|
||||
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
|
||||
local pr = PseudoRandom(seed)
|
||||
local num_chunks = math.floor(chunks_per_volume * volume)
|
||||
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
|
||||
for i=1,num_chunks do
|
||||
local y0 = pr:next(y_min, y_max-chunk_size+1)
|
||||
if y0 >= height_min and y0 <= height_max then
|
||||
local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
|
||||
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
|
||||
local p0 = {x=x0, y=y0, z=z0}
|
||||
for x1=0,chunk_size-1 do
|
||||
for y1=0,chunk_size-1 do
|
||||
for z1=0,chunk_size-1 do
|
||||
if pr:next(1,inverse_chance) == 1 then
|
||||
local x2 = x0+x1
|
||||
local y2 = y0+y1
|
||||
local z2 = z0+z1
|
||||
local p2 = {x=x2, y=y2, z=z2}
|
||||
if minetest.get_node(p2).name == wherein then
|
||||
minetest.set_node(p2, {name=name})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--ABM's
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"clams:sandalgaeused"},
|
||||
interval = 30,
|
||||
chance = 20,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local y = {x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local yy = {x = pos.x, y = pos.y + 2, z = pos.z }
|
||||
if minetest.get_node(y).name == "default:water_source" or
|
||||
minetest.get_node(y).name == "noairblocks:water_sourcex" then
|
||||
if minetest.get_node(yy).name == "default:water_source" or
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex" then
|
||||
minetest.add_node(pos, {name = "clams:sandalgae"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"clams:dirtalgaeused"},
|
||||
interval = 30,
|
||||
chance = 20,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local y = {x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local yy = {x = pos.x, y = pos.y + 2, z = pos.z }
|
||||
if minetest.get_node(y).name == "default:water_source" or
|
||||
minetest.get_node(y).name == "noairblocks:water_sourcex" then
|
||||
if minetest.get_node(yy).name == "default:water_source" or
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex" then
|
||||
minetest.add_node(pos, {name = "clams:dirtalgae"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"clams:sandalgae"},
|
||||
interval = 40,
|
||||
chance = 40,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local y = {x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local yy = {x = pos.x, y = pos.y + 2, z = pos.z }
|
||||
if (active_object_count_wider + active_object_count_wider) > 40 then
|
||||
return
|
||||
elseif (minetest.get_node(y).name == "default:water_source" or
|
||||
minetest.get_node(y).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yy).name == "default:water_source" or
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex") then
|
||||
pos.y=pos.y + 1
|
||||
minetest.add_entity(pos, "clams:whiteshell")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"clams:dirtalgae"},
|
||||
interval = 40,
|
||||
chance = 40,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local y = {x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
local yy = {x = pos.x, y = pos.y + 2, z = pos.z }
|
||||
if (active_object_count_wider + active_object_count_wider) > 40 then
|
||||
return
|
||||
elseif (minetest.get_node(y).name == "default:water_source" or
|
||||
minetest.get_node(y).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yy).name == "default:water_source" or
|
||||
minetest.get_node(yy).name == "noairblocks:water_sourcex") then
|
||||
pos.y=pos.y + 1
|
||||
minetest.add_entity(pos, "clams:whiteshell")
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
-- ALIASES
|
||||
|
||||
|
||||
minetest.register_alias("clams:yellowalgae","clams:collectedalgae")
|
||||
minetest.register_alias("clams:redalgae","clams:collectedalgae")
|
||||
minetest.register_alias("clams:bluealgae","clams:collectedalgae")
|
||||
|
||||
minetest.register_alias("clams:yellowshell","clams:whiteshell")
|
||||
minetest.register_alias("clams:redshell","clams:whiteshell")
|
||||
minetest.register_alias("clams:blueshell","clams:whiteshell")
|
||||
|
||||
minetest.register_alias("clams:yellowseedsanddirt","clams:sandalgae")
|
||||
minetest.register_alias("clams:redseedsanddirt","clams:dirtalgae")
|
||||
minetest.register_alias("clams:blueseedsanddirt","clams:sandalgae")
|
||||
|
||||
minetest.register_alias("clams:yellowseed","clams:collectedalgae")
|
||||
minetest.register_alias("clams:redseed","clams:collectedalgae")
|
||||
minetest.register_alias("clams:blueseed","clams:collectedalgae")
|
||||
|
||||
minetest.register_alias("clams:sanddirt","clams:sandalgaeused")
|
||||
minetest.register_alias("clams:sanddirtalgae","clams:dirtalgae")
|
||||
minetest.register_alias("clams:sanddirtused","clams:dirtalgaeused")
|
||||
|
||||
minetest.register_alias("clams:sandbalgae","clams:sandalgae")
|
||||
minetest.register_alias("clams:dirtbalgae","clams:dirtalgae")
|
||||
|
||||
minetest.register_alias("clams:crushedyellow","clams:crushedwhite")
|
||||
minetest.register_alias("clams:crushedred","clams:crushedwhite")
|
||||
minetest.register_alias("clams:crushedblue","clams:crushedwhite")
|
||||
minetest.register_alias("clams:crushedblack","clams:crushedwhite")
|
||||
|
||||
minetest.register_alias("clams:emptybleacher","colormachine:colormachine")
|
||||
minetest.register_alias("clams:filledbleacher","colormachine:colormachine")
|
||||
minetest.register_alias("clams:readybleacher","colormachine:colormachine")
|
||||
|
||||
if( minetest.get_modpath( "colormachine") ~= nil ) then
|
||||
minetest.register_alias("clams:emptybleacher","colormachine:colormachine")
|
||||
minetest.register_alias("clams:filledbleacher","colormachine:colormachine")
|
||||
minetest.register_alias("clams:readybleacher","colormachine:colormachine") else
|
||||
minetest.register_alias("clams:emptybleacher","default:mese")
|
||||
minetest.register_alias("clams:filledbleacher","default:mese")
|
||||
minetest.register_alias("clams:readybleacher","default:mese")
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- ALIASES OLDEST VERSION
|
||||
|
||||
|
||||
minetest.register_alias("algae:yellowalgae","clams:collectedalgae")
|
||||
minetest.register_alias("algae:redalgae","clams:collectedalgae")
|
||||
minetest.register_alias("algae:bluealgae","clams:collectedalgae")
|
||||
|
||||
minetest.register_alias("algae:sandalgae","clams:sandalgae")
|
||||
minetest.register_alias("algae:dirtalgae","clams:dirtalgae")
|
||||
minetest.register_alias("algae:sandbalgae","clams:sandalgae")
|
||||
minetest.register_alias("algae:dirtbalgae","clams:dirtalgae")
|
||||
|
||||
minetest.register_alias("sea_cult:emptybleacher","colormachine:colormachine")
|
||||
minetest.register_alias("sea_cult:filledbleacher","colormachine:colormachine")
|
||||
minetest.register_alias("sea_cult:readybleacher","colormachine:colormachine")
|
||||
|
||||
if( minetest.get_modpath( "colormachine") ~= nil ) then
|
||||
minetest.register_alias("sea_cult:emptybleacher","colormachine:colormachine")
|
||||
minetest.register_alias("sea_cult:filledbleacher","colormachine:colormachine")
|
||||
minetest.register_alias("sea_cult:readybleacher","colormachine:colormachine") else
|
||||
minetest.register_alias("sea_cult:emptybleacher","default:mese")
|
||||
minetest.register_alias("sea_cult:filledbleacher","default:mese")
|
||||
minetest.register_alias("sea_cult:readybleacher","default:mese")
|
||||
return
|
||||
end
|
||||
|
||||
minetest.register_alias("sea_cult:sanddirt","clams:sandalgaeused")
|
||||
minetest.register_alias("sea_cult:sanddirtalgae","clams:dirtalgae")
|
||||
minetest.register_alias("sea_cult:sanddirtused","clams:dirtalgaeused")
|
||||
|
||||
minetest.register_alias("shells:yellowshell","clams:whiteshell")
|
||||
minetest.register_alias("shells:redshell","clams:whiteshell")
|
||||
minetest.register_alias("shells:blueshell","clams:whiteshell")
|
||||
|
||||
minetest.register_alias("shells:yellowseed","clams:collectedalgae")
|
||||
minetest.register_alias("shells:redseed","clams:collectedalgae")
|
||||
minetest.register_alias("shells:blueseed","clams:collectedalgae")
|
||||
|
||||
minetest.register_alias("shells:crushedyellow","clams:crushedwhite")
|
||||
minetest.register_alias("shells:crushedred","clams:crushedwhite")
|
||||
minetest.register_alias("shells:crushedblue","clams:crushedwhite")
|
||||
minetest.register_alias("shells:crushedblack","clams:crushedwhite")
|
||||
minetest.register_alias("shells:crushedwhite","clams:crushedwhite")
|
||||
|
||||
minetest.register_alias("shells_dye:yellowlightglass","clams:yellowlightglass")
|
||||
minetest.register_alias("shells_dye:redlightglass","clams:redlightglass")
|
||||
minetest.register_alias("shells_dye:bluelightglass","clams:bluelightglass")
|
||||
minetest.register_alias("shells_dye:whitelightglass","clams:whitelightglass")
|
||||
minetest.register_alias("shells_dye:blacklightglass","clams:blacklightglass")
|
0
mods/sea/clams/readme.txt
Executable file → Normal file
0
mods/sea/clams/textures/clams_algae.png
Executable file → Normal file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
0
mods/sea/clams/textures/clams_algaeused.png
Executable file → Normal file
Before Width: | Height: | Size: 997 B After Width: | Height: | Size: 997 B |
0
mods/sea/clams/textures/clams_collectedalgae.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/clams/textures/clams_crushedwhite.png
Executable file → Normal file
Before Width: | Height: | Size: 989 B After Width: | Height: | Size: 989 B |
0
mods/sea/clams/textures/clams_whiteshell.png
Executable file → Normal file
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
0
mods/sea/modpack.txt
Executable file → Normal file
0
mods/sea/noairblocks/depends.txt
Executable file → Normal file
0
mods/sea/noairblocks/init.lua
Executable file → Normal file
0
mods/sea/noairblocks/readme.txt
Executable file → Normal file
0
mods/sea/seacobble/depends.txt
Executable file → Normal file
0
mods/sea/seacobble/init.lua
Executable file → Normal file
0
mods/sea/seacobble/readme.txt
Executable file → Normal file
0
mods/sea/seacobble/textures/seacobble_seacobble.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seacobble/textures/seacobble_seacobble_aqua.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seacobble/textures/seacobble_seacobble_cyan.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seacobble/textures/seacobble_seacobble_lime.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seacobble/textures/seacobble_seacobble_magenta.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seacobble/textures/seacobble_seacobble_redviolet.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seacobble/textures/seacobble_seacobble_skyblue.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seacoral/depends.txt
Executable file → Normal file
104
mods/sea/seacoral/init.lua
Executable file → Normal file
@ -128,6 +128,23 @@ minetest.register_node("seacoral:seacoralsandcyan", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtcyan", {
|
||||
@ -146,6 +163,23 @@ minetest.register_node("seacoral:seacoralsandmagenta", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtmagenta", {
|
||||
@ -164,6 +198,23 @@ minetest.register_node("seacoral:seacoralsandaqua", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtaqua", {
|
||||
@ -182,6 +233,23 @@ minetest.register_node("seacoral:seacoralsandlime", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtlime", {
|
||||
@ -200,6 +268,23 @@ minetest.register_node("seacoral:seacoralsandskyblue", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtskyblue", {
|
||||
@ -218,6 +303,23 @@ minetest.register_node("seacoral:seacoralsandredviolet", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtredviolet", {
|
||||
@ -647,4 +749,4 @@ minetest.register_alias("seadye:magenta","dye:magenta")
|
||||
minetest.register_alias("seadye:lime","dye:lime")
|
||||
minetest.register_alias("seadye:aqua","dye:aqua")
|
||||
minetest.register_alias("seadye:skyblue","dye:skyblue")
|
||||
minetest.register_alias("seadye:redviolet","dye:redviolet")
|
||||
minetest.register_alias("seadye:redviolet","dye:redviolet")
|
||||
|
734
mods/sea/seacoral/init.lua~
Normal file
@ -0,0 +1,734 @@
|
||||
-- NODES
|
||||
|
||||
|
||||
minetest.register_node("seacoral:coralcyan", {
|
||||
description = "Cyan Coral",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seacoral_coralcyan.png"},
|
||||
inventory_image = "seacoral_coralcyan.png",
|
||||
wield_image = "seacoral_coralcyan.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seacoral=1, sea=1,basecolor_cyan=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:coralmagenta", {
|
||||
description = "Magenta Coral",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seacoral_coralmagenta.png"},
|
||||
inventory_image = "seacoral_coralmagenta.png",
|
||||
wield_image = "seacoral_coralmagenta.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seacoral=1, sea=1,basecolor_magenta=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:coralaqua", {
|
||||
description = "Aqua Coral",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seacoral_coralaqua.png"},
|
||||
inventory_image = "seacoral_coralaqua.png",
|
||||
wield_image = "seacoral_coralaqua.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seacoral=1, sea=1,excolor_aqua=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:corallime", {
|
||||
description = "Lime Coral",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seacoral_corallime.png"},
|
||||
inventory_image = "seacoral_corallime.png",
|
||||
wield_image = "seacoral_corallime.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seacoral=1, sea=1,excolor_lime=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:coralskyblue", {
|
||||
description = "Skyblue Coral",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seacoral_coralskyblue.png"},
|
||||
inventory_image = "seacoral_coralskyblue.png",
|
||||
wield_image = "seacoral_coralskyblue.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seacoral=1, sea=1,excolor_skyblue=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:coralredviolet", {
|
||||
description = "Redviolet Coral",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seacoral_coralredviolet.png"},
|
||||
inventory_image = "seacoral_coralredviolet.png",
|
||||
wield_image = "seacoral_coralredviolet.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seacoral=1, sea=1,excolor_redviolet=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoralsandcyan", {
|
||||
description = "Sea coral sand cyan",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtcyan", {
|
||||
description = "Sea coral dirt cyan",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoralsandmagenta", {
|
||||
description = "Sea coral sand magenta",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtmagenta", {
|
||||
description = "Sea coral dirt magenta",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoralsandaqua", {
|
||||
description = "Sea coral sand aqua",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtaqua", {
|
||||
description = "Sea coral dirt aqua",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoralsandlime", {
|
||||
description = "Sea coral sand lime",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtlime", {
|
||||
description = "Sea coral dirt lime",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoralsandskyblue", {
|
||||
description = "Sea coral sand skyblue",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtskyblue", {
|
||||
description = "Sea coral dirt skyblue",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoralsandredviolet", {
|
||||
description = "Sea coral sand redviolet",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seacoral:seacoraldirtredviolet", {
|
||||
description = "Sea coral dirt redviolet",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-- CRAFTING
|
||||
|
||||
|
||||
if( minetest.get_modpath( "colormachine") == nil ) then
|
||||
register_seacoral_craft = function(output,recipe)
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = output,
|
||||
recipe = recipe,
|
||||
})
|
||||
end
|
||||
|
||||
register_seacoral_craft('dye:cyan 4', {'seacoral:coralcyan'})
|
||||
register_seacoral_craft('dye:magenta 4', {'seacoral:coralmagenta'})
|
||||
register_seacoral_craft('dye:lime 4', {'seacoral:corallime'})
|
||||
register_seacoral_craft('dye:aqua 4', {'seacoral:coralaqua'})
|
||||
register_seacoral_craft('dye:skyblue 4', {'seacoral:coralskyblue'})
|
||||
register_seacoral_craft('dye:redviolet 4', {'seacoral:coralredviolet'})
|
||||
end
|
||||
|
||||
-- SEACORAL SAND AND DIRT GENERATION
|
||||
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoralsandcyan",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoraldirtcyan",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoralsandmagenta",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoraldirtmagenta",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoralsandaqua",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoraldirtaqua",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoralsandlime",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoraldirtlime",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoralsandskyblue",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoraldirtskyblue",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoralsandredviolet",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seacoral:seacoraldirtredviolet",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -4,
|
||||
height_min = -8,
|
||||
})
|
||||
|
||||
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
|
||||
if maxp.y < height_min or minp.y > height_max then
|
||||
return
|
||||
end
|
||||
local y_min = math.max(minp.y, height_min)
|
||||
local y_max = math.min(maxp.y, height_max)
|
||||
if chunk_size >= y_max - y_min + 1 then
|
||||
return
|
||||
end
|
||||
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
|
||||
local pr = PseudoRandom(seed)
|
||||
local num_chunks = math.floor(chunks_per_volume * volume)
|
||||
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
|
||||
for i=1,num_chunks do
|
||||
local y0 = pr:next(y_min, y_max-chunk_size+1)
|
||||
if y0 >= height_min and y0 <= height_max then
|
||||
local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
|
||||
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
|
||||
local p0 = {x=x0, y=y0, z=z0}
|
||||
for x1=0,chunk_size-1 do
|
||||
for y1=0,chunk_size-1 do
|
||||
for z1=0,chunk_size-1 do
|
||||
if pr:next(1,inverse_chance) == 1 then
|
||||
local x2 = x0+x1
|
||||
local y2 = y0+y1
|
||||
local z2 = z0+z1
|
||||
local p2 = {x=x2, y=y2, z=z2}
|
||||
if minetest.get_node(p2).name == wherein then
|
||||
minetest.set_node(p2, {name=name})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- ABM'S
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoraldirtcyan"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralcyan"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoralsandcyan"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralcyan"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoraldirtmagenta"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralmagenta"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoralsandmagenta"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralmagenta"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoraldirtaqua"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralaqua"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoralsandaqua"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralaqua"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoraldirtlime"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:corallime"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoralsandlime"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:corallime"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoraldirtskyblue"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralskyblue"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoralsandskyblue"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralskyblue"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoraldirtredviolet"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralredviolet"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seacoral:seacoralsandredviolet"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seacoral:coralredviolet"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:seacoral"},
|
||||
interval = 3,
|
||||
chance = 1,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local yyp = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
if ((minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") and
|
||||
(minetest.get_node(yyp).name == "default:water_source" or
|
||||
minetest.get_node(yyp).name == "noairblocks:water_sourcex")) then
|
||||
local objs = minetest.env:get_objects_inside_radius(pos, 2)
|
||||
for k, obj in pairs(objs) do
|
||||
obj:set_hp(obj:get_hp()+ 1)
|
||||
end
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- OPTIONAL DEPENDENCY
|
||||
|
||||
|
||||
if( minetest.get_modpath( "colormachine") ~= nil ) then
|
||||
colormachine.basic_dye_sources = { "flowers:rose", "flowers:tulip", "flowers:dandelion_yellow", "seacoral:corallime", "default:cactus", "seacoral:coralaqua", "seacoral:coralcyan", "seacoral:coralskyblue", "flowers:geranium", "flowers:viola", "seacoral:coralmagenta", "seacoral:coralredviolet", "default:stone", "", "", "", "default:coal_lump" };
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
|
||||
-- ALIASES
|
||||
|
||||
|
||||
minetest.register_alias("seadye:cyan","dye:cyan")
|
||||
minetest.register_alias("seadye:magenta","dye:magenta")
|
||||
minetest.register_alias("seadye:lime","dye:lime")
|
||||
minetest.register_alias("seadye:aqua","dye:aqua")
|
||||
minetest.register_alias("seadye:skyblue","dye:skyblue")
|
||||
minetest.register_alias("seadye:redviolet","dye:redviolet")
|
0
mods/sea/seacoral/readme.txt
Executable file → Normal file
0
mods/sea/seacoral/textures/seacoral_coralaqua.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seacoral/textures/seacoral_coralcyan.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seacoral/textures/seacoral_corallime.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/seacoral/textures/seacoral_coralmagenta.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seacoral/textures/seacoral_coralredviolet.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/seacoral/textures/seacoral_coralskyblue.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seaglass/depends.txt
Executable file → Normal file
0
mods/sea/seaglass/init.lua
Executable file → Normal file
0
mods/sea/seaglass/readme.txt
Executable file → Normal file
0
mods/sea/seaglass/textures/seaglass_seaglass.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seaglass/textures/seaglass_seaglass_black.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seaglass/textures/seaglass_seaglass_blue.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seaglass/textures/seaglass_seaglass_red.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seaglass/textures/seaglass_seaglass_white.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/sea/seaglass/textures/seaglass_seaglass_yellow.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seagravel/depends.txt
Executable file → Normal file
254
mods/sea/seagravel/init.lua
Executable file → Normal file
@ -10,6 +10,23 @@ minetest.register_node("seagravel:seagravel", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_cyan", {
|
||||
@ -21,6 +38,23 @@ minetest.register_node("seagravel:seagravel_cyan", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_magenta", {
|
||||
@ -32,6 +66,23 @@ minetest.register_node("seagravel:seagravel_magenta", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_lime", {
|
||||
@ -43,6 +94,23 @@ minetest.register_node("seagravel:seagravel_lime", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_aqua", {
|
||||
@ -54,6 +122,23 @@ minetest.register_node("seagravel:seagravel_aqua", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_skyblue", {
|
||||
@ -65,6 +150,23 @@ minetest.register_node("seagravel:seagravel_skyblue", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_redviolet", {
|
||||
@ -76,6 +178,23 @@ minetest.register_node("seagravel:seagravel_redviolet", {
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
@ -90,7 +209,24 @@ stairs.register_stair_and_slab("seagravel", "seagravel:seagravel",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_cyan", "seagravel:seagravel_cyan",
|
||||
{crumbly=2, falling_node=1},
|
||||
@ -100,7 +236,24 @@ stairs.register_stair_and_slab("seagravel_cyan", "seagravel:seagravel_cyan",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_magenta", "seagravel:seagravel_magenta",
|
||||
{crumbly=2, falling_node=1},
|
||||
@ -110,7 +263,24 @@ stairs.register_stair_and_slab("seagravel_magenta", "seagravel:seagravel_magenta
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_lime", "seagravel:seagravel_lime",
|
||||
{cracky=3, stone=2},
|
||||
@ -120,7 +290,24 @@ stairs.register_stair_and_slab("seagravel_lime", "seagravel:seagravel_lime",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_aqua", "seagravel:seagravel_aqua",
|
||||
{crumbly=2, falling_node=1},
|
||||
@ -130,7 +317,24 @@ stairs.register_stair_and_slab("seagravel_aqua", "seagravel:seagravel_aqua",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_skyblue", "seagravel:seagravel_skyblue",
|
||||
{crumbly=2, falling_node=1},
|
||||
@ -140,7 +344,24 @@ stairs.register_stair_and_slab("seagravel_skyblue", "seagravel:seagravel_skyblue
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_redviolet", "seagravel:seagravel_redviolet",
|
||||
{crumbly=2, falling_node=1},
|
||||
@ -150,7 +371,24 @@ stairs.register_stair_and_slab("seagravel_redviolet", "seagravel:seagravel_redvi
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}))
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
|
||||
-- CRAFTING
|
||||
@ -178,4 +416,4 @@ register_seagravel_craft("seagravel:seagravel_magenta", {'clams:crushedwhite', '
|
||||
register_seagravel_craft("seagravel:seagravel_lime", {'clams:crushedwhite', 'default:gravel','dye:lime'})
|
||||
register_seagravel_craft("seagravel:seagravel_aqua", {'clams:crushedwhite', 'default:gravel','dye:aqua'})
|
||||
register_seagravel_craft("seagravel:seagravel_skyblue", {'clams:crushedwhite', 'default:gravel','dye:skyblue'})
|
||||
register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'})
|
||||
register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'})
|
||||
|
377
mods/sea/seagravel/init.lua~
Normal file
@ -0,0 +1,377 @@
|
||||
-- NODES
|
||||
|
||||
|
||||
minetest.register_node("seagravel:seagravel", {
|
||||
description = "Sea gravel",
|
||||
tiles = {"seagravel_seagravel.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_cyan", {
|
||||
description = "Sea gravel cyan",
|
||||
tiles = {"seagravel_seagravel_cyan.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_magenta", {
|
||||
description = "Sea gravel magenta",
|
||||
tiles = {"seagravel_seagravel_magenta.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_lime", {
|
||||
description = "Sea gravel lime",
|
||||
tiles = {"seagravel_seagravel_lime.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_aqua", {
|
||||
description = "Sea gravel aqua",
|
||||
tiles = {"seagravel_seagravel_aqua.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_skyblue", {
|
||||
description = "Sea gravel skyblue",
|
||||
tiles = {"seagravel_seagravel_skyblue.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seagravel:seagravel_redviolet", {
|
||||
description = "Sea gravel redviolet",
|
||||
tiles = {"seagravel_seagravel_redviolet.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=2, falling_node=1},
|
||||
sounds = default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
}),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- STAIRS
|
||||
|
||||
|
||||
stairs.register_stair_and_slab("seagravel", "seagravel:seagravel",
|
||||
{crumbly=2, falling_node=1},
|
||||
{"seagravel_seagravel.png"},
|
||||
"Seagravel stair",
|
||||
"Seagravel slab",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_cyan", "seagravel:seagravel_cyan",
|
||||
{crumbly=2, falling_node=1},
|
||||
{"seagravel_seagravel_cyan.png"},
|
||||
"Seagravel stair cyan",
|
||||
"Seagravel slab cyan",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_magenta", "seagravel:seagravel_magenta",
|
||||
{crumbly=2, falling_node=1},
|
||||
{"seagravel_seagravel_magenta.png"},
|
||||
"Seagravel stair magenta",
|
||||
"Seagravel slab magenta",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_lime", "seagravel:seagravel_lime",
|
||||
{cracky=3, stone=2},
|
||||
{"seagravel_seagravel_lime.png"},
|
||||
"Seagravel stair lime",
|
||||
"Seagravel slab lime",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_aqua", "seagravel:seagravel_aqua",
|
||||
{crumbly=2, falling_node=1},
|
||||
{"seagravel_seagravel_aqua.png"},
|
||||
"Seagravel stair aqua",
|
||||
"Seagravel slab aqua",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_skyblue", "seagravel:seagravel_skyblue",
|
||||
{crumbly=2, falling_node=1},
|
||||
{"seagravel_seagravel_skyblue.png"},
|
||||
"Seagravel stair skyblue ",
|
||||
"Seagravel slab skyblue",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
stairs.register_stair_and_slab("seagravel_redviolet", "seagravel:seagravel_redviolet",
|
||||
{crumbly=2, falling_node=1},
|
||||
{"seagravel_seagravel_redviolet.png"},
|
||||
"Seagravel stair redviolet",
|
||||
"Seagravel slab redviolet",
|
||||
default.node_sound_dirt_defaults({
|
||||
footstep = {name="default_gravel_footstep", gain=0.5},
|
||||
dug = {name="default_gravel_footstep", gain=1.0},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
}))
|
||||
|
||||
|
||||
-- CRAFTING
|
||||
|
||||
|
||||
local register_seagravel_craft = function(output,recipe)
|
||||
minetest.register_craft({
|
||||
type = 'shapeless',
|
||||
output = output,
|
||||
recipe = recipe,
|
||||
})
|
||||
end
|
||||
|
||||
register_seagravel_craft("seagravel:seagravel", {'clams:crushedwhite', 'default:gravel'})
|
||||
|
||||
register_seagravel_craft("seagravel:seagravel_cyan", {'seagravel:seagravel', 'dye:cyan'})
|
||||
register_seagravel_craft("seagravel:seagravel_magenta", {'seagravel:seagravel', 'dye:magenta'})
|
||||
register_seagravel_craft("seagravel:seagravel_lime", {'seagravel:seagravel', 'dye:lime'})
|
||||
register_seagravel_craft("seagravel:seagravel_aqua", {'seagravel:seagravel', 'dye:aqua'})
|
||||
register_seagravel_craft("seagravel:seagravel_skyblue", {'seagravel:seagravel', 'dye:skyblue'})
|
||||
register_seagravel_craft("seagravel:seagravel_redviolet", {'seagravel:seagravel', 'dye:redviolet'})
|
||||
|
||||
register_seagravel_craft("seagravel:seagravel_cyan", {'clams:crushedwhite', 'default:gravel','dye:cyan'})
|
||||
register_seagravel_craft("seagravel:seagravel_magenta", {'clams:crushedwhite', 'default:gravel','dye:magenta'})
|
||||
register_seagravel_craft("seagravel:seagravel_lime", {'clams:crushedwhite', 'default:gravel','dye:lime'})
|
||||
register_seagravel_craft("seagravel:seagravel_aqua", {'clams:crushedwhite', 'default:gravel','dye:aqua'})
|
||||
register_seagravel_craft("seagravel:seagravel_skyblue", {'clams:crushedwhite', 'default:gravel','dye:skyblue'})
|
||||
register_seagravel_craft("seagravel:seagravel_redviolet", {'clams:crushedwhite', 'default:gravel','dye:redviolet'})
|
0
mods/sea/seagravel/readme.txt
Executable file → Normal file
0
mods/sea/seagravel/textures/seagravel_seagravel.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seagravel/textures/seagravel_seagravel_aqua.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/sea/seagravel/textures/seagravel_seagravel_cyan.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/seagravel/textures/seagravel_seagravel_lime.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/seagravel/textures/seagravel_seagravel_magenta.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/sea/seagravel/textures/seagravel_seagravel_redviolet.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seagravel/textures/seagravel_seagravel_skyblue.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/sealamps/depends.txt
Executable file → Normal file
0
mods/sea/sealamps/init.lua
Executable file → Normal file
0
mods/sea/sealamps/readme.txt
Executable file → Normal file
0
mods/sea/sealamps/textures/sealamps_lantern.png
Executable file → Normal file
Before Width: | Height: | Size: 991 B After Width: | Height: | Size: 991 B |
0
mods/sea/sealamps/textures/sealamps_lantern_on_ceiling.png
Executable file → Normal file
Before Width: | Height: | Size: 1010 B After Width: | Height: | Size: 1010 B |
0
mods/sea/sealamps/textures/sealamps_lantern_on_floor.png
Executable file → Normal file
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1012 B |
0
mods/sea/sealamps/textures/sealamps_torch_animated.png
Executable file → Normal file
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
0
mods/sea/sealamps/textures/sealamps_torch_on_ceiling_animated.png
Executable file → Normal file
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
0
mods/sea/sealamps/textures/sealamps_torch_on_floor.png
Executable file → Normal file
Before Width: | Height: | Size: 972 B After Width: | Height: | Size: 972 B |
0
mods/sea/sealamps/textures/sealamps_torch_on_floor_animated.png
Executable file → Normal file
Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB |
0
mods/sea/seaplants/depends.txt
Executable file → Normal file
70
mods/sea/seaplants/init.lua
Executable file → Normal file
@ -133,6 +133,23 @@ minetest.register_node("seaplants:seaplantssandkelpgreen", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtkelpgreen", {
|
||||
@ -151,6 +168,23 @@ minetest.register_node("seaplants:seaplantssandkelpbrown", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtkelpbrown", {
|
||||
@ -169,6 +203,23 @@ minetest.register_node("seaplants:seaplantssandseagrassgreen", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtseagrassgreen", {
|
||||
@ -187,6 +238,23 @@ minetest.register_node("seaplants:seaplantssandseagrassred", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtseagrassred", {
|
||||
@ -536,4 +604,4 @@ minetest.register_alias("seaplants:chewstickgreen","seaplants:kelpgreen")
|
||||
minetest.register_alias("seaplants:chewstickbrown","seaplants:kelpbrown")
|
||||
minetest.register_alias("seaplants:leavysnackgreen","seaplants:seagrassgreen")
|
||||
minetest.register_alias("seaplants:leavysnackblue","seaplants:seagrassred")
|
||||
minetest.register_alias("seaplants:seasalad","seaplants:seasaladmix")
|
||||
minetest.register_alias("seaplants:seasalad","seaplants:seasaladmix")
|
||||
|
595
mods/sea/seaplants/init.lua~
Normal file
@ -0,0 +1,595 @@
|
||||
-- NODES
|
||||
|
||||
minetest.register_node("seaplants:kelpgreen", {
|
||||
description = "Green Kelp",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaplants_kelpgreen.png"},
|
||||
inventory_image = "seaplants_kelpgreen.png",
|
||||
wield_image = "seaplants_kelpgreen.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.3, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seaplants=1, sea=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:kelpgreenmiddle", {
|
||||
description = "Green Kelp middle",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaplants_kelpgreenmiddle.png"},
|
||||
inventory_image = "seaplants_kelpgreenmiddle.png",
|
||||
wield_image = "seaplants_kelpgreenmiddle.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seaplants=1, sea=1},
|
||||
drop = "seaplants:kelpgreen",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:kelpbrown", {
|
||||
description = "Brown Kelp ",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaplants_kelpbrown.png"},
|
||||
inventory_image = "seaplants_kelpbrown.png",
|
||||
wield_image = "seaplants_kelpbrown.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.3, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seaplants=1, sea=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:kelpbrownmiddle", {
|
||||
description = "Brown Kelp middle",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaplants_kelpbrownmiddle.png"},
|
||||
inventory_image = "seaplants_kelpbrownmiddle.png",
|
||||
wield_image = "seaplants_kelpbrownmiddle.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seaplants=1, sea=1},
|
||||
drop = "seaplants:kelpbrown",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seagrassgreen", {
|
||||
description = "Green Seagrass",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaplants_seagrassgreen.png"},
|
||||
inventory_image = "seaplants_seagrassgreen.png",
|
||||
wield_image = "seaplants_seagrassgreen.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.3, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seaplants=1, sea=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seagrassred", {
|
||||
description = "Red Seagrass",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"seaplants_seagrassred.png"},
|
||||
inventory_image = "seaplants_seagrassred.png",
|
||||
wield_image = "seaplants_seagrassred.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
climbable = true,
|
||||
drowning = 1,
|
||||
is_ground_content = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.3, 0.3}
|
||||
},
|
||||
post_effect_color = {a=64, r=100, g=100, b=200},
|
||||
groups = {snappy=3, seaplants=1, sea=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantssandkelpgreen", {
|
||||
description = "Sea plants sand kelp green",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtkelpgreen", {
|
||||
description = "Sea plants dirt kelp green",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantssandkelpbrown", {
|
||||
description = "Sea plants sand kelp brown",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtkelpbrown", {
|
||||
description = "Sea plants dirt kelp brown",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantssandseagrassgreen", {
|
||||
description = "Sea plants sand seagrass green",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtseagrassgreen", {
|
||||
description = "Sea plants dirt seagrass green",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantssandseagrassred", {
|
||||
description = "Sea plants sand seagrass red",
|
||||
tiles = {"default_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:sand',
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if not pointed_thing.type == "node" then
|
||||
return itemstack
|
||||
end
|
||||
local pn = placer:get_player_name()
|
||||
if minetest.is_protected(pointed_thing.above, pn) then
|
||||
return itemstack
|
||||
end
|
||||
minetest.env:add_node(pointed_thing.above, {name=itemstack:get_name()})
|
||||
local meta = minetest.env:get_meta(pointed_thing.above)
|
||||
meta:set_string("owner", pn)
|
||||
nodeupdate(pointed_thing.above)
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("seaplants:seaplantsdirtseagrassred", {
|
||||
description = "Sea plants dirt seagrass red",
|
||||
tiles = {"default_dirt.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
|
||||
drop = 'default:dirt',
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
|
||||
-- CRAFT ITEMS
|
||||
|
||||
|
||||
minetest.register_craftitem("seaplants:seasaladmix", {
|
||||
description = "Sea salad mix",
|
||||
inventory_image = "seaplants_seasaladmix.png",
|
||||
on_use = minetest.item_eat(6)
|
||||
})
|
||||
|
||||
|
||||
-- CRAFTING
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "seaplants:seasaladmix",
|
||||
recipe = {"seaplants:kelpgreen", "seaplants:kelpbrown", "seaplants:seagrassgreen", "seaplants:seagrassred"}
|
||||
})
|
||||
|
||||
|
||||
-- SEAPLANTS SAND AND DIRT GENERATION
|
||||
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantssandkelpgreen",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantsdirtkelpgreen",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantssandkelpbrown",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantsdirtkelpbrown",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantssandseagrassgreen",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantsdirtseagrassgreen",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantssandseagrassred",
|
||||
wherein = "default:sand",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "seaplants:seaplantsdirtseagrassred",
|
||||
wherein = "default:dirt",
|
||||
clust_scarcity = 10*10*10,
|
||||
clust_num_ores = 24,
|
||||
clust_size = 4,
|
||||
height_max = -14,
|
||||
height_min = -31000,
|
||||
})
|
||||
|
||||
local function generate_ore(name, wherein, minp, maxp, seed, chunks_per_volume, chunk_size, ore_per_chunk, height_min, height_max)
|
||||
if maxp.y < height_min or minp.y > height_max then
|
||||
return
|
||||
end
|
||||
local y_min = math.max(minp.y, height_min)
|
||||
local y_max = math.min(maxp.y, height_max)
|
||||
if chunk_size >= y_max - y_min + 1 then
|
||||
return
|
||||
end
|
||||
local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1)
|
||||
local pr = PseudoRandom(seed)
|
||||
local num_chunks = math.floor(chunks_per_volume * volume)
|
||||
local inverse_chance = math.floor(chunk_size*chunk_size*chunk_size / ore_per_chunk)
|
||||
for i=1,num_chunks do
|
||||
local y0 = pr:next(y_min, y_max-chunk_size+1)
|
||||
if y0 >= height_min and y0 <= height_max then
|
||||
local x0 = pr:next(minp.x, maxp.x-chunk_size+1)
|
||||
local z0 = pr:next(minp.z, maxp.z-chunk_size+1)
|
||||
local p0 = {x=x0, y=y0, z=z0}
|
||||
for x1=0,chunk_size-1 do
|
||||
for y1=0,chunk_size-1 do
|
||||
for z1=0,chunk_size-1 do
|
||||
if pr:next(1,inverse_chance) == 1 then
|
||||
local x2 = x0+x1
|
||||
local y2 = y0+y1
|
||||
local z2 = z0+z1
|
||||
local p2 = {x=x2, y=y2, z=z2}
|
||||
if minetest.get_node(p2).name == wherein then
|
||||
minetest.set_node(p2, {name=name})
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- ABM'S
|
||||
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantsdirtkelpgreen"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:kelpgreen"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantssandkelpgreen"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:kelpgreen"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:kelpgreen"},
|
||||
interval = 6,
|
||||
chance = 3,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local yyp = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
local yyyp = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
if minetest.get_node(pos).name == "seaplants:kelpgreen" and
|
||||
(minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yyp).name == "default:water_source" or
|
||||
minetest.get_node(yyp).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yyyp).name == "default:water_source" or
|
||||
minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then
|
||||
minetest.add_node(pos, {name = "seaplants:kelpgreenmiddle"})
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:kelpgreen"})
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantsdirtkelpbrown"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:kelpbrown"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantssandkelpbrown"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:kelpbrown"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:kelpbrown"},
|
||||
interval = 6,
|
||||
chance = 3,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local yyp = {x = pos.x, y = pos.y + 2, z = pos.z}
|
||||
local yyyp = {x = pos.x, y = pos.y + 3, z = pos.z}
|
||||
if minetest.get_node(pos).name == "seaplants:kelpbrown" and
|
||||
(minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yyp).name == "default:water_source" or
|
||||
minetest.get_node(yyp).name == "noairblocks:water_sourcex") then
|
||||
if (minetest.get_node(yyyp).name == "default:water_source" or
|
||||
minetest.get_node(yyyp).name == "noairblocks:water_sourcex") then
|
||||
minetest.add_node(pos, {name = "seaplants:kelpbrownmiddle"})
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:kelpbrown"})
|
||||
else
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantsdirtseagrassgreen"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:seagrassgreen"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantssandseagrassgreen"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:seagrassgreen"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantsdirtseagrassred"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:seagrassred"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"seaplants:seaplantssandseagrassred"},
|
||||
interval = 12,
|
||||
chance = 12,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
local yp = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
if (minetest.get_node(yp).name == "default:water_source" or
|
||||
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
|
||||
pos.y = pos.y + 1
|
||||
minetest.add_node(pos, {name = "seaplants:seagrassred"}) else
|
||||
return
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
-- ALIASES
|
||||
|
||||
|
||||
minetest.register_alias("seaplants:stemsgreen","default:sand")
|
||||
minetest.register_alias("seaplants:stemsbrown","default:dirt")
|
||||
minetest.register_alias("seaplants:leafyblue","default:sand")
|
||||
minetest.register_alias("seaplants:leafygreen","default:dirt")
|
||||
|
||||
minetest.register_alias("seaplants:chewstickgreen","seaplants:kelpgreen")
|
||||
minetest.register_alias("seaplants:chewstickbrown","seaplants:kelpbrown")
|
||||
minetest.register_alias("seaplants:leavysnackgreen","seaplants:seagrassgreen")
|
||||
minetest.register_alias("seaplants:leavysnackblue","seaplants:seagrassred")
|
||||
minetest.register_alias("seaplants:seasalad","seaplants:seasaladmix")
|
0
mods/sea/seaplants/readme.txt
Executable file → Normal file
0
mods/sea/seaplants/textures/seaplants_kelpbrown.png
Executable file → Normal file
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
0
mods/sea/seaplants/textures/seaplants_kelpbrownmiddle.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/sea/seaplants/textures/seaplants_kelpgreen.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/seaplants/textures/seaplants_kelpgreenmiddle.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/sea/seaplants/textures/seaplants_seagrassgreen.png
Executable file → Normal file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
0
mods/sea/seaplants/textures/seaplants_seagrassred.png
Executable file → Normal file
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
0
mods/sea/seaplants/textures/seaplants_seasaladmix.png
Executable file → Normal file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
0
mods/sea/seastone/depends.txt
Executable file → Normal file
0
mods/sea/seastone/init.lua
Executable file → Normal file
0
mods/sea/seastone/readme.txt
Executable file → Normal file
0
mods/sea/seastone/textures/seastone_seastone.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seastone/textures/seastone_seastone_aqua.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seastone/textures/seastone_seastone_cyan.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seastone/textures/seastone_seastone_lime.png
Executable file → Normal file
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
0
mods/sea/seastone/textures/seastone_seastone_magenta.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
0
mods/sea/seastone/textures/seastone_seastone_redviolet.png
Executable file → Normal file
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
0
mods/sea/seastone/textures/seastone_seastone_skyblue.png
Executable file → Normal file
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |