1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Clean up the "/mods" folder and new "Ice" texture

- Delete the mod « painting »
- Delete the mod « player_notes »
- Delete useless temporary files (.lua)
- Change the « ice » texture
This commit is contained in:
Ombridride 2014-11-03 22:17:10 +01:00
parent 72ad0dc7b7
commit ca2f79403c
53 changed files with 0 additions and 4522 deletions

View File

@ -1,117 +0,0 @@
local drop = function(pos, itemstack)
local it = itemstack:take_item(itemstack:get_count())
local obj = core.add_item(pos, it)
if obj then
obj:setvelocity({x=math.random(-1,1), y=5, z=math.random(-1,1)})
local remi = minetest.setting_get("remove_items")
if remi and remi == "true" then
obj:remove()
end
end
return itemstack
end
minetest.register_on_dieplayer(function(player)
if minetest.setting_getbool("creative_mode") then
return
end
local pos = player:getpos()
pos.y = math.floor(pos.y + 0.5)
minetest.chat_send_player(player:get_player_name(), 'at '..math.floor(pos.x)..','..math.floor(pos.y)..','..math.floor(pos.z))
local player_inv = player:get_inventory()
for i=1,player_inv:get_size("main") do
drop(pos, player_inv:get_stack("main", i))
player_inv:set_stack("main", i, nil)
end
for i=1,player_inv:get_size("craft") do
drop(pos, player_inv:get_stack("craft", i))
player_inv:set_stack("craft", i, nil)
end
-- Drop unified_inventory bags and their contents
if minetest.get_modpath("unified_inventory") then
local bag_id = {"bag1"}
local contents_id = ""
local n = 0
for n = 1, 4 do
if player_inv:get_size(bag_id[n]) ~= nil and player_inv:get_size(bag_id[n] == 1) then
contents_id = bag_id[n].."contents"
-- Drop the contents of the bag (but keep the bag itself)
for i = 1, player_inv:get_size(contents_id) do
-- Drop a clone of this item's stack and remove the one from the inventory
drop(pos, player_inv:get_stack(contents_id, i))
player_inv:set_stack(contents_id, i, nil)
end
end
end
end
if minetest.get_modpath("unified_inventory") then
local bag_id = {"bag2"}
local contents_id = ""
local n = 0
for n = 1, 4 do
if player_inv:get_size(bag_id[n]) ~= nil and player_inv:get_size(bag_id[n] == 1) then
contents_id = bag_id[n].."contents"
-- Drop the contents of the bag (but keep the bag itself)
for i = 1, player_inv:get_size(contents_id) do
-- Drop a clone of this item's stack and remove the one from the inventory
drop(pos, player_inv:get_stack(contents_id, i))
player_inv:set_stack(contents_id, i, nil)
end
end
end
end
if minetest.get_modpath("unified_inventory") then
local bag_id = {"bag3"}
local contents_id = ""
local n = 0
for n = 1, 4 do
if player_inv:get_size(bag_id[n]) ~= nil and player_inv:get_size(bag_id[n] == 1) then
contents_id = bag_id[n].."contents"
-- Drop the contents of the bag (but keep the bag itself)
for i = 1, player_inv:get_size(contents_id) do
-- Drop a clone of this item's stack and remove the one from the inventory
drop(pos, player_inv:get_stack(contents_id, i))
player_inv:set_stack(contents_id, i, nil)
end
end
end
end
if minetest.get_modpath("unified_inventory") then
local bag_id = {"bag4"}
local contents_id = ""
local n = 0
for n = 1, 4 do
if player_inv:get_size(bag_id[n]) ~= nil and player_inv:get_size(bag_id[n] == 1) then
contents_id = bag_id[n].."contents"
-- Drop the contents of the bag (but keep the bag itself)
for i = 1, player_inv:get_size(contents_id) do
-- Drop a clone of this item's stack and remove the one from the inventory
drop(pos, player_inv:get_stack(contents_id, i))
player_inv:set_stack(contents_id, i, nil)
end
end
end
end
end)

View File

@ -1,116 +0,0 @@
minetest.register_globalstep(function(dtime)
for _,player in ipairs(minetest.get_connected_players()) do
if player:get_hp() > 0 or not minetest.setting_getbool("enable_damage") then
local pos = player:getpos()
pos.y = pos.y+0.5
local inv = player:get_inventory()
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 1)) do
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
if object:get_luaentity().itemstring ~= "" then
minetest.sound_play("item_drop_pickup", {
to_player = player:get_player_name(),
gain = 0.4,
})
end
object:get_luaentity().itemstring = ""
object:remove()
end
end
end
for _,object in ipairs(minetest.env:get_objects_inside_radius(pos, 2)) do
if not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "__builtin:item" then
if object:get_luaentity().collect then
if inv and inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
local pos1 = pos
pos1.y = pos1.y+0.2
local pos2 = object:getpos()
local vec = {x=pos1.x-pos2.x, y=pos1.y-pos2.y, z=pos1.z-pos2.z}
vec.x = vec.x*3
vec.y = vec.y*3
vec.z = vec.z*3
object:setvelocity(vec)
object:get_luaentity().physical_state = false
object:get_luaentity().object:set_properties({
physical = false
})
minetest.after(1, function(args)
local lua = object:get_luaentity()
if object == nil or lua == nil or lua.itemstring == nil then
return
end
if inv:room_for_item("main", ItemStack(object:get_luaentity().itemstring)) then
inv:add_item("main", ItemStack(object:get_luaentity().itemstring))
if object:get_luaentity().itemstring ~= "" then
minetest.sound_play("item_drop_pickup", {
to_player = player:get_player_name(),
gain = 0.4,
})
end
object:get_luaentity().itemstring = ""
object:remove()
else
object:setvelocity({x=0,y=0,z=0})
object:get_luaentity().physical_state = true
object:get_luaentity().object:set_properties({
physical = true
})
end
end, {player, object})
end
end
end
end
end
end
end)
function minetest.handle_node_drops(pos, drops, digger)
local inv
if minetest.setting_getbool("creative_mode") and digger and digger:is_player() then
inv = digger:get_inventory()
end
for _,item in ipairs(drops) do
local count, name
if type(item) == "string" then
count = 1
name = item
else
count = item:get_count()
name = item:get_name()
end
if not inv or not inv:contains_item("main", ItemStack(name)) then
for i=1,count do
local obj = minetest.env:add_item(pos, name)
if obj ~= nil 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})
-- FIXME this doesnt work for deactiveted objects
if minetest.setting_get("remove_items") and tonumber(minetest.setting_get("remove_items")) then
minetest.after(tonumber(minetest.setting_get("remove_items")), function(obj)
obj:remove()
end, obj)
end
end
end
end
end
end
if minetest.setting_get("log_mods") then
minetest.log("action", "item_drop loaded")
end

View File

@ -1,4 +0,0 @@
painting
========
in-game painting mod for minetest

View File

@ -1,39 +0,0 @@
-- painting - in-game painting for minetest
-- THIS MOD CODE AND TEXTURES LICENSED
-- <3 TO YOU <3
-- UNDER TERMS OF WTFPL LICENSE
-- 2012, 2013, 2014 obneq aka jin xi
minetest.register_craft({
output = 'painting:easel 1',
recipe = {
{ '', 'default:wood', '' },
{ '', 'default:wood', '' },
{ 'default:stick','', 'default:stick' },
}})
minetest.register_craft({
output = 'painting:canvas_16 1',
recipe = {
{ '', '', '' },
{ '', '', '' },
{ 'default:paper', '', '' },
}})
minetest.register_craft({
output = 'painting:canvas_32 1',
recipe = {
{ '', '', '' },
{ 'default:paper', 'default:paper', '' },
{ 'default:paper', 'default:paper', '' },
}})
minetest.register_craft({
output = 'painting:canvas_64 1',
recipe = {
{ 'default:paper', 'default:paper', 'default:paper' },
{ 'default:paper', 'default:paper', 'default:paper' },
{ 'default:paper', 'default:paper', 'default:paper' },
}})

View File

@ -1,441 +0,0 @@
-- painting - in-game painting for minetest
-- THIS MOD CODE AND TEXTURES LICENSED
-- <3 TO YOU <3
-- UNDER TERMS OF WTFPL LICENSE
-- 2012, 2013, 2014 obneq aka jin xi
-- picture is drawn using a nodebox to draw the canvas
-- and an entity which has the painting as its texture.
-- this texture is created by minetests internal image
-- compositing engine (see tile.cpp).
dofile(minetest.get_modpath("painting").."/crafts.lua")
textures = {
white = "white.png", yellow = "yellow.png",
orange = "orange.png", red = "red.png",
violet = "violet.png", blue = "blue.png",
green = "green.png", magenta = "magenta.png",
cyan = "cyan.png", grey = "grey.png",
darkgrey = "darkgrey.png", black = "black.png",
darkgreen = "darkgreen.png", brown="brown.png",
pink = "pink.png"
}
local colors = {}
local revcolors = {}
thickness = 0.1
-- picture node
picbox = {
type = "fixed",
fixed = { -0.499, -0.499, 0.499, 0.499, 0.499, 0.499 - thickness }
}
picnode = {
description = "Picture",
tiles = { "white.png" },
inventory_image = "painted.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = picbox,
selection_box = picbox,
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory=1},
--handle that right below, don't drop anything
drop = "",
after_dig_node=function(pos, oldnode, oldmetadata, digger)
--find and remove the entity
local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
for _, e in ipairs(objects) do
if e:get_luaentity().name == "painting:picent" then
e:remove()
end
end
--put picture data back into inventory item
local data = oldmetadata.fields["painting:picturedata"]
local item = { name = "painting:paintedcanvas", count = 1, metadata = data }
digger:get_inventory():add_item("main", item)
end
}
-- picture texture entity
picent = {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = { "white.png" },
on_activate = function(self, staticdata)
local pos = self.object:getpos()
local meta = minetest.env:get_meta(pos)
local data = meta:get_string("painting:picturedata")
data = minetest.deserialize(data)
if not data.grid then return end
self.object:set_properties({textures = { to_imagestring(data.grid, data.res) }})
end
}
paintbox = { [0] = { -0.5,-0.5,0,0.5,0.5,0 },
[1] = { 0,-0.5,-0.5,0,0.5,0.5 } }
paintent = {
collisionbox = { 0, 0, 0, 0, 0, 0 },
visual = "upright_sprite",
textures = { "white.png" },
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir)
--check for brush
local name = puncher:get_wielded_item():get_name()
name = string.split(name, "_")[2]
if not textures[name] then return end
--get player eye level
--see player.h line 129
local ppos = puncher:getpos()
ppos = { x = ppos.x, y = ppos.y + 1.625, z = ppos.z }
local pos = self.object:getpos()
local l = puncher:get_look_dir()
local d = dirs[self.fd]
local od = dirs[(self.fd + 1) % 4]
local normal = { x = d.x, y = 0, z = d.z }
local p = intersect(ppos, l, pos, normal)
local off = -0.5
pos = { x = pos.x + off * od.x, y = pos.y + off, z = pos.z + off * od.z }
p = sub(p, pos)
local x = math.abs(p.x + p.z)
local y = 1 - p.y
--print("x: "..x.." y: "..y)
x = math.floor(x / (1/self.res) )
y = math.floor(y / (1/self.res) )
--print("grid x: "..x.." grid y: "..y)
x = clamp(x, self.res)
y = clamp(y, self.res)
self.grid[x][y] = colors[name]
self.object:set_properties({textures = { to_imagestring(self.grid, self.res) }})
local wielded = puncher:get_wielded_item()
wielded:add_wear(65535/256)
puncher:set_wielded_item(wielded)
end,
on_activate = function(self, staticdata)
local data = minetest.deserialize(staticdata)
if not data then return end
self.fd = data.fd
self.res = data.res
self.grid = data.grid
self.object:set_properties({ textures = { to_imagestring(self.grid, self.res) }})
self.object:set_properties({ collisionbox = paintbox[self.fd%2] })
self.object:set_armor_groups({immortal=1})
end,
get_staticdata = function(self)
local data = { fd = self.fd, res = self.res, grid = self.grid }
return minetest.serialize(data)
end
}
-- just pure magic
local walltoface = {-1, -1, 1, 3, 0, 2}
--paintedcanvas picture inventory item
paintedcanvas = {
description = "Painted Canvas",
inventory_image = "painted.png",
stack_max = 1,
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory=1 },
on_place = function(itemstack, placer, pointed_thing)
--place node
local pos = pointed_thing.above
local under = pointed_thing.under
local above = pointed_thing.above
local dir = sub(under, above)
local wm = minetest.dir_to_wallmounted(dir)
local fd = walltoface[wm + 1]
if fd == -1 then
return itemstack
end
minetest.env:add_node(pos, { name = "painting:pic",
param2 = fd,
paramtype2 = "none" })
--save metadata
local data = itemstack:get_metadata()
local meta = minetest.env:get_meta(pos)
meta:set_string("painting:picturedata", data)
--add entity
dir = dirs[fd]
local off = 0.5 - thickness - 0.01
pos = { x = pos.x + dir.x * off,
y = pos.y,
z = pos.z + dir.z * off }
data = minetest.deserialize(data)
local p = minetest.env:add_entity(pos, "painting:picent"):get_luaentity()
p.object:set_properties({ textures = { to_imagestring(data.grid, data.res) }})
p.object:setyaw(math.pi * fd / -2)
return ItemStack("")
end
}
--canvas inventory item
canvas = {
description = "Canvas",
inventory_image = "default_paper.png",
stack_max = 99,
}
--canvas for drawing
canvasbox = {
type = "fixed",
fixed = { -0.5, -0.5, 0.0, 0.5, 0.5, thickness }
}
canvasnode = {
description = "Canvas",
tiles = { "white.png" },
inventory_image = "painted.png",
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = canvasbox,
selection_box = canvasbox,
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, not_in_creative_inventory=1 },
drop = "",
after_dig_node=function(pos, oldnode, oldmetadata, digger)
--get data and remove pixels
local data = {}
local objects = minetest.env:get_objects_inside_radius(pos, 0.5)
for _, e in ipairs(objects) do
e = e:get_luaentity()
if e.grid then
data.grid = e.grid
data.res = e.res
end
e.object:remove()
end
pos.y = pos.y-1
minetest.env:get_meta(pos):set_string("has_canvas", 0)
if data.grid then
local item = { name = "painting:paintedcanvas", count = 1, metadata = minetest.serialize(data) }
digger:get_inventory():add_item("main", item)
end
end
}
-- easel
easelbox = {
type="fixed",
fixed = {
--feet
{-0.4, -0.5, -0.5, -0.3, -0.4, 0.5 },
{ 0.3, -0.5, -0.5, 0.4, -0.4, 0.5 },
--legs
{-0.4, -0.4, 0.1, -0.3, 1.5, 0.2 },
{ 0.3, -0.4, 0.1, 0.4, 1.5, 0.2 },
--shelf
{-0.5, 0.35, -0.3, 0.5, 0.45, 0.1 }
}
}
easel = {
description = "Easel",
tiles = { "default_wood.png" },
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = "light",
paramtype2 = "facedir",
node_box = easelbox,
selection_box = easelbox,
groups = { snappy = 2, choppy = 2, oddly_breakable_by_hand = 2 },
on_punch = function(pos, node, player)
local wielded_raw = player:get_wielded_item():get_name()
wielded = string.split(wielded_raw, "_")
local name = wielded[1]
local res = tonumber(wielded[2])
if name ~= "painting:canvas" then
return
end
local meta = minetest.env:get_meta(pos)
local fd = node.param2
pos = { x = pos.x, y = pos.y + 1, z = pos.z }
if minetest.env:get_node(pos).name ~= "air" then return end
minetest.env:add_node(pos, { name = "painting:canvasnode",
param2 = fd,
paramtype2 = "none" })
local dir = dirs[fd]
pos = { x = pos.x - 0.01 * dir.x, y = pos.y, z = pos.z - 0.01 * dir.z }
local p = minetest.env:add_entity(pos, "painting:paintent"):get_luaentity()
p.object:set_properties({ collisionbox = paintbox[fd%2] })
p.object:set_armor_groups({immortal=1})
p.object:setyaw(math.pi * fd / -2)
p.grid = initgrid(res)
p.res = res
p.fd = fd
meta:set_int("has_canvas", 1)
local itemstack = ItemStack(wielded_raw)
player:get_inventory():remove_item("main", itemstack)
end,
can_dig = function(pos,player)
local meta = minetest.env:get_meta(pos)
local inv = meta:get_inventory()
if meta:get_int("has_canvas") == 0 then
return true
end
return false
end
}
--brushes
local function table_copy(t)
local t2 = {}
for k,v in pairs(t) do
t2[k] = v
end
return t2
end
brush = {
description = "brush",
inventory_image = "default_tool_steelaxe.png",
wield_image = "",
wield_scale = { x = 1, y = 1, z = 1 },
stack_max = 99,
liquids_pointable = false,
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
groupcaps = {}
}
}
minetest.register_entity("painting:picent", picent)
minetest.register_node("painting:pic", picnode)
minetest.register_craftitem("painting:canvas_16", canvas)
minetest.register_craftitem("painting:canvas_32", canvas)
minetest.register_craftitem("painting:canvas_64", canvas)
minetest.register_craftitem("painting:paintedcanvas", paintedcanvas)
minetest.register_entity("painting:paintent", paintent)
minetest.register_node("painting:canvasnode", canvasnode)
minetest.register_node("painting:easel", easel)
for color, _ in pairs(textures) do
table.insert(revcolors, color)
local brush_new = table_copy(brush)
brush_new.description = color:gsub("^%l", string.upper).." brush"
brush_new.inventory_image = "painting_brush_"..color..".png"
minetest.register_tool("painting:brush_"..color, brush_new)
minetest.register_craft({
output = "painting:brush_"..color,
recipe = {
{"dye:"..color},
{"default:stick"},
{"default:stick"}
}
})
end
for i, color in ipairs(revcolors) do
colors[color] = i
end
minetest.register_alias("easel", "painting:easel")
minetest.register_alias("canvas", "painting:canvas_16")
function initgrid(res)
local grid, x, y = {}
for x = 0, res - 1 do
grid[x] = {}
for y = 0, res - 1 do
grid[x][y] = colors["white"]
end
end
return grid
end
function to_imagestring(data, res)
if not data then return end
local t = { "[combine:", res, "x", res, ":" }
for y = 0, res - 1 do
for x = 0, res - 1 do
table.insert(t, x..","..y.."="..revcolors[ data[x][y] ]..".png:")
end
end
return table.concat(t)
end
dirs = {
[0] = { x = 0, z = 1 },
[1] = { x = 1, z = 0 },
[2] = { x = 0, z =-1 },
[3] = { x =-1, z = 0 } }
function sub(v, w)
return { x = v.x - w.x,
y = v.y - w.y,
z = v.z - w.z }
end
function dot(v, w)
return v.x * w.x + v.y * w.y + v.z * w.z
end
function intersect(pos, dir, origin, normal)
local t = -(dot(sub(pos, origin), normal)) / dot(dir, normal)
return { x = pos.x + dir.x * t,
y = pos.y + dir.y * t,
z = pos.z + dir.z * t }
end
function clamp(num, res)
if num < 0 then
return 0
elseif num > res - 1 then
return res - 1
else
return num
end
end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 568 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 572 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 569 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 573 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 571 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 295 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

View File

@ -1,23 +0,0 @@
Minetest player_notes mod - API
===============================
player_notes.add_note(name, target, note)
Adds a note to a player
Returns nil on success, otherwise error string
^ name -> player or object which added the note
^ target -> to which player the note should get added
^ note -> the note text to add to <name>
player_notes.rm_note(target, key)
Removes a note from a player
Returns nil on success, otherwise error string
^ target -> from which player the note should get removed
^ key -> key of the note to remove from <name>
player_notes.save_data()
Saves changed data (use this after add_note or rm_note)
Returns nothing
player_notes.player[]
player_notes.player["dummy"] = { key1 = note1, key2 = note2, ... }

View File

@ -1,6 +0,0 @@
player_notes
============
Player notes mod for Minetest
License for everything: WTFPL

View File

@ -1,98 +0,0 @@
-- Created by Krock
-- License: WTFPL
player_notes.load_data = function()
local file = io.open(player_notes.data_file, "r")
if not file then
return
end
for line in file:lines() do
if line ~= "" then
local data = string.split(line, "|")
--[1] player_name, [2] key 1, [3] notice 1, [?] key X, [?+1] notice X
if #data > 1 then
player_notes.player[data[1]] = {}
local index = 2
while index <= #data do
if data[index] ~= "" then
-- if not empty
player_notes.player[data[1]][data[index]] = data[index + 1]
end
index = index + 2
end
end
end
end
io.close(file)
end
-- Load late, because not much used
minetest.after(3, player_notes.load_data)
player_notes.save_data = function()
local file = io.open(player_notes.data_file, "w")
for player, notes in pairs(player_notes.player) do
local str = ""
for key, _note in pairs(notes) do
local note = string.gsub(_note, "|", "/")
str = str..key.."|"..note.."|"
end
if string.len(str) > 2 then
file:write(player.."|"..str.."\n")
end
end
io.close(file)
end
player_notes.add_note = function(name, target, note)
if not name or not target or not note then
return "ERROR: Name, target or note == NIL"
end
if not minetest.auth_table[target] then
return "Unknown player: "..target
end
if string.len(note) < 2 or string.len(note) > 60 then
return "Note is too short or too long to add. Sorry."
end
if not player_notes.player[target] then
player_notes.player[target] = {}
end
-- generate random key
local key = tostring(math.random(player_notes.key_min, player_notes.key_max))
if player_notes.enable_timestamp ~= "" then
player_notes.player[target][key] = "<"..name.." ("..os.date(player_notes.enable_timestamp)..")> "..note
else
player_notes.player[target][key] = "<"..name.."> "..note
end
return nil
end
player_notes.rm_note = function(target, key)
if not target or not key then
return "ERROR: Target or key == NIL"
end
if not player_notes.player[target] then
return "Player has no notes so far."
end
-- must be unique key
key = tonumber(key)
if not key then
return "Key must be a number!"
end
if not player_notes.player[target][tostring(key)] then
return "Key does not exist. Can not remove unknown note."
end
player_notes.player[target][tostring(key)] = nil
local delete = true
for key, note in pairs(player_notes.player[target]) do
if string.len(note) > 2 then
delete = false
break
end
end
-- remove empty players
if delete then
player_notes.player[target] = nil
end
return nil
end

View File

@ -1,183 +0,0 @@
-- Created by Krock
-- License: WTFPL
player_notes = {}
player_notes.player = {}
player_notes.mod_path = minetest.get_modpath("player_notes")
player_notes.data_file = minetest.get_worldpath().."/player_notes.data"
player_notes.mgr = {}
-- to generate unique 4-digit long numbers as key
player_notes.enable_timestamp = "%x %X" -- %x = date | %X = time -> "%x %X"
player_notes.key_min = 100
player_notes.key_max = 999
dofile(player_notes.mod_path.."/data_mgr.lua")
minetest.register_privilege("player_notes", "Can view and modify player's notes.")
minetest.register_chatcommand("notes", {
description = "Lists all notes / Lists notes of <name>",
privs = {player_notes=true},
func = function(name, param)
player_notes.mgr[name] = { indx={}, data="", note={}, key="" }
minetest.show_formspec(name, "player_notes:conf", player_notes.get_formspec(0, name))
end
})
minetest.register_on_player_receive_fields(function(player,formname,fields)
if formname ~= "player_notes:conf" then
return
end
local player_name = player:get_player_name()
if fields.quit then -- exit
if player_notes.mgr[player_name] then
player_notes.mgr[player_name] = nil
end
return
end
if not player_notes.mgr[player_name] then
return
end
if not minetest.check_player_privs(player_name, {player_notes=true}) then
return
end
if fields.close then -- exit to main
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(0, player_name))
return
end
if fields.m_all then -- list-click-event
local selected_player = ""
local event = minetest.explode_textlist_event(fields.m_all)
if event.type == "CHG" then
selected_player = player_notes.mgr[player_name].indx[event.index]
end
player_notes.mgr[player_name].data = selected_player
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(0, player_name))
return
end
if fields.p_all then -- list-click-event
local selected_note = ""
local event = minetest.explode_textlist_event(fields.p_all)
if event.type == "CHG" then
selected_note = tostring(player_notes.mgr[player_name].note[event.index])
end
player_notes.mgr[player_name].key = selected_note
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(2, player_name))
return
end
if fields.m_add and fields.p_name then -- show adding formspec
if not minetest.auth_table[fields.p_name] then
minetest.chat_send_player(player_name, "Unknown player: "..fields.p_name)
return
end
player_notes.mgr[player_name].data = fields.p_name
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(1, player_name))
return
end
if fields.m_rm then -- show removing formspec
if not player_notes.player[player_notes.mgr[player_name].data] then
minetest.chat_send_player(player_name, "Please select a player name.")
return
end
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(2, player_name))
return
end
if fields.m_so then -- show player notes only
if not player_notes.player[player_notes.mgr[player_name].data] then
minetest.chat_send_player(player_name, "Please select a player name.")
return
end
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(3, player_name))
return
end
if fields.p_add and fields.p_name and fields.p_note then -- add note
local back_err = player_notes.add_note(player_name, fields.p_name, fields.p_note)
if not back_err then
minetest.chat_send_player(player_name, "Added note!")
player_notes.save_data()
else
minetest.chat_send_player(player_name, back_err)
end
return
end
if fields.p_rm and fields.p_key then -- ReMove note
local back_err = player_notes.rm_note(player_notes.mgr[player_name].data, fields.p_key)
if not back_err then
minetest.chat_send_player(player_name, "Removed note!")
player_notes.save_data()
else
minetest.chat_send_player(player_name, back_err)
end
minetest.show_formspec(player_name, "player_notes:conf", player_notes.get_formspec(2, player_name))
end
end)
function player_notes.get_formspec(mode, player_name)
local formspec = ""
if mode == 0 then
--main formspec
formspec = ("size[5,8]"..
"label[1,0;Player note manager]"..
"field[0.3,7.2;5,0.5;p_name;;"..player_notes.mgr[player_name].data.."]"..
"button_exit[1,7.5;3,1;exit;Close]"..
"textlist[0,0.5;4,6;m_all;")
player_notes.mgr[player_name].indx = {}
local i = 1
for player, notes in pairs(player_notes.player) do
local num = 0
for key, note in pairs(notes) do
num = num + 1
end
formspec = formspec..player.." ("..tostring(num)..")"..","
player_notes.mgr[player_name].indx[i] = player
i = i + 1
end
player_notes.mgr[player_name].indx[i] = ""
formspec = (formspec..";;false]"..
"button[4.2,2;1,1;m_add;+]"..
"button[4.2,3;1,1;m_so;?]"..
"button[4.2,4;1,1;m_rm;-]")
elseif mode == 1 then
--player add note
formspec = ("size[7,4]"..
"label[1,0;Add a player note]"..
"field[0.5,1.5;4,0.5;p_name;Player name:;"..player_notes.mgr[player_name].data.."]"..
"field[0.5,3;6,0.5;p_note;Note text:;]"..
"button[1,3.5;2,1;p_add;Add]"..
"button[3,3.5;2,1;close;Close]")
elseif mode == 2 then
--player remove note
formspec = ("size[10,6]"..
"label[1,0;Remove a player note]"..
"label[0,0.6;Key:]"..
"field[1,1;3,0.5;p_key;;"..player_notes.mgr[player_name].key.."]"..
"button[3.6,0.5;2,1;p_rm;Remove]"..
"button[5.6,0.5;2,1;close;Close]"..
"textlist[0,1.5;9.8,4.8;p_all;")
player_notes.mgr[player_name].note = {}
local i = 1
if player_notes.player[player_notes.mgr[player_name].data] then
for key, note in pairs(player_notes.player[player_notes.mgr[player_name].data]) do
formspec = formspec..key.." - "..minetest.formspec_escape(note)..","
player_notes.mgr[player_name].note[i] = key
i = i + 1
end
end
player_notes.mgr[player_name].note[i] = ""
formspec = formspec..";;false]"
elseif mode == 3 then
formspec = ("size[10,5]"..
"label[1,0;Notes of: "..player_notes.mgr[player_name].data.."]"..
"button[3.5,4.5;3,1;close;Close]"..
"textlist[0,0;9.8,4.5;p_see;")
player_notes.mgr[player_name].note = {}
if player_notes.player[player_notes.mgr[player_name].data] then
for key, note in pairs(player_notes.player[player_notes.mgr[player_name].data]) do
formspec = formspec..minetest.formspec_escape(note)..","
end
end
formspec = formspec..";;false]"
end
return formspec
end

View File

@ -1,420 +0,0 @@
-- 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")

View File

@ -1,734 +0,0 @@
-- 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")

View File

@ -1,377 +0,0 @@
-- 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'})

View File

@ -1,595 +0,0 @@
-- 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")

View File

@ -1,956 +0,0 @@
-- NODES
minetest.register_node("seawrecks:woodship", {
description = "Sand for the wooden ship",
tiles = {"default_sand.png"},
is_ground_content = true,
groups = {crumbly=3, falling_node=1, sand=1, soil=1, not_in_creative_inventory=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("seawrecks:uboot", {
description = "Dirt for the U-boot",
tiles = {"default_dirt.png"},
is_ground_content = true,
groups = {crumbly=3,soil=1, not_in_creative_inventory=1},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_node("seawrecks:woodshipchest", {
description = "Wooden ship chest",
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2, not_in_creative_inventory=1},
drop = 'default:chest',
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec",
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "Woodship chest")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
meta:from_table({
inventory = {
main = {[1] = "default:tree 99", [2] = "default:jungletree 99", [3] = "default:wood 99", [4] = "default:junglewood 99", [5] = "default:sapling 99", [6] = "default:junglesapling 99", [7] = "default:grass_1 99", [8] = "default:junglegrass 99", [32] = ""}
},
fields = {
formspec = "size[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]",
infotext = "Normal chest"
}
})
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos))
end,
})
minetest.register_node("seawrecks:ubootchest", {
description = "U-boot chest",
tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png",
"default_chest_side.png", "default_chest_side.png", "default_chest_front.png"},
paramtype2 = "facedir",
groups = {choppy=2,oddly_breakable_by_hand=2, not_in_creative_inventory=1},
drop = 'default:chest',
legacy_facedir_simple = true,
is_ground_content = false,
sounds = default.node_sound_wood_defaults(),
on_construct = function(pos)
local meta = minetest.get_meta(pos)
local kind_of_price = math.floor(math.random()*2)
local amount_of_price = math.floor(math.random()*10)+1
local ingot_price = {"default:steel_ingot","default:copper_ingot","default:gold_ingot","moreores:tin_ingot","moreore:silver_ingot"}
local price_group = {"",""}
choosen_ingot = math.floor(math.random()*5)+1
price_group[1] = ingot_price[choosen_ingot].." "..amount_of_price
if (kind_of_price == 0) then -- Ingots AND mese
price_group[2] = "default:mese_crystal "..math.floor(math.random()*3)+1
elseif (kind_of_price == 1) then -- Ingots AND diamond
price_group[2] = "default:diamond "..math.floor(math.random()*2)+1
else
price_group[2] = ""
end
meta:set_string("formspec",
"size[8,9]"..
"list[current_name;main;0,0;8,4;]"..
"list[current_player;main;0,5;8,4;]")
meta:set_string("infotext", "U-boot chest")
local inv = meta:get_inventory()
inv:set_size("main", 8*4)
meta:from_table({
inventory = {
main = {[1] = price_group[1], [2] = price_group[2], [32] = ""}
--main = {[1] = "default:wood", [2] = "default:tree", [32] = ""}
},
fields = {
formspec = "size[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]",
infotext = "Normal chest"
}
})
end,
can_dig = function(pos,player)
local meta = minetest.get_meta(pos);
local inv = meta:get_inventory()
return inv:is_empty("main")
end,
on_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player)
minetest.log("action", player:get_player_name()..
" moves stuff in chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_put = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" moves stuff to chest at "..minetest.pos_to_string(pos))
end,
on_metadata_inventory_take = function(pos, listname, index, stack, player)
minetest.log("action", player:get_player_name()..
" takes stuff from chest at "..minetest.pos_to_string(pos))
end,
})
-- WRECK GENERATION
minetest.register_ore({
ore_type = "scatter",
ore = "seawrecks:woodship",
wherein = "default:sand",
clust_scarcity = 30*30*30,
clust_num_ores = 1,
clust_size = 12,
height_max = -4,
height_min = -31000,
})
minetest.register_ore({
ore_type = "scatter",
ore = "seawrecks:uboot",
wherein = "default:dirt",
clust_scarcity = 30*30*30,
clust_num_ores = 1,
clust_size = 12,
height_max = -8,
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 = {"seawrecks:woodship"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local yp = {x = pos.x, y = pos.y + 3, z = pos.z}
if minetest.get_node(pos).name == "seawrecks:woodship" and
(minetest.get_node(yp).name == "default:water_source" or
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "default:sand"})
pos.y = pos.y + 1
pos.x = pos.x - 6
for a = 1, 11 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.z = pos.z + 1
pos.x = pos.x - 10
for a = 1, 9 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.z = pos.z - 2
pos.x = pos.x - 9
for a = 1, 9 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.y = pos.y + 1
pos.x = pos.x - 8
pos.z = pos.z - 1
for a = 1, 7 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.z = pos.z + 4
pos.x = pos.x - 7
for a = 1, 7 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.z = pos.z - 1
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
pos.z = pos.z - 1
pos.x = pos.x - 2
minetest.add_node(pos, {name = "default:tree"})
pos.z = pos.z + 2
pos.x = pos.x - 8
minetest.add_node(pos, {name = "default:tree"})
pos.z = pos.z - 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:tree"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:tree"})
pos.z = pos.z - 1
pos.x = pos.x + 2
minetest.add_node(pos, {name = "default:tree"})
pos.y = pos.y + 1
pos.z = pos.z - 1
for a = 1, 7 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.z = pos.z + 4
pos.x = pos.x - 7
for a = 1, 7 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.z = pos.z - 1
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z + 2
pos.x = pos.x - 8
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.z = pos.z - 1
pos.x = pos.x + 4
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z + 1
pos.x = pos.x + 3
minetest.add_node(pos, {name = "default:wood"})
pos.y = pos.y + 1
minetest.add_node(pos, {name = "default:wood"})
pos.y = pos.y - 2
minetest.add_node(pos, {name = "default:wood"})
pos.y = pos.y + 3
pos.z = pos.z - 4
for a = 1, 7 do
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.z = pos.z - 3
for a = 1, 2 do
pos.y = pos.y + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y + 1
pos.z = pos.z - 3
for a = 1, 5 do
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y + 1
pos.z = pos.z - 2
minetest.add_node(pos, {name = "default:wood"})
pos.y = pos.y - 7
pos.z = pos.z + 1
pos.x = pos.x - 2
minetest.add_node(pos, {name = "seawrecks:woodshipchest"})
else
return
end
end
})
minetest.register_abm({
nodenames = {"seawrecks:uboot"},
interval = 1,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local yp = {x = pos.x, y = pos.y + 8, z = pos.z}
if minetest.get_node(pos).name == "seawrecks:uboot" and
(minetest.get_node(yp).name == "default:water_source" or
minetest.get_node(yp).name == "noairblocks:water_sourcex") then
minetest.add_node(pos, {name = "default:dirt"})
pos.y = pos.y + 1
pos.x = pos.x - 15
for a = 1, 31 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:cobble"})
end
pos.z = pos.z + 1
pos.x = pos.x + 1
for a = 1, 31 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:cobble"})
end
pos.z = pos.z + 1
pos.x = pos.x +1
for a = 1, 27 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 3
pos.x = pos.x + 1
for a = 1, 27 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 1
pos.x = pos.x + 2
for a = 1, 21 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z + 5
pos.x = pos.x + 1
for a = 1, 21 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.y = pos.y + 1
pos.z = pos.z + 1
pos.x = pos.x - 1
for a = 1, 21 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 7
pos.x = pos.x + 1
for a = 1, 21 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z + 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 24
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 5
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 22
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z - 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 29
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z - 3
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 28
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 32
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 32
minetest.add_node(pos, {name = "default:stone"})
pos.y = pos.y + 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 32
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x - 32
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 28
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z + 3
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x - 28
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z + 1
pos.x = pos.x + 2
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 22
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z + 1
pos.x = pos.x - 2
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
for a = 1, 9 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.z = pos.z - 6
pos.x = pos.x - 3
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 22
minetest.add_node(pos, {name = "default:wood"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
pos.z = pos.z - 1
pos.x = pos.x - 2
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:obsidian_glass"})
for a = 1, 9 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y + 1
pos.z = pos.z + 7
pos.x = pos.x - 1
for a = 1, 21 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 7
pos.x = pos.x + 1
for a = 1, 21 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z + 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 24
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 5
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 22
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z - 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 29
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z - 3
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 28
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 1
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 32
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 32
minetest.add_node(pos, {name = "default:stone"})
pos.y = pos.y + 1
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 28
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 28
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z - 1
pos.x = pos.x + 2
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 22
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 3
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 22
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
pos.z = pos.z + 1
pos.x = pos.x + 2
for a = 1, 21 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 5
pos.x = pos.x + 1
for a = 1, 21 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.y = pos.y + 1
pos.z = pos.z + 2
pos.x = pos.x - 4
for a = 1, 3 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.x = pos.x + 21
for a = 1, 3 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z + 1
pos.x = pos.x + 1
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.x = pos.x - 21
for a = 1, 3 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z + 2
pos.x = pos.x + 3
for a = 1, 4 do
pos.z = pos.z - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 1
pos.x = pos.x + 1
for a = 1, 4 do
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.x = pos.x + 6
for a = 1, 13 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z - 3
pos.x = pos.x + 1
for a = 1, 13 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:stone"})
end
pos.z = pos.z + 1
pos.x = pos.x - 1
for a = 1, 13 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.z = pos.z + 1
pos.x = pos.x + 1
for a = 1, 13 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:tree"})
end
pos.z = pos.z - 3
for a = 1, 6 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.z = pos.z + 5
pos.x = pos.x - 1
for a = 1, 6 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y + 1
for a = 1, 4 do
pos.z = pos.z - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 5
pos.z = pos.z - 1
for a = 1, 4 do
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:wood"})
end
for a = 1, 4 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x + 1
pos.z = pos.z - 3
for a = 1, 4 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y + 1
pos.x = pos.x - 1
pos.z = pos.z - 1
for a = 1, 4 do
pos.z = pos.z + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x + 5
pos.z = pos.z + 1
for a = 1, 4 do
pos.z = pos.z - 1
minetest.add_node(pos, {name = "default:wood"})
end
for a = 1, 4 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
pos.z = pos.z + 3
for a = 1, 4 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y + 1
pos.x = pos.x - 1
pos.z = pos.z - 1
for a = 1, 2 do
pos.x = pos.x - 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.x = pos.x - 1
pos.z = pos.z - 1
for a = 1, 2 do
pos.x = pos.x + 1
minetest.add_node(pos, {name = "default:wood"})
end
pos.y = pos.y - 7
pos.x = pos.x +16
pos.z = pos.z +3
minetest.add_node(pos, {name = "seawrecks:ubootchest"})
else
return
end
end
})

View File

@ -1,96 +0,0 @@
-- NODES
minetest.register_node("whiteshell:whiteshell", {
description = "White shell",
drawtype = "normal",
-- tiles = {"default_desert_sand.png^clams_crushedwhite.png"},
tiles = {"default_desert_sand.png"},
is_ground_content = true,
groups = {sand=1, crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1},
drop = {
max_items = 2,
items = {
{
items = {'clams:crushedwhite'},
},
{
items = {'default:desert_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
})
-- WHITESHELL GENERATION
minetest.register_ore({
ore_type = "scatter",
ore = "whiteshell:whiteshell",
wherein = "default:desert_sand",
clust_scarcity = 10*10*10,
clust_num_ores = 18,
clust_size = 6,
height_max = 31000,
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
-- ALIASES
minetest.register_alias("clams:whiteshell","whiteshell:whiteshell")

View File

@ -1,18 +0,0 @@
# Whether you are running a legacy minetest version (auto-detected).
legacy = false
# Enables falling snow.
enable_snowfall = true
# Disable this to stop snow from being smoothed.
smooth_snow = true
# Disable this to remove christmas saplings from being found.
christmas_content = true
# The minumum height a snow biome will generate.
min_height = 3
# Disable this to prevent sleds from being riden.
sleds = true
# Enables debug output.
debug = false
# Reduces the amount of resources and fps used by snowfall.
lighter_snowfall = false
# Enables smooth transition of biomes
smooth_biomes = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

After

Width:  |  Height:  |  Size: 206 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 742 B

After

Width:  |  Height:  |  Size: 206 B

View File

View File

@ -1,299 +0,0 @@
--[[
Stained Glass 1.1
This mod provides luminescent stained glass blocks for Minetest 0.4.x.
Depends:
[moreblocks] by Calinou
[unifieddyes] by VanessaE
==============================================================================
Sun 24 Feb 2013 11:52:27 AM EST
Copyright (C) 2013, Eli Innis
Email: doyousketch2 @ yahoo.com
Unified Dyes was released under GNU-GPL 2.0, see LICENSE for info.
More Blocks was released under zlib/libpng for code and CC BY-SA 3.0 Unported for textures, see LICENSE.txt for info.
==============================================================================
Recipe for standard colors:
dye
super glow glass
super glow glass
super glow glass
Recipe for pastel colors:
light dye
white paint
super glow glass
super glow glass
super glow glass
Recipe for faint colors:
light dye
white paint
white paint
super glow glass
super glow glass
super glow glass
All recipes produce three glowing stained glass blocks.
Pastel blocks give back an empty bucket.
Faint blocks give back two empty buckets.
==============================================================================
]]--
-- HUES includes all colors for the various shades
-- I'm trying to get it to sort by color in the game, tho it sorts alpha-numerically...
-- so with 12 colors, it's sorting 10, 11, 12, 1, 2, 3, 4...
HUES = {
"yellow",
"lime",
"green",
"aqua",
"cyan",
"skyblue",
"blue",
"violet",
"magenta",
"redviolet",
"red",
"orange"
}
-- Brightness levels in the textures are 33% ("dark"), 66% ("medium"),
-- 100% ("full"), 150% ("light"), 200% ("pastel").
-- 1x and 2x are simply placeholders to fill in so numbers start at 3.
BRIGHT = {
"1x",
"2x",
"dark_",
"medium_",
"", --(full)
}
-- Saturation - "s50" in a file/item name means "saturation: 50%".
-- 1x - 5x are simply placeholders so numbers start at 6.
SAT = {
"1x",
"2x",
"3x",
"4x",
"5x",
"_s50",
"" --(full)
}
--main loop for all 12 hues
for h = 1, 12 do
hues = HUES[h]
--nested loop for brightness
--starts at 3 to hopefully keep colors in order
for b = 3, 5 do
bright = BRIGHT[b]
--sub loop for saturation
--starts at 6 to keep colors in order
for s = 6, 7 do
sat = SAT[s]
--register recipes
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s) .." 3",
recipe = {
"unifieddyes:" .. bright .. hues .. sat,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_" .. (b) .. "_" .. (s), {
description = "Stained Glass - " .. bright .. hues .. sat,
drawtype = "glasslike",
tiles = {"stained_glass_" .. bright .. hues .. sat .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_" .. bright .. hues .. sat .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --sat
end --bright
end --hues
--secondary loop for light blocks
--(as they don't have 50% saturation blocks to go along with 'em)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 8 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_8 3",
recipe = {
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_8_", {
description = "Stained Glass - light_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_light_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_light_" .. hues .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
--third loop for pastel blocks
--(as they don't have 50% saturation blocks to go along with 'em)
--(plus they have a diff recipe to create.)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 9 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_9 3",
recipe = {
"unifieddyes:white_paint",
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty'}, },
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_9", {
description = "Stained Glass - pastel_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_pastel_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_pastel_" .. hues .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
--last loop for faint blocks
--(as they don't have 50% saturation blocks to go along with 'em)
--(plus they have a diff recipe to create.)
for h = 1, 12 do
hues = HUES[h]
--register recipes (set at 91 to keep colors in order)
minetest.register_craft({
type = "shapeless",
output = "stained_glass:" .. (h) .. "_91 3",
recipe = {
"unifieddyes:white_paint",
"unifieddyes:white_paint",
"unifieddyes:light_" .. hues,
"moreblocks:superglowglass",
"moreblocks:superglowglass",
"moreblocks:superglowglass",
},
replacements = { {'unifieddyes:white_paint', 'bucket:bucket_empty 2'}, },
})
--register item attributes
minetest.register_node("stained_glass:" .. (h) .. "_91", {
description = "Stained Glass - faint_" .. hues,
drawtype = "glasslike",
tiles = {"stained_glass_faint_" .. hues .. ".png"},
inventory_image = minetest.inventorycube("stained_glass_faint_" .. hues .. ".png"),
paramtype = "light",
sunlight_propagates = true,
use_texture_alpha = true,
light_source = 14,
is_ground_content = true,
groups = {snappy=2,cracky=3,oddly_breakable_by_hand=3},
sounds = default.node_sound_glass_defaults()
})
end --hues
print("[stained_glass] Loaded!")