From ca2f79403c8570e2b155bf70fc572bbfe2e82bb0 Mon Sep 17 00:00:00 2001 From: Ombridride Date: Mon, 3 Nov 2014 22:17:10 +0100 Subject: [PATCH] Clean up the "/mods" folder and new "Ice" texture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Delete the mod « painting » - Delete the mod « player_notes » - Delete useless temporary files (.lua) - Change the « ice » texture --- mods/dropondie/init.lua~ | 117 --- mods/item_drop/init.lua~ | 116 --- mods/painting/README.md | 4 - mods/painting/crafts.lua | 39 - mods/painting/init.lua | 441 -------- mods/painting/textures/black.png | Bin 295 -> 0 bytes mods/painting/textures/blue.png | Bin 301 -> 0 bytes mods/painting/textures/brown.png | Bin 128 -> 0 bytes mods/painting/textures/cyan.png | Bin 301 -> 0 bytes mods/painting/textures/darkgreen.png | Bin 128 -> 0 bytes mods/painting/textures/darkgrey.png | Bin 295 -> 0 bytes mods/painting/textures/green.png | Bin 301 -> 0 bytes mods/painting/textures/grey.png | Bin 295 -> 0 bytes mods/painting/textures/magenta.png | Bin 128 -> 0 bytes mods/painting/textures/orange.png | Bin 301 -> 0 bytes mods/painting/textures/painted.png | Bin 651 -> 0 bytes .../textures/painting_brush_black.png | Bin 571 -> 0 bytes .../painting/textures/painting_brush_blue.png | Bin 571 -> 0 bytes .../textures/painting_brush_brown.png | Bin 570 -> 0 bytes .../painting/textures/painting_brush_cyan.png | Bin 568 -> 0 bytes .../textures/painting_brush_darkgreen.png | Bin 563 -> 0 bytes .../textures/painting_brush_darkgrey.png | Bin 567 -> 0 bytes .../textures/painting_brush_green.png | Bin 572 -> 0 bytes .../painting/textures/painting_brush_grey.png | Bin 569 -> 0 bytes .../textures/painting_brush_magenta.png | Bin 569 -> 0 bytes .../textures/painting_brush_orange.png | Bin 572 -> 0 bytes .../painting/textures/painting_brush_pink.png | Bin 574 -> 0 bytes mods/painting/textures/painting_brush_red.png | Bin 569 -> 0 bytes .../textures/painting_brush_violet.png | Bin 575 -> 0 bytes .../textures/painting_brush_white.png | Bin 573 -> 0 bytes .../textures/painting_brush_yellow.png | Bin 571 -> 0 bytes mods/painting/textures/palette.png | Bin 306 -> 0 bytes mods/painting/textures/pink.png | Bin 128 -> 0 bytes mods/painting/textures/red.png | Bin 301 -> 0 bytes mods/painting/textures/violet.png | Bin 301 -> 0 bytes mods/painting/textures/white.png | Bin 295 -> 0 bytes mods/painting/textures/yellow.png | Bin 301 -> 0 bytes mods/player_notes/API.txt | 23 - mods/player_notes/README.md | 6 - mods/player_notes/data_mgr.lua | 98 -- mods/player_notes/depends.txt | 0 mods/player_notes/init.lua | 183 ---- mods/sea/clams/init.lua~ | 420 -------- mods/sea/seacoral/init.lua~ | 734 -------------- mods/sea/seagravel/init.lua~ | 377 ------- mods/sea/seaplants/init.lua~ | 595 ----------- mods/sea/seawrecks/init.lua~ | 956 ------------------ mods/sea/whiteshell/init.lua~ | 96 -- mods/snow/config.txt~ | 18 - mods/snow/textures/default_ice.png | Bin 371 -> 206 bytes mods/snow/textures/snow_ice.png | Bin 742 -> 206 bytes mods/spawn/init.lua~ | 0 mods/stained_glass/init.lua~ | 299 ------ 53 files changed, 4522 deletions(-) delete mode 100644 mods/dropondie/init.lua~ delete mode 100644 mods/item_drop/init.lua~ delete mode 100755 mods/painting/README.md delete mode 100755 mods/painting/crafts.lua delete mode 100755 mods/painting/init.lua delete mode 100755 mods/painting/textures/black.png delete mode 100755 mods/painting/textures/blue.png delete mode 100755 mods/painting/textures/brown.png delete mode 100755 mods/painting/textures/cyan.png delete mode 100755 mods/painting/textures/darkgreen.png delete mode 100755 mods/painting/textures/darkgrey.png delete mode 100755 mods/painting/textures/green.png delete mode 100755 mods/painting/textures/grey.png delete mode 100755 mods/painting/textures/magenta.png delete mode 100755 mods/painting/textures/orange.png delete mode 100755 mods/painting/textures/painted.png delete mode 100755 mods/painting/textures/painting_brush_black.png delete mode 100755 mods/painting/textures/painting_brush_blue.png delete mode 100755 mods/painting/textures/painting_brush_brown.png delete mode 100755 mods/painting/textures/painting_brush_cyan.png delete mode 100755 mods/painting/textures/painting_brush_darkgreen.png delete mode 100755 mods/painting/textures/painting_brush_darkgrey.png delete mode 100755 mods/painting/textures/painting_brush_green.png delete mode 100755 mods/painting/textures/painting_brush_grey.png delete mode 100755 mods/painting/textures/painting_brush_magenta.png delete mode 100755 mods/painting/textures/painting_brush_orange.png delete mode 100755 mods/painting/textures/painting_brush_pink.png delete mode 100755 mods/painting/textures/painting_brush_red.png delete mode 100755 mods/painting/textures/painting_brush_violet.png delete mode 100755 mods/painting/textures/painting_brush_white.png delete mode 100755 mods/painting/textures/painting_brush_yellow.png delete mode 100755 mods/painting/textures/palette.png delete mode 100755 mods/painting/textures/pink.png delete mode 100755 mods/painting/textures/red.png delete mode 100755 mods/painting/textures/violet.png delete mode 100755 mods/painting/textures/white.png delete mode 100755 mods/painting/textures/yellow.png delete mode 100755 mods/player_notes/API.txt delete mode 100755 mods/player_notes/README.md delete mode 100755 mods/player_notes/data_mgr.lua delete mode 100755 mods/player_notes/depends.txt delete mode 100755 mods/player_notes/init.lua delete mode 100644 mods/sea/clams/init.lua~ delete mode 100644 mods/sea/seacoral/init.lua~ delete mode 100644 mods/sea/seagravel/init.lua~ delete mode 100644 mods/sea/seaplants/init.lua~ delete mode 100644 mods/sea/seawrecks/init.lua~ delete mode 100644 mods/sea/whiteshell/init.lua~ delete mode 100644 mods/snow/config.txt~ delete mode 100644 mods/spawn/init.lua~ delete mode 100755 mods/stained_glass/init.lua~ diff --git a/mods/dropondie/init.lua~ b/mods/dropondie/init.lua~ deleted file mode 100644 index f3758a0b..00000000 --- a/mods/dropondie/init.lua~ +++ /dev/null @@ -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) diff --git a/mods/item_drop/init.lua~ b/mods/item_drop/init.lua~ deleted file mode 100644 index e4bce006..00000000 --- a/mods/item_drop/init.lua~ +++ /dev/null @@ -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 diff --git a/mods/painting/README.md b/mods/painting/README.md deleted file mode 100755 index 24a974f3..00000000 --- a/mods/painting/README.md +++ /dev/null @@ -1,4 +0,0 @@ -painting -======== - -in-game painting mod for minetest diff --git a/mods/painting/crafts.lua b/mods/painting/crafts.lua deleted file mode 100755 index c231e6c0..00000000 --- a/mods/painting/crafts.lua +++ /dev/null @@ -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' }, - }}) diff --git a/mods/painting/init.lua b/mods/painting/init.lua deleted file mode 100755 index cf16f164..00000000 --- a/mods/painting/init.lua +++ /dev/null @@ -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 diff --git a/mods/painting/textures/black.png b/mods/painting/textures/black.png deleted file mode 100755 index daa5f56b402c915348be4ed35848331eeebdcb48..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>mUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f+@+{ z-GzZ+Rj;xUkjGiz5n0T@z%2~Ij105pNPq;(3LMjcG}sXg$EU`>1#-AOT^vI=t|uq_ z;AdcDVq~~=Oy~?yShd78q9i4;B-JXpC>2OC7#SEE=^B{p8k&U|SXvnySQ(mW8yHy` k7+h4*OGVL;o1c=IR*74~g34((ff^V*UHx3vIVCg!0GvHTv;Y7A diff --git a/mods/painting/textures/blue.png b/mods/painting/textures/blue.png deleted file mode 100755 index 1eb421797bddf96feaa83472980025adcce41b67..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blmUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*l2rk&Wd@@jkv%n*=n1O*?7=#%aX3dcR36>Q&rUPlPLl}-vjeiT|@Orv9hHzX@ zPI&P1zdQr88WXpq$@~963DpwUh?11Vl2ohYqEsNoU}Ruuq-$WVYiJf?U}O>_ z%)r1c48n{Iv*t(u1=&kHeO=k_aB>S;YM*(kX9*PI^>lFz;kceWNSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*l2rk&Wd@@jkv%n*=n1O*?7=#%aX3dcR36>Q&rUPlPLl}-vjeiT|@Orv9hHzX@ zPWbWvl|2LNRi>9}PZs(EB~(jXBT7;dOH!?pi&B9UgOP!uk*O>_ z%)r1c48n{Iv*t(u1=&kHeO=k_aB>S;=y=cSx(yWK^>lFz;kcfh;F0))pMlAMF-0r; R^mm{HgQu&X%Q~loCIF2#8o>Yn diff --git a/mods/painting/textures/darkgrey.png b/mods/painting/textures/darkgrey.png deleted file mode 100755 index d15030795fb807c51a4c970ca5eac2cd6f1b98ee..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>mUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f+@+{ z-GzZ+Rj;xUkjGiz5n0T@z%2~Ij105pNPq;(3LMjcG}sXg$EU`>1#-AOT^vI=t|zbf z$Irm{gRwgQqUtfAuxg2GL`h0wNvc(HQ7VvPFfuSS(ls#GH8cw`u(UEZurf5$HZZa> kFu16qmx`hxH$NpatrE9}1(nlo0yQvry85}Sb4q9e07MK$AOHXW diff --git a/mods/painting/textures/green.png b/mods/painting/textures/green.png deleted file mode 100755 index 1f965f98a3fd4c986e326a77d309162659d3770b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blmUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J~B7>-Yke+%UBdb&7gTe~DWM4foF7MQ diff --git a/mods/painting/textures/grey.png b/mods/painting/textures/grey.png deleted file mode 100755 index 30baffe850b95b20910472cd10203c99577226cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>mUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f+@+{ z-GzZ+Rj;xUkjGiz5n0T@z%2~Ij105pNPq;(3LMjcG}sXg$EU`>1#-AOT^vI=t|#C4 zF3-SJ$GFe)4DVl{uxg2GL`h0wNvc(HQ7VvPFfuSS(ls#GH8cw`u(UEZurf5$HZZa> kFu16qmx`hxH$NpatrE9}1(nlo0yQvry85}Sb4q9e06-!|7XSbN diff --git a/mods/painting/textures/magenta.png b/mods/painting/textures/magenta.png deleted file mode 100755 index 4ff568a1b1385265ff79414b2fc55b28bd55e211..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blwj^(N7l!{JxM1({$v_d#0*}aI z1_o|n5N2eUHAey{$X?><>&kwIlS5dMNwzk$2Pnkr>Eal|aXtCR;Sc}q8Q4BC{mw9v Rhz3e9c)I$ztaD0e0sxTH9;5&O diff --git a/mods/painting/textures/orange.png b/mods/painting/textures/orange.png deleted file mode 100755 index e951ba3e782eef83b547c3bd7c9e653d335afb68..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blmUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*l2rk&Wd@@jkv%n*=n1O*?7=#%aX3dcR36>Q&rUPlPLl}-vjeiT|@Orv9hHzX@ z{xSdX2YCiI7p81;jal=65~?Mx5hW>!C8<`)MX5lF!N|bSNY}tz*U&7)z|zXtz{=1} o+rY@mz~G{aUMh-)-29Zxv`X9>7F15V3Dm&g>FVdQ&MBb@0I+gOGynhq diff --git a/mods/painting/textures/painted.png b/mods/painting/textures/painted.png deleted file mode 100755 index a376a7ae8524c73acb3764d49bc508d68917ab66..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 651 zcmV;60(AX}P)Px#24YJ`L;ybkVF1sV{OTS6000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyk@ z5hx=Iykw>T00Ik1L_t(I%cYUeOOtUN$6p)H{b05tqE*ad*|Q*|l|-Zj5<%oa@)9J3 zMG)jMi0Dw%9}sou62kU?cxVS>>k#db7Dz=w(!#cBYi;SCa)xui-JX3rEGMqzW$)96 z&+qs9tr0>9nt+xj(e#3r{}mKj24G8fHvlF{YS^c#*I;dM4XLRq030JDjW3BhB;0P1 zaJ%c%A{5PvP&6wp-kK4iXttJbNFg&lU5jO}g6vf|&~B{OIwz3!4mZ|dy0@2ELk9up z1#I#c#$Fd0>fgzv%gO!tV}iLk`Yp#cccJ6q16r+CvVqS`x}01-w+mVE5Y9zNs~LPr z|KY}w`H^RA$KZycd?doFJCE>9BuVLhl2X(3 zZ9j!C=_j0vtlKDi6`s8Kg|lsm7LCBNIESUDhg>koheb1^?lZ`Whw(Sx*!sR7{g8_r zwrfZx`}zl`k8fjG`p$gkJHlNKit!j~dWG9}PXchsdLG}vO%6NE#1ciW-V0S-kQEP4 z?axW6X`TU2^C4n|QCN{Lpj zj#iBhDq2)j3Zh7v5_$}1|NgsLDbZov#|cXpno#zukWBWPD83~>pE5JViVL*sch>|p lXbrX4VcJi;xInBh&mRUe1S#u$6ITEL002ovPDHLkV1n&F8L|KX diff --git a/mods/painting/textures/painting_brush_black.png b/mods/painting/textures/painting_brush_black.png deleted file mode 100755 index b97e9339ce9ca79ad2e72eacad1f3c4e18c8737c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 571 zcmV-B0>u4^P)B7&8;4)k1p;C=YKANWsHJRYY|D9G=i zR;y8|RFrMot^}InI2eY3rfC4^x{hHO;Vu3 zbYnq1@$O!=@_d08OOGghSi`G%Wm_Egf=uQC1Lu><=WAkLOBg{wyfS*ZyYYzij12bh z_RVX~Ca=oI=XJ`Pp8&f^B~T1^3ePN^^63Baz_F{l~n_EviF@kKyu4^P))+^N5g5_c zBm$utk{M`2*X+j$FYL#NQCDGeyQnx6dOTkj60E{?py%?1@8SJk_)jDnjq z$`Zv7_r5*`sb77@16lA6Ajg4To93AqZmNuiNVWg-9eq zE|((~i{Us9$z)RV`8>95Qz#UqzCJ*I|KQq!KZ7Te``EJJ=Z51SrPRil#=h z^!2q?Z&1mFGjWczw&|QXi)DQSf!nDGG29$qipRNm=ONFtQ?h680en6msEZ9Mx!Bvu zjgc|Voo>^XgGYJ$W)6FK*}VW@XsC%A_P)nSOi9N zHHkn7hhzrY&^0ShcwrwScF|2}I_QH#u$|7^MG&iS9q76I!Ta!gfAF73JRT<`@6`}+ z70MNt$)z>1ZQGN;a2$u0#^A4Di_f6{*bepDz{qB^e6q_#b~Vw`7{n0RzBS` zKA*=lOsZLn$Tz#hjhpGeH~7saKYeD;Nh!QtAsUUM3PHc2rP2q6 zlP78ms)=`*viNkCXY-R3->u*?eCn#>U69G#r|)!9{Qe+2LtzvJ_36m@uG%A3Gd$4E ztCvfhN?z3UkE@h6)&Rlv*NOAxGwF%k<_!Suj6b6POdl`ubJ7~#&9;UnKrzbSH9e7I zaIm9xgK93FOK`NKQz>% diff --git a/mods/painting/textures/painting_brush_cyan.png b/mods/painting/textures/painting_brush_cyan.png deleted file mode 100755 index 2e0c05bc1b880c0e73c6283e0b01a31093239dd9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 568 zcmV-80>}M{P)y88 zbaf;GAsUhyXhYZR#|bYi8?oE4bYR9I$g}fyA;BtK2YN0)@IHLr5Bw)8nM|@`n(`}< zYL!jfR<7#?5@??1v8%ZmbbZ?x3b7}Xk)RE)UB`$S=hM&z`cp5oV(D^>*AbhjU8Zb<32#pepJPtEHF6O zS-(LoS1zSE+1Vva&LXb+4HVqBXOtG?_*yE(-3L#2RhUzU4j&^DiGT#ypq8rxz1*3Y z;_}5V={SChmG?_{TU)^e0Api)jF0E&>p4POTZgQ#t@0CMsizZ~sP}dN0000h_JZyNJSc(xO(mSzXc+KQi|D` zd(wL37>?s$ngN!wbLyL0;>OMN-y8g9Q(Hc}r%x5$t`dz#5rKNkkW%SABgvDs1=Ym6 zY_9hSj&o8K^$bNQ*_W*+Ny&~!99D{=$wHs7( z>3o9Y9i6h`EaSRgK*8kWCq&MHT!X57xrVsZo{R!s5r#(biOXSS%vFB&*cl>!~4DPpGY#9L{(KpP*oa@ z2IX>D9LMn`FkIIq7K;%G1OPBilSCq+ej6BtLV;SXhGkhqqfrdQARG?+f5EaWN~IF1 zR0_}Y$Y!%zsZ?-Xmuj^tot+&_Oib-8_%nFAw7{Ody=vPws>;gh6Nz+nbM@Nwe+yI< z5n*Bef%YCef^FNhwFOu$EXp^h&W)S7zc={JCck{C;S*AMzfL?JM-|#lL+kaAOlFR^ z7BrI_Ov&1_C7!Q5r21iLzEX9mRm@|oORapwjAcV-`R>dYuFOUu$7iLt9=H=r2be`s#5$oP1F z>juqSI+x~X|A3b5H5}(F2;9vris9$@N;=K$dyjZgT$X+N4-pE5Kz(e`%;m9RZq3ef z;p~9+9X`gpw`JVzZT|v*>FE(>X7Y>-9iXSDPq#KV_z6qMthHWy#RmWY002ovPDHLk FV1mH{`i%ep diff --git a/mods/painting/textures/painting_brush_green.png b/mods/painting/textures/painting_brush_green.png deleted file mode 100755 index 14a9b547bf7780b7f8a9b97d71334fecbcd7fc5e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 572 zcmV-C0>k}@P)rU_jX-SuyDu?URl zY7&7EEy)bDp=#JTArOdU~j4D#D~yNF;Ft^+-nA9x==?+5-9l}skFBk$!` zpw~2??k_3FaXbkOtu@=4>o7JM0QffhsO#P#UK<$sd>+SMWmnH`LWja&D7M5x-d{*0 z5)_L?Ow+`5T{4-Blu9ME*4VbK!r>4D14A1N{tO;ZO|W-ggIJb@h%htzNJZ--T)KSa z-vSXqDaFM2U1?}Mf@N9wd^ODGC)HP{%++hzzc={JrhfX&juWc%c7b?2jtJBS3@MjC zFql4GT~JA~%~W$wrg%DY5BuE$e#0-WXzzkt?hak2(kc+BWoLa9K|uU6)Yn#h#7YKx z+j;f!1t-(zWO-?k^2$d*;Rb4y{_>gZSYhJ^05?Y;(%sX=^WwCMME9^Yv>gzPZ{H<5 zR-nJXrFw%(&Ywwfw53(%tvMWL6%^dcPAbF8@x@e%8@C_utT3(iA2>`f7zFXKK_wS@ zJGeeN&e_wg($sv6H?QZ>>+9YH0K>zbjEv;yY(GdW)+8&-i~Il(FQ{DE-lOCI0000< KMNUMnLSTY{%KbS2 diff --git a/mods/painting/textures/painting_brush_grey.png b/mods/painting/textures/painting_brush_grey.png deleted file mode 100755 index 1dff28c60305b3eac7d6cf8823c93a1f1c1908cf..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=G`P)20?8IuBi2crL>y#;>;&z2Sl9qdulG*MMnR-a0+vy1CDZvI=K zs)z^+^AEM>$Z<^5q_wq$)%>FTuqxcTo%wr%-)!>B7auw;r4JiKA`w)f&0}b#@`;Jm zspf)4Vgqqmd%nbrl}D66Zs0OpT36e-AeYNBaxNtvPaA>GAc}&zbn?B!Xyod}1Sk6Xb=_RUvc7}B{mh~mPL8i765M_8n3siRIdu3aUauF_!3K>?j}CEX zcAm=@`nC7iN#4I($KKg-E&!OC8fIoD$M9g7?(SaQ-r8grYAvbLoy5KH00000NkvXX Hu0mjf?6C+D diff --git a/mods/painting/textures/painting_brush_magenta.png b/mods/painting/textures/painting_brush_magenta.png deleted file mode 100755 index 98f48021342e6130a7980b87be38fa8c2589f847..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=G`P)iqQg4{k5`Gk7{P#esv3YFQSl%G~@D3Dh?*eBrdi9r`T&Z8dUfzpton$R4D__| z_Vp{yCa>t~=M_q8p8%n3dc;}(LV6;%eFK2IV~^=R-^I)PtTY7nv)jKHP>k6P%2+>Y}xPZEt|Uz4WvgZjP@f5{%w|#Eaal96EdypU(&CVuMPq^|W(m zY?8|tTDAFD3-8}8;%siZ7XSk}@P)uPe*4TnRMWw$U4Q5!j&s*d6e2yRA~(HqbJe40&^%%jYAU4ednJ;Pl~2_b)^u z5pua4x~}6m4#{Lv3WWl;ZDX3Is;;i0tE+c=!Qa7)sR<4qsu#mB5D{i(pQ~U^Edzsh z{w)v@lu}HLJ(2q34H$+&MTLji%%obgirgJaZQbAxoBHL`TiR6N^E}~j7!e5gG$|Gr z=t-O_FDNC}q^r4?Q@omaiuq+8ujUm;Z1;k6`Z4X763XWbu)ijVARu1pz1~!Q#8P@X zn)&eVEf*5qvh;0{;__EO;rKktUinUHG`oERfCnSbxOk0=&yW5c}wps%l$;o&r`&Bv(4}*B0mASv#4N{7{SQ^0000< KMNUMnLSTXhh5+0E diff --git a/mods/painting/textures/painting_brush_pink.png b/mods/painting/textures/painting_brush_pink.png deleted file mode 100755 index 8293898c86078f815f3206096173d2199b0d6181..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 574 zcmV-E0>S->P)qmpAI}(h3kc`!yBH9`?=viQSo@38+%$s znI=-L;%Lo@sR?DsK#1mA)ivpH``?e*_ec&s6%`SF)3Z?Hd5x9e>2>vngH_=T%F1FFP7{0)nwo zmF#4Jfq~BY4Qd%VpX6v~mn>UL*!Fi&a4$Qn3^&JDl1c7NJmh&{UhO|{2*2MC;$nkZ zF8B9xdwiOU=enfh@G;)LSw?Sex)%V9j`lG&mZPudAZ=|Ovc9&;FTUZa==_*imH+?% M07*qoM6N<$g7I?tUH||9 diff --git a/mods/painting/textures/painting_brush_red.png b/mods/painting/textures/painting_brush_red.png deleted file mode 100755 index 6c73aa9673b64f8dd78e47d23690cf1f30c24f4a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 569 zcmV-90>=G`P))+^N5g5_c zBmyB?k{M`2*X-ql7xpsZbQzWosXPVx>pWdVunO0KK9^s3K75}q{3j}zOcJqe`4xQC zntN+&%5fY|0z+#}OMN}t3s*kw{Q1 z7BNi|*LBHcGEyp)&{|{LwrXeyF)%Q^wcyX-(aaQk_BM%SS%?U8^AA-t9O2@n%l{UL z2udlYChtho!6R6fh0j;Re12MebIM$~n*Do&-)!oq&+I&*N^h2k$K!}VZNQLn`8`AF z53@OXwNb9b@dF5x%);)?bz$mMR+eJZU2fm(KjqX+`xm*KPR)kmyksIP;U zFP?KUJt!+5mnpA)02FSZM(NL=$W9ctZUAs&`~f|^-8?JKsz`J1F!PxjN*@*)E z{jJp-R5EfV#nIL_S+o{#oG+l@W_DT`UXCxMQe3}vpQnXcwQv7ng25n&hYcz@-`B~t z@k!2|Zj!M_0!IVzFjfU0LP_$)2c3oohE#00000NkvXX Hu0mjfdC~k( diff --git a/mods/painting/textures/painting_brush_violet.png b/mods/painting/textures/painting_brush_violet.png deleted file mode 100755 index f45662078506f49ab852ff535c96a36de2a2b7eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 575 zcmV-F0>J%=P)TSTnGAGe&PA>eZKIYs7NG&`F5}T z3cl*k2#WR%X35zcd)(Y5K0+rUf1OP zg>X1bHk-w=EL_(mkw{2BpGRv=p-@oO)m8NN_OCAZGk7#H#@1~OV%s(%!qoIb6|Ak} z;-$;~7KjK+DaJ>Zi|YJFfDtX9-L2(E zETyk2%F7qe>4=|`#Silomlgnp8>mov`6J1Z%<2sQZVW%*#Hmi6WhYf#a0_dz)&qj^ z?YksLGW7H`mv2zYz?m2anpxHe)~R8Gm~oPt|m;=1o5yz zDd)S|xHde>+0!l3xbGmZ=4Q|b@?P)a>{kxKmyJ4JWSI>*L464!@#y}3EDs_7K_wsHBzY*u~-aU*NH}>!Cy!u z5|qnjEX%_8eQev7N~MD5c~q-a)!Es>*x1DOfN3v=w*+ar$SAR;U+KUR^hZmwLt z_HTiRpp;^6_P+ESJc8pmw6*Ch7w6SCx6bt&`M)>#&8B|&ticni@@|cIJdOyohc&6! zKQNv--dfO1GG(cirwcq=dO-F48X+wtzIed}g~C0CPiIs(+|I792!eowWFnhtJz_KC zBLlpC^^%jB3$pQPo%-fSK;egV<$d`~ex|g21AyDpk2rN^m>1nxlRFvg)khx?e%To&3Dgf*fB?r@3|aAu4^P)yK{ z=xP#y5Dm!;w4rPE?jq$R=<&Q=M6e3ifu73`ybquE1OJKAb)AzZ7Ufs4 zwz|bg=DV^i%auU0ZJYS1AOXJuAh^rJjp3c*wt<$<=Xv{Xon*2NJr+b$5Q*$?|3Wkx zrC2Ot7zU2xkWQziR4QTHHsx|zH8j-I*Eg`e;LqUM)CBtvw1{b%hzK*YPgSU~iR;5R z|1A&^lu}HLKa`du$1zQlx;hWD`AM~IRk(FK`}YRF+0;*;(RoIdJ}wXrhY^8*Pm@aJ zGySR4wFTAa9fq2FKE;cfN0dJ;;MKh1i0xjG%RQhwnNmJqfW3_&1Of5Nz@?7bBUaPj z6KC-PYHwy`DI zu>!rl?X??JGk7sUq&+6{<{Xx_1`6(FCza;r_*x>to%@e@S(sJ_4;{tt_k+0Dpqi^a zos5i*bNNC{T938y;r%@J=B9fAz|c?^nM{tZ_+grxTV-W=i67Z^sI-$r9OD20002ov JPDHLkV1m{)1z!LF diff --git a/mods/painting/textures/palette.png b/mods/painting/textures/palette.png deleted file mode 100755 index f0b0998bc9f039ef05aff49b246358a0e1acf870..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6U4S$Y z{B+)352QE?JR*x37`TN&n2}-D90{Nxdx@v7EBhUG9v(Sy{;)6wpwK2y7sn8b(^n^- z<~?K};4Unys-d*7SCmA)PE%bSmWN<)<76zSjI+vEJjN@4={U z!?gL|)z3HJ)T%hs$40V)+j&US+m=nx)!~^H=tMzc?@Ibip}Q{_6Lc ux68Ek|F)dlS$@{je3gF8in`C!_cCa2ExB=vIe9nG^$eb_elF{r5}E+6`*2+V diff --git a/mods/painting/textures/pink.png b/mods/painting/textures/pink.png deleted file mode 100755 index 0e8924a263145c674274a850634e21762e34c7f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 128 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blwj^(N7a;wg!61=oza5apS>O>_ z%)r1c48n{Iv*t(u1=&kHeO=k_aB>S;NgovS4Fd}Cdb&79dL diff --git a/mods/painting/textures/red.png b/mods/painting/textures/red.png deleted file mode 100755 index 26f57d272bdbd28f621d126ae279fdeb99a3d1e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blmUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-33Sk!B6Mi^+1ZVz$3Dlfq`2Xgc%uT&5-~JmK8Xr18J~B7>-Yke+%UBdb&7NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*l2rk&Wd@@jkv%n*=n1O*?7=#%aX3dcR36>Q&rUPlPLl}-vjeiT|@Orv9hHzX@ zev$O!zdQr07E`CY#wm~kR7+eVN>UO_QmvAUQh^kMk%6I+u7SC(p;?H5rIoRPm7$ro nfsvJg!9^9lR1^)l`6-!cmAEx5sGN2asDZ)L)z4*}Q$iB}>4QqS diff --git a/mods/painting/textures/white.png b/mods/painting/textures/white.png deleted file mode 100755 index de406e1578f6cf9db800996b00fda275e2326e22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 295 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx0wlM}@Gt=>mUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f+@+{ z-GzZ+Rj;xUkjGiz5n0T@z%2~Ij105pNPq;(3LMjcG}sXg$EU`>1#-AOT^vI=t|$Na zFVDct!1zBUw&*KRShd78q9i4;B-JXpC>2OC7#SEE=^B{p8k&U|SXvnySQ(mW8yHy` k7+h4*OGVL;o1c=IR*74~g34((ff^V*UHx3vIVCg!06P3d3;+NC diff --git a/mods/painting/textures/yellow.png b/mods/painting/textures/yellow.png deleted file mode 100755 index 140cb7647f83531f13f4181da253267ac8972349..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 301 zcmeAS@N?(olHy`uVBq!ia0vp^j3CUx1|;Q0k8}blmUKs7M+SzC{oH>NSwWJ;LGDfr z>(0r%1acITJ%W507^>757#dm_7=8hT8eT9klo~KFyh>nTu$sZZAYL$MSD+10f-TA0 z-G$*l2rk&Wd@@jkv%n*=n1O*?7=#%aX3dcR36>Q&rUPlPLl}-vjeiT|@Orv9hHzX@ z{_(%@p*;ip1*Z3Ttu@nt5~?Mx5hW>!C8<`)MX5lF!N|bSNY}tz*U&7)z|zXtz{=1} o+rY@mz~G{aUMh-)-29Zxv`X9>7F15V3Dm&g>FVdQ&MBb@0CUGn;s5{u diff --git a/mods/player_notes/API.txt b/mods/player_notes/API.txt deleted file mode 100755 index c7f929a3..00000000 --- a/mods/player_notes/API.txt +++ /dev/null @@ -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 - -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 - -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, ... } - \ No newline at end of file diff --git a/mods/player_notes/README.md b/mods/player_notes/README.md deleted file mode 100755 index b850f44d..00000000 --- a/mods/player_notes/README.md +++ /dev/null @@ -1,6 +0,0 @@ -player_notes -============ - -Player notes mod for Minetest - -License for everything: WTFPL \ No newline at end of file diff --git a/mods/player_notes/data_mgr.lua b/mods/player_notes/data_mgr.lua deleted file mode 100755 index f93d3eb4..00000000 --- a/mods/player_notes/data_mgr.lua +++ /dev/null @@ -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 \ No newline at end of file diff --git a/mods/player_notes/depends.txt b/mods/player_notes/depends.txt deleted file mode 100755 index e69de29b..00000000 diff --git a/mods/player_notes/init.lua b/mods/player_notes/init.lua deleted file mode 100755 index e02a81fb..00000000 --- a/mods/player_notes/init.lua +++ /dev/null @@ -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 ", - 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 diff --git a/mods/sea/clams/init.lua~ b/mods/sea/clams/init.lua~ deleted file mode 100644 index cc1887e6..00000000 --- a/mods/sea/clams/init.lua~ +++ /dev/null @@ -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") diff --git a/mods/sea/seacoral/init.lua~ b/mods/sea/seacoral/init.lua~ deleted file mode 100644 index 6e284a25..00000000 --- a/mods/sea/seacoral/init.lua~ +++ /dev/null @@ -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") diff --git a/mods/sea/seagravel/init.lua~ b/mods/sea/seagravel/init.lua~ deleted file mode 100644 index 972d4175..00000000 --- a/mods/sea/seagravel/init.lua~ +++ /dev/null @@ -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'}) diff --git a/mods/sea/seaplants/init.lua~ b/mods/sea/seaplants/init.lua~ deleted file mode 100644 index 83891772..00000000 --- a/mods/sea/seaplants/init.lua~ +++ /dev/null @@ -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") diff --git a/mods/sea/seawrecks/init.lua~ b/mods/sea/seawrecks/init.lua~ deleted file mode 100644 index f31e1053..00000000 --- a/mods/sea/seawrecks/init.lua~ +++ /dev/null @@ -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 -}) diff --git a/mods/sea/whiteshell/init.lua~ b/mods/sea/whiteshell/init.lua~ deleted file mode 100644 index 1eb077a0..00000000 --- a/mods/sea/whiteshell/init.lua~ +++ /dev/null @@ -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") diff --git a/mods/snow/config.txt~ b/mods/snow/config.txt~ deleted file mode 100644 index 47935839..00000000 --- a/mods/snow/config.txt~ +++ /dev/null @@ -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 diff --git a/mods/snow/textures/default_ice.png b/mods/snow/textures/default_ice.png index 14e4f563e6a4927ee0d36bfb4361285211eea316..97581e8b8cbc1350f974c25f57cea276d9a46fda 100644 GIT binary patch literal 206 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=ffJsh%#5Ar-gYPWR?Ipupqu{MugE z^%qM0FD||rtNG))C)+{SvRU6%5*=j9cT8zr%6iUS<3K|=tJ8*7aaNlLk&QBQLjSuv zaQ3sLJ>2?xR+ABH(~n2(o;YOGI+ZBxvXhnVI~Vnf;oY{hFHoo16cfod2Dj z|DK-zpP&D%toN<0_^+?~u(15GvHh{J{<5WNFQkuRIHKF`d zs2R2shpz<*cu~Y9PP{TWv@XvDT?Loi<@O}*@i5j%>^b-}a$)$*2P&(YEfKUCsuT@1 z2?xR+ABH(~n2(o;YOGI+ZBxvXVGd000McNliru+zA5~FcPWLqs?@P?Tkbac%`vIJe^Js%AO`?^`~7%6NH6D9akH;pD{f@KE7>OIa5D`qd#K z=q#%+1`ZD^X0u+`XcSm3Ax6PD$LG(E`Mk!t6=_;98iCdZV=}bX@a2o=^%X>5GJ*NL z*Qb=?=qTgq$@GS4&FSfy`+NUxrn#L#b zTFNpf1kfUp5Ii3~G`zj#3X;lpjA5^rjBm&j29=_V?lWxj`w| z+lwrh+c(evO|zyba+G32Ga?e{x|V~3gvA1442;L{@}fyog)y5lm1V*4aY@^Dguo`s z9bMOOel9E)J=LqLn%i58_a194XJV!Z07*qoM6N<$g5Ic9