commit 825c69242836385f8a953146d2105f5b46dc8fdf Author: NathanSalapat Date: Wed Aug 12 15:21:14 2015 -0500 initial upload diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..7edcd32 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,21 @@ +License of source code +---------------------- + +For the default mods: + +© 2010-2012 celeron55, Perttu Ahola +See README.txt in each mod directory for information about other authors. + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8ec7faf --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +Survive! +========================================================== +~ ~ +~ You find yourself suddenly thrown into ~ +~ a strange cubic world, and you must rely ~ +~ on your wits and what resources you can ~ +~ find and harvest. Eating and drinking are ~ +~ important, without food or water you will ~ +~ find yourself losing health and won't last ~ +~ very long. Be Careful, not all foods are ~ +~ safe to eat, some can cause sickness or ~ +~ even death. Make yourself a weapon, find ~ +~ shelter and prepare to survive. ~ +~ ~ +========================================================== + +Please Note, this game is heavily under development and has many bugs and unfinished parts of code. Play at your own risk. Also there could be some game breaking changes in the future, though I'll try and use ABMs to change things so if you keep up to date and update regularly problems should take care of themselves. diff --git a/changelog.txt b/changelog.txt new file mode 100644 index 0000000..000cb45 --- /dev/null +++ b/changelog.txt @@ -0,0 +1,14 @@ +2015-08-12: +Well bottoms are now placable on any nodes that belong to the soil group, code also got a huge cleanup from that change. +Smokers are still very hacky, use at your own risk, they don't smoke anything yet, so there really is no point to use them. + +2015-08-10: +Put code on github. + +2015-08-01: +Added inventory image for smoker. +Created active smoker node, started working on coding. + +2015-07-31: +Fixed bug in trail code, it now functions properly for grasses and soils. +Added mesh and texture for the smoker, no coding yet. diff --git a/game.conf b/game.conf new file mode 100644 index 0000000..f72bfee --- /dev/null +++ b/game.conf @@ -0,0 +1 @@ +name = Survive! diff --git a/menu/header.png b/menu/header.png new file mode 100644 index 0000000..03f869f Binary files /dev/null and b/menu/header.png differ diff --git a/menu/icon.png b/menu/icon.png new file mode 100644 index 0000000..c892656 Binary files /dev/null and b/menu/icon.png differ diff --git a/mods/beds/Changelog.txt b/mods/beds/Changelog.txt new file mode 100644 index 0000000..988db2a --- /dev/null +++ b/mods/beds/Changelog.txt @@ -0,0 +1,18 @@ +1.0.1 beta +---------- +- Add backwards compatibility with PilzAdam's beds mod +- Fix placement +- Fix small bugs +- Prevent possible crash + +1.1 +--- +- Add fancy bed model (based on jp's model) +- Add API to register beds +- Allow players always to detach from bed (by donat-b) +- If more than 50% of players want sleep they can skip the night +- Don't show sleep dialog in singleplayer + +1.1.1 +----- +- Prevent possbile crash by trying to reposition leaving players diff --git a/mods/beds/README.txt b/mods/beds/README.txt new file mode 100644 index 0000000..21d4433 --- /dev/null +++ b/mods/beds/README.txt @@ -0,0 +1,29 @@ +Minetest mod "Beds" +=================== +by BlockMen (c) 2014-2015 + +Version: 1.1.1 + +About +~~~~~ +This mod adds a bed to Minetest which allows to skip the night. To sleep rightclick the bed, if playing +in singleplayer mode the night gets skipped imideatly. If playing on server you get shown how many other +players are in bed too. If all players are sleeping the night gets skipped aswell. Also the night skip can be forced +if more than 50% of the players are lying in bed and use this option. + +Another feature is a controled respawning. If you have slept in bed (not just lying in it) your respawn point +is set to the beds location and you will respawn there after death. +You can disable the respawn at beds by setting "enable_bed_respawn = false" in minetest.conf + + + +License of source code, textures: WTFPL +--------------------------------------- +(c) Copyright BlockMen (2014-2015) + + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. diff --git a/mods/beds/api.lua b/mods/beds/api.lua new file mode 100644 index 0000000..9104ee7 --- /dev/null +++ b/mods/beds/api.lua @@ -0,0 +1,111 @@ +function beds.register_bed(name, def) + minetest.register_node(name .. "_bottom", { + description = def.description, + inventory_image = def.inventory_image, + wield_image = def.wield_image, + drawtype = "nodebox", + tiles = def.tiles.bottom, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + stack_max = 1, + groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 1}, + sounds = default.node_sound_wood_defaults(), + node_box = { + type = "fixed", + fixed = def.nodebox.bottom, + }, + selection_box = { + type = "fixed", + fixed = def.selectionbox, + + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node_or_nil(pos) + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local dir = minetest.facedir_to_dir(n.param2) + local p = vector.add(pos, dir) + local n2 = minetest.get_node_or_nil(p) + local def = n2 and minetest.registered_items[n2.name] + if not def or not def.buildable_to then + minetest.remove_node(pos) + return true + end + minetest.set_node(p, {name = n.name:gsub("%_bottom", "_top"), param2 = n.param2}) + return false + end, + on_destruct = function(pos) + local n = minetest.get_node_or_nil(pos) + if not n then return end + local dir = minetest.facedir_to_dir(n.param2) + local p = vector.add(pos, dir) + local n2 = minetest.get_node(p) + if minetest.get_item_group(n2.name, "bed") == 2 and n.param2 == n2.param2 then + minetest.remove_node(p) + end + end, + on_rightclick = function(pos, node, clicker) + beds.on_rightclick(pos, clicker) + end, + on_rotate = function(pos, node, user, mode, new_param2) + local dir = minetest.facedir_to_dir(node.param2) + local p = vector.add(pos, dir) + local node2 = minetest.get_node_or_nil(p) + if not node2 or not minetest.get_item_group(node2.name, "bed") == 2 or + not node.param2 == node2.param2 then + return false + end + if minetest.is_protected(p, user:get_player_name()) then + minetest.record_protection_violation(p, user:get_player_name()) + return false + end + if mode ~= screwdriver.ROTATE_FACE then + return false + end + local newp = vector.add(pos, minetest.facedir_to_dir(new_param2)) + local node3 = minetest.get_node_or_nil(newp) + local def = node3 and minetest.registered_nodes[node3.name] + if not def or not def.buildable_to then + return false + end + if minetest.is_protected(newp, user:get_player_name()) then + minetest.record_protection_violation(newp, user:get_player_name()) + return false + end + node.param2 = new_param2 + minetest.swap_node(pos, node) + minetest.remove_node(p) + minetest.set_node(newp, {name = node.name:gsub("%_bottom", "_top"), param2 = new_param2}) + return true + end, + }) + + minetest.register_node(name .. "_top", { + drawtype = "nodebox", + tiles = def.tiles.top, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, bed = 2}, + sounds = default.node_sound_wood_defaults(), + node_box = { + type = "fixed", + fixed = def.nodebox.top, + }, + selection_box = { + type = "fixed", + fixed = {0, 0, 0, 0, 0, 0}, + }, + }) + + minetest.register_alias(name, name .. "_bottom") + + -- register recipe + minetest.register_craft({ + output = name, + recipe = def.recipe + }) +end diff --git a/mods/beds/beds.lua b/mods/beds/beds.lua new file mode 100644 index 0000000..43bf98e --- /dev/null +++ b/mods/beds/beds.lua @@ -0,0 +1,88 @@ +-- fancy shaped bed +beds.register_bed("beds:fancy_bed", { + description = "Fancy Bed", + inventory_image = "beds_bed_fancy.png", + wield_image = "beds_bed_fancy.png", + tiles = { + bottom = { + "beds_bed_top1.png", + "default_wood.png", + "beds_bed_side1.png", + "beds_bed_side1.png^[transformFX", + "default_wood.png", + "beds_bed_foot.png", + }, + top = { + "beds_bed_top2.png", + "default_wood.png", + "beds_bed_side2.png", + "beds_bed_side2.png^[transformFX", + "beds_bed_head.png", + "default_wood.png", + } + }, + nodebox = { + bottom = { + {-0.5, -0.5, -0.5, -0.375, -0.065, -0.4375}, + {0.375, -0.5, -0.5, 0.5, -0.065, -0.4375}, + {-0.5, -0.375, -0.5, 0.5, -0.125, -0.4375}, + {-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5}, + {0.4375, -0.375, -0.5, 0.5, -0.125, 0.5}, + {-0.4375, -0.3125, -0.4375, 0.4375, -0.0625, 0.5}, + }, + top = { + {-0.5, -0.5, 0.4375, -0.375, 0.1875, 0.5}, + {0.375, -0.5, 0.4375, 0.5, 0.1875, 0.5}, + {-0.5, 0, 0.4375, 0.5, 0.125, 0.5}, + {-0.5, -0.375, 0.4375, 0.5, -0.125, 0.5}, + {-0.5, -0.375, -0.5, -0.4375, -0.125, 0.5}, + {0.4375, -0.375, -0.5, 0.5, -0.125, 0.5}, + {-0.4375, -0.3125, -0.5, 0.4375, -0.0625, 0.4375}, + } + }, + selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, + recipe = { + {"", "", "group:stick"}, + {"wool:red", "wool:red", "wool:white"}, + {"group:wood", "group:wood", "group:wood"}, + }, +}) + +-- simple shaped bed +beds.register_bed("beds:bed", { + description = "Simple Bed", + inventory_image = "beds_bed.png", + wield_image = "beds_bed.png", + tiles = { + bottom = { + "beds_bed_top_bottom.png^[transformR90", + "default_wood.png", + "beds_bed_side_bottom_r.png", + "beds_bed_side_bottom_r.png^[transformfx", + "beds_transparent.png", + "beds_bed_side_bottom.png" + }, + top = { + "beds_bed_top_top.png^[transformR90", + "default_wood.png", + "beds_bed_side_top_r.png", + "beds_bed_side_top_r.png^[transformfx", + "beds_bed_side_top.png", + "beds_transparent.png", + } + }, + nodebox = { + bottom = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5}, + top = {-0.5, -0.5, -0.5, 0.5, 0.06, 0.5}, + }, + selectionbox = {-0.5, -0.5, -0.5, 0.5, 0.06, 1.5}, + recipe = { + {"wool:red", "wool:red", "wool:white"}, + {"group:wood", "group:wood", "group:wood"} + }, + +}) + +-- aliases for PA's beds mod +minetest.register_alias("beds:bed_bottom_red", "beds:bed_bottom") +minetest.register_alias("beds:bed_top_red", "beds:bed_top") diff --git a/mods/beds/depends.txt b/mods/beds/depends.txt new file mode 100644 index 0000000..470ec30 --- /dev/null +++ b/mods/beds/depends.txt @@ -0,0 +1,2 @@ +default +wool diff --git a/mods/beds/functions.lua b/mods/beds/functions.lua new file mode 100644 index 0000000..4c5c7d1 --- /dev/null +++ b/mods/beds/functions.lua @@ -0,0 +1,213 @@ +local player_in_bed = 0 +local is_sp = minetest.is_singleplayer() +local enable_respawn = minetest.setting_getbool("enable_bed_respawn") +if enable_respawn == nil then + enable_respawn = true +end + + +-- helper functions + +local function get_look_yaw(pos) + local n = minetest.get_node(pos) + if n.param2 == 1 then + return 7.9, n.param2 + elseif n.param2 == 3 then + return 4.75, n.param2 + elseif n.param2 == 0 then + return 3.15, n.param2 + else + return 6.28, n.param2 + end +end + +local function check_in_beds(players) + local in_bed = beds.player + if not players then + players = minetest.get_connected_players() + end + + for n, player in ipairs(players) do + local name = player:get_player_name() + if not in_bed[name] then + return false + end + end + + return #players > 0 +end + +local function lay_down(player, pos, bed_pos, state, skip) + local name = player:get_player_name() + local hud_flags = player:hud_get_flags() + + if not player or not name then + return + end + + -- stand up + if state ~= nil and not state then + local p = beds.pos[name] or nil + if beds.player[name] ~= nil then + beds.player[name] = nil + player_in_bed = player_in_bed - 1 + end + -- skip here to prevent sending player specific changes (used for leaving players) + if skip then + return + end + if p then + player:setpos(p) + end + + -- physics, eye_offset, etc + player:set_eye_offset({x=0,y=0,z=0}, {x=0,y=0,z=0}) + player:set_look_yaw(math.random(1, 180)/100) + default.player_attached[name] = false + player:set_physics_override(1, 1, 1) + hud_flags.wielditem = true + default.player_set_animation(player, "stand" , 30) + + -- lay down + else + beds.player[name] = 1 + beds.pos[name] = pos + player_in_bed = player_in_bed + 1 + + -- physics, eye_offset, etc + player:set_eye_offset({x=0,y=-13,z=0}, {x=0,y=0,z=0}) + local yaw, param2 = get_look_yaw(bed_pos) + player:set_look_yaw(yaw) + local dir = minetest.facedir_to_dir(param2) + local p = {x=bed_pos.x+dir.x/2,y=bed_pos.y,z=bed_pos.z+dir.z/2} + player:set_physics_override(0, 0, 0) + player:setpos(p) + default.player_attached[name] = true + hud_flags.wielditem = false + default.player_set_animation(player, "lay" , 0) + end + + player:hud_set_flags(hud_flags) +end + +local function update_formspecs(finished) + local ges = #minetest.get_connected_players() + local form_n = "" + local is_majority = (ges/2) < player_in_bed + + if finished then + form_n = beds.formspec .. + "label[2.7,11; Good morning.]" + else + form_n = beds.formspec .. + "label[2.2,11;"..tostring(player_in_bed).." of "..tostring(ges).." players are in bed]" + if is_majority then + form_n = form_n .. + "button_exit[2,8;4,0.75;force;Force night skip]" + end + end + + for name,_ in pairs(beds.player) do + minetest.show_formspec(name, "beds_form", form_n) + end +end + + +-- public functions + +function beds.kick_players() + for name,_ in pairs(beds.player) do + local player = minetest.get_player_by_name(name) + lay_down(player, nil, nil, false) + end +end + +function beds.skip_night() + minetest.set_timeofday(0.23) + beds.set_spawns() +end + +function beds.on_rightclick(pos, player) + local name = player:get_player_name() + local ppos = player:getpos() + local tod = minetest.get_timeofday() + + if tod > 0.2 and tod < 0.805 then + if beds.player[name] then + lay_down(player, nil, nil, false) + end + minetest.chat_send_player(name, "You can only sleep at night.") + return + end + + -- move to bed + if not beds.player[name] then + lay_down(player, ppos, pos) + else + lay_down(player, nil, nil, false) + end + + if not is_sp then + update_formspecs(false) + end + + -- skip the night and let all players stand up + if check_in_beds() then + minetest.after(2, function() + beds.skip_night() + if not is_sp then + update_formspecs(true) + end + beds.kick_players() + end) + end +end + + +-- callbacks + +minetest.register_on_joinplayer(function(player) + beds.read_spawns() +end) + +-- respawn player at bed if enabled and valid position is found +minetest.register_on_respawnplayer(function(player) + if not enable_respawn then + return false + end + local name = player:get_player_name() + local pos = beds.spawn[name] or nil + if pos then + player:setpos(pos) + return true + end +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + lay_down(player, nil, nil, false, true) + beds.player[name] = nil + if check_in_beds() then + minetest.after(2, function() + beds.skip_night() + update_formspecs(true) + beds.kick_players() + end) + end +end) + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if formname ~= "beds_form" then + return + end + if fields.quit or fields.leave then + lay_down(player, nil, nil, false) + update_formspecs(false) + end + + if fields.force then + beds.skip_night() + update_formspecs(true) + beds.kick_players() + end +end) diff --git a/mods/beds/init.lua b/mods/beds/init.lua new file mode 100644 index 0000000..09982c2 --- /dev/null +++ b/mods/beds/init.lua @@ -0,0 +1,16 @@ +beds = {} +beds.player = {} +beds.pos = {} +beds.spawn = {} + +beds.formspec = "size[8,15;true]".. + "bgcolor[#080808BB; true]".. + "button_exit[2,12;4,0.75;leave;Leave Bed]" + +local modpath = minetest.get_modpath("beds") + +-- load files +dofile(modpath.."/functions.lua") +dofile(modpath.."/api.lua") +dofile(modpath.."/beds.lua") +dofile(modpath.."/spawns.lua") diff --git a/mods/beds/spawns.lua b/mods/beds/spawns.lua new file mode 100644 index 0000000..6e087f8 --- /dev/null +++ b/mods/beds/spawns.lua @@ -0,0 +1,58 @@ +local world_path = minetest.get_worldpath() +local org_file = world_path .. "/beds_spawns" +local file = world_path .. "/beds_spawns" +local bkwd = false + +-- check for PA's beds mod spawns +local cf = io.open(world_path .. "/beds_player_spawns", "r") +if cf ~= nil then + io.close(cf) + file = world_path .. "/beds_player_spawns" + bkwd = true +end + +function beds.read_spawns() + local spawns = beds.spawn + local input = io.open(file, "r") + if input and not bkwd then + repeat + local x = input:read("*n") + if x == nil then + break + end + local y = input:read("*n") + local z = input:read("*n") + local name = input:read("*l") + spawns[name:sub(2)] = {x = x, y = y, z = z} + until input:read(0) == nil + io.close(input) + elseif input and bkwd then + beds.spawn = minetest.deserialize(input:read("*all")) + input:close() + beds.save_spawns() + os.rename(file, file .. ".backup") + file = org_file + else + spawns = {} + end +end + +function beds.save_spawns() + if not beds.spawn then + return + end + local output = io.open(org_file, "w") + for i, v in pairs(beds.spawn) do + output:write(v.x.." "..v.y.." "..v.z.." "..i.."\n") + end + io.close(output) +end + +function beds.set_spawns() + for name,_ in pairs(beds.player) do + local player = minetest.get_player_by_name(name) + local p = player:getpos() + beds.spawn[name] = p + end + beds.save_spawns() +end diff --git a/mods/beds/textures/beds_bed.png b/mods/beds/textures/beds_bed.png new file mode 100644 index 0000000..5c0054c Binary files /dev/null and b/mods/beds/textures/beds_bed.png differ diff --git a/mods/beds/textures/beds_bed_fancy.png b/mods/beds/textures/beds_bed_fancy.png new file mode 100644 index 0000000..4f9e8a7 Binary files /dev/null and b/mods/beds/textures/beds_bed_fancy.png differ diff --git a/mods/beds/textures/beds_bed_foot.png b/mods/beds/textures/beds_bed_foot.png new file mode 100644 index 0000000..74d84c8 Binary files /dev/null and b/mods/beds/textures/beds_bed_foot.png differ diff --git a/mods/beds/textures/beds_bed_head.png b/mods/beds/textures/beds_bed_head.png new file mode 100644 index 0000000..763f5e1 Binary files /dev/null and b/mods/beds/textures/beds_bed_head.png differ diff --git a/mods/beds/textures/beds_bed_side1.png b/mods/beds/textures/beds_bed_side1.png new file mode 100644 index 0000000..1ed8158 Binary files /dev/null and b/mods/beds/textures/beds_bed_side1.png differ diff --git a/mods/beds/textures/beds_bed_side2.png b/mods/beds/textures/beds_bed_side2.png new file mode 100644 index 0000000..9d1384d Binary files /dev/null and b/mods/beds/textures/beds_bed_side2.png differ diff --git a/mods/beds/textures/beds_bed_side_bottom.png b/mods/beds/textures/beds_bed_side_bottom.png new file mode 100644 index 0000000..99ff309 Binary files /dev/null and b/mods/beds/textures/beds_bed_side_bottom.png differ diff --git a/mods/beds/textures/beds_bed_side_bottom_r.png b/mods/beds/textures/beds_bed_side_bottom_r.png new file mode 100644 index 0000000..6f870e8 Binary files /dev/null and b/mods/beds/textures/beds_bed_side_bottom_r.png differ diff --git a/mods/beds/textures/beds_bed_side_top.png b/mods/beds/textures/beds_bed_side_top.png new file mode 100644 index 0000000..b2807c5 Binary files /dev/null and b/mods/beds/textures/beds_bed_side_top.png differ diff --git a/mods/beds/textures/beds_bed_side_top_r.png b/mods/beds/textures/beds_bed_side_top_r.png new file mode 100644 index 0000000..429ad7d Binary files /dev/null and b/mods/beds/textures/beds_bed_side_top_r.png differ diff --git a/mods/beds/textures/beds_bed_top1.png b/mods/beds/textures/beds_bed_top1.png new file mode 100644 index 0000000..b6fcc2c Binary files /dev/null and b/mods/beds/textures/beds_bed_top1.png differ diff --git a/mods/beds/textures/beds_bed_top2.png b/mods/beds/textures/beds_bed_top2.png new file mode 100644 index 0000000..2fe5bf2 Binary files /dev/null and b/mods/beds/textures/beds_bed_top2.png differ diff --git a/mods/beds/textures/beds_bed_top_bottom.png b/mods/beds/textures/beds_bed_top_bottom.png new file mode 100644 index 0000000..9b78be6 Binary files /dev/null and b/mods/beds/textures/beds_bed_top_bottom.png differ diff --git a/mods/beds/textures/beds_bed_top_top.png b/mods/beds/textures/beds_bed_top_top.png new file mode 100644 index 0000000..e877c80 Binary files /dev/null and b/mods/beds/textures/beds_bed_top_top.png differ diff --git a/mods/beds/textures/beds_transparent.png b/mods/beds/textures/beds_transparent.png new file mode 100644 index 0000000..2dc0e3d Binary files /dev/null and b/mods/beds/textures/beds_transparent.png differ diff --git a/mods/boats/README.txt b/mods/boats/README.txt new file mode 100644 index 0000000..5100481 --- /dev/null +++ b/mods/boats/README.txt @@ -0,0 +1,16 @@ +Minetest 0.4 mod: boats +======================= +by PilzAdam, slightly modified for NeXt + +License of source code: +----------------------- +WTFPL + +License of media (textures and sounds): +--------------------------------------- +WTFPL + +Authors of media files: +----------------------- +textures: Zeg9 +model: thetoon and Zeg9, modified by PavelS(SokolovPavel) diff --git a/mods/boats/depends.txt b/mods/boats/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/boats/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/boats/init.lua b/mods/boats/init.lua new file mode 100644 index 0000000..8d61dc5 --- /dev/null +++ b/mods/boats/init.lua @@ -0,0 +1,217 @@ + +-- +-- Helper functions +-- + +local function is_water(pos) + local nn = minetest.get_node(pos).name + return minetest.get_item_group(nn, "water") ~= 0 +end + +local function get_sign(i) + if i == 0 then + return 0 + else + return i / math.abs(i) + end +end + +local function get_velocity(v, yaw, y) + local x = -math.sin(yaw) * v + local z = math.cos(yaw) * v + return {x = x, y = y, z = z} +end + +local function get_v(v) + return math.sqrt(v.x ^ 2 + v.z ^ 2) +end + +-- +-- Boat entity +-- + +local boat = { + physical = true, + collisionbox = {-0.5, -0.4, -0.5, 0.5, 0.3, 0.5}, + visual = "mesh", + mesh = "boat.obj", + textures = {"default_wood.png"}, + + driver = nil, + v = 0, + last_v = 0, + removed = false +} + +function boat.on_rightclick(self, clicker) + if not clicker or not clicker:is_player() then + return + end + local name = clicker:get_player_name() + if self.driver and clicker == self.driver then + self.driver = nil + clicker:set_detach() + default.player_attached[name] = false + default.player_set_animation(clicker, "stand" , 30) + elseif not self.driver then + self.driver = clicker + clicker:set_attach(self.object, "", {x = 0, y = 11, z = -3}, {x = 0, y = 0, z = 0}) + default.player_attached[name] = true + minetest.after(0.2, function() + default.player_set_animation(clicker, "sit" , 30) + end) + self.object:setyaw(clicker:get_look_yaw() - math.pi / 2) + end +end + +function boat.on_activate(self, staticdata, dtime_s) + self.object:set_armor_groups({immortal = 1}) + if staticdata then + self.v = tonumber(staticdata) + end + self.last_v = self.v +end + +function boat.get_staticdata(self) + return tostring(self.v) +end + +function boat.on_punch(self, puncher, time_from_last_punch, tool_capabilities, direction) + if not puncher or not puncher:is_player() or self.removed then + return + end + if self.driver and puncher == self.driver then + self.driver = nil + puncher:set_detach() + default.player_attached[puncher:get_player_name()] = false + end + if not self.driver then + self.removed = true + -- delay remove to ensure player is detached + minetest.after(0.1, function() + self.object:remove() + end) + if not minetest.setting_getbool("creative_mode") then + puncher:get_inventory():add_item("main", "boats:boat") + end + end +end + +function boat.on_step(self, dtime) + self.v = get_v(self.object:getvelocity()) * get_sign(self.v) + if self.driver then + local ctrl = self.driver:get_player_control() + local yaw = self.object:getyaw() + if ctrl.up then + self.v = self.v + 0.1 + elseif ctrl.down then + self.v = self.v - 0.1 + end + if ctrl.left then + if self.v < 0 then + self.object:setyaw(yaw - (1 + dtime) * 0.03) + else + self.object:setyaw(yaw + (1 + dtime) * 0.03) + end + elseif ctrl.right then + if self.v < 0 then + self.object:setyaw(yaw + (1 + dtime) * 0.03) + else + self.object:setyaw(yaw - (1 + dtime) * 0.03) + end + end + end + local velo = self.object:getvelocity() + if self.v == 0 and velo.x == 0 and velo.y == 0 and velo.z == 0 then + self.object:setpos(self.object:getpos()) + return + end + local s = get_sign(self.v) + self.v = self.v - 0.02 * s + if s ~= get_sign(self.v) then + self.object:setvelocity({x = 0, y = 0, z = 0}) + self.v = 0 + return + end + if math.abs(self.v) > 4.5 then + self.v = 4.5 * get_sign(self.v) + end + + local p = self.object:getpos() + p.y = p.y - 0.5 + local new_velo = {x = 0, y = 0, z = 0} + local new_acce = {x = 0, y = 0, z = 0} + if not is_water(p) then + local nodedef = minetest.registered_nodes[minetest.get_node(p).name] + if (not nodedef) or nodedef.walkable then + self.v = 0 + new_acce = {x = 0, y = 1, z = 0} + else + new_acce = {x = 0, y = -9.8, z = 0} + end + new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y) + self.object:setpos(self.object:getpos()) + else + p.y = p.y + 1 + if is_water(p) then + local y = self.object:getvelocity().y + if y >= 4.5 then + y = 4.5 + elseif y < 0 then + new_acce = {x = 0, y = 20, z = 0} + else + new_acce = {x = 0, y = 5, z = 0} + end + new_velo = get_velocity(self.v, self.object:getyaw(), y) + self.object:setpos(self.object:getpos()) + else + new_acce = {x = 0, y = 0, z = 0} + if math.abs(self.object:getvelocity().y) < 1 then + local pos = self.object:getpos() + pos.y = math.floor(pos.y) + 0.5 + self.object:setpos(pos) + new_velo = get_velocity(self.v, self.object:getyaw(), 0) + else + new_velo = get_velocity(self.v, self.object:getyaw(), self.object:getvelocity().y) + self.object:setpos(self.object:getpos()) + end + end + end + self.object:setvelocity(new_velo) + self.object:setacceleration(new_acce) +end + +minetest.register_entity("boats:boat", boat) + +minetest.register_craftitem("boats:boat", { + description = "Boat", + inventory_image = "boat_inventory.png", + wield_image = "boat_wield.png", + wield_scale = {x = 2, y = 2, z = 1}, + liquids_pointable = true, + + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return + end + if not is_water(pointed_thing.under) then + return + end + pointed_thing.under.y = pointed_thing.under.y + 0.5 + minetest.add_entity(pointed_thing.under, "boats:boat") + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end, +}) + +minetest.register_craft({ + output = "boats:boat", + recipe = { + {"", "", "" }, + {"group:wood", "", "group:wood"}, + {"group:wood", "group:wood", "group:wood"}, + }, +}) + diff --git a/mods/boats/models/boat.obj b/mods/boats/models/boat.obj new file mode 100644 index 0000000..8c3424f --- /dev/null +++ b/mods/boats/models/boat.obj @@ -0,0 +1,3111 @@ +# Blender v2.73 (sub 0) OBJ File: '' +# www.blender.org +v -6.786140 -1.967150 -4.863200 +v -6.786140 -3.034000 -6.001260 +v -6.786140 -3.034000 -4.863200 +v -6.786140 -1.967150 -3.725140 +v -6.786140 -3.034000 -3.725140 +v -6.786140 -1.967150 -6.001260 +v -6.786140 -3.034000 -7.139320 +v -6.786140 -1.967150 -7.139320 +v -6.786140 -3.034000 -8.277380 +v -6.786140 -1.967150 -8.277380 +v -6.786140 -3.034000 -9.415440 +v -6.786140 -1.967150 -9.415440 +v -6.786140 -1.967150 -2.587080 +v -6.786140 -3.034000 -2.587080 +v -6.786140 -1.967150 -1.449020 +v -6.786140 -3.034000 -1.449020 +v -6.786140 -1.967150 -0.310965 +v -6.786140 -3.034000 -0.310965 +v -6.786140 -1.967150 0.827094 +v -6.786140 -3.034000 0.827094 +v -6.786140 -1.967150 1.965150 +v -6.786140 -3.034000 1.965150 +v -6.786140 -1.967150 3.103210 +v -6.786140 -3.034000 3.103210 +v -6.786140 -1.967150 4.241270 +v -6.786140 -3.034000 4.241270 +v -6.786140 -1.967150 5.379330 +v -6.786140 -3.034000 5.379330 +v -6.786140 -1.967150 6.517390 +v -6.786140 -3.034000 6.517390 +v -6.786140 -1.967150 7.655450 +v -6.786140 -3.034000 7.655450 +v -6.786140 -1.967150 8.793510 +v -6.786140 -3.033999 8.793510 +v 5.732520 -1.967150 -8.277380 +v 5.732520 -3.034000 -7.139320 +v 5.732520 -3.034000 -8.277380 +v 5.732520 -1.967150 -9.415440 +v 5.732520 -3.034000 -9.415440 +v 5.732520 -1.967150 -7.139320 +v 5.732520 -3.034000 -6.001260 +v 5.732520 -1.967150 -6.001260 +v 5.732520 -3.034000 -4.863200 +v 5.732520 -1.967150 -4.863200 +v 5.732520 -3.034000 -3.725140 +v 5.732520 -1.967150 -3.725140 +v 5.732520 -3.034000 -2.587080 +v 5.732520 -1.967150 -2.587080 +v 5.732520 -3.034000 -1.449020 +v 5.732520 -1.967150 -1.449020 +v 5.732520 -3.034000 -0.310965 +v 5.732520 -1.967150 -0.310965 +v 5.732520 -3.034000 0.827094 +v 5.732520 -1.967150 0.827094 +v 5.732520 -3.034000 1.965150 +v 5.732520 -1.967150 1.965150 +v 5.732520 -3.034000 3.103210 +v 5.732520 -1.967150 3.103210 +v 5.732520 -3.034000 4.241270 +v 5.732520 -1.967150 4.241270 +v 5.732520 -3.034000 5.379330 +v 5.732520 -1.967150 5.379330 +v 5.732520 -3.034000 6.517390 +v 5.732520 -1.967150 6.517390 +v 5.732520 -3.034000 7.655450 +v 5.732520 -1.967150 7.655450 +v 5.732520 -3.033999 8.793510 +v 5.732520 -1.967150 8.793510 +v -2.233900 -1.967150 -6.001260 +v -2.233900 -3.034000 -7.139320 +v -2.233900 -3.034000 -6.001260 +v -2.233900 -1.967150 -4.863200 +v -2.233900 -3.034000 -4.863200 +v -2.233900 -1.967150 -7.139320 +v -2.233900 -3.034000 -8.277380 +v -2.233900 -1.967150 -8.277380 +v -2.233900 -3.034000 -9.415440 +v -2.233900 -1.967150 -9.415440 +v -2.233900 -1.967150 -3.725140 +v -2.233900 -3.034000 -3.725140 +v -2.233900 -1.967150 -2.587080 +v -2.233900 -3.034000 -2.587080 +v -2.233900 -1.967150 -1.449020 +v -2.233900 -3.034000 -1.449020 +v -2.233900 -1.967150 -0.310965 +v -2.233900 -3.034000 -0.310965 +v -2.233900 -1.967150 0.827094 +v -2.233900 -3.034000 0.827094 +v -2.233900 -1.967150 1.965150 +v -2.233900 -3.034000 1.965150 +v -2.233900 -1.967150 3.103210 +v -2.233900 -3.034000 3.103210 +v -2.233900 -1.967150 4.241270 +v -2.233900 -3.034000 4.241270 +v -2.233900 -1.967150 5.379330 +v -2.233900 -3.034000 5.379330 +v -2.233900 -1.967150 6.517390 +v -2.233900 -3.034000 6.517390 +v -2.233900 -1.967150 7.655450 +v -2.233900 -3.034000 7.655450 +v -2.233900 -1.967150 8.793510 +v -2.233900 -3.033999 8.793510 +v 2.318340 -1.967150 -3.725140 +v 2.318340 -3.034000 -4.863200 +v 2.318340 -3.034000 -3.725140 +v 2.318340 -1.967150 -2.587080 +v 2.318340 -3.034000 -2.587080 +v 2.318340 -1.967150 -4.863200 +v 2.318340 -3.034000 -6.001260 +v 2.318340 -1.967150 -6.001260 +v 2.318340 -3.034000 -7.139320 +v 2.318340 -1.967150 -7.139320 +v 2.318340 -3.034000 -8.277380 +v 2.318340 -1.967150 -8.277380 +v 2.318340 -3.034000 -9.415440 +v 2.318340 -1.967150 -9.415440 +v 2.318340 -1.967150 -1.449020 +v 2.318340 -3.034000 -1.449020 +v 2.318340 -1.967150 -0.310965 +v 2.318340 -3.034000 -0.310965 +v 2.318340 -1.967150 0.827094 +v 2.318340 -3.034000 0.827094 +v 2.318340 -1.967150 1.965150 +v 2.318340 -3.034000 1.965150 +v 2.318340 -1.967150 3.103210 +v 2.318340 -3.034000 3.103210 +v 2.318340 -1.967150 4.241270 +v 2.318340 -3.034000 4.241270 +v 2.318340 -1.967150 5.379330 +v 2.318340 -3.034000 5.379330 +v 2.318340 -1.967150 6.517390 +v 2.318340 -3.034000 6.517390 +v 2.318340 -1.967150 7.655450 +v 2.318340 -3.034000 7.655450 +v 2.318340 -1.967150 8.793510 +v 2.318340 -3.033999 8.793510 +v -3.371960 -1.967150 6.517390 +v -3.371960 -3.034000 7.655450 +v -3.371960 -3.034000 6.517390 +v -3.371960 -1.967150 5.379330 +v -3.371960 -3.034000 5.379330 +v -3.371960 -1.967150 7.655450 +v -3.371960 -3.033999 8.793510 +v -3.371960 -1.967150 8.793510 +v -3.371960 -1.967150 4.241270 +v -3.371960 -3.034000 4.241270 +v -3.371960 -1.967150 3.103210 +v -3.371960 -3.034000 3.103210 +v -3.371960 -1.967150 1.965150 +v -3.371960 -3.034000 1.965150 +v -3.371960 -1.967150 0.827094 +v -3.371960 -3.034000 0.827094 +v -3.371960 -1.967150 -0.310965 +v -3.371960 -3.034000 -0.310965 +v -3.371960 -1.967150 -1.449020 +v -3.371960 -3.034000 -1.449020 +v -3.371960 -1.967150 -2.587080 +v -3.371960 -3.034000 -2.587080 +v -3.371960 -1.967150 -3.725140 +v -3.371960 -3.034000 -3.725140 +v -3.371960 -1.967150 -4.863200 +v -3.371960 -3.034000 -4.863200 +v -3.371960 -1.967150 -6.001260 +v -3.371960 -3.034000 -6.001260 +v -3.371960 -1.967150 -7.139320 +v -3.371960 -3.034000 -7.139320 +v -3.371960 -1.967150 -8.277380 +v -3.371960 -3.034000 -8.277380 +v -3.371960 -1.967150 -9.415440 +v -3.371960 -3.034000 -9.415440 +v 4.594460 -1.967150 8.793510 +v 3.456400 -3.033999 8.793510 +v 4.594460 -3.033999 8.793510 +v 3.456400 -1.967150 8.793510 +v 4.594460 0.276645 8.793510 +v 3.456400 0.276645 8.793510 +v 2.318340 0.276645 8.793510 +v 1.180280 -1.967150 8.793510 +v 3.456400 1.039180 8.793510 +v 4.594460 1.039180 8.793510 +v 5.732520 0.276645 8.793510 +v 5.732520 1.039180 8.793510 +v 6.870580 0.276645 8.793510 +v 6.870580 -1.967150 8.793510 +v 2.318340 1.039180 8.793510 +v 1.180280 0.276645 8.793510 +v 0.042220 0.276645 8.793510 +v 1.180280 1.039180 8.793510 +v 0.042220 -1.967150 8.793510 +v -1.095840 0.276645 8.793510 +v 0.042220 1.039180 8.793510 +v -1.095840 -1.967150 8.793510 +v 0.042220 -3.033999 8.793510 +v -1.095840 -3.033999 8.793510 +v 1.180280 -3.033999 8.793510 +v -2.233900 0.276645 8.793510 +v -4.510020 -1.967150 8.793510 +v -4.510020 -3.033999 8.793510 +v -3.371960 0.276645 8.793510 +v -1.095840 1.039180 8.793510 +v -2.233900 1.039180 8.793510 +v -4.510020 0.276645 8.793510 +v -3.371960 1.039180 8.793510 +v -4.510020 1.039180 8.793510 +v -5.648080 0.276645 8.793510 +v -5.648080 -1.967150 8.793510 +v -5.648080 1.039180 8.793510 +v -6.786140 0.276645 8.793510 +v -5.648080 -3.033999 8.793510 +v -7.786200 0.276645 8.793510 +v -7.786200 -1.967150 8.793510 +v -6.786140 1.039180 8.793510 +v 1.180280 -1.967150 1.965150 +v 1.180280 -3.034000 3.103210 +v 1.180280 -3.034000 1.965150 +v 1.180280 -1.967150 0.827094 +v 1.180280 -3.034000 0.827094 +v 1.180280 -1.967150 3.103210 +v 1.180280 -3.034000 4.241270 +v 1.180280 -1.967150 4.241270 +v 1.180280 -3.034000 5.379330 +v 1.180280 -1.967150 5.379330 +v 1.180280 -3.034000 6.517390 +v 1.180280 -1.967150 6.517390 +v 1.180280 -3.034000 7.655450 +v 1.180280 -1.967150 7.655450 +v 1.180280 -1.967150 -0.310965 +v 1.180280 -3.034000 -0.310965 +v 1.180280 -1.967150 -1.449020 +v 1.180280 -3.034000 -1.449020 +v 1.180280 -1.967150 -2.587080 +v 1.180280 -3.034000 -2.587080 +v 1.180280 -1.967150 -3.725140 +v 1.180280 -3.034000 -3.725140 +v 1.180280 -1.967150 -4.863200 +v 1.180280 -3.034000 -4.863200 +v 1.180280 -1.967150 -6.001260 +v 1.180280 -3.034000 -6.001260 +v 1.180280 -1.967150 -7.139320 +v 1.180280 -3.034000 -7.139320 +v 1.180280 -1.967150 -8.277380 +v 1.180280 -3.034000 -8.277380 +v 1.180280 -1.967150 -9.415440 +v 1.180280 -3.034000 -9.415440 +v 3.456400 -3.034000 -9.415440 +v 3.456400 -1.967150 -9.415440 +v 2.318340 0.276645 -9.415440 +v 1.180280 0.276645 -9.415440 +v 4.594460 -3.034000 -9.415440 +v 4.594460 -1.967150 -9.415440 +v 3.456400 0.276645 -9.415440 +v 2.318340 1.039180 -9.415440 +v 4.594460 0.276645 -9.415440 +v 3.456400 1.039180 -9.415440 +v 4.594460 1.039180 -9.415440 +v 5.732520 0.276645 -9.415440 +v 6.870580 -1.967150 -9.415440 +v 5.732520 1.039180 -9.415440 +v 6.870580 0.276645 -9.415440 +v 0.042220 0.276645 -9.415440 +v 0.042220 1.039180 -9.415440 +v 1.180280 1.039180 -9.415440 +v 0.042220 -1.967150 -9.415440 +v 0.042220 -3.034000 -9.415440 +v -1.095840 -1.967150 -9.415440 +v -1.095840 -3.034000 -9.415440 +v -2.233900 0.276645 -9.415440 +v -1.095840 0.276645 -9.415440 +v -3.371960 0.276645 -9.415440 +v -2.233900 1.039180 -9.415440 +v -1.095840 1.039180 -9.415440 +v -4.510020 0.276645 -9.415440 +v -4.510020 1.039180 -9.415440 +v -3.371960 1.039180 -9.415440 +v -4.510020 -1.967150 -9.415440 +v -5.648080 0.276645 -9.415440 +v -5.648080 1.039180 -9.415440 +v -5.648080 -1.967150 -9.415440 +v -4.510020 -3.034000 -9.415440 +v -6.786140 0.276645 -9.415440 +v -6.786140 1.039180 -9.415440 +v -5.648080 -3.034000 -9.415440 +v -7.786200 -1.967150 -9.415440 +v -7.786200 0.276645 -9.415440 +v 6.870580 -1.967150 7.655450 +v 6.870580 -1.967150 6.517390 +v 6.870580 -1.967150 5.379330 +v 6.870580 -1.967150 4.241270 +v 6.870580 -1.967150 3.103210 +v 6.870580 -1.967150 1.965150 +v 6.870580 -1.967150 0.827094 +v 6.870580 -1.967150 -0.310965 +v 6.870580 -1.967150 -1.449020 +v 6.870580 -1.967150 -2.587080 +v 6.870580 -1.967150 -3.725140 +v 6.870580 -1.967150 -4.863200 +v 6.870580 -1.967150 -6.001260 +v 6.870580 -1.967150 -7.139320 +v 6.870580 -1.967150 -8.277380 +v -5.648080 -3.034000 0.827094 +v -5.648080 -3.034000 -0.310965 +v -5.648080 -3.034000 1.965150 +v -4.510020 -3.034000 1.965150 +v -5.648080 -3.034000 3.103210 +v -4.510020 -3.034000 0.827094 +v -5.648080 -3.034000 4.241270 +v -4.510020 -3.034000 3.103210 +v -4.510020 -3.034000 -0.310965 +v -4.510020 -3.034000 -1.449020 +v -4.510020 -3.034000 -2.587080 +v -5.648080 -3.034000 -1.449020 +v -5.648080 -3.034000 -2.587080 +v -4.510020 -3.034000 -3.725140 +v -5.648080 -3.034000 -3.725140 +v -4.510020 -3.034000 -4.863200 +v -5.648080 -3.034000 -4.863200 +v -4.510020 -3.034000 -6.001260 +v -5.648080 -3.034000 -6.001260 +v -4.510020 -3.034000 -7.139320 +v -5.648080 -3.034000 -7.139320 +v -4.510020 -3.034000 -8.277380 +v -5.648080 -3.034000 -8.277380 +v -4.510020 -3.034000 4.241270 +v -4.510020 -3.034000 5.379330 +v -5.648080 -3.034000 5.379330 +v -5.648080 -3.034000 6.517390 +v -4.510020 -3.034000 6.517390 +v -5.648080 -3.034000 7.655450 +v -4.510020 -3.034000 7.655450 +v -1.095840 -3.034000 0.827094 +v -1.095840 -3.034000 -0.310965 +v -1.095840 -3.034000 1.965150 +v 0.042220 -3.034000 1.965150 +v -1.095840 -3.034000 3.103210 +v 0.042220 -3.034000 0.827094 +v -1.095840 -3.034000 4.241270 +v 0.042220 -3.034000 3.103210 +v 0.042220 -3.034000 -0.310965 +v 0.042220 -3.034000 -1.449020 +v 0.042220 -3.034000 -2.587080 +v -1.095840 -3.034000 -1.449020 +v -1.095840 -3.034000 -2.587080 +v 0.042220 -3.034000 -3.725140 +v -1.095840 -3.034000 -3.725140 +v 0.042220 -3.034000 -4.863200 +v -1.095840 -3.034000 -4.863200 +v 0.042220 -3.034000 -6.001260 +v -1.095840 -3.034000 -6.001260 +v 0.042220 -3.034000 -7.139320 +v -1.095840 -3.034000 -7.139320 +v 0.042220 -3.034000 -8.277380 +v -1.095840 -3.034000 -8.277380 +v 0.042220 -3.034000 4.241270 +v 0.042220 -3.034000 5.379330 +v -1.095840 -3.034000 5.379330 +v -1.095840 -3.034000 6.517390 +v 0.042220 -3.034000 6.517390 +v -1.095840 -3.034000 7.655450 +v 0.042220 -3.034000 7.655450 +v 3.456400 -3.034000 -3.725140 +v 3.456400 -3.034000 -4.863200 +v 3.456400 -3.034000 -2.587080 +v 4.594460 -3.034000 -2.587080 +v 3.456400 -3.034000 -1.449020 +v 4.594460 -3.034000 -3.725140 +v 3.456400 -3.034000 -0.310965 +v 4.594460 -3.034000 -1.449020 +v 4.594460 -3.034000 -4.863200 +v 4.594460 -3.034000 -6.001260 +v 4.594460 -3.034000 -7.139320 +v 3.456400 -3.034000 -6.001260 +v 3.456400 -3.034000 -7.139320 +v 4.594460 -3.034000 -8.277380 +v 3.456400 -3.034000 -8.277380 +v 4.594460 -3.034000 -0.310965 +v 4.594460 -3.034000 0.827094 +v 3.456400 -3.034000 0.827094 +v 3.456400 -3.034000 1.965150 +v 4.594460 -3.034000 1.965150 +v 3.456400 -3.034000 3.103210 +v 4.594460 -3.034000 3.103210 +v 3.456400 -3.034000 4.241270 +v 4.594460 -3.034000 4.241270 +v 3.456400 -3.034000 5.379330 +v 4.594460 -3.034000 5.379330 +v 3.456400 -3.034000 6.517390 +v 4.594460 -3.034000 6.517390 +v 3.456400 -3.034000 7.655450 +v 4.594460 -3.034000 7.655450 +v -2.233900 0.276645 -2.587080 +v -2.233900 1.039180 -1.449020 +v -2.233900 1.039180 -2.587080 +v -2.233900 0.276645 -3.725140 +v -2.233900 1.039180 -3.725140 +v -2.233900 0.276645 -1.449020 +v -2.233900 1.039180 -0.310965 +v -2.233900 0.276645 -0.310965 +v -2.233900 1.039180 0.827094 +v -2.233900 0.276645 0.827094 +v -2.233900 1.039180 1.965150 +v -2.233900 0.276645 1.965150 +v -2.233900 1.039180 3.103210 +v -2.233900 0.276645 3.103210 +v -2.233900 1.039180 4.241270 +v -2.233900 0.276645 4.241270 +v -2.233900 1.039180 5.379330 +v -2.233900 0.276645 5.379330 +v -2.233900 1.039180 6.517390 +v -2.233900 0.276645 6.517390 +v -2.233900 1.039180 7.655450 +v -2.233900 0.276645 7.655450 +v -2.233900 0.276645 -4.863200 +v -2.233900 1.039180 -4.863200 +v -2.233900 0.276645 -6.001260 +v -2.233900 1.039180 -6.001260 +v -2.233900 0.276645 -7.139320 +v -2.233900 1.039180 -7.139320 +v -2.233900 0.276645 -8.277380 +v -2.233900 1.039180 -8.277380 +v 2.318340 0.276645 4.241270 +v 2.318340 1.039180 5.379330 +v 2.318340 1.039180 4.241270 +v 2.318340 0.276645 3.103210 +v 2.318340 1.039180 3.103210 +v 2.318340 0.276645 5.379330 +v 2.318340 1.039180 6.517390 +v 2.318340 0.276645 6.517390 +v 2.318340 1.039180 7.655450 +v 2.318340 0.276645 7.655450 +v 2.318340 0.276645 1.965150 +v 2.318340 1.039180 1.965150 +v 2.318340 0.276645 0.827094 +v 2.318340 1.039180 0.827094 +v 2.318340 0.276645 -0.310965 +v 2.318340 1.039180 -0.310965 +v 2.318340 0.276645 -1.449020 +v 2.318340 1.039180 -1.449020 +v 2.318340 0.276645 -2.587080 +v 2.318340 1.039180 -2.587080 +v 2.318340 0.276645 -3.725140 +v 2.318340 1.039180 -3.725140 +v 2.318340 0.276645 -4.863200 +v 2.318340 1.039180 -4.863200 +v 2.318340 0.276645 -6.001260 +v 2.318340 1.039180 -6.001260 +v 2.318340 0.276645 -7.139320 +v 2.318340 1.039180 -7.139320 +v 2.318340 0.276645 -8.277380 +v 2.318340 1.039180 -8.277380 +v -6.786140 0.276645 6.517390 +v -6.786140 1.039180 7.655450 +v -6.786140 1.039180 6.517390 +v -6.786140 0.276645 5.379330 +v -6.786140 1.039180 5.379330 +v -6.786140 0.276645 7.655450 +v -6.786140 0.276645 4.241270 +v -6.786140 1.039180 4.241270 +v -6.786140 0.276645 3.103210 +v -6.786140 1.039180 3.103210 +v -6.786140 0.276645 1.965150 +v -6.786140 1.039180 1.965150 +v -6.786140 0.276645 0.827094 +v -6.786140 1.039180 0.827094 +v -6.786140 0.276645 -0.310965 +v -6.786140 1.039180 -0.310965 +v -6.786140 0.276645 -1.449020 +v -6.786140 1.039180 -1.449020 +v -6.786140 0.276645 -2.587080 +v -6.786140 1.039180 -2.587080 +v -6.786140 0.276645 -3.725140 +v -6.786140 1.039180 -3.725140 +v -6.786140 0.276645 -4.863200 +v -6.786140 1.039180 -4.863200 +v -6.786140 0.276645 -6.001260 +v -6.786140 1.039180 -6.001260 +v -6.786140 0.276645 -7.139320 +v -6.786140 1.039180 -7.139320 +v -6.786140 0.276645 -8.277380 +v -6.786140 1.039180 -8.277380 +v 1.180280 0.276645 -7.139320 +v 1.180280 1.039180 -8.277380 +v 1.180280 1.039180 -7.139320 +v 1.180280 0.276645 -6.001260 +v 1.180280 1.039180 -6.001260 +v 1.180280 0.276645 -8.277380 +v 1.180280 0.276645 -4.863200 +v 1.180280 1.039180 -4.863200 +v 1.180280 0.276645 -3.725140 +v 1.180280 1.039180 -3.725140 +v 1.180280 0.276645 -2.587080 +v 1.180280 1.039180 -2.587080 +v 1.180280 0.276645 -1.449020 +v 1.180280 1.039180 -1.449020 +v 1.180280 0.276645 -0.310965 +v 1.180280 1.039180 -0.310965 +v 1.180280 0.276645 0.827094 +v 1.180280 1.039180 0.827094 +v 1.180280 0.276645 1.965150 +v 1.180280 1.039180 1.965150 +v 1.180280 0.276645 3.103210 +v 1.180280 1.039180 3.103210 +v 1.180280 0.276645 4.241270 +v 1.180280 1.039180 4.241270 +v 1.180280 0.276645 5.379330 +v 1.180280 1.039180 5.379330 +v 1.180280 0.276645 6.517390 +v 1.180280 1.039180 6.517390 +v 1.180280 0.276645 7.655450 +v 1.180280 1.039180 7.655450 +v 5.732520 0.276645 3.103210 +v 5.732520 1.039180 1.965150 +v 5.732520 1.039180 3.103210 +v 5.732520 0.276645 4.241270 +v 5.732520 1.039180 4.241270 +v 5.732520 0.276645 1.965150 +v 5.732520 1.039180 0.827094 +v 5.732520 0.276645 0.827094 +v 5.732520 1.039180 -0.310965 +v 5.732520 0.276645 -0.310965 +v 5.732520 1.039180 -1.449020 +v 5.732520 0.276645 -1.449020 +v 5.732520 1.039180 -2.587080 +v 5.732520 0.276645 -2.587080 +v 5.732520 1.039180 -3.725140 +v 5.732520 0.276645 -3.725140 +v 5.732520 1.039180 -4.863200 +v 5.732520 0.276645 -4.863200 +v 5.732520 1.039180 -6.001260 +v 5.732520 0.276645 -6.001260 +v 5.732520 1.039180 -7.139320 +v 5.732520 0.276645 -7.139320 +v 5.732520 1.039180 -8.277380 +v 5.732520 0.276645 -8.277380 +v 5.732520 0.276645 5.379330 +v 5.732520 1.039180 5.379330 +v 5.732520 0.276645 6.517390 +v 5.732520 1.039180 6.517390 +v 5.732520 0.276645 7.655450 +v 5.732520 1.039180 7.655450 +v -3.371960 1.039180 7.655450 +v -3.371960 0.276645 7.655450 +v -3.371960 1.039180 6.517390 +v -3.371960 0.276645 6.517390 +v -3.371960 1.039180 5.379330 +v -3.371960 0.276645 5.379330 +v -3.371960 1.039180 4.241270 +v -3.371960 0.276645 4.241270 +v -3.371960 1.039180 3.103210 +v -3.371960 0.276645 3.103210 +v -3.371960 1.039180 1.965150 +v -3.371960 0.276645 1.965150 +v -3.371960 1.039180 0.827094 +v -3.371960 0.276645 0.827094 +v -3.371960 1.039180 -0.310965 +v -3.371960 0.276645 -0.310965 +v -3.371960 1.039180 -1.449020 +v -3.371960 0.276645 -1.449020 +v -3.371960 1.039180 -2.587080 +v -3.371960 0.276645 -2.587080 +v -3.371960 1.039180 -3.725140 +v -3.371960 0.276645 -3.725140 +v -3.371960 1.039180 -4.863200 +v -3.371960 0.276645 -4.863200 +v -3.371960 1.039180 -6.001260 +v -3.371960 0.276645 -6.001260 +v -3.371960 1.039180 -7.139320 +v -3.371960 0.276645 -7.139320 +v -3.371960 1.039180 -8.277380 +v -3.371960 0.276645 -8.277380 +v 6.870580 0.276645 7.655450 +v 6.870580 0.276645 6.517390 +v 6.870580 0.276645 5.379330 +v 6.870580 0.276645 4.241270 +v 6.870580 0.276645 3.103210 +v 6.870580 0.276645 1.965150 +v 6.870580 0.276645 0.827094 +v 6.870580 0.276645 -0.310965 +v 6.870580 0.276645 -1.449020 +v 6.870580 0.276645 -2.587080 +v 6.870580 0.276645 -3.725140 +v 6.870580 0.276645 -4.863200 +v 6.870580 0.276645 -6.001260 +v 6.870580 0.276645 -7.139320 +v 6.870580 0.276645 -8.277380 +v -1.095840 0.276645 -10.802900 +v -1.095840 -1.967150 -10.802900 +v -1.095840 0.276644 -12.034100 +v -1.095840 -1.967150 -12.034100 +v -1.095840 -4.601110 -10.802900 +v -1.095840 -4.601110 -12.034100 +v -1.095840 -4.601110 -9.415440 +v -1.095840 1.039180 -10.802900 +v -1.095840 1.039180 -12.034100 +v -1.095840 2.768579 -10.802900 +v -1.095840 2.768579 -12.034100 +v -1.095840 3.746069 -10.802900 +v -1.095840 2.768580 -7.883420 +v -1.095840 3.746069 -12.034100 +v -1.095840 3.746070 -7.883420 +v -1.095840 0.276644 -14.284900 +v -1.095840 -1.967151 -14.284900 +v -1.095840 -4.601110 -14.284900 +v 0.042220 -1.967150 -12.034100 +v 0.042220 -4.601110 -10.802900 +v 0.042220 -4.601110 -12.034100 +v 0.042220 -4.601110 -14.284900 +v 0.042220 -1.967150 -10.802900 +v 0.042220 -4.601110 -9.415440 +v 0.042220 0.276645 -10.802900 +v 0.042220 1.039180 -10.802900 +v 0.042220 0.276644 -12.034100 +v 0.042220 1.039180 -12.034100 +v 0.042220 2.768579 -12.034100 +v 0.042220 2.768579 -10.802900 +v 0.042220 -1.967151 -14.284900 +v 0.042220 0.276644 -14.284900 +v 0.042220 3.746069 -12.034100 +v 0.042220 3.746069 -10.802900 +v 0.042220 3.746070 -7.883420 +v 0.042220 2.768580 -7.883420 +v -7.786200 -1.967150 -8.277380 +v -7.786200 -1.967150 -7.139320 +v -7.786200 -1.967150 -6.001260 +v -7.786200 -1.967150 -4.863200 +v -7.786200 -1.967150 -3.725140 +v -7.786200 -1.967150 -2.587080 +v -7.786200 -1.967150 -1.449020 +v -7.786200 -1.967150 -0.310965 +v -7.786200 -1.967150 0.827094 +v -7.786200 -1.967150 1.965150 +v -7.786200 -1.967150 3.103210 +v -7.786200 -1.967150 4.241270 +v -7.786200 -1.967150 5.379330 +v -7.786200 -1.967150 6.517390 +v -7.786200 -1.967150 7.655450 +v -7.786200 0.276645 3.103210 +v -7.786200 0.276645 4.241270 +v -7.786200 0.276645 5.379330 +v -7.786200 0.276645 1.965150 +v -7.786200 0.276645 0.827094 +v -7.786200 0.276645 -0.310965 +v -7.786200 0.276645 -1.449020 +v -7.786200 0.276645 -2.587080 +v -7.786200 0.276645 -3.725140 +v -7.786200 0.276645 -4.863200 +v -7.786200 0.276645 -6.001260 +v -7.786200 0.276645 -7.139320 +v -7.786200 0.276645 -8.277380 +v -7.786200 0.276645 6.517390 +v -7.786200 0.276645 7.655450 +v 0.042220 1.039180 7.655450 +v 0.042220 1.039180 6.517390 +v -1.095840 1.039180 7.655450 +v 0.042220 1.039180 5.379330 +v -1.095840 1.039180 6.517390 +v -1.095840 1.039180 5.379330 +v 0.042220 1.039180 4.241270 +v -1.095840 1.039180 4.241270 +v 0.042220 1.039180 3.103210 +v -1.095840 1.039180 3.103210 +v 0.042220 1.039180 1.965150 +v -1.095840 1.039180 1.965150 +v 0.042220 1.039180 0.827094 +v -1.095840 1.039180 0.827094 +v 0.042220 1.039180 -0.310965 +v -1.095840 1.039180 -0.310965 +v 0.042220 1.039180 -1.449020 +v -1.095840 1.039180 -1.449020 +v 0.042220 1.039180 -2.587080 +v -1.095840 1.039180 -2.587080 +v 0.042220 1.039180 -3.725140 +v -1.095840 1.039180 -3.725140 +v 0.042220 1.039180 -4.863200 +v -1.095840 1.039180 -4.863200 +v 0.042220 1.039180 -6.001260 +v -1.095840 1.039180 -6.001260 +v 0.042220 1.039180 -7.139320 +v -1.095840 1.039180 -7.139320 +v 0.042220 1.039180 -8.277380 +v -1.095840 1.039180 -8.277380 +v -4.510020 1.039180 7.655450 +v -4.510020 1.039180 6.517390 +v -5.648080 1.039180 7.655450 +v -4.510020 1.039180 5.379330 +v -5.648080 1.039180 6.517390 +v -5.648080 1.039180 5.379330 +v -4.510020 1.039180 4.241270 +v -5.648080 1.039180 4.241270 +v -4.510020 1.039180 3.103210 +v -5.648080 1.039180 3.103210 +v -4.510020 1.039180 1.965150 +v -5.648080 1.039180 1.965150 +v -4.510020 1.039180 0.827094 +v -5.648080 1.039180 0.827094 +v -4.510020 1.039180 -0.310965 +v -5.648080 1.039180 -0.310965 +v -4.510020 1.039180 -1.449020 +v -5.648080 1.039180 -1.449020 +v -4.510020 1.039180 -2.587080 +v -5.648080 1.039180 -2.587080 +v -4.510020 1.039180 -3.725140 +v -5.648080 1.039180 -3.725140 +v -4.510020 1.039180 -4.863200 +v -5.648080 1.039180 -4.863200 +v -4.510020 1.039180 -6.001260 +v -5.648080 1.039180 -6.001260 +v -4.510020 1.039180 -7.139320 +v -5.648080 1.039180 -7.139320 +v -4.510020 1.039180 -8.277380 +v -5.648080 1.039180 -8.277380 +v 4.594460 1.039180 7.655450 +v 4.594460 1.039180 6.517390 +v 3.456400 1.039180 7.655450 +v 4.594460 1.039180 5.379330 +v 3.456400 1.039180 6.517390 +v 3.456400 1.039180 5.379330 +v 4.594460 1.039180 4.241270 +v 3.456400 1.039180 4.241270 +v 4.594460 1.039180 3.103210 +v 3.456400 1.039180 3.103210 +v 4.594460 1.039180 1.965150 +v 3.456400 1.039180 1.965150 +v 4.594460 1.039180 0.827094 +v 3.456400 1.039180 0.827094 +v 4.594460 1.039180 -0.310965 +v 3.456400 1.039180 -0.310965 +v 4.594460 1.039180 -1.449020 +v 3.456400 1.039180 -1.449020 +v 4.594460 1.039180 -2.587080 +v 3.456400 1.039180 -2.587080 +v 4.594460 1.039180 -3.725140 +v 3.456400 1.039180 -3.725140 +v 4.594460 1.039180 -4.863200 +v 3.456400 1.039180 -4.863200 +v 4.594460 1.039180 -6.001260 +v 3.456400 1.039180 -6.001260 +v 4.594460 1.039180 -7.139320 +v 3.456400 1.039180 -7.139320 +v 4.594460 1.039180 -8.277380 +v 3.456400 1.039180 -8.277380 +vt 0.116019 0.974315 +vt 0.087066 0.947167 +vt 0.116022 0.947170 +vt 0.144976 0.974318 +vt 0.144979 0.947173 +vt 0.087063 0.974311 +vt 0.058110 0.947165 +vt 0.058107 0.974308 +vt 0.029155 0.947162 +vt 0.029152 0.974306 +vt 0.000199 0.947159 +vt 0.000197 0.974303 +vt 0.173933 0.974322 +vt 0.173936 0.947177 +vt 0.202891 0.974326 +vt 0.202894 0.947180 +vt 0.231849 0.974330 +vt 0.231853 0.947184 +vt 0.260808 0.974334 +vt 0.260812 0.947187 +vt 0.289768 0.974338 +vt 0.289772 0.947190 +vt 0.318729 0.974342 +vt 0.318732 0.947194 +vt 0.347690 0.974345 +vt 0.347693 0.947196 +vt 0.376652 0.974348 +vt 0.376654 0.947199 +vt 0.405614 0.974351 +vt 0.405616 0.947201 +vt 0.434577 0.974353 +vt 0.434578 0.947203 +vt 0.463539 0.974355 +vt 0.463541 0.947205 +vt 0.029160 0.492913 +vt 0.058118 0.520059 +vt 0.029160 0.520059 +vt 0.000202 0.492913 +vt 0.000202 0.520059 +vt 0.058118 0.492913 +vt 0.087076 0.520059 +vt 0.087076 0.492913 +vt 0.116034 0.520059 +vt 0.116034 0.492914 +vt 0.144992 0.520060 +vt 0.144992 0.492914 +vt 0.173949 0.520060 +vt 0.173950 0.492914 +vt 0.202907 0.520060 +vt 0.202907 0.492915 +vt 0.231864 0.520060 +vt 0.231865 0.492915 +vt 0.260822 0.520061 +vt 0.260822 0.492916 +vt 0.289779 0.520061 +vt 0.289778 0.492916 +vt 0.318735 0.520060 +vt 0.318735 0.492916 +vt 0.347692 0.520060 +vt 0.347691 0.492915 +vt 0.376649 0.520059 +vt 0.376648 0.492915 +vt 0.405605 0.520058 +vt 0.405604 0.492914 +vt 0.434561 0.520056 +vt 0.434560 0.492912 +vt 0.463517 0.520055 +vt 0.463516 0.492911 +vt 0.087075 0.804197 +vt 0.058119 0.777052 +vt 0.087076 0.777053 +vt 0.116032 0.804198 +vt 0.116033 0.777053 +vt 0.058119 0.804197 +vt 0.029163 0.777052 +vt 0.029163 0.804196 +vt 0.000207 0.777052 +vt 0.000207 0.804196 +vt 0.144989 0.804200 +vt 0.144990 0.777054 +vt 0.173947 0.804201 +vt 0.173948 0.777055 +vt 0.202905 0.804202 +vt 0.202906 0.777056 +vt 0.231863 0.804203 +vt 0.231864 0.777057 +vt 0.260822 0.804204 +vt 0.260822 0.777057 +vt 0.289780 0.804205 +vt 0.289781 0.777058 +vt 0.318740 0.804205 +vt 0.318740 0.777058 +vt 0.347700 0.804206 +vt 0.347700 0.777058 +vt 0.376660 0.804206 +vt 0.376659 0.777058 +vt 0.405620 0.804205 +vt 0.405620 0.777057 +vt 0.434581 0.804205 +vt 0.434580 0.777056 +vt 0.463543 0.804203 +vt 0.463541 0.777054 +vt 0.144991 0.634078 +vt 0.116033 0.606933 +vt 0.144991 0.606933 +vt 0.173949 0.634079 +vt 0.173949 0.606933 +vt 0.116034 0.634078 +vt 0.087076 0.606933 +vt 0.087076 0.634079 +vt 0.058118 0.606933 +vt 0.058118 0.634079 +vt 0.029160 0.606933 +vt 0.029160 0.634079 +vt 0.000202 0.606933 +vt 0.000202 0.634080 +vt 0.202907 0.634079 +vt 0.202907 0.606933 +vt 0.231864 0.634078 +vt 0.231864 0.606933 +vt 0.260822 0.634078 +vt 0.260822 0.606933 +vt 0.289780 0.634078 +vt 0.289780 0.606932 +vt 0.318738 0.634077 +vt 0.318737 0.606932 +vt 0.347696 0.634077 +vt 0.347695 0.606931 +vt 0.376653 0.634076 +vt 0.376652 0.606930 +vt 0.405611 0.634074 +vt 0.405609 0.606928 +vt 0.434569 0.634072 +vt 0.434567 0.606927 +vt 0.463527 0.634069 +vt 0.463524 0.606924 +vt 0.405621 0.833166 +vt 0.434582 0.860316 +vt 0.405620 0.860316 +vt 0.376660 0.833166 +vt 0.376659 0.860315 +vt 0.434582 0.833166 +vt 0.463545 0.860317 +vt 0.463544 0.833166 +vt 0.347699 0.833166 +vt 0.347698 0.860314 +vt 0.318739 0.833165 +vt 0.318738 0.860313 +vt 0.289780 0.833164 +vt 0.289778 0.860311 +vt 0.260820 0.833163 +vt 0.260819 0.860309 +vt 0.231862 0.833161 +vt 0.231860 0.860308 +vt 0.202903 0.833160 +vt 0.202902 0.860306 +vt 0.173946 0.833158 +vt 0.173944 0.860304 +vt 0.144988 0.833157 +vt 0.144987 0.860302 +vt 0.116031 0.833155 +vt 0.116029 0.860300 +vt 0.087074 0.833154 +vt 0.087073 0.860299 +vt 0.058118 0.833153 +vt 0.058116 0.860297 +vt 0.029162 0.833152 +vt 0.029161 0.860295 +vt 0.000206 0.833151 +vt 0.000205 0.860294 +vt 0.662141 0.076691 +vt 0.691099 0.103837 +vt 0.662141 0.103837 +vt 0.633183 0.076691 +vt 0.633183 0.103837 +vt 0.691099 0.076691 +vt 0.720057 0.103837 +vt 0.720058 0.076691 +vt 0.662141 0.019597 +vt 0.691100 0.019597 +vt 0.720058 0.019597 +vt 0.749016 0.076691 +vt 0.691100 0.000194 +vt 0.662142 0.000194 +vt 0.633183 0.019597 +vt 0.633183 0.000194 +vt 0.604225 0.019597 +vt 0.604225 0.076691 +vt 0.720058 0.000194 +vt 0.749016 0.019597 +vt 0.777974 0.019597 +vt 0.749016 0.000195 +vt 0.777974 0.076691 +vt 0.806932 0.019597 +vt 0.777974 0.000195 +vt 0.806932 0.076691 +vt 0.777974 0.103837 +vt 0.806932 0.103837 +vt 0.749016 0.103837 +vt 0.835890 0.103837 +vt 0.835890 0.076691 +vt 0.864848 0.076691 +vt 0.835890 0.019597 +vt 0.893806 0.076691 +vt 0.893806 0.103837 +vt 0.864848 0.103837 +vt 0.864848 0.019597 +vt 0.806932 0.000195 +vt 0.835890 0.000195 +vt 0.893806 0.019597 +vt 0.864848 0.000195 +vt 0.893806 0.000194 +vt 0.922764 0.019597 +vt 0.922764 0.076691 +vt 0.922764 0.000194 +vt 0.951722 0.019597 +vt 0.951722 0.076691 +vt 0.951722 0.103837 +vt 0.922764 0.103837 +vt 0.977169 0.019597 +vt 0.977169 0.076690 +vt 0.951722 0.000194 +vt 0.289780 0.663036 +vt 0.318739 0.690182 +vt 0.289781 0.690182 +vt 0.260822 0.663036 +vt 0.260823 0.690182 +vt 0.318739 0.663035 +vt 0.347698 0.690181 +vt 0.347697 0.663035 +vt 0.376656 0.690180 +vt 0.376655 0.663033 +vt 0.405615 0.690178 +vt 0.405613 0.663032 +vt 0.434574 0.690176 +vt 0.434571 0.663030 +vt 0.463533 0.690173 +vt 0.463530 0.663027 +vt 0.231865 0.663036 +vt 0.231865 0.690182 +vt 0.202907 0.663036 +vt 0.202907 0.690182 +vt 0.173949 0.663036 +vt 0.173949 0.690182 +vt 0.144991 0.663036 +vt 0.144991 0.690182 +vt 0.116034 0.663036 +vt 0.116034 0.690182 +vt 0.087076 0.663036 +vt 0.087076 0.690182 +vt 0.058118 0.663036 +vt 0.058119 0.690182 +vt 0.029161 0.663037 +vt 0.029162 0.690182 +vt 0.000203 0.663038 +vt 0.000205 0.690183 +vt 0.579762 0.491109 +vt 0.550803 0.463966 +vt 0.579760 0.463963 +vt 0.550805 0.491111 +vt 0.579767 0.548202 +vt 0.608720 0.491107 +vt 0.608724 0.548199 +vt 0.521845 0.463968 +vt 0.521847 0.491114 +vt 0.550809 0.548204 +vt 0.579768 0.567604 +vt 0.521852 0.548206 +vt 0.550811 0.567606 +vt 0.492890 0.491116 +vt 0.492888 0.463971 +vt 0.521853 0.567608 +vt 0.492895 0.548208 +vt 0.463933 0.491118 +vt 0.492896 0.567610 +vt 0.463938 0.548210 +vt 0.637682 0.548197 +vt 0.637683 0.567600 +vt 0.608726 0.567602 +vt 0.637678 0.491105 +vt 0.608718 0.463961 +vt 0.637676 0.463959 +vt 0.666636 0.491103 +vt 0.666635 0.463957 +vt 0.695594 0.491102 +vt 0.695595 0.548197 +vt 0.666637 0.548197 +vt 0.695593 0.463956 +vt 0.724553 0.491102 +vt 0.724554 0.548197 +vt 0.695596 0.567600 +vt 0.666637 0.567600 +vt 0.753512 0.548197 +vt 0.753512 0.567600 +vt 0.724554 0.567600 +vt 0.753512 0.491102 +vt 0.724553 0.463955 +vt 0.782471 0.548197 +vt 0.782471 0.567600 +vt 0.782471 0.491102 +vt 0.753512 0.463955 +vt 0.811429 0.548197 +vt 0.811429 0.567600 +vt 0.782471 0.463955 +vt 0.811430 0.491102 +vt 0.836877 0.491102 +vt 0.836877 0.548197 +vt 0.811430 0.463955 +vt 0.434558 0.463956 +vt 0.405603 0.463958 +vt 0.463514 0.463955 +vt 0.376647 0.463959 +vt 0.347691 0.463959 +vt 0.318735 0.463959 +vt 0.289779 0.463959 +vt 0.260822 0.463959 +vt 0.231865 0.463958 +vt 0.202908 0.463957 +vt 0.173950 0.463956 +vt 0.144992 0.463956 +vt 0.116034 0.463956 +vt 0.087076 0.463955 +vt 0.058118 0.463955 +vt 0.029160 0.463955 +vt 0.000202 0.463955 +vt 0.260815 0.918228 +vt 0.231856 0.918225 +vt 0.289774 0.918230 +vt 0.289777 0.889271 +vt 0.318734 0.918233 +vt 0.260817 0.889269 +vt 0.347695 0.918235 +vt 0.318737 0.889273 +vt 0.231858 0.889266 +vt 0.202900 0.889264 +vt 0.173942 0.889262 +vt 0.202897 0.918222 +vt 0.173939 0.918219 +vt 0.144984 0.889259 +vt 0.144982 0.918216 +vt 0.116028 0.889257 +vt 0.116025 0.918214 +vt 0.087071 0.889255 +vt 0.087069 0.918211 +vt 0.058115 0.889253 +vt 0.058113 0.918209 +vt 0.029159 0.889251 +vt 0.029157 0.918206 +vt 0.000204 0.889249 +vt 0.000202 0.918204 +vt 0.347697 0.889274 +vt 0.376658 0.889276 +vt 0.376656 0.918237 +vt 0.405618 0.918239 +vt 0.405619 0.889277 +vt 0.434580 0.918241 +vt 0.434581 0.889278 +vt 0.463543 0.918242 +vt 0.463544 0.889279 +vt 0.260823 0.748099 +vt 0.231864 0.748098 +vt 0.289781 0.748099 +vt 0.289781 0.719140 +vt 0.318740 0.748099 +vt 0.260823 0.719140 +vt 0.347699 0.748099 +vt 0.318740 0.719140 +vt 0.231865 0.719140 +vt 0.202907 0.719140 +vt 0.173949 0.719140 +vt 0.202906 0.748098 +vt 0.173948 0.748097 +vt 0.144991 0.719139 +vt 0.144991 0.748097 +vt 0.116034 0.719139 +vt 0.116033 0.748096 +vt 0.087076 0.719139 +vt 0.087076 0.748096 +vt 0.058119 0.719139 +vt 0.058119 0.748096 +vt 0.029162 0.719139 +vt 0.029163 0.748096 +vt 0.000206 0.719140 +vt 0.000207 0.748096 +vt 0.347698 0.719140 +vt 0.376657 0.719139 +vt 0.376659 0.748098 +vt 0.405618 0.748097 +vt 0.405617 0.719137 +vt 0.434578 0.748095 +vt 0.434576 0.719135 +vt 0.463539 0.748093 +vt 0.463536 0.719133 +vt 0.144991 0.577975 +vt 0.116033 0.577975 +vt 0.173949 0.577975 +vt 0.173949 0.549017 +vt 0.202907 0.577975 +vt 0.144991 0.549017 +vt 0.231864 0.577975 +vt 0.202907 0.549018 +vt 0.116034 0.549017 +vt 0.087076 0.549017 +vt 0.058118 0.549017 +vt 0.087076 0.577975 +vt 0.058118 0.577975 +vt 0.029160 0.549017 +vt 0.029160 0.577975 +vt 0.000202 0.549017 +vt 0.000202 0.577975 +vt 0.231864 0.549018 +vt 0.260822 0.549018 +vt 0.260822 0.577975 +vt 0.289779 0.577975 +vt 0.289779 0.549018 +vt 0.318736 0.577974 +vt 0.318736 0.549017 +vt 0.347694 0.577974 +vt 0.347693 0.549017 +vt 0.376651 0.577973 +vt 0.376650 0.549016 +vt 0.405608 0.577971 +vt 0.405606 0.549014 +vt 0.434565 0.577969 +vt 0.434563 0.549013 +vt 0.463521 0.577967 +vt 0.463519 0.549011 +vt 0.237437 0.289790 +vt 0.256842 0.260831 +vt 0.256841 0.289791 +vt 0.237435 0.318750 +vt 0.256839 0.318751 +vt 0.237438 0.260831 +vt 0.256843 0.231873 +vt 0.237440 0.231872 +vt 0.256844 0.202915 +vt 0.237441 0.202914 +vt 0.256845 0.173957 +vt 0.237443 0.173956 +vt 0.256846 0.145001 +vt 0.237444 0.145000 +vt 0.256847 0.116044 +vt 0.237446 0.116043 +vt 0.256848 0.087089 +vt 0.237447 0.087088 +vt 0.256849 0.058134 +vt 0.237449 0.058133 +vt 0.256850 0.029180 +vt 0.237450 0.029179 +vt 0.256852 0.000226 +vt 0.237452 0.000225 +vt 0.237433 0.347711 +vt 0.256839 0.347712 +vt 0.237432 0.376673 +vt 0.256838 0.376674 +vt 0.237431 0.405636 +vt 0.256837 0.405637 +vt 0.237430 0.434601 +vt 0.256837 0.434601 +vt 0.237429 0.463567 +vt 0.256838 0.463567 +vt 0.392072 0.116043 +vt 0.411472 0.087086 +vt 0.411474 0.116042 +vt 0.392074 0.144999 +vt 0.411476 0.144998 +vt 0.392071 0.087087 +vt 0.411469 0.058130 +vt 0.392068 0.058132 +vt 0.411467 0.029175 +vt 0.392066 0.029177 +vt 0.411463 0.000221 +vt 0.392064 0.000223 +vt 0.392076 0.173956 +vt 0.411478 0.173955 +vt 0.392077 0.202913 +vt 0.411480 0.202912 +vt 0.392079 0.231871 +vt 0.411481 0.231870 +vt 0.392080 0.260829 +vt 0.411483 0.260828 +vt 0.392082 0.289788 +vt 0.411485 0.289787 +vt 0.392084 0.318747 +vt 0.411488 0.318746 +vt 0.392086 0.347707 +vt 0.411490 0.347705 +vt 0.392089 0.376667 +vt 0.411493 0.376665 +vt 0.392093 0.405628 +vt 0.411497 0.405625 +vt 0.392097 0.434589 +vt 0.411501 0.434585 +vt 0.392102 0.463550 +vt 0.411507 0.463546 +vt 0.082827 0.058117 +vt 0.102232 0.029164 +vt 0.102228 0.058119 +vt 0.082823 0.087072 +vt 0.102224 0.087075 +vt 0.082831 0.029162 +vt 0.102236 0.000209 +vt 0.082835 0.000207 +vt 0.082819 0.116028 +vt 0.102221 0.116031 +vt 0.082815 0.144984 +vt 0.102217 0.144987 +vt 0.082811 0.173940 +vt 0.102213 0.173943 +vt 0.082806 0.202897 +vt 0.102209 0.202900 +vt 0.082802 0.231854 +vt 0.102204 0.231857 +vt 0.082797 0.260812 +vt 0.102200 0.260815 +vt 0.082791 0.289770 +vt 0.102194 0.289774 +vt 0.082785 0.318729 +vt 0.102189 0.318733 +vt 0.082779 0.347689 +vt 0.102183 0.347693 +vt 0.082772 0.376649 +vt 0.102177 0.376654 +vt 0.082764 0.405611 +vt 0.102170 0.405616 +vt 0.082755 0.434573 +vt 0.102162 0.434579 +vt 0.082745 0.463537 +vt 0.102153 0.463544 +vt 0.363131 0.405631 +vt 0.343729 0.434595 +vt 0.343726 0.405633 +vt 0.363129 0.376670 +vt 0.343724 0.376671 +vt 0.363135 0.434593 +vt 0.343733 0.463559 +vt 0.363139 0.463555 +vt 0.363126 0.347709 +vt 0.343722 0.347710 +vt 0.363124 0.318749 +vt 0.343720 0.318750 +vt 0.363123 0.289790 +vt 0.343719 0.289791 +vt 0.363122 0.260831 +vt 0.343718 0.260832 +vt 0.363121 0.231873 +vt 0.343718 0.231873 +vt 0.363120 0.202915 +vt 0.343717 0.202915 +vt 0.363118 0.173957 +vt 0.343716 0.173958 +vt 0.363117 0.145001 +vt 0.343716 0.145001 +vt 0.363116 0.116044 +vt 0.343715 0.116045 +vt 0.363115 0.087089 +vt 0.343714 0.087089 +vt 0.363114 0.058133 +vt 0.343713 0.058134 +vt 0.363112 0.029179 +vt 0.343712 0.029180 +vt 0.363110 0.000226 +vt 0.343711 0.000226 +vt 0.517748 0.144989 +vt 0.498349 0.173948 +vt 0.498346 0.144991 +vt 0.517745 0.116032 +vt 0.498343 0.116034 +vt 0.517751 0.173946 +vt 0.498352 0.202905 +vt 0.517754 0.202903 +vt 0.498355 0.231863 +vt 0.517757 0.231861 +vt 0.498358 0.260820 +vt 0.517760 0.260818 +vt 0.498361 0.289778 +vt 0.517763 0.289776 +vt 0.498364 0.318737 +vt 0.517767 0.318734 +vt 0.498367 0.347695 +vt 0.517770 0.347693 +vt 0.498371 0.376653 +vt 0.517774 0.376651 +vt 0.498375 0.405612 +vt 0.517778 0.405609 +vt 0.498379 0.434570 +vt 0.517782 0.434567 +vt 0.498384 0.463528 +vt 0.517787 0.463525 +vt 0.517742 0.087075 +vt 0.498340 0.087077 +vt 0.517739 0.058119 +vt 0.498337 0.058121 +vt 0.517735 0.029162 +vt 0.498333 0.029165 +vt 0.517731 0.000205 +vt 0.498329 0.000208 +vt 0.208499 0.000223 +vt 0.189096 0.029175 +vt 0.189099 0.000221 +vt 0.208496 0.029177 +vt 0.189093 0.058129 +vt 0.208494 0.058131 +vt 0.189091 0.087084 +vt 0.208492 0.087086 +vt 0.189088 0.116040 +vt 0.208490 0.116042 +vt 0.189086 0.144996 +vt 0.208488 0.144998 +vt 0.189083 0.173953 +vt 0.208486 0.173955 +vt 0.189081 0.202910 +vt 0.208483 0.202912 +vt 0.189078 0.231868 +vt 0.208481 0.231870 +vt 0.189076 0.260827 +vt 0.208479 0.260829 +vt 0.189073 0.289786 +vt 0.208477 0.289788 +vt 0.189070 0.318746 +vt 0.208474 0.318748 +vt 0.189067 0.347707 +vt 0.208472 0.347709 +vt 0.189063 0.376669 +vt 0.208469 0.376671 +vt 0.189060 0.405633 +vt 0.208467 0.405635 +vt 0.189056 0.434597 +vt 0.208464 0.434599 +vt 0.189053 0.463564 +vt 0.208462 0.463566 +vt 0.546692 0.029158 +vt 0.546688 0.000201 +vt 0.546696 0.058115 +vt 0.546699 0.087072 +vt 0.546702 0.116029 +vt 0.546705 0.144986 +vt 0.546709 0.173943 +vt 0.546712 0.202900 +vt 0.546715 0.231858 +vt 0.546718 0.260815 +vt 0.546721 0.289773 +vt 0.546725 0.318731 +vt 0.546728 0.347689 +vt 0.546732 0.376647 +vt 0.546736 0.405605 +vt 0.546740 0.434563 +vt 0.546744 0.463521 +vt 0.779682 0.749443 +vt 0.744378 0.806538 +vt 0.744377 0.749444 +vt 0.713049 0.806539 +vt 0.713048 0.749445 +vt 0.744376 0.682422 +vt 0.713047 0.682423 +vt 0.779683 0.806538 +vt 0.779681 0.682421 +vt 0.779683 0.825941 +vt 0.744379 0.825941 +vt 0.713050 0.825941 +vt 0.744378 0.869946 +vt 0.713050 0.869946 +vt 0.744378 0.894818 +vt 0.818664 0.869946 +vt 0.713050 0.894818 +vt 0.818664 0.894818 +vt 0.655778 0.806540 +vt 0.655777 0.749446 +vt 0.655775 0.682424 +vt 0.569547 0.749447 +vt 0.538217 0.682426 +vt 0.569546 0.682425 +vt 0.626817 0.682425 +vt 0.538218 0.749448 +vt 0.502912 0.682427 +vt 0.502914 0.806542 +vt 0.502913 0.749448 +vt 0.538218 0.806541 +vt 0.502915 0.825944 +vt 0.538219 0.825944 +vt 0.569547 0.806541 +vt 0.569547 0.825944 +vt 0.569546 0.869948 +vt 0.538218 0.869947 +vt 0.626818 0.749446 +vt 0.626819 0.806540 +vt 0.569546 0.894819 +vt 0.538218 0.894819 +vt 0.463933 0.894818 +vt 0.463933 0.869946 +vt 0.603794 0.116022 +vt 0.603790 0.087065 +vt 0.603797 0.144979 +vt 0.603801 0.173936 +vt 0.603804 0.202894 +vt 0.603808 0.231851 +vt 0.603811 0.260809 +vt 0.603814 0.289766 +vt 0.603818 0.318724 +vt 0.603822 0.347682 +vt 0.603825 0.376640 +vt 0.603829 0.405597 +vt 0.603833 0.434555 +vt 0.603837 0.463513 +vt 0.603787 0.058108 +vt 0.603783 0.029151 +vt 0.603779 0.000194 +vt 0.029149 0.999750 +vt 0.000194 0.999747 +vt 0.058105 0.999753 +vt 0.087060 0.999756 +vt 0.116016 0.999760 +vt 0.144972 0.999764 +vt 0.173929 0.999768 +vt 0.202887 0.999773 +vt 0.231845 0.999778 +vt 0.260805 0.999783 +vt 0.289765 0.999787 +vt 0.318726 0.999792 +vt 0.347687 0.999795 +vt 0.376649 0.999799 +vt 0.405612 0.999801 +vt 0.434575 0.999804 +vt 0.463537 0.999806 +vt 0.057370 0.144980 +vt 0.057374 0.116024 +vt 0.057379 0.087069 +vt 0.057365 0.173936 +vt 0.057361 0.202893 +vt 0.057355 0.231850 +vt 0.057350 0.260807 +vt 0.057344 0.289765 +vt 0.057338 0.318724 +vt 0.057331 0.347683 +vt 0.057323 0.376643 +vt 0.057314 0.405603 +vt 0.057305 0.434564 +vt 0.057294 0.463526 +vt 0.057383 0.058113 +vt 0.057387 0.029158 +vt 0.057391 0.000203 +vt 0.314758 0.000227 +vt 0.314758 0.029181 +vt 0.285805 0.000227 +vt 0.314758 0.058135 +vt 0.285804 0.029180 +vt 0.314759 0.087090 +vt 0.285804 0.058135 +vt 0.285803 0.087090 +vt 0.314759 0.116045 +vt 0.285803 0.116045 +vt 0.314759 0.145002 +vt 0.285802 0.145001 +vt 0.314759 0.173958 +vt 0.285802 0.173958 +vt 0.314759 0.202916 +vt 0.285802 0.202915 +vt 0.314759 0.231874 +vt 0.285801 0.231873 +vt 0.314760 0.260832 +vt 0.285801 0.260832 +vt 0.314760 0.289791 +vt 0.285800 0.289791 +vt 0.314760 0.318751 +vt 0.285800 0.318751 +vt 0.314761 0.347712 +vt 0.285800 0.347712 +vt 0.314762 0.376673 +vt 0.285800 0.376674 +vt 0.314764 0.405635 +vt 0.285801 0.405637 +vt 0.314766 0.434598 +vt 0.285802 0.434600 +vt 0.314769 0.463562 +vt 0.285804 0.463565 +vt 0.160145 0.000217 +vt 0.160142 0.029172 +vt 0.131191 0.000214 +vt 0.160138 0.058126 +vt 0.131187 0.029168 +vt 0.160135 0.087082 +vt 0.131183 0.058123 +vt 0.131180 0.087078 +vt 0.160132 0.116037 +vt 0.131176 0.116034 +vt 0.160129 0.144994 +vt 0.131173 0.144990 +vt 0.160126 0.173950 +vt 0.131170 0.173947 +vt 0.160123 0.202907 +vt 0.131166 0.202904 +vt 0.160120 0.231865 +vt 0.131162 0.231862 +vt 0.160117 0.260824 +vt 0.131158 0.260820 +vt 0.160113 0.289783 +vt 0.131154 0.289779 +vt 0.160109 0.318743 +vt 0.131149 0.318739 +vt 0.160105 0.347704 +vt 0.131144 0.347699 +vt 0.160101 0.376666 +vt 0.131138 0.376660 +vt 0.160096 0.405629 +vt 0.131132 0.405623 +vt 0.160091 0.434593 +vt 0.131126 0.434587 +vt 0.160085 0.463559 +vt 0.131119 0.463552 +vt 0.469373 0.000213 +vt 0.469377 0.029168 +vt 0.440418 0.000217 +vt 0.469381 0.058124 +vt 0.440421 0.029172 +vt 0.469384 0.087080 +vt 0.440425 0.058127 +vt 0.440428 0.087083 +vt 0.469387 0.116037 +vt 0.440430 0.116039 +vt 0.469389 0.144994 +vt 0.440433 0.144996 +vt 0.469392 0.173951 +vt 0.440435 0.173953 +vt 0.469394 0.202908 +vt 0.440437 0.202910 +vt 0.469397 0.231865 +vt 0.440439 0.231868 +vt 0.469400 0.260823 +vt 0.440442 0.260826 +vt 0.469402 0.289781 +vt 0.440444 0.289784 +vt 0.469405 0.318740 +vt 0.440447 0.318743 +vt 0.469409 0.347699 +vt 0.440450 0.347702 +vt 0.469412 0.376657 +vt 0.440453 0.376661 +vt 0.469416 0.405616 +vt 0.440457 0.405620 +vt 0.469421 0.434575 +vt 0.440461 0.434580 +vt 0.469426 0.463534 +vt 0.440467 0.463540 +vt 0.000206 0.434543 +vt 0.000194 0.463503 +vt 0.000217 0.405584 +vt 0.000226 0.376625 +vt 0.000235 0.347667 +vt 0.000244 0.318709 +vt 0.000251 0.289752 +vt 0.000258 0.260795 +vt 0.000264 0.231838 +vt 0.000270 0.202882 +vt 0.000276 0.173926 +vt 0.000281 0.144971 +vt 0.000285 0.116015 +vt 0.000290 0.087060 +vt 0.000294 0.058105 +vt 0.000299 0.029149 +vt 0.000303 0.000194 +vt 0.666640 0.558125 +vt 0.637681 0.558127 +vt 0.604225 0.133183 +vt 0.639530 0.104225 +vt 0.639530 0.133183 +vt 0.604225 0.104225 +vt 0.661494 0.463564 +vt 0.680897 0.434607 +vt 0.680897 0.463565 +vt 0.724902 0.434608 +vt 0.724902 0.463566 +vt 0.661495 0.434607 +vt 0.749775 0.434608 +vt 0.749774 0.463567 +vt 0.683535 0.104225 +vt 0.683535 0.133183 +vt 0.781104 0.434608 +vt 0.781104 0.463567 +vt 0.855393 0.434608 +vt 0.855393 0.463567 +vt 0.666641 0.593430 +vt 0.637683 0.593431 +vt 0.666643 0.624759 +vt 0.637685 0.624760 +vt 0.666646 0.682031 +vt 0.637688 0.682033 +vt 0.604225 0.463561 +vt 0.604227 0.434604 +vt 0.757821 0.133183 +vt 0.782694 0.104225 +vt 0.782694 0.133183 +vt 0.757821 0.104225 +s off +f 1/1 2/2 3/3 +f 4/4 1/1 3/3 +f 4/4 3/3 5/5 +f 1/1 6/6 2/2 +f 6/6 7/7 2/2 +f 6/6 8/8 7/7 +f 8/8 9/9 7/7 +f 8/8 10/10 9/9 +f 10/10 11/11 9/9 +f 10/10 12/12 11/11 +f 13/13 4/4 5/5 +f 13/13 5/5 14/14 +f 15/15 13/13 14/14 +f 15/15 14/14 16/16 +f 17/17 15/15 16/16 +f 17/17 16/16 18/18 +f 19/19 17/17 18/18 +f 19/19 18/18 20/20 +f 21/21 19/19 20/20 +f 21/21 20/20 22/22 +f 23/23 21/21 22/22 +f 23/23 22/22 24/24 +f 25/25 23/23 24/24 +f 25/25 24/24 26/26 +f 27/27 25/25 26/26 +f 27/27 26/26 28/28 +f 29/29 27/27 28/28 +f 29/29 28/28 30/30 +f 31/31 29/29 30/30 +f 31/31 30/30 32/32 +f 33/33 31/31 32/32 +f 33/33 32/32 34/34 +f 35/35 36/36 37/37 +f 38/38 35/35 37/37 +f 38/38 37/37 39/39 +f 35/35 40/40 36/36 +f 40/40 41/41 36/36 +f 40/40 42/42 41/41 +f 42/42 43/43 41/41 +f 42/42 44/44 43/43 +f 44/44 45/45 43/43 +f 44/44 46/46 45/45 +f 46/46 47/47 45/45 +f 46/46 48/48 47/47 +f 48/48 49/49 47/47 +f 48/48 50/50 49/49 +f 50/50 51/51 49/49 +f 50/50 52/52 51/51 +f 52/52 53/53 51/51 +f 52/52 54/54 53/53 +f 54/54 55/55 53/53 +f 54/54 56/56 55/55 +f 56/56 57/57 55/55 +f 56/56 58/58 57/57 +f 58/58 59/59 57/57 +f 58/58 60/60 59/59 +f 60/60 61/61 59/59 +f 60/60 62/62 61/61 +f 62/62 63/63 61/61 +f 62/62 64/64 63/63 +f 64/64 65/65 63/63 +f 64/64 66/66 65/65 +f 66/66 67/67 65/65 +f 66/66 68/68 67/67 +f 69/69 70/70 71/71 +f 72/72 69/69 71/71 +f 72/72 71/71 73/73 +f 69/69 74/74 70/70 +f 74/74 75/75 70/70 +f 74/74 76/76 75/75 +f 76/76 77/77 75/75 +f 76/76 78/78 77/77 +f 79/79 72/72 73/73 +f 79/79 73/73 80/80 +f 81/81 79/79 80/80 +f 81/81 80/80 82/82 +f 83/83 81/81 82/82 +f 83/83 82/82 84/84 +f 85/85 83/83 84/84 +f 85/85 84/84 86/86 +f 87/87 85/85 86/86 +f 87/87 86/86 88/88 +f 89/89 87/87 88/88 +f 89/89 88/88 90/90 +f 91/91 89/89 90/90 +f 91/91 90/90 92/92 +f 93/93 91/91 92/92 +f 93/93 92/92 94/94 +f 95/95 93/93 94/94 +f 95/95 94/94 96/96 +f 97/97 95/95 96/96 +f 97/97 96/96 98/98 +f 99/99 97/97 98/98 +f 99/99 98/98 100/100 +f 101/101 99/99 100/100 +f 101/101 100/100 102/102 +f 103/103 104/104 105/105 +f 106/106 103/103 105/105 +f 106/106 105/105 107/107 +f 103/103 108/108 104/104 +f 108/108 109/109 104/104 +f 108/108 110/110 109/109 +f 110/110 111/111 109/109 +f 110/110 112/112 111/111 +f 112/112 113/113 111/111 +f 112/112 114/114 113/113 +f 114/114 115/115 113/113 +f 114/114 116/116 115/115 +f 117/117 106/106 107/107 +f 117/117 107/107 118/118 +f 119/119 117/117 118/118 +f 119/119 118/118 120/120 +f 121/121 119/119 120/120 +f 121/121 120/120 122/122 +f 123/123 121/121 122/122 +f 123/123 122/122 124/124 +f 125/125 123/123 124/124 +f 125/125 124/124 126/126 +f 127/127 125/125 126/126 +f 127/127 126/126 128/128 +f 129/129 127/127 128/128 +f 129/129 128/128 130/130 +f 131/131 129/129 130/130 +f 131/131 130/130 132/132 +f 133/133 131/131 132/132 +f 133/133 132/132 134/134 +f 135/135 133/133 134/134 +f 135/135 134/134 136/136 +f 137/137 138/138 139/139 +f 140/140 137/137 139/139 +f 140/140 139/139 141/141 +f 137/137 142/142 138/138 +f 142/142 143/143 138/138 +f 142/142 144/144 143/143 +f 145/145 140/140 141/141 +f 145/145 141/141 146/146 +f 147/147 145/145 146/146 +f 147/147 146/146 148/148 +f 149/149 147/147 148/148 +f 149/149 148/148 150/150 +f 151/151 149/149 150/150 +f 151/151 150/150 152/152 +f 153/153 151/151 152/152 +f 153/153 152/152 154/154 +f 155/155 153/153 154/154 +f 155/155 154/154 156/156 +f 157/157 155/155 156/156 +f 157/157 156/156 158/158 +f 159/159 157/157 158/158 +f 159/159 158/158 160/160 +f 161/161 159/159 160/160 +f 161/161 160/160 162/162 +f 163/163 161/161 162/162 +f 163/163 162/162 164/164 +f 165/165 163/163 164/164 +f 165/165 164/164 166/166 +f 167/167 165/165 166/166 +f 167/167 166/166 168/168 +f 169/169 167/167 168/168 +f 169/169 168/168 170/170 +f 171/171 172/172 173/173 +f 68/174 171/171 173/173 +f 68/174 173/173 67/175 +f 171/171 174/176 172/172 +f 174/176 136/177 172/172 +f 174/176 135/178 136/177 +f 174/176 171/171 175/179 +f 174/176 175/179 176/180 +f 135/178 174/176 176/180 +f 135/178 176/180 177/181 +f 178/182 135/178 177/181 +f 177/181 176/180 179/183 +f 176/180 175/179 180/184 +f 176/180 180/184 179/183 +f 175/179 181/185 182/186 +f 175/179 182/186 180/184 +f 171/171 181/185 175/179 +f 171/171 68/174 181/185 +f 68/174 183/187 181/185 +f 68/174 184/188 183/187 +f 177/181 179/183 185/189 +f 178/182 177/181 186/190 +f 187/191 186/190 188/192 +f 189/193 178/182 186/190 +f 189/193 186/190 187/191 +f 190/194 187/191 191/195 +f 187/191 188/192 191/195 +f 192/196 189/193 187/191 +f 192/196 187/191 190/194 +f 178/182 189/193 193/197 +f 189/193 192/196 194/198 +f 189/193 194/198 193/197 +f 178/182 193/197 195/199 +f 192/196 102/200 194/198 +f 192/196 101/201 102/200 +f 101/201 192/196 190/194 +f 144/202 101/201 196/203 +f 101/201 190/194 196/203 +f 144/202 197/204 198/205 +f 144/202 198/205 143/206 +f 197/204 144/202 199/207 +f 144/202 196/203 199/207 +f 196/203 190/194 200/208 +f 196/203 200/208 201/209 +f 190/194 191/195 200/208 +f 202/210 199/207 203/211 +f 197/204 199/207 202/210 +f 202/210 203/211 204/212 +f 205/213 202/210 204/212 +f 206/214 197/204 202/210 +f 206/214 202/210 205/213 +f 205/213 204/212 207/215 +f 208/216 205/213 207/215 +f 33/217 206/214 205/213 +f 33/217 205/213 208/216 +f 206/214 33/217 34/218 +f 206/214 34/218 209/219 +f 197/204 206/214 209/219 +f 197/204 209/219 198/205 +f 33/217 208/216 210/220 +f 33/217 210/220 211/221 +f 208/216 207/215 212/222 +f 213/223 214/224 215/225 +f 216/226 213/223 215/225 +f 216/226 215/225 217/227 +f 213/223 218/228 214/224 +f 218/228 219/229 214/224 +f 218/228 220/230 219/229 +f 220/230 221/231 219/229 +f 220/230 222/232 221/231 +f 222/232 223/233 221/231 +f 222/232 224/234 223/233 +f 224/234 225/235 223/233 +f 224/234 226/236 225/235 +f 226/236 195/237 225/235 +f 226/236 178/238 195/237 +f 227/239 216/226 217/227 +f 227/239 217/227 228/240 +f 229/241 227/239 228/240 +f 229/241 228/240 230/242 +f 231/243 229/241 230/242 +f 231/243 230/242 232/244 +f 233/245 231/243 232/244 +f 233/245 232/244 234/246 +f 235/247 233/245 234/246 +f 235/247 234/246 236/248 +f 237/249 235/247 236/248 +f 237/249 236/248 238/250 +f 239/251 237/249 238/250 +f 239/251 238/250 240/252 +f 241/253 239/251 240/252 +f 241/253 240/252 242/254 +f 243/255 241/253 242/254 +f 243/255 242/254 244/256 +f 116/257 245/258 115/259 +f 116/257 246/260 245/258 +f 246/260 116/257 247/261 +f 116/257 243/262 248/263 +f 116/257 248/263 247/261 +f 246/260 249/264 245/258 +f 246/260 250/265 249/264 +f 250/265 246/260 251/266 +f 246/260 247/261 251/266 +f 251/266 247/261 252/267 +f 253/268 251/266 254/269 +f 251/266 252/267 254/269 +f 250/265 251/266 253/268 +f 250/265 38/270 39/271 +f 250/265 39/271 249/264 +f 38/270 250/265 253/268 +f 253/268 254/269 255/272 +f 256/273 253/268 255/272 +f 38/270 253/268 256/273 +f 257/274 38/270 256/273 +f 256/273 255/272 258/275 +f 257/274 256/273 259/276 +f 248/263 260/277 261/278 +f 248/263 261/278 262/279 +f 243/262 260/277 248/263 +f 243/262 263/280 260/277 +f 263/280 243/262 244/281 +f 263/280 244/281 264/282 +f 265/283 263/280 264/282 +f 265/283 264/282 266/284 +f 78/285 265/283 266/284 +f 265/283 78/285 267/286 +f 265/283 267/286 268/287 +f 78/285 266/284 77/288 +f 78/285 169/289 269/290 +f 78/285 269/290 267/286 +f 268/287 267/286 270/291 +f 268/287 270/291 271/292 +f 269/290 272/293 273/294 +f 269/290 273/294 274/295 +f 169/289 272/293 269/290 +f 275/296 169/289 170/297 +f 169/289 275/296 272/293 +f 272/293 276/298 277/299 +f 272/293 277/299 273/294 +f 275/296 276/298 272/293 +f 278/300 275/296 279/301 +f 275/296 170/297 279/301 +f 275/296 278/300 276/298 +f 276/298 280/302 281/303 +f 276/298 281/303 277/299 +f 278/300 280/302 276/298 +f 278/300 279/301 282/304 +f 12/305 278/300 282/304 +f 278/300 12/305 280/302 +f 280/302 12/305 283/306 +f 280/302 283/306 284/307 +f 12/305 282/304 11/308 +f 133/133 178/238 226/236 +f 131/131 133/133 226/236 +f 131/131 226/236 224/234 +f 133/133 135/135 178/238 +f 129/129 131/131 224/234 +f 129/129 224/234 222/232 +f 127/127 129/129 222/232 +f 127/127 222/232 220/230 +f 125/125 127/127 220/230 +f 125/125 220/230 218/228 +f 123/123 125/125 218/228 +f 123/123 218/228 213/223 +f 121/121 123/123 213/223 +f 121/121 213/223 216/226 +f 119/119 121/121 216/226 +f 119/119 216/226 227/239 +f 117/117 119/119 227/239 +f 117/117 227/239 229/241 +f 106/106 117/117 229/241 +f 106/106 229/241 231/243 +f 103/103 106/106 231/243 +f 103/103 231/243 233/245 +f 108/108 103/103 233/245 +f 108/108 233/245 235/247 +f 110/110 108/108 235/247 +f 110/110 235/247 237/249 +f 112/112 110/110 237/249 +f 112/112 237/249 239/251 +f 114/114 112/112 239/251 +f 114/114 239/251 241/253 +f 116/116 114/114 241/253 +f 116/116 241/253 243/255 +f 99/99 144/144 142/142 +f 97/97 99/99 142/142 +f 97/97 142/142 137/137 +f 99/99 101/101 144/144 +f 95/95 97/97 137/137 +f 95/95 137/137 140/140 +f 93/93 95/95 140/140 +f 93/93 140/140 145/145 +f 91/91 93/93 145/145 +f 91/91 145/145 147/147 +f 89/89 91/91 147/147 +f 89/89 147/147 149/149 +f 87/87 89/89 149/149 +f 87/87 149/149 151/151 +f 85/85 87/87 151/151 +f 85/85 151/151 153/153 +f 83/83 85/85 153/153 +f 83/83 153/153 155/155 +f 81/81 83/83 155/155 +f 81/81 155/155 157/157 +f 79/79 81/81 157/157 +f 79/79 157/157 159/159 +f 72/72 79/79 159/159 +f 72/72 159/159 161/161 +f 69/69 72/72 161/161 +f 69/69 161/161 163/163 +f 74/74 69/69 163/163 +f 74/74 163/163 165/165 +f 76/76 74/74 165/165 +f 76/76 165/165 167/167 +f 78/78 76/76 167/167 +f 78/78 167/167 169/169 +f 285/309 68/68 66/66 +f 286/310 285/309 66/66 +f 286/310 66/66 64/64 +f 285/309 184/311 68/68 +f 287/312 286/310 64/64 +f 287/312 64/64 62/62 +f 288/313 287/312 62/62 +f 288/313 62/62 60/60 +f 289/314 288/313 60/60 +f 289/314 60/60 58/58 +f 290/315 289/314 58/58 +f 290/315 58/58 56/56 +f 291/316 290/315 56/56 +f 291/316 56/56 54/54 +f 292/317 291/316 54/54 +f 292/317 54/54 52/52 +f 293/318 292/317 52/52 +f 293/318 52/52 50/50 +f 294/319 293/318 50/50 +f 294/319 50/50 48/48 +f 295/320 294/319 48/48 +f 295/320 48/48 46/46 +f 296/321 295/320 46/46 +f 296/321 46/46 44/44 +f 297/322 296/321 44/44 +f 297/322 44/44 42/42 +f 298/323 297/322 42/42 +f 298/323 42/42 40/40 +f 299/324 298/323 40/40 +f 299/324 40/40 35/35 +f 257/325 299/324 35/35 +f 257/325 35/35 38/38 +f 300/326 22/22 20/20 +f 301/327 300/326 20/20 +f 301/327 20/20 18/18 +f 300/326 302/328 22/22 +f 302/328 24/24 22/22 +f 303/329 304/330 302/328 +f 302/328 304/330 24/24 +f 305/331 303/329 302/328 +f 305/331 302/328 300/326 +f 304/330 26/26 24/24 +f 304/330 306/332 26/26 +f 307/333 306/332 304/330 +f 303/329 307/333 304/330 +f 152/152 150/150 303/329 +f 152/152 303/329 305/331 +f 150/150 307/333 303/329 +f 154/154 152/152 305/331 +f 154/154 305/331 308/334 +f 308/334 305/331 300/326 +f 156/156 154/154 308/334 +f 156/156 308/334 309/335 +f 309/335 308/334 301/327 +f 308/334 300/326 301/327 +f 158/158 156/156 309/335 +f 158/158 309/335 310/336 +f 309/335 301/327 311/337 +f 310/336 309/335 311/337 +f 311/337 301/327 18/18 +f 311/337 18/18 16/16 +f 310/336 311/337 312/338 +f 312/338 311/337 16/16 +f 160/160 158/158 310/336 +f 160/160 310/336 313/339 +f 313/339 310/336 312/338 +f 314/340 312/338 14/14 +f 312/338 16/16 14/14 +f 313/339 312/338 314/340 +f 315/341 313/339 314/340 +f 162/162 160/160 313/339 +f 162/162 313/339 315/341 +f 314/340 14/14 5/5 +f 315/341 314/340 316/342 +f 316/342 314/340 5/5 +f 164/164 162/162 315/341 +f 164/164 315/341 317/343 +f 317/343 315/341 316/342 +f 318/344 316/342 3/3 +f 316/342 5/5 3/3 +f 317/343 316/342 318/344 +f 166/166 164/164 317/343 +f 166/166 317/343 319/345 +f 319/345 317/343 318/344 +f 318/344 3/3 2/2 +f 319/345 318/344 320/346 +f 320/346 318/344 2/2 +f 168/168 166/166 319/345 +f 168/168 319/345 321/347 +f 321/347 319/345 320/346 +f 322/348 320/346 7/7 +f 320/346 2/2 7/7 +f 321/347 320/346 322/348 +f 170/170 168/168 321/347 +f 170/170 321/347 279/349 +f 279/349 321/347 322/348 +f 322/348 7/7 9/9 +f 279/349 322/348 282/350 +f 282/350 322/348 9/9 +f 282/350 9/9 11/11 +f 148/148 323/351 307/333 +f 150/150 148/148 307/333 +f 307/333 323/351 306/332 +f 148/148 146/146 323/351 +f 323/351 324/352 325/353 +f 323/351 325/353 306/332 +f 146/146 324/352 323/351 +f 306/332 325/353 28/28 +f 306/332 28/28 26/26 +f 325/353 326/354 30/30 +f 325/353 30/30 28/28 +f 324/352 326/354 325/353 +f 141/141 327/355 324/352 +f 324/352 327/355 326/354 +f 146/146 141/141 324/352 +f 327/355 328/356 326/354 +f 326/354 328/356 32/32 +f 326/354 32/32 30/30 +f 141/141 139/139 327/355 +f 139/139 329/357 327/355 +f 327/355 329/357 328/356 +f 328/356 209/358 34/34 +f 328/356 34/34 32/32 +f 329/357 209/358 328/356 +f 138/138 198/359 329/357 +f 139/139 138/138 329/357 +f 329/357 198/359 209/358 +f 138/138 143/143 198/359 +f 330/360 90/90 88/88 +f 331/361 330/360 88/88 +f 331/361 88/88 86/86 +f 330/360 332/362 90/90 +f 332/362 92/92 90/90 +f 333/363 334/364 332/362 +f 332/362 334/364 92/92 +f 335/365 333/363 332/362 +f 335/365 332/362 330/360 +f 334/364 94/94 92/92 +f 334/364 336/366 94/94 +f 337/367 336/366 334/364 +f 333/363 337/367 334/364 +f 217/227 215/225 333/363 +f 217/227 333/363 335/365 +f 215/225 337/367 333/363 +f 338/368 335/365 330/360 +f 228/240 217/227 335/365 +f 228/240 335/365 338/368 +f 230/242 228/240 338/368 +f 230/242 338/368 339/369 +f 338/368 330/360 331/361 +f 339/369 338/368 331/361 +f 232/244 230/242 339/369 +f 232/244 339/369 340/370 +f 339/369 331/361 341/371 +f 340/370 339/369 341/371 +f 341/371 331/361 86/86 +f 341/371 86/86 84/84 +f 340/370 341/371 342/372 +f 342/372 341/371 84/84 +f 234/246 232/244 340/370 +f 234/246 340/370 343/373 +f 343/373 340/370 342/372 +f 344/374 342/372 82/82 +f 342/372 84/84 82/82 +f 343/373 342/372 344/374 +f 236/248 234/246 343/373 +f 236/248 343/373 345/375 +f 345/375 343/373 344/374 +f 344/374 82/82 80/80 +f 345/375 344/374 346/376 +f 346/376 344/374 80/80 +f 238/250 236/248 345/375 +f 238/250 345/375 347/377 +f 347/377 345/375 346/376 +f 348/378 346/376 73/73 +f 346/376 80/80 73/73 +f 347/377 346/376 348/378 +f 240/252 238/250 347/377 +f 240/252 347/377 349/379 +f 349/379 347/377 348/378 +f 348/378 73/73 71/71 +f 349/379 348/378 350/380 +f 350/380 348/378 71/71 +f 242/254 240/252 349/379 +f 242/254 349/379 351/381 +f 351/381 349/379 350/380 +f 352/382 350/380 70/70 +f 350/380 71/71 70/70 +f 351/381 350/380 352/382 +f 244/256 242/254 351/381 +f 244/256 351/381 264/383 +f 264/383 351/381 352/382 +f 352/382 70/70 75/75 +f 264/383 352/382 266/384 +f 266/384 352/382 75/75 +f 266/384 75/75 77/77 +f 214/224 353/385 337/367 +f 215/225 214/224 337/367 +f 337/367 353/385 336/366 +f 214/224 219/229 353/385 +f 219/229 354/386 353/385 +f 353/385 354/386 355/387 +f 353/385 355/387 336/366 +f 336/366 355/387 96/96 +f 336/366 96/96 94/94 +f 355/387 356/388 98/98 +f 355/387 98/98 96/96 +f 354/386 356/388 355/387 +f 221/231 357/389 354/386 +f 219/229 221/231 354/386 +f 354/386 357/389 356/388 +f 357/389 358/390 356/388 +f 356/388 358/390 100/100 +f 356/388 100/100 98/98 +f 221/231 223/233 357/389 +f 223/233 359/391 357/389 +f 357/389 359/391 358/390 +f 358/390 194/392 102/102 +f 358/390 102/102 100/100 +f 359/391 194/392 358/390 +f 225/235 193/393 359/391 +f 223/233 225/235 359/391 +f 359/391 193/393 194/392 +f 225/235 195/237 193/393 +f 360/394 107/107 105/105 +f 361/395 360/394 105/105 +f 361/395 105/105 104/104 +f 360/394 362/396 107/107 +f 362/396 118/118 107/107 +f 363/397 364/398 362/396 +f 362/396 364/398 118/118 +f 365/399 363/397 362/396 +f 365/399 362/396 360/394 +f 364/398 120/120 118/118 +f 364/398 366/400 120/120 +f 367/401 366/400 364/398 +f 363/397 367/401 364/398 +f 45/45 47/47 363/397 +f 45/45 363/397 365/399 +f 47/47 367/401 363/397 +f 368/402 365/399 360/394 +f 43/43 45/45 365/399 +f 43/43 365/399 368/402 +f 41/41 43/43 368/402 +f 41/41 368/402 369/403 +f 368/402 360/394 361/395 +f 369/403 368/402 361/395 +f 36/36 41/41 369/403 +f 36/36 369/403 370/404 +f 369/403 361/395 371/405 +f 370/404 369/403 371/405 +f 371/405 361/395 104/104 +f 371/405 104/104 109/109 +f 370/404 371/405 372/406 +f 372/406 371/405 109/109 +f 37/37 36/36 370/404 +f 37/37 370/404 373/407 +f 373/407 370/404 372/406 +f 374/408 372/406 111/111 +f 372/406 109/109 111/111 +f 373/407 372/406 374/408 +f 39/39 37/37 373/407 +f 39/39 373/407 249/409 +f 249/409 373/407 374/408 +f 374/408 111/111 113/113 +f 249/409 374/408 245/410 +f 245/410 374/408 113/113 +f 245/410 113/113 115/115 +f 49/49 375/411 367/401 +f 47/47 49/49 367/401 +f 367/401 375/411 366/400 +f 49/49 51/51 375/411 +f 51/51 376/412 375/411 +f 375/411 376/412 377/413 +f 375/411 377/413 366/400 +f 366/400 377/413 122/122 +f 366/400 122/122 120/120 +f 377/413 378/414 124/124 +f 377/413 124/124 122/122 +f 376/412 378/414 377/413 +f 53/53 379/415 376/412 +f 51/51 53/53 376/412 +f 376/412 379/415 378/414 +f 379/415 380/416 378/414 +f 378/414 380/416 126/126 +f 378/414 126/126 124/124 +f 53/53 55/55 379/415 +f 55/55 381/417 379/415 +f 379/415 381/417 380/416 +f 380/416 382/418 128/128 +f 380/416 128/128 126/126 +f 381/417 382/418 380/416 +f 57/57 383/419 381/417 +f 55/55 57/57 381/417 +f 381/417 383/419 382/418 +f 383/419 384/420 382/418 +f 382/418 384/420 130/130 +f 382/418 130/130 128/128 +f 57/57 59/59 383/419 +f 383/419 385/421 384/420 +f 59/59 385/421 383/419 +f 384/420 386/422 132/132 +f 384/420 132/132 130/130 +f 385/421 386/422 384/420 +f 61/61 387/423 385/421 +f 385/421 387/423 386/422 +f 59/59 61/61 385/421 +f 387/423 388/424 386/422 +f 386/422 388/424 134/134 +f 386/422 134/134 132/132 +f 61/61 63/63 387/423 +f 63/63 389/425 387/423 +f 387/423 389/425 388/424 +f 388/424 172/426 136/136 +f 388/424 136/136 134/134 +f 389/425 172/426 388/424 +f 65/65 173/427 389/425 +f 63/63 65/65 389/425 +f 389/425 173/427 172/426 +f 65/65 67/67 173/427 +f 390/428 391/429 392/430 +f 393/431 390/428 392/430 +f 393/431 392/430 394/432 +f 390/428 395/433 391/429 +f 395/433 396/434 391/429 +f 395/433 397/435 396/434 +f 397/435 398/436 396/434 +f 397/435 399/437 398/436 +f 399/437 400/438 398/436 +f 399/437 401/439 400/438 +f 401/439 402/440 400/438 +f 401/439 403/441 402/440 +f 403/441 404/442 402/440 +f 403/441 405/443 404/442 +f 405/443 406/444 404/442 +f 405/443 407/445 406/444 +f 407/445 408/446 406/444 +f 407/445 409/447 408/446 +f 409/447 410/448 408/446 +f 409/447 411/449 410/448 +f 411/449 201/450 410/448 +f 411/449 196/451 201/450 +f 412/452 393/431 394/432 +f 412/452 394/432 413/453 +f 414/454 412/452 413/453 +f 414/454 413/453 415/455 +f 416/456 414/454 415/455 +f 416/456 415/455 417/457 +f 418/458 416/456 417/457 +f 418/458 417/457 419/459 +f 267/460 418/458 419/459 +f 267/460 419/459 270/461 +f 420/462 421/463 422/464 +f 423/465 420/462 422/464 +f 423/465 422/464 424/466 +f 420/462 425/467 421/463 +f 425/467 426/468 421/463 +f 425/467 427/469 426/468 +f 427/469 428/470 426/468 +f 427/469 429/471 428/470 +f 429/471 185/472 428/470 +f 429/471 177/473 185/472 +f 430/474 423/465 424/466 +f 430/474 424/466 431/475 +f 432/476 430/474 431/475 +f 432/476 431/475 433/477 +f 434/478 432/476 433/477 +f 434/478 433/477 435/479 +f 436/480 434/478 435/479 +f 436/480 435/479 437/481 +f 438/482 436/480 437/481 +f 438/482 437/481 439/483 +f 440/484 438/482 439/483 +f 440/484 439/483 441/485 +f 442/486 440/484 441/485 +f 442/486 441/485 443/487 +f 444/488 442/486 443/487 +f 444/488 443/487 445/489 +f 446/490 444/488 445/489 +f 446/490 445/489 447/491 +f 448/492 446/490 447/491 +f 448/492 447/491 449/493 +f 247/494 448/492 449/493 +f 247/494 449/493 252/495 +f 450/496 451/497 452/498 +f 453/499 450/496 452/498 +f 453/499 452/498 454/500 +f 450/496 455/501 451/497 +f 455/501 212/502 451/497 +f 455/501 208/503 212/502 +f 456/504 453/499 454/500 +f 456/504 454/500 457/505 +f 458/506 456/504 457/505 +f 458/506 457/505 459/507 +f 460/508 458/506 459/507 +f 460/508 459/507 461/509 +f 462/510 460/508 461/509 +f 462/510 461/509 463/511 +f 464/512 462/510 463/511 +f 464/512 463/511 465/513 +f 466/514 464/512 465/513 +f 466/514 465/513 467/515 +f 468/516 466/514 467/515 +f 468/516 467/515 469/517 +f 470/518 468/516 469/517 +f 470/518 469/517 471/519 +f 472/520 470/518 471/519 +f 472/520 471/519 473/521 +f 474/522 472/520 473/521 +f 474/522 473/521 475/523 +f 476/524 474/522 475/523 +f 476/524 475/523 477/525 +f 478/526 476/524 477/525 +f 478/526 477/525 479/527 +f 280/528 478/526 479/527 +f 280/528 479/527 281/529 +f 480/530 481/531 482/532 +f 483/533 480/530 482/532 +f 483/533 482/532 484/534 +f 480/530 485/535 481/531 +f 485/535 262/536 481/531 +f 485/535 248/537 262/536 +f 486/538 483/533 484/534 +f 486/538 484/534 487/539 +f 488/540 486/538 487/539 +f 488/540 487/539 489/541 +f 490/542 488/540 489/541 +f 490/542 489/541 491/543 +f 492/544 490/542 491/543 +f 492/544 491/543 493/545 +f 494/546 492/544 493/545 +f 494/546 493/545 495/547 +f 496/548 494/546 495/547 +f 496/548 495/547 497/549 +f 498/550 496/548 497/549 +f 498/550 497/549 499/551 +f 500/552 498/550 499/551 +f 500/552 499/551 501/553 +f 502/554 500/552 501/553 +f 502/554 501/553 503/555 +f 504/556 502/554 503/555 +f 504/556 503/555 505/557 +f 506/558 504/556 505/557 +f 506/558 505/557 507/559 +f 508/560 506/558 507/559 +f 508/560 507/559 509/561 +f 186/562 508/560 509/561 +f 186/562 509/561 188/563 +f 510/564 511/565 512/566 +f 513/567 510/564 512/566 +f 513/567 512/566 514/568 +f 510/564 515/569 511/565 +f 515/569 516/570 511/565 +f 515/569 517/571 516/570 +f 517/571 518/572 516/570 +f 517/571 519/573 518/572 +f 519/573 520/574 518/572 +f 519/573 521/575 520/574 +f 521/575 522/576 520/574 +f 521/575 523/577 522/576 +f 523/577 524/578 522/576 +f 523/577 525/579 524/578 +f 525/579 526/580 524/578 +f 525/579 527/581 526/580 +f 527/581 528/582 526/580 +f 527/581 529/583 528/582 +f 529/583 530/584 528/582 +f 529/583 531/585 530/584 +f 531/585 532/586 530/584 +f 531/585 533/587 532/586 +f 533/587 258/588 532/586 +f 533/587 256/589 258/588 +f 534/590 513/567 514/568 +f 534/590 514/568 535/591 +f 536/592 534/590 535/591 +f 536/592 535/591 537/593 +f 538/594 536/592 537/593 +f 538/594 537/593 539/595 +f 181/596 538/594 539/595 +f 181/596 539/595 182/597 +f 199/598 540/599 203/600 +f 199/598 541/601 540/599 +f 541/601 542/602 540/599 +f 541/601 543/603 542/602 +f 543/603 544/604 542/602 +f 543/603 545/605 544/604 +f 545/605 546/606 544/604 +f 545/605 547/607 546/606 +f 547/607 548/608 546/606 +f 547/607 549/609 548/608 +f 549/609 550/610 548/608 +f 549/609 551/611 550/610 +f 551/611 552/612 550/610 +f 551/611 553/613 552/612 +f 553/613 554/614 552/612 +f 553/613 555/615 554/614 +f 555/615 556/616 554/614 +f 555/615 557/617 556/616 +f 557/617 558/618 556/616 +f 557/617 559/619 558/618 +f 559/619 560/620 558/618 +f 559/619 561/621 560/620 +f 561/621 562/622 560/620 +f 561/621 563/623 562/622 +f 563/623 564/624 562/622 +f 563/623 565/625 564/624 +f 565/625 566/626 564/624 +f 565/625 567/627 566/626 +f 567/627 568/628 566/626 +f 567/627 569/629 568/628 +f 569/629 274/630 568/628 +f 569/629 269/631 274/630 +f 429/471 186/562 177/473 +f 429/471 508/560 186/562 +f 427/469 508/560 429/471 +f 427/469 506/558 508/560 +f 425/467 506/558 427/469 +f 425/467 504/556 506/558 +f 420/462 504/556 425/467 +f 420/462 502/554 504/556 +f 423/465 502/554 420/462 +f 423/465 500/552 502/554 +f 430/474 500/552 423/465 +f 430/474 498/550 500/552 +f 432/476 498/550 430/474 +f 432/476 496/548 498/550 +f 434/478 496/548 432/476 +f 434/478 494/546 496/548 +f 436/480 494/546 434/478 +f 436/480 492/544 494/546 +f 438/482 492/544 436/480 +f 438/482 490/542 492/544 +f 440/484 490/542 438/482 +f 440/484 488/540 490/542 +f 442/486 488/540 440/484 +f 442/486 486/538 488/540 +f 444/488 486/538 442/486 +f 444/488 483/533 486/538 +f 446/490 483/533 444/488 +f 446/490 480/530 483/533 +f 448/492 480/530 446/490 +f 448/492 485/535 480/530 +f 247/494 485/535 448/492 +f 247/494 248/537 485/535 +f 411/449 199/598 196/451 +f 411/449 541/601 199/598 +f 409/447 541/601 411/449 +f 409/447 543/603 541/601 +f 407/445 543/603 409/447 +f 407/445 545/605 543/603 +f 405/443 545/605 407/445 +f 405/443 547/607 545/605 +f 403/441 547/607 405/443 +f 403/441 549/609 547/607 +f 401/439 549/609 403/441 +f 401/439 551/611 549/609 +f 399/437 551/611 401/439 +f 399/437 553/613 551/611 +f 397/435 553/613 399/437 +f 397/435 555/615 553/613 +f 395/433 555/615 397/435 +f 395/433 557/617 555/615 +f 390/428 557/617 395/433 +f 390/428 559/619 557/617 +f 393/431 559/619 390/428 +f 393/431 561/621 559/619 +f 412/452 561/621 393/431 +f 412/452 563/623 561/621 +f 414/454 563/623 412/452 +f 414/454 565/625 563/623 +f 416/456 565/625 414/454 +f 416/456 567/627 565/625 +f 418/458 567/627 416/456 +f 418/458 569/629 567/627 +f 267/460 569/629 418/458 +f 267/460 269/631 569/629 +f 570/632 181/596 183/633 +f 570/632 538/594 181/596 +f 571/634 538/594 570/632 +f 571/634 536/592 538/594 +f 572/635 536/592 571/634 +f 572/635 534/590 536/592 +f 573/636 534/590 572/635 +f 573/636 513/567 534/590 +f 574/637 513/567 573/636 +f 574/637 510/564 513/567 +f 575/638 510/564 574/637 +f 575/638 515/569 510/564 +f 576/639 515/569 575/638 +f 576/639 517/571 515/569 +f 577/640 517/571 576/639 +f 577/640 519/573 517/571 +f 578/641 519/573 577/640 +f 578/641 521/575 519/573 +f 579/642 521/575 578/641 +f 579/642 523/577 521/575 +f 580/643 523/577 579/642 +f 580/643 525/579 523/577 +f 581/644 525/579 580/643 +f 581/644 527/581 525/579 +f 582/645 527/581 581/644 +f 582/645 529/583 527/581 +f 583/646 529/583 582/645 +f 583/646 531/585 529/583 +f 584/647 531/585 583/646 +f 584/647 533/587 531/585 +f 259/648 533/587 584/647 +f 259/648 256/589 533/587 +f 265/649 585/650 586/651 +f 586/651 585/650 587/652 +f 586/651 587/652 588/653 +f 265/649 586/651 589/654 +f 586/651 588/653 590/655 +f 586/651 590/655 589/654 +f 265/649 268/656 585/650 +f 265/649 589/654 591/657 +f 268/656 271/658 592/659 +f 268/656 592/659 585/650 +f 585/650 592/659 593/660 +f 593/660 592/659 594/661 +f 585/650 593/660 587/652 +f 593/660 594/661 595/662 +f 596/663 594/661 597/664 +f 595/662 594/661 596/663 +f 595/662 596/663 598/665 +f 596/663 597/664 599/666 +f 588/653 587/652 600/667 +f 590/655 588/653 601/668 +f 588/653 600/667 601/668 +f 590/655 601/668 602/669 +f 603/670 604/671 605/672 +f 603/670 605/672 606/673 +f 603/670 607/674 604/671 +f 607/674 608/675 604/671 +f 260/676 263/677 607/674 +f 260/676 607/674 609/678 +f 609/678 607/674 603/670 +f 607/674 263/677 608/675 +f 261/679 260/676 609/678 +f 261/679 609/678 610/680 +f 610/680 609/678 611/681 +f 609/678 603/670 611/681 +f 610/680 611/681 612/682 +f 610/680 612/682 613/683 +f 610/680 613/683 614/684 +f 611/681 603/670 615/685 +f 611/681 615/685 616/686 +f 603/670 606/673 615/685 +f 614/684 613/683 617/687 +f 614/684 617/687 618/688 +f 614/684 618/688 619/689 +f 614/684 619/689 620/690 +f 288/691 574/637 573/636 +f 287/692 288/691 573/636 +f 287/692 573/636 572/635 +f 288/691 289/693 574/637 +f 289/693 575/638 574/637 +f 289/693 290/694 575/638 +f 290/694 576/639 575/638 +f 290/694 291/695 576/639 +f 291/695 577/640 576/639 +f 291/695 292/696 577/640 +f 292/696 578/641 577/640 +f 292/696 293/697 578/641 +f 293/697 579/642 578/641 +f 293/697 294/698 579/642 +f 294/698 580/643 579/642 +f 294/698 295/699 580/643 +f 295/699 581/644 580/643 +f 295/699 296/700 581/644 +f 296/700 582/645 581/644 +f 296/700 297/701 582/645 +f 297/701 583/646 582/645 +f 297/701 298/702 583/646 +f 298/702 584/647 583/646 +f 298/702 299/703 584/647 +f 299/703 259/648 584/647 +f 299/703 257/704 259/648 +f 286/705 287/692 572/635 +f 286/705 572/635 571/634 +f 285/706 286/705 571/634 +f 285/706 571/634 570/632 +f 184/707 285/706 570/632 +f 184/707 570/632 183/633 +f 12/12 621/708 283/709 +f 12/12 10/10 621/708 +f 10/10 622/710 621/708 +f 10/10 8/8 622/710 +f 8/8 623/711 622/710 +f 8/8 6/6 623/711 +f 6/6 624/712 623/711 +f 6/6 1/1 624/712 +f 1/1 625/713 624/712 +f 1/1 4/4 625/713 +f 4/4 626/714 625/713 +f 4/4 13/13 626/714 +f 13/13 627/715 626/714 +f 13/13 15/15 627/715 +f 15/15 628/716 627/715 +f 15/15 17/17 628/716 +f 17/17 629/717 628/716 +f 17/17 19/19 629/717 +f 19/19 630/718 629/717 +f 19/19 21/21 630/718 +f 21/21 631/719 630/718 +f 21/21 23/23 631/719 +f 23/23 632/720 631/719 +f 23/23 25/25 632/720 +f 25/25 633/721 632/720 +f 25/25 27/27 633/721 +f 27/27 634/722 633/721 +f 27/27 29/29 634/722 +f 29/29 635/723 634/722 +f 29/29 31/31 635/723 +f 31/31 211/724 635/723 +f 31/31 33/33 211/724 +f 456/504 636/725 637/726 +f 453/499 456/504 637/726 +f 453/499 637/726 638/727 +f 456/504 458/506 636/725 +f 458/506 639/728 636/725 +f 458/506 460/508 639/728 +f 460/508 640/729 639/728 +f 460/508 462/510 640/729 +f 462/510 641/730 640/729 +f 462/510 464/512 641/730 +f 464/512 642/731 641/730 +f 464/512 466/514 642/731 +f 466/514 643/732 642/731 +f 466/514 468/516 643/732 +f 468/516 644/733 643/732 +f 468/516 470/518 644/733 +f 470/518 645/734 644/733 +f 470/518 472/520 645/734 +f 472/520 646/735 645/734 +f 472/520 474/522 646/735 +f 474/522 647/736 646/735 +f 474/522 476/524 647/736 +f 476/524 648/737 647/736 +f 476/524 478/526 648/737 +f 478/526 284/738 648/737 +f 478/526 280/528 284/738 +f 450/496 453/499 638/727 +f 450/496 638/727 649/739 +f 455/501 450/496 649/739 +f 455/501 649/739 650/740 +f 208/503 455/501 650/740 +f 208/503 650/740 210/741 +f 509/561 191/742 188/563 +f 509/561 651/743 191/742 +f 507/559 651/743 509/561 +f 651/743 200/744 191/742 +f 507/559 652/745 651/743 +f 651/743 653/746 200/744 +f 652/745 653/746 651/743 +f 505/557 652/745 507/559 +f 505/557 654/747 652/745 +f 652/745 655/748 653/746 +f 654/747 655/748 652/745 +f 653/746 410/448 201/450 +f 653/746 201/450 200/744 +f 655/748 410/448 653/746 +f 656/749 408/446 655/748 +f 655/748 408/446 410/448 +f 654/747 656/749 655/748 +f 503/555 657/750 654/747 +f 503/555 654/747 505/557 +f 657/750 656/749 654/747 +f 656/749 406/444 408/446 +f 657/750 658/751 656/749 +f 658/751 406/444 656/749 +f 501/553 659/752 657/750 +f 501/553 657/750 503/555 +f 659/752 658/751 657/750 +f 660/753 404/442 658/751 +f 658/751 404/442 406/444 +f 659/752 660/753 658/751 +f 499/551 661/754 659/752 +f 499/551 659/752 501/553 +f 661/754 660/753 659/752 +f 660/753 402/440 404/442 +f 661/754 662/755 660/753 +f 662/755 402/440 660/753 +f 497/549 663/756 661/754 +f 497/549 661/754 499/551 +f 663/756 662/755 661/754 +f 664/757 400/438 662/755 +f 662/755 400/438 402/440 +f 663/756 664/757 662/755 +f 665/758 664/757 663/756 +f 495/547 665/758 663/756 +f 495/547 663/756 497/549 +f 664/757 398/436 400/438 +f 665/758 666/759 664/757 +f 666/759 398/436 664/757 +f 493/545 667/760 665/758 +f 493/545 665/758 495/547 +f 667/760 666/759 665/758 +f 668/761 396/434 666/759 +f 666/759 396/434 398/436 +f 667/760 668/761 666/759 +f 491/543 669/762 667/760 +f 491/543 667/760 493/545 +f 669/762 668/761 667/760 +f 668/761 391/429 396/434 +f 669/762 670/763 668/761 +f 670/763 391/429 668/761 +f 489/541 671/764 669/762 +f 489/541 669/762 491/543 +f 671/764 670/763 669/762 +f 672/765 392/430 670/763 +f 670/763 392/430 391/429 +f 671/764 672/765 670/763 +f 487/539 673/766 671/764 +f 487/539 671/764 489/541 +f 673/766 672/765 671/764 +f 672/765 394/432 392/430 +f 673/766 674/767 672/765 +f 674/767 394/432 672/765 +f 484/534 675/768 673/766 +f 484/534 673/766 487/539 +f 675/768 674/767 673/766 +f 676/769 413/453 674/767 +f 674/767 413/453 394/432 +f 675/768 676/769 674/767 +f 482/532 677/770 675/768 +f 482/532 675/768 484/534 +f 677/770 676/769 675/768 +f 676/769 415/455 413/453 +f 677/770 678/771 676/769 +f 678/771 415/455 676/769 +f 481/531 679/772 677/770 +f 481/531 677/770 482/532 +f 679/772 678/771 677/770 +f 680/773 417/457 678/771 +f 678/771 417/457 415/455 +f 679/772 680/773 678/771 +f 262/536 261/774 679/772 +f 262/536 679/772 481/531 +f 261/774 680/773 679/772 +f 680/773 419/459 417/457 +f 261/774 271/775 680/773 +f 271/775 419/459 680/773 +f 271/775 270/461 419/459 +f 540/599 204/776 203/600 +f 540/599 681/777 204/776 +f 542/602 681/777 540/599 +f 681/777 207/778 204/776 +f 542/602 682/779 681/777 +f 681/777 683/780 207/778 +f 682/779 683/780 681/777 +f 544/604 682/779 542/602 +f 544/604 684/781 682/779 +f 682/779 685/782 683/780 +f 684/781 685/782 682/779 +f 683/780 451/497 212/502 +f 683/780 212/502 207/778 +f 685/782 451/497 683/780 +f 686/783 452/498 685/782 +f 685/782 452/498 451/497 +f 684/781 686/783 685/782 +f 687/784 686/783 684/781 +f 546/606 687/784 684/781 +f 546/606 684/781 544/604 +f 686/783 454/500 452/498 +f 687/784 688/785 686/783 +f 688/785 454/500 686/783 +f 548/608 689/786 687/784 +f 548/608 687/784 546/606 +f 689/786 688/785 687/784 +f 690/787 457/505 688/785 +f 688/785 457/505 454/500 +f 689/786 690/787 688/785 +f 550/610 691/788 689/786 +f 550/610 689/786 548/608 +f 691/788 690/787 689/786 +f 690/787 459/507 457/505 +f 691/788 692/789 690/787 +f 692/789 459/507 690/787 +f 552/612 693/790 691/788 +f 552/612 691/788 550/610 +f 693/790 692/789 691/788 +f 694/791 461/509 692/789 +f 692/789 461/509 459/507 +f 693/790 694/791 692/789 +f 554/614 695/792 693/790 +f 554/614 693/790 552/612 +f 695/792 694/791 693/790 +f 694/791 463/511 461/509 +f 695/792 696/793 694/791 +f 696/793 463/511 694/791 +f 556/616 697/794 695/792 +f 556/616 695/792 554/614 +f 697/794 696/793 695/792 +f 698/795 465/513 696/793 +f 697/794 698/795 696/793 +f 696/793 465/513 463/511 +f 558/618 699/796 697/794 +f 558/618 697/794 556/616 +f 699/796 698/795 697/794 +f 698/795 467/515 465/513 +f 699/796 700/797 698/795 +f 700/797 467/515 698/795 +f 560/620 701/798 699/796 +f 560/620 699/796 558/618 +f 701/798 700/797 699/796 +f 702/799 469/517 700/797 +f 700/797 469/517 467/515 +f 701/798 702/799 700/797 +f 703/800 702/799 701/798 +f 562/622 703/800 701/798 +f 562/622 701/798 560/620 +f 702/799 471/519 469/517 +f 703/800 704/801 702/799 +f 704/801 471/519 702/799 +f 564/624 705/802 703/800 +f 564/624 703/800 562/622 +f 705/802 704/801 703/800 +f 706/803 473/521 704/801 +f 704/801 473/521 471/519 +f 705/802 706/803 704/801 +f 566/626 707/804 705/802 +f 566/626 705/802 564/624 +f 707/804 706/803 705/802 +f 706/803 475/523 473/521 +f 707/804 708/805 706/803 +f 708/805 475/523 706/803 +f 568/628 709/806 707/804 +f 568/628 707/804 566/626 +f 709/806 708/805 707/804 +f 710/807 477/525 708/805 +f 708/805 477/525 475/523 +f 709/806 710/807 708/805 +f 274/630 273/808 709/806 +f 274/630 709/806 568/628 +f 273/808 710/807 709/806 +f 710/807 479/527 477/525 +f 273/808 277/809 710/807 +f 277/809 479/527 710/807 +f 277/809 281/529 479/527 +f 539/595 180/810 182/597 +f 539/595 711/811 180/810 +f 537/593 711/811 539/595 +f 711/811 179/812 180/810 +f 537/593 712/813 711/811 +f 711/811 713/814 179/812 +f 712/813 713/814 711/811 +f 535/591 712/813 537/593 +f 535/591 714/815 712/813 +f 712/813 715/816 713/814 +f 714/815 715/816 712/813 +f 713/814 428/470 185/472 +f 713/814 185/472 179/812 +f 715/816 428/470 713/814 +f 716/817 426/468 715/816 +f 715/816 426/468 428/470 +f 714/815 716/817 715/816 +f 717/818 716/817 714/815 +f 514/568 717/818 714/815 +f 514/568 714/815 535/591 +f 716/817 421/463 426/468 +f 717/818 718/819 716/817 +f 718/819 421/463 716/817 +f 512/566 719/820 717/818 +f 512/566 717/818 514/568 +f 719/820 718/819 717/818 +f 720/821 422/464 718/819 +f 718/819 422/464 421/463 +f 719/820 720/821 718/819 +f 511/565 721/822 719/820 +f 511/565 719/820 512/566 +f 721/822 720/821 719/820 +f 720/821 424/466 422/464 +f 721/822 722/823 720/821 +f 722/823 424/466 720/821 +f 516/570 723/824 721/822 +f 516/570 721/822 511/565 +f 723/824 722/823 721/822 +f 724/825 431/475 722/823 +f 722/823 431/475 424/466 +f 723/824 724/825 722/823 +f 518/572 725/826 723/824 +f 518/572 723/824 516/570 +f 725/826 724/825 723/824 +f 724/825 433/477 431/475 +f 725/826 726/827 724/825 +f 726/827 433/477 724/825 +f 520/574 727/828 725/826 +f 520/574 725/826 518/572 +f 727/828 726/827 725/826 +f 728/829 435/479 726/827 +f 727/828 728/829 726/827 +f 726/827 435/479 433/477 +f 522/576 729/830 727/828 +f 522/576 727/828 520/574 +f 729/830 728/829 727/828 +f 728/829 437/481 435/479 +f 729/830 730/831 728/829 +f 730/831 437/481 728/829 +f 524/578 731/832 729/830 +f 524/578 729/830 522/576 +f 731/832 730/831 729/830 +f 732/833 439/483 730/831 +f 730/831 439/483 437/481 +f 731/832 732/833 730/831 +f 733/834 732/833 731/832 +f 526/580 733/834 731/832 +f 526/580 731/832 524/578 +f 732/833 441/485 439/483 +f 733/834 734/835 732/833 +f 734/835 441/485 732/833 +f 528/582 735/836 733/834 +f 528/582 733/834 526/580 +f 735/836 734/835 733/834 +f 736/837 443/487 734/835 +f 734/835 443/487 441/485 +f 735/836 736/837 734/835 +f 530/584 737/838 735/836 +f 530/584 735/836 528/582 +f 737/838 736/837 735/836 +f 736/837 445/489 443/487 +f 737/838 738/839 736/837 +f 738/839 445/489 736/837 +f 532/586 739/840 737/838 +f 532/586 737/838 530/584 +f 739/840 738/839 737/838 +f 740/841 447/491 738/839 +f 738/839 447/491 445/489 +f 739/840 740/841 738/839 +f 258/588 255/842 739/840 +f 258/588 739/840 532/586 +f 255/842 740/841 739/840 +f 740/841 449/493 447/491 +f 255/842 254/843 740/841 +f 254/843 449/493 740/841 +f 254/843 252/495 449/493 +f 621/844 647/736 648/737 +f 283/845 621/844 648/737 +f 283/845 648/737 284/738 +f 621/844 622/846 647/736 +f 622/846 646/735 647/736 +f 622/846 623/847 646/735 +f 623/847 645/734 646/735 +f 623/847 624/848 645/734 +f 624/848 644/733 645/734 +f 624/848 625/849 644/733 +f 625/849 643/732 644/733 +f 625/849 626/850 643/732 +f 626/850 642/731 643/732 +f 626/850 627/851 642/731 +f 627/851 641/730 642/731 +f 627/851 628/852 641/730 +f 628/852 640/729 641/730 +f 628/852 629/853 640/729 +f 629/853 639/728 640/729 +f 629/853 630/854 639/728 +f 630/854 636/725 639/728 +f 630/854 631/855 636/725 +f 631/855 637/726 636/725 +f 631/855 632/856 637/726 +f 632/856 638/727 637/726 +f 632/856 633/857 638/727 +f 633/857 649/739 638/727 +f 633/857 634/858 649/739 +f 634/858 650/740 649/739 +f 634/858 635/859 650/740 +f 635/859 210/741 650/740 +f 635/859 211/860 210/741 +f 263/280 591/861 608/862 +f 263/280 265/283 591/861 +f 271/863 610/864 592/865 +f 271/863 261/866 610/864 +f 611/867 593/868 612/869 +f 612/869 593/868 595/870 +f 612/869 595/870 613/871 +f 611/867 587/872 593/868 +f 613/871 595/870 598/873 +f 613/871 598/873 617/874 +f 592/865 614/875 594/876 +f 592/865 610/864 614/875 +f 596/877 617/874 598/873 +f 596/877 618/878 617/874 +f 618/878 596/877 599/879 +f 618/878 599/879 619/880 +f 608/862 589/881 604/882 +f 604/882 589/881 590/883 +f 604/882 590/883 605/884 +f 608/862 591/861 589/881 +f 605/884 590/883 602/885 +f 605/884 602/885 606/886 +f 615/685 600/667 616/686 +f 615/685 601/668 600/667 +f 601/668 615/685 606/673 +f 601/668 606/673 602/669 +f 587/872 616/887 600/888 +f 587/872 611/867 616/887 +f 597/889 619/890 599/891 +f 597/889 620/892 619/890 +f 594/876 620/892 597/889 +f 594/876 614/875 620/892 diff --git a/mods/boats/textures/boat_inventory.png b/mods/boats/textures/boat_inventory.png new file mode 100644 index 0000000..f9d082e Binary files /dev/null and b/mods/boats/textures/boat_inventory.png differ diff --git a/mods/boats/textures/boat_wield.png b/mods/boats/textures/boat_wield.png new file mode 100644 index 0000000..f998b5b Binary files /dev/null and b/mods/boats/textures/boat_wield.png differ diff --git a/mods/bones/README.txt b/mods/bones/README.txt new file mode 100644 index 0000000..b0ebed8 --- /dev/null +++ b/mods/bones/README.txt @@ -0,0 +1,17 @@ +Minetest 0.4 mod: bones +======================= + +License of source code: +----------------------- +Copyright (C) 2012 PilzAdam + +WTFPL + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Authors of media files +---------------------- +Bad_Command_ diff --git a/mods/bones/depends.txt b/mods/bones/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/bones/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/bones/init.lua b/mods/bones/init.lua new file mode 100644 index 0000000..f35d519 --- /dev/null +++ b/mods/bones/init.lua @@ -0,0 +1,219 @@ +-- Minetest 0.4 mod: bones +-- See README.txt for licensing and other information. + +bones = {} + +local function is_owner(pos, name) + local owner = minetest.get_meta(pos):get_string("owner") + if owner == "" or owner == name then + return true + end + return false +end + +bones.bones_formspec = + "size[8,9]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_name;main;0,0.3;8,4;]".. + "list[current_player;main;0,4.85;8,1;]".. + "list[current_player;main;0,6.08;8,3;8]".. + default.get_hotbar_bg(0,4.85) + +local share_bones_time = tonumber(minetest.setting_get("share_bones_time") or 1200) +local share_bones_time_early = tonumber(minetest.setting_get("share_bones_time_early") or (share_bones_time/4)) + +minetest.register_node("bones:bones", { + description = "Bones", + tiles = { + "bones_top.png", + "bones_bottom.png", + "bones_side.png", + "bones_side.png", + "bones_rear.png", + "bones_front.png" + }, + paramtype2 = "facedir", + groups = {dig_immediate=2}, + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_gravel_footstep", gain=0.5}, + dug = {name="default_gravel_footstep", gain=1.0}, + }), + + can_dig = function(pos, player) + local inv = minetest.get_meta(pos):get_inventory() + return is_owner(pos, player:get_player_name()) and inv:is_empty("main") + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + if is_owner(pos, player:get_player_name()) then + return count + end + return 0 + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + return 0 + end, + + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + if is_owner(pos, player:get_player_name()) then + return stack:get_count() + end + return 0 + end, + + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if meta:get_inventory():is_empty("main") then + minetest.remove_node(pos) + end + end, + + on_punch = function(pos, node, player) + if(not is_owner(pos, player:get_player_name())) then + return + end + + local inv = minetest.get_meta(pos):get_inventory() + local player_inv = player:get_inventory() + local has_space = true + + for i=1,inv:get_size("main") do + local stk = inv:get_stack("main", i) + if player_inv:room_for_item("main", stk) then + inv:set_stack("main", i, nil) + player_inv:add_item("main", stk) + else + has_space = false + break + end + end + + -- remove bones if player emptied them + if has_space then + minetest.remove_node(pos) + end + end, + + on_timer = function(pos, elapsed) + local meta = minetest.get_meta(pos) + local time = meta:get_int("time") + elapsed + if time >= share_bones_time then + meta:set_string("infotext", meta:get_string("owner").."'s old bones") + meta:set_string("owner", "") + else + meta:set_int("time", time) + return true + end + end, +}) + +local function may_replace(pos, player) + local node_name = minetest.get_node(pos).name + local node_definition = minetest.registered_nodes[node_name] + + -- if the node is unknown, we let the protection mod decide + -- this is consistent with when a player could dig or not dig it + -- unknown decoration would often be removed + -- while unknown building materials in use would usually be left + if not node_definition then + -- only replace nodes that are not protected + return not minetest.is_protected(pos, player:get_player_name()) + end + + -- allow replacing air and liquids + if node_name == "air" or node_definition.liquidtype ~= "none" then + return true + end + + -- don't replace filled chests and other nodes that don't allow it + local can_dig_func = node_definition.can_dig + if can_dig_func and not can_dig_func(pos, player) then + return false + end + + -- default to each nodes buildable_to; if a placed block would replace it, why shouldn't bones? + -- flowers being squished by bones are more realistical than a squished stone, too + -- exception are of course any protected buildable_to + return node_definition.buildable_to and not minetest.is_protected(pos, player:get_player_name()) +end + +minetest.register_on_dieplayer(function(player) + if minetest.setting_getbool("creative_mode") then + return + end + + local player_inv = player:get_inventory() + if player_inv:is_empty("main") and + player_inv:is_empty("craft") then + return + end + + local pos = player:getpos() + pos.x = math.floor(pos.x+0.5) + pos.y = math.floor(pos.y+0.5) + pos.z = math.floor(pos.z+0.5) + local param2 = minetest.dir_to_facedir(player:get_look_dir()) + local player_name = player:get_player_name() + local player_inv = player:get_inventory() + + if (not may_replace(pos, player)) then + if (may_replace({x=pos.x, y=pos.y+1, z=pos.z}, player)) then + -- drop one node above if there's space + -- this should solve most cases of protection related deaths in which players dig straight down + -- yet keeps the bones reachable + pos.y = pos.y+1 + else + -- drop items instead of delete + for i=1,player_inv:get_size("main") do + minetest.add_item(pos, player_inv:get_stack("main", i)) + end + for i=1,player_inv:get_size("craft") do + minetest.add_item(pos, player_inv:get_stack("craft", i)) + end + -- empty lists main and craft + player_inv:set_list("main", {}) + player_inv:set_list("craft", {}) + return + end + end + + minetest.set_node(pos, {name="bones:bones", param2=param2}) + + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + inv:set_list("main", player_inv:get_list("main")) + + for i=1,player_inv:get_size("craft") do + local stack = player_inv:get_stack("craft", i) + if inv:room_for_item("main", stack) then + inv:add_item("main", stack) + else + --drop if no space left + minetest.add_item(pos, stack) + end + end + + player_inv:set_list("main", {}) + player_inv:set_list("craft", {}) + + meta:set_string("formspec", bones.bones_formspec) + meta:set_string("owner", player_name) + + if share_bones_time ~= 0 then + meta:set_string("infotext", player_name.."'s fresh bones") + + if share_bones_time_early == 0 or not minetest.is_protected(pos, player_name) then + meta:set_int("time", 0) + else + meta:set_int("time", (share_bones_time - share_bones_time_early)) + end + + minetest.get_node_timer(pos):start(10) + else + meta:set_string("infotext", player_name.."'s bones") + end +end) diff --git a/mods/bones/textures/bones_bottom.png b/mods/bones/textures/bones_bottom.png new file mode 100644 index 0000000..ada72ce Binary files /dev/null and b/mods/bones/textures/bones_bottom.png differ diff --git a/mods/bones/textures/bones_front.png b/mods/bones/textures/bones_front.png new file mode 100644 index 0000000..9dcbb97 Binary files /dev/null and b/mods/bones/textures/bones_front.png differ diff --git a/mods/bones/textures/bones_rear.png b/mods/bones/textures/bones_rear.png new file mode 100644 index 0000000..8e1ac10 Binary files /dev/null and b/mods/bones/textures/bones_rear.png differ diff --git a/mods/bones/textures/bones_side.png b/mods/bones/textures/bones_side.png new file mode 100644 index 0000000..3b4810c Binary files /dev/null and b/mods/bones/textures/bones_side.png differ diff --git a/mods/bones/textures/bones_top.png b/mods/bones/textures/bones_top.png new file mode 100644 index 0000000..6119864 Binary files /dev/null and b/mods/bones/textures/bones_top.png differ diff --git a/mods/bucket/README.txt b/mods/bucket/README.txt new file mode 100644 index 0000000..7dad641 --- /dev/null +++ b/mods/bucket/README.txt @@ -0,0 +1,26 @@ +Minetest 0.4 mod: bucket +========================= + +License of source code: +----------------------- +Copyright (C) 2011-2012 Kahrl +Copyright (C) 2011-2012 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Authors of media files +----------------------- +Everything not listed in here: +Copyright (C) 2010-2012 celeron55, Perttu Ahola + + diff --git a/mods/bucket/depends.txt b/mods/bucket/depends.txt new file mode 100644 index 0000000..3a7daa1 --- /dev/null +++ b/mods/bucket/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/mods/bucket/init.lua b/mods/bucket/init.lua new file mode 100644 index 0000000..89730de --- /dev/null +++ b/mods/bucket/init.lua @@ -0,0 +1,192 @@ +-- Minetest 0.4 mod: bucket +-- See README.txt for licensing and other information. + +minetest.register_alias("bucket", "bucket:bucket_empty") +minetest.register_alias("bucket_water", "bucket:bucket_water") +minetest.register_alias("bucket_lava", "bucket:bucket_lava") + +minetest.register_craft({ + output = 'bucket:bucket_empty 1', + recipe = { + {'default:steel_ingot', '', 'default:steel_ingot'}, + {'', 'default:steel_ingot', ''}, + } +}) + +bucket = {} +bucket.liquids = {} + +local function check_protection(pos, name, text) + if minetest.is_protected(pos, name) then + minetest.log("action", (name ~= "" and name or "A mod") + .. " tried to " .. text + .. " at protected position " + .. minetest.pos_to_string(pos) + .. " with a bucket") + minetest.record_protection_violation(pos, name) + return true + end + return false +end + +-- Register a new liquid +-- source = name of the source node +-- flowing = name of the flowing node +-- itemname = name of the new bucket item (or nil if liquid is not takeable) +-- inventory_image = texture of the new bucket item (ignored if itemname == nil) +-- name = text description of the bucket item +-- groups = (optional) groups of the bucket item, for example {water_bucket = 1} +-- This function can be called from any mod (that depends on bucket). +function bucket.register_liquid(source, flowing, itemname, inventory_image, name, groups) + bucket.liquids[source] = { + source = source, + flowing = flowing, + itemname = itemname, + } + bucket.liquids[flowing] = bucket.liquids[source] + + if itemname ~= nil then + minetest.register_craftitem(itemname, { + description = name, + inventory_image = inventory_image, + stack_max = 1, + liquids_pointable = true, + groups = groups, + on_place = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + + local node = minetest.get_node_or_nil(pointed_thing.under) + local ndef + if node then + ndef = minetest.registered_nodes[node.name] + end + -- Call on_rightclick if the pointed node defines it + if ndef and ndef.on_rightclick and + user and not user:get_player_control().sneak then + return ndef.on_rightclick( + pointed_thing.under, + node, user, + itemstack) or itemstack + end + + local place_liquid = function(pos, node, source, flowing) + if check_protection(pos, + user and user:get_player_name() or "", + "place "..source) then + return + end + minetest.add_node(pos, {name=source}) + end + + -- Check if pointing to a buildable node + if ndef and ndef.buildable_to then + -- buildable; replace the node + place_liquid(pointed_thing.under, node, + source, flowing) + else + -- not buildable to; place the liquid above + -- check if the node above can be replaced + local node = minetest.get_node_or_nil(pointed_thing.above) + if node and minetest.registered_nodes[node.name].buildable_to then + place_liquid(pointed_thing.above, + node, source, + flowing) + else + -- do not remove the bucket with the liquid + return + end + end + return {name="bucket:bucket_empty"} + end + }) + end +end + +minetest.register_craftitem("bucket:bucket_empty", { + description = "Empty Bucket", + inventory_image = "bucket.png", + stack_max = 99, + liquids_pointable = true, + on_use = function(itemstack, user, pointed_thing) + -- Must be pointing to node + if pointed_thing.type ~= "node" then + return + end + -- Check if pointing to a liquid source + local node = minetest.get_node(pointed_thing.under) + local liquiddef = bucket.liquids[node.name] + local item_count = user:get_wielded_item():get_count() + + if liquiddef ~= nil + and liquiddef.itemname ~= nil + and node.name == liquiddef.source then + if check_protection(pointed_thing.under, + user:get_player_name(), + "take ".. node.name) then + return + end + + -- default set to return filled bucket + local giving_back = liquiddef.itemname + + -- check if holding more than 1 empty bucket + if item_count > 1 then + + -- if space in inventory add filled bucked, otherwise drop as item + local inv = user:get_inventory() + if inv:room_for_item("main", {name=liquiddef.itemname}) then + inv:add_item("main", liquiddef.itemname) + else + local pos = user:getpos() + pos.y = math.floor(pos.y + 0.5) + core.add_item(pos, liquiddef.itemname) + end + + -- set to return empty buckets minus 1 + giving_back = "bucket:bucket_empty "..tostring(item_count-1) + + end + + minetest.add_node(pointed_thing.under, {name="air"}) + + return ItemStack(giving_back) + end + end, +}) + +bucket.register_liquid( + "default:water_source", + "default:water_flowing", + "bucket:bucket_water", + "bucket_water.png", + "Water Bucket", + {water_bucket = 1} +) + +bucket.register_liquid( + "default:river_water_source", + "default:river_water_flowing", + "bucket:bucket_river_water", + "bucket_river_water.png", + "River Water Bucket", + {water_bucket = 1} +) + +bucket.register_liquid( + "default:lava_source", + "default:lava_flowing", + "bucket:bucket_lava", + "bucket_lava.png", + "Lava Bucket" +) + +minetest.register_craft({ + type = "fuel", + recipe = "bucket:bucket_lava", + burntime = 60, + replacements = {{"bucket:bucket_lava", "bucket:bucket_empty"}}, +}) + diff --git a/mods/bucket/textures/bucket.png b/mods/bucket/textures/bucket.png new file mode 100644 index 0000000..6779528 Binary files /dev/null and b/mods/bucket/textures/bucket.png differ diff --git a/mods/bucket/textures/bucket_lava.png b/mods/bucket/textures/bucket_lava.png new file mode 100644 index 0000000..d2baeb9 Binary files /dev/null and b/mods/bucket/textures/bucket_lava.png differ diff --git a/mods/bucket/textures/bucket_river_water.png b/mods/bucket/textures/bucket_river_water.png new file mode 100644 index 0000000..1d9e62a Binary files /dev/null and b/mods/bucket/textures/bucket_river_water.png differ diff --git a/mods/bucket/textures/bucket_water.png b/mods/bucket/textures/bucket_water.png new file mode 100644 index 0000000..877692a Binary files /dev/null and b/mods/bucket/textures/bucket_water.png differ diff --git a/mods/compassgps/README.md b/mods/compassgps/README.md new file mode 100644 index 0000000..838750e --- /dev/null +++ b/mods/compassgps/README.md @@ -0,0 +1,158 @@ +This mod creates a customizable compass with user settable bookmarks and shared and admin bookmarks in multiplayer. + +**Compass GPS version 2.6** + +Echo created a compass mod back in 2012: [https://forum.minetest.net/viewtopic.php?id=3785](https://forum.minetest.net/viewtopic.php?id=3785)

+PilzAdams made a modification of it, which I can not find the source to, I don't know how much of PilzAdams changes made it into the later versions of Echo's mod.

+Then in 2013 TeTpaAka made a fork of the compass mod that he called compass+ [https://forum.minetest.net/viewtopic.php?id=8117](https://forum.minetest.net/viewtopic.php?id=8117)

+This fork added the ability to "bookmark" specific places, and a gui so you could choose what point the compass should point to. + +This is my fork of TeTpaAka's fork of Echo's mod. :) + +The compass mod as it was is REALLY cool I love the way Echo managed to make the compass in your inventory actually change it's image to point in the direction of it's target + +![alt text](http://i59.tinypic.com/a15ls0.png "image") + +And TeTpaAka's gui, file io, and coding for multiplayer games was simply amazing. But as I was learning from their awesome code, I saw some changes I'd like to make using these new ideas, as well as some things I learned while looking at other mods. So, with complete and total respect for the original awesome mods, and hopefully in the same spirit as theirs, I present my own fork of the fork. CompassGPS + +The crafting recipe for a compass is unchanged:

+``` + , steel , +steel, mese fragment, steel + , steel , +``` +![alt text](http://i59.tinypic.com/14ad2qw.png "image") + +Compass GPS introduces several other changes though. First of all, this mod adds a heads up display that indicates your current position, and the name of the bookmark the compass is pointing at, that bookmarks pos, as well as the distance to that bookmark. + +![alt text](http://i60.tinypic.com/facwea.png "image") + +The hud updates constantly as long as the compass is in one of your active inventory slots, so you can always know where you are in relation to the target node, and how far away it is. + +There is a GUI that pops up whenever you wield the compass and left click. I never played with a GUI in minetest before, so this was a new experience for me, I learned a lot and made quite a few changes: + +![alt text](http://i61.tinypic.com/29zzgy1.png "image") + +To create a new bookmark, type the name into the "bookmark:" field and click "Create Bookmark" (or just hit enter). To remove a bookmark, select it from the list and click "Remove Bookmark." A confirmation dialog will appear and the bookmark will only be removed if you click "YES". + +The bookmark list has been expanded from a dropdown into a textlist to improve visibility. Select any bookmark in the list by clicking on it, and then click "Find Selected Bookmark" to make the compass (and hud) point at that location. "default" is always at the top of the list and will point to (0,0,0) or your bed from PilzAdams bed-mod, or home location as defined in the sethome-mod. (Setting default to your bed or sethome is old code, I modified it to make it work with my new version, but I cant take credit for the idea or basic structure.) The rest of the list are bookmarked locations that you have set and named + +Just click in the "Sort by" box to change whether the bookmarks are sorted by name, or by distance from your current location. ("default" will still always be the first item in the list no matter which way you sort it) + +Click in the "Dist" box to change whether the distance is calculated in 3d (including your distance in the vertical direction) or in 2d (x and z coords only, ignore vertical distance) + +Down at the lower right of the screen, I'm certain you noticed the "Teleport to bookmark" button. *That button appears if, and ONLY IF the player has teleport privileges.* If they do, then they can select any bookmark out of the list, click on teleport, and be instantly transported to the location of that bookmark. Since the user already had teleport privileges, this just saved them some typing, it's not adding any new abilities. + +If you click the "Settings" button in the upper right hand corner it brings up a screen where you can customize the appearance of your compass gps: + +![alt text](http://i59.tinypic.com/aahqa8.png "image")

+(The two awesome new compass images are by Bas080 and Spootonium) + +I figured the position of the hud text was likely to be something that people would want to customize, so here in the settings gui are the x and y coords for the hud text. Just enter the new coords where you want the hud text to appear and click "Change Hud"

+The cords must be between 0 and 1 and represent a percentage of the screen, so x=0 would put the text at the far left of the screen, and y=0.98 would put the text almost at the bottom of the screen. The default is x=0.4 and y=0.01, and that is displayed right over the input boxes so the user can easily set them back to the default if they are having trouble placing the hud. If you change either the x or y coord to a number that is out of range (less than 0 or greater than 1) then the hud will not be displayed. That makes it easy to turn the hud off if you wish.

+You can also change the color of the hud text by changing the value in the "Color" field here. Again, click "Change Hud" to make the update appear. + +AND, there are three buttons here that allow you to select from 3 different styles of compass images. The basic compass image by Echo. A nice wooden compass image by Bas080. And a high resolution compass image by spootonium. + +In Multiplayer, there are now shared and admin bookmarks!

+![alt text](http://i61.tinypic.com/a5b7li.png "image")

+If a player has the new "shared_bookmarks" privilege, then they will get the "Create Shared Bookmark" button and be able to create bookmarks that all players on the server can see and use. Shared bookmarks are preceded by *shared* and the name of the player that created them. There is a variable near the top of the init.lua called max_shared. This controls the maximum number of shared bookmarks that an individual player can create. It is set to 10 by default, but the server admin can change it to whatever they want. A player can delete their own shared bookmarks, but they can not delete anyone else's (unless they are an admin, then they can delete anyone's shared bookmarks) + +If a player has the "privs" privilege, then they will get the "Create Admin Bookmark" button. Admin bookmarks are intended to allow the admins to mark important places in their world that they want everyone to be able to find. There are no limits on how many admin bookmarks can be created. Only Admins can delete admin bookmarks. + +In a multiplayer game, all players get the "Show: Private, Shared, Admin" checkboxes. You can use these checkboxes to toggle which type of bookmarks show in your list. If you uncheck all three the system will automatically recheck "Private" for you. + +The bookmark list is saved any time a user changes it. All of your other settings, the currently selected bookmark, sort order, distance function, and hud position and color, and compass type, are saved whenever a user leaves the game, and on game shutdown. So if you move the hud down to the lower right hand corner of the screen, and then quit, the hud will still be in the place you put it when you restart the game later. + +The Chat Commands from the orignal compass mod still work, but only on private bookmarks. Chat commands available are:

+list_bookmarks

+set_bookmark

+find_bookmark

+remove_bookmark + +I also fixed a few bugs while I was working on this. There was a problem in the mod that caused compass to jump around in inventory if there were empty slots above it, that is fixed now. And there was also a problem with the bookmark list not being saved after you removed a bookmark if you didn't add a new bookmark afterwards. Now the bookmark list is saved whenever you change it, either adding or removing. + +I tried to follow Echo and TeTpaAka's examples of how to properly code for multiplayer games, and all of the new settings should work just fine in a multiplayer game. + +----** MAPS! **---- + +Thanks to a great idea and initial code from TeTpaAka CompassGPS now includes MAPS!

+Maps allow you to store a bookmark that you can then give to another player and they can use the map to put that bookmark into their own list. They also enhance role playing/story possibilities since you can hide maps for players to find that will give them bookmarks they need to find their next goal. + +Craft a blank map by putting 5 papers in an X pattern:

+``` +paper, ,paper + ,paper, +paper, ,paper +``` +![alt text](http://i57.tinypic.com/20z5wmr.png "image") + +To place a bookmark into a map, just right click while wielding the map, select any bookmark from your list, and click the "write to cgpsmap" button. You can also put your current position into the map (without having to first create a bookmark in your compassGPS) + +The map icon now changes to have a red X on it, so you can tell it is a marked map. This map can be given to another player. To transfer the bookmark to their own compassgps, they right click while wielding the marked map and a formspec like this pops up:

+![alt text](http://i61.tinypic.com/jakj9v.png "image")

+You can change the name of the bookmark to whatever you wish, click the "copy bookmark to your compassgps" button and the new bookmark is now available in your compassgps list. + +To turn a marked map back into a blank map, just put it into the crafting grid. + +Thanks to some nice code by Miner59 you can now mount a map on a wall! If you can dig on the position where the map is placed, you can take the map, otherwise you can add the bookmark saved in the map in your compassgps. This will make it possible on a multiplayer server to mount maps that everyone can use. + +--------------------- + +The code is kinda a mess, because I was learning a lot of new things while working on it. I hope to do a clean up on it sometime in the near future, but I wanted to release it now so some people could start testing it. Please do not hesitate to offer critiques, criticism, or coding advice. I'm new to lua and minetest and could use the help. + +And above all, if you run into a bug, please let me know! + +**Credits:**

+Original mod is by Echo and TeTpaAka, and probably PilzAdam. Cactuz_pl clockmod showed me how to write the hud to the screen. My son offered a lot of advice and suggested several changes. I got an example of how to sort lists in lua from Michal Kottman on StackOverflow. Big thanks to Bas080 and spootonium for providing some very nice alternate images for the compass gps mod! Also thanks to Topywo for the shared bookmarks idea, and to my son for several ideas, corrections, and testing help.

+Map idea, image, and initial code by TeTpaAka. Store current position in map code contributed by Miner95

+intllib support by TeTpaAka

+Wall mounted maps by Miner59 + +**License:**

+Original code by Echo, PilzAdam, and TeTpaAka is WTFPL. My changes are CC0 (No rights reserved)

+textures: original compass textures: CC BY-SA by Echo

+ compass b textures: CC BY-SA by Bas080 (slight modifications by Kilarin)

+ compass c textures: CC BY-SA by Andre Goble mailto:spootonium@gmail.com

+ (slight modifications by Kilarin)

+ map texture: CC BY-SA by TeTpaAka (slight modifications by Kilarin for blank map) + +**Dependencies:**

+default is the only requirement.

+PilzAdams Beds mod and the sethome-mod are supported if you have them. + +**Incompatibilities:**

+This mod will clash with both the original compass and compass+ mods. They should not be installed and enabled at the same time as compassgps. HOWEVER, compassgps is 100% compatible with the bookmarks file from the compass+ mod. So if you were using compass+ and switch to compassgps you will NOT lose your previous bookmarks. + +**github source:**

+[https://github.com/Kilarin/compassgps](https://github.com/Kilarin/compassgps) + +**Download:**

+[https://github.com/Kilarin/compassgps/archive/master.zip](https://github.com/Kilarin/compassgps/archive/master.zip) + +**To install:**

+Simply unzip the file into your mods folder, then rename the resulting folder from compassgps-master to compassgps

+OR, simply install it directly from minetest using the online mod repository. + +**Mod Database:**

+If you use this mod, please consider reviewing it on the MineTest Mod Database.

+[https://forum.minetest.net/mmdb/mod/compassgps/](https://forum.minetest.net/mmdb/mod/compassgps/) + +**Changelog:**

+2.6 bug fix from myoung008, type causing crashes when entering bad color.

+2.5 bug fix from TeTpaAka fix bug when static_spawnpoint is invalid

+2.4 wall mounted maps by Miner59

+2.3 intllib support by TeTpaTka so CompassGPS will work with different languages now!

+2.2 current position option in bookmark list when writing to map (Miner95 contribution)

+2.1 cgpsmap_marked notincreative and defaults to default on /giveme

+2.0 maps so you can exchange bookmarks between players (TeTpaAka initial contribution)

+1.9 corrected undeclared global variables to avoid warnings.

+1.8 changed register_craft to compassgps:0 for unified inventory compatibility

+1.7 fixed bug causing crash on first load of formspec in multiplayer

+1.6 fixed compass point_to not saving

+1.5 shared/admin bookmarks. confirm dialog for remove.

+1.4 corrected teleport button priv

+1.3 multiple compass types

+1.2 rounding of position corrected

+1.1 switched core to minetest

+1.0 Initial release

diff --git a/mods/compassgps/README.txt b/mods/compassgps/README.txt new file mode 100644 index 0000000..781c989 --- /dev/null +++ b/mods/compassgps/README.txt @@ -0,0 +1,157 @@ +[b]Compass GPS version 2.6[/b] +This mod creates a customizable compass with user settable bookmarks and shared and admin bookmarks in multiplayer. + +Echo created a compass mod back in 2012: [url]https://forum.minetest.net/viewtopic.php?id=3785[/url] +PilzAdams made a modification of it, which I can not find the source to, I don't know how much of PilzAdams changes made it into the later versions of Echo's mod. +Then in 2013 TeTpaAka made a fork of the compass mod that he called compass+ [url]https://forum.minetest.net/viewtopic.php?id=8117[/url] +This fork added the ability to "bookmark" specific places, and a gui so you could choose what point the compass should point to. + +This is my fork of TeTpaAka's fork of Echo's mod. :) + +The compass mod as it was is REALLY cool I love the way Echo managed to make the compass in your inventory actually change it's image to point in the direction of it's target + +[img]http://i59.tinypic.com/a15ls0.png[/img] + +And TeTpaAka's gui, file io, and coding for multiplayer games was simply amazing. But as I was learning from their awesome code, I saw some changes I'd like to make using these new ideas, as well as some things I learned while looking at other mods. So, with complete and total respect for the original awesome mods, and hopefully in the same spirit as theirs, I present my own fork of the fork. CompassGPS + +The crafting recipe for a compass is unchanged: +[code] + , steel , +steel, mese fragment, steel + , steel , +[/code] +[img]http://i59.tinypic.com/14ad2qw.png[/img] + +Compass GPS introduces several other changes though. First of all, this mod adds a heads up display that indicates your current position, and the name of the bookmark the compass is pointing at, that bookmarks pos, as well as the distance to that bookmark. + +[img]http://i60.tinypic.com/facwea.png[/img] + +The hud updates constantly as long as the compass is in one of your active inventory slots, so you can always know where you are in relation to the target node, and how far away it is. + +There is a GUI that pops up whenever you wield the compass and left click. I never played with a GUI in minetest before, so this was a new experience for me, I learned a lot and made quite a few changes: + +[IMG]http://i61.tinypic.com/29zzgy1.png[/IMG] + +To create a new bookmark, type the name into the "bookmark:" field and click "Create Bookmark" (or just hit enter). To remove a bookmark, select it from the list and click "Remove Bookmark." A confirmation dialog will appear and the bookmark will only be removed if you click "YES". + +The bookmark list has been expanded from a dropdown into a textlist to improve visibility. Select any bookmark in the list by clicking on it, and then click "Find Selected Bookmark" to make the compass (and hud) point at that location. "default" is always at the top of the list and will point to (0,0,0) or your bed from PilzAdams bed-mod, or home location as defined in the sethome-mod. (Setting default to your bed or sethome is old code, I modified it to make it work with my new version, but I cant take credit for the idea or basic structure.) The rest of the list are bookmarked locations that you have set and named + +Just click in the "Sort by" box to change whether the bookmarks are sorted by name, or by distance from your current location. ("default" will still always be the first item in the list no matter which way you sort it) + +Click in the "Dist" box to change whether the distance is calculated in 3d (including your distance in the vertical direction) or in 2d (x and z coords only, ignore vertical distance) + +Down at the lower right of the screen, I'm certain you noticed the "Teleport to bookmark" button. [i]That button appears if, and ONLY IF the player has teleport privileges.[/i] If they do, then they can select any bookmark out of the list, click on teleport, and be instantly transported to the location of that bookmark. Since the user already had teleport privileges, this just saved them some typing, it's not adding any new abilities. + +If you click the "Settings" button in the upper right hand corner it brings up a screen where you can customize the appearance of your compass gps: + +[IMG]http://i59.tinypic.com/aahqa8.png[/IMG] +(The two awesome new compass images are by Bas080 and Spootonium) + +I figured the position of the hud text was likely to be something that people would want to customize, so here in the settings gui are the x and y coords for the hud text. Just enter the new coords where you want the hud text to appear and click "Change Hud" +The cords must be between 0 and 1 and represent a percentage of the screen, so x=0 would put the text at the far left of the screen, and y=0.98 would put the text almost at the bottom of the screen. The default is x=0.4 and y=0.01, and that is displayed right over the input boxes so the user can easily set them back to the default if they are having trouble placing the hud. If you change either the x or y coord to a number that is out of range (less than 0 or greater than 1) then the hud will not be displayed. That makes it easy to turn the hud off if you wish. +You can also change the color of the hud text by changing the value in the "Color" field here. Again, click "Change Hud" to make the update appear. + +AND, there are three buttons here that allow you to select from 3 different styles of compass images. The basic compass image by Echo. A nice wooden compass image by Bas080. And a high resolution compass image by spootonium. + +In Multiplayer, there are now shared and admin bookmarks! +[IMG]http://i61.tinypic.com/a5b7li.png[/IMG] +If a player has the new "shared_bookmarks" privilege, then they will get the "Create Shared Bookmark" button and be able to create bookmarks that all players on the server can see and use. Shared bookmarks are preceded by *shared* and the name of the player that created them. There is a variable near the top of the init.lua called max_shared. This controls the maximum number of shared bookmarks that an individual player can create. It is set to 10 by default, but the server admin can change it to whatever they want. A player can delete their own shared bookmarks, but they can not delete anyone else's (unless they are an admin, then they can delete anyone's shared bookmarks) + +If a player has the "privs" privilege, then they will get the "Create Admin Bookmark" button. Admin bookmarks are intended to allow the admins to mark important places in their world that they want everyone to be able to find. There are no limits on how many admin bookmarks can be created. Only Admins can delete admin bookmarks. + +In a multiplayer game, all players get the "Show: Private, Shared, Admin" checkboxes. You can use these checkboxes to toggle which type of bookmarks show in your list. If you uncheck all three the system will automatically recheck "Private" for you. + +The bookmark list is saved any time a user changes it. All of your other settings, the currently selected bookmark, sort order, distance function, and hud position and color, and compass type, are saved whenever a user leaves the game, and on game shutdown. So if you move the hud down to the lower right hand corner of the screen, and then quit, the hud will still be in the place you put it when you restart the game later. + +The Chat Commands from the orignal compass mod still work, but only on private bookmarks. Chat commands available are: +list_bookmarks +set_bookmark +find_bookmark +remove_bookmark + +I also fixed a few bugs while I was working on this. There was a problem in the mod that caused compass to jump around in inventory if there were empty slots above it, that is fixed now. And there was also a problem with the bookmark list not being saved after you removed a bookmark if you didn't add a new bookmark afterwards. Now the bookmark list is saved whenever you change it, either adding or removing. + +I tried to follow Echo and TeTpaAka's examples of how to properly code for multiplayer games, and all of the new settings should work just fine in a multiplayer game. + +----[b] MAPS! [/b]---- + +Thanks to a great idea and initial code from TeTpaAka CompassGPS now includes MAPS! +Maps allow you to store a bookmark that you can then give to another player and they can use the map to put that bookmark into their own list. They also enhance role playing/story possibilities since you can hide maps for players to find that will give them bookmarks they need to find their next goal. + +Craft a blank map by putting 5 papers in an X pattern: +[code] +paper, ,paper + ,paper, +paper, ,paper +[/code] +[img]http://i57.tinypic.com/20z5wmr.png[/img] + +To place a bookmark into a map, just right click while wielding the map, select any bookmark from your list, and click the "write to cgpsmap" button. You can also put your current position into the map (without having to first create a bookmark in your compassGPS) + +The map icon now changes to have a red X on it, so you can tell it is a marked map. This map can be given to another player. To transfer the bookmark to their own compassgps, they right click while wielding the marked map and a formspec like this pops up: +[img]http://i61.tinypic.com/jakj9v.png[/img] +You can change the name of the bookmark to whatever you wish, click the "copy bookmark to your compassgps" button and the new bookmark is now available in your compassgps list. + +To turn a marked map back into a blank map, just put it into the crafting grid. + +Thanks to some nice code by Miner59 you can now mount a map on a wall! If you can dig on the position where the map is placed, you can take the map, otherwise you can add the bookmark saved in the map in your compassgps. This will make it possible on a multiplayer server to mount maps that everyone can use. + +--------------------- + +The code is kinda a mess, because I was learning a lot of new things while working on it. I hope to do a clean up on it sometime in the near future, but I wanted to release it now so some people could start testing it. Please do not hesitate to offer critiques, criticism, or coding advice. I'm new to lua and minetest and could use the help. + +And above all, if you run into a bug, please let me know! + +[b]Credits:[/b] +Original mod is by Echo and TeTpaAka, and probably PilzAdam. Cactuz_pl clockmod showed me how to write the hud to the screen. My son offered a lot of advice and suggested several changes. I got an example of how to sort lists in lua from Michal Kottman on StackOverflow. Big thanks to Bas080 and spootonium for providing some very nice alternate images for the compass gps mod! Also thanks to Topywo for the shared bookmarks idea, and to my son for several ideas, corrections, and testing help. +Map idea, image, and initial code by TeTpaAka. Store current position in map code contributed by Miner95 +intllib support by TeTpaAka +Wall mounted maps by Miner59 + +[b]License:[/b] +Original code by Echo, PilzAdam, and TeTpaAka is WTFPL. My changes are CC0 (No rights reserved) +textures: original compass textures: CC BY-SA by Echo + compass b textures: CC BY-SA by Bas080 (slight modifications by Kilarin) + compass c textures: CC BY-SA by Andre Goble mailto:spootonium@gmail.com + (slight modifications by Kilarin) + map texture: CC BY-SA by TeTpaAka (slight modifications by Kilarin for blank map) + +[b]Dependencies:[/b] +default is the only requirement. +PilzAdams Beds mod and the sethome-mod are supported if you have them. + +[b]Incompatibilities:[/b] +This mod will clash with both the original compass and compass+ mods. They should not be installed and enabled at the same time as compassgps. HOWEVER, compassgps is 100% compatible with the bookmarks file from the compass+ mod. So if you were using compass+ and switch to compassgps you will NOT lose your previous bookmarks. + +[b]github source:[/b] +[url]https://github.com/Kilarin/compassgps[/url] + +[b]Download:[/b] +[url]https://github.com/Kilarin/compassgps/archive/master.zip[/url] + +[b]To install:[/b] +Simply unzip the file into your mods folder, then rename the resulting folder from compassgps-master to compassgps +OR, simply install it directly from minetest using the online mod repository. + +[b]Mod Database:[/b] +If you use this mod, please consider reviewing it on the MineTest Mod Database. +[url]https://forum.minetest.net/mmdb/mod/compassgps/[/url] + +[b]Changelog:[/b] +2.6 bug fix from myoung008, type causing crashes when entering bad color. +2.5 bug fix from TeTpaAka fix bug when static_spawnpoint is invalid +2.4 wall mounted maps by Miner59 +2.3 intllib support by TeTpaTka so CompassGPS will work with different languages now! +2.2 current position option in bookmark list when writing to map (Miner95 contribution) +2.1 cgpsmap_marked notincreative and defaults to default on /giveme +2.0 maps so you can exchange bookmarks between players (TeTpaAka initial contribution) +1.9 corrected undeclared global variables to avoid warnings. +1.8 changed register_craft to compassgps:0 for unified inventory compatibility +1.7 fixed bug causing crash on first load of formspec in multiplayer +1.6 fixed compass point_to not saving +1.5 shared/admin bookmarks. confirm dialog for remove. +1.4 corrected teleport button priv +1.3 multiple compass types +1.2 rounding of position corrected +1.1 switched core to minetest +1.0 Initial release diff --git a/mods/compassgps/cgpsmap.lua b/mods/compassgps/cgpsmap.lua new file mode 100644 index 0000000..cab62ed --- /dev/null +++ b/mods/compassgps/cgpsmap.lua @@ -0,0 +1,350 @@ +--original code for storing bookmarks outside of the compass by TeTpaAka +--modifications by Kilarin and Miner59 +--wall mounted maps by Miner59 + +--set growing_wall_maps to true and wall mounted maps will get bigger the further +--away the target is. +local growing_wall_maps=false + + +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if (minetest.get_modpath("intllib")) then + dofile(minetest.get_modpath("intllib").."/intllib.lua") + S = intllib.Getter(minetest.get_current_modname()) +else + S = function ( s ) return s end +end + + +local selected_cgpsmap = {} +local textlist_bookmark = {} +local selected_bookmark = {} + +function write_to_cgpsmap(itemstack, user) + --print("write_to_cgpsmap") + selected_cgpsmap[user:get_player_name()] = itemstack + local list,bkmrkidx=compassgps.bookmark_loop("M", user:get_player_name()) + if list == "" then + return nil + end + textlist_bookmark[user:get_player_name()] = list + local formspec = "size[9,10;]".. + "button_exit[2,2;5,0.5;write;"..S("Write to cgpsmap").."]".. + "textlist[0,3.0;9,6;bookmark_list;"..list..";"..bkmrkidx.."]" + minetest.show_formspec(user:get_player_name(), "compassgps:write", formspec) + --print("write_to_cgpsmap end") +end + + +function read_from_cgpsmap(itemstack, user, meta) + --print("read_from_cgpsmap") + local formspec = "size[9,5]".. + "button_exit[2,3;5,0.5;read;"..S("copy bookmark to your compassgps").."]" + if itemstack~=nil then + formspec=formspec.. "button_exit[3.1,4;2.6,0.8;rename;"..S("rename bookmark").."]" + else + itemstack=ItemStack("compassgps:cgpsmap_marked 1") + if meta then + itemstack:set_metadata(minetest.serialize(meta)) + end + end + if not meta then --marked map from creative or /giveme has no meta! + meta={bkmrkname="default",x=0,y=0,z=0} + itemstack:set_metadata(minetest.serialize(meta)) + end + selected_cgpsmap[user:get_player_name()] = itemstack + + formspec=formspec.."label[2,0.5;"..S("bookmark pos:").." ("..meta["x"]..","..meta["y"]..","..meta["z"]..")]".. + "field[2,2;5,0.5;name;"..S("bookmark name:")..";"..meta["bkmrkname"].."]" + minetest.show_formspec(user:get_player_name(), "compassgps:read", formspec) + --print("read_from_cgpsmap end") +end + + + +minetest.register_craft({ + output = 'compassgps:cgpsmap', + recipe = { + {'default:paper', '', 'default:paper'}, + {'', 'default:paper', ''}, + {'default:paper', '', 'default:paper'} + } +}) + +minetest.register_craft({ + output = 'compassgps:cgpsmap', + recipe = { + {'compassgps:cgpsmap_marked'}, + } +}) + +minetest.register_craftitem("compassgps:cgpsmap", { + description = S("CompassGPS Map (blank)"), + inventory_image = "cgpsmap-blank.png", + --groups = {book = 1}, + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + write_to_cgpsmap(itemstack, user) + return + end +}) + +minetest.register_craftitem("compassgps:cgpsmap_marked", { + description = "CompassGPS Map (marked)", + inventory_image = "cgpsmap-marked.png", + groups = {not_in_creative_inventory = 1}, + stack_max = 1, + + on_use = function(itemstack, user, pointed_thing) + local meta = minetest.deserialize(itemstack:get_metadata()) + read_from_cgpsmap(itemstack, user, meta) + return nil + end, + + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type=="node" and pointed_thing.above then + local pos=pointed_thing.above + local ppos=placer:getpos() + local facedir=minetest.dir_to_facedir(vector.direction(ppos,pointed_thing.under)) + local x=pos.x + local y=pos.y + local z=pos.z + if facedir~=nil and itemstack:get_name()=="compassgps:cgpsmap_marked" + and (not minetest.is_protected(pos,placer:get_player_name())) then + minetest.set_node(pos,{name="compassgps:cgpsmap_wall",param2=facedir}) + local mapdata = itemstack:get_metadata() + local meta=minetest.get_meta(pos) + meta:set_string("mapdata",mapdata) + if mapdata~=nil then + local data=minetest.deserialize(mapdata) + if data~=nil then + meta:set_string("infotext", data["bkmrkname"]) + x=data["x"] + y=data["y"] + z=data["z"] + end + end + if facedir==1 then + pos={x=pos.x+0.3,y=pos.y,z=pos.z} + elseif facedir==3 then + pos={x=pos.x-0.3,y=pos.y,z=pos.z} + elseif facedir==0 then + pos={x=pos.x,y=pos.y,z=pos.z+0.3} + elseif facedir==2 then + pos={x=pos.x,y=pos.y,z=pos.z-0.3} + end + local e = minetest.env:add_entity(pos,"compassgps:cgpsmap_item") + local yaw = math.pi*2 - facedir * math.pi/2 + e:setyaw(yaw) + local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z) + if growing_wall_maps == false then + e:set_properties({visual_size={x=0.85,y=0.85}}) + elseif dist>30000 then + e:set_properties({visual_size={x=3.45,y=3.45}}) + elseif dist>15000 then + e:set_properties({visual_size={x=2.95,y=2.95}}) + elseif dist>5000 then + e:set_properties({visual_size={x=2.45,y=2.45}}) + elseif dist>3000 then + e:set_properties({visual_size={x=1.45,y=1.45}}) + elseif dist>2000 then + e:set_properties({visual_size={x=1.2,y=1.2}}) + elseif dist>1000 then + e:set_properties({visual_size={x=1,y=1}}) + elseif dist>500 then + e:set_properties({visual_size={x=0.85,y=0.85}}) + end--else default (0.7) + + itemstack:take_item() + end + end + return itemstack + end, +}) + +minetest.register_node("compassgps:cgpsmap_wall",{ + description = "CompassGPS Map (wallmounted)", + drawtype = "nodebox", + node_box = { type = "fixed", fixed = {-0.5, -0.5, 7/16, 0.5, 0.5, 0.5} }, + selection_box = { type = "fixed", fixed = {-0.7, -0.7, 7/16, 0.7, 0.7, 0.7} }, + tiles = {"compassgps_blank.png"}, + inventory_image = "cgpsmap_marked.png", + wield_image = "cgpsmap_marked.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = { choppy=2,dig_immediate=2,not_in_creative_inventory=1,not_in_craft_guide=1 }, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), + on_punch = function(pos,node,puncher) + local meta = minetest.env:get_meta(pos) + local mapdata=meta:get_string("mapdata") + + if minetest.is_protected(pos,puncher:get_player_name()) then + --don't take map, instead open formspec to add coordinates in compassgps + if mapdata~=nil then + read_from_cgpsmap(nil, puncher, minetest.deserialize(mapdata)) + end + return + end + local inv = puncher:get_inventory() + + local objs = nil + objs = minetest.env:get_objects_inside_radius(pos, .5) + if objs then + for _, obj in ipairs(objs) do + if obj and obj:get_luaentity() and obj:get_luaentity().name == "compassgps:cgpsmap_item" then + obj:remove() + end + end + end + local itemstack=ItemStack("compassgps:cgpsmap_marked 1") + itemstack:set_metadata(mapdata) + if inv:room_for_item("main",itemstack) then + inv:add_item("main",itemstack) + else + minetest.env:add_item(pos, itemstack) + end + minetest.remove_node(pos) + end, +}) + +minetest.register_entity("compassgps:cgpsmap_item",{ + hp_max = 1, + visual="wielditem", + visual_size={x=0.7,y=0.7}, + collisionbox = {0,0,0,0,0,0}, + physical=false, + textures={"compassgps:cgpsmap_marked"}, +}) + +minetest.register_abm({ + nodenames = { "compassgps:cgpsmap_wall" }, + interval = 600, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + if #minetest.get_objects_inside_radius(pos, 0.5) > 0 then return end + local meta=minetest.get_meta(pos) + local x=pos.x + local y=pos.y + local z=pos.z + local mapdata=meta:get_string("mapdata",mapdata) + if mapdata~=nil then + local data=minetest.deserialize(mapdata) + if data~=nil then + x=data["x"] + y=data["y"] + z=data["z"] + end + end + local facedir=node.param2 + if facedir==1 then + pos={x=pos.x+0.3,y=pos.y,z=pos.z} + elseif facedir==3 then + pos={x=pos.x-0.3,y=pos.y,z=pos.z} + elseif facedir==0 then + pos={x=pos.x,y=pos.y,z=pos.z+0.3} + elseif facedir==2 then + pos={x=pos.x,y=pos.y,z=pos.z-0.3} + end + local e = minetest.env:add_entity(pos,"compassgps:cgpsmap_item") + local yaw = math.pi*2 - facedir * math.pi/2 + e:setyaw(yaw) + local dist=math.abs(pos.x-x)+math.abs(pos.y-y)+math.abs(pos.z-z) + if dist>30000 then + e:set_properties({visual_size={x=3.45,y=3.45}}) + elseif dist>15000 then + e:set_properties({visual_size={x=2.95,y=2.95}}) + elseif dist>5000 then + e:set_properties({visual_size={x=2.45,y=2.45}}) + elseif dist>3000 then + e:set_properties({visual_size={x=1.45,y=1.45}}) + elseif dist>2000 then + e:set_properties({visual_size={x=1.2,y=1.2}}) + elseif dist>1000 then + e:set_properties({visual_size={x=1,y=1}}) + elseif dist>500 then + e:set_properties({visual_size={x=0.85,y=0.85}}) + end--else default (0.7) + + end +}) + + +minetest.register_on_player_receive_fields(function(player, formname, fields) + if (formname == "compassgps:write") then + if not player then + return + end + local playername = player:get_player_name(); + if (playername ~= "") then + if (selected_cgpsmap[playername] == nil) then + return + end + if fields["bookmark_list"] then + -- to get the currently selected + local id = minetest.explode_textlist_event(fields["bookmark_list"]) + selected_bookmark[playername] = id.index + end + if fields["write"] then + --print("***cgpsmap fields=write***") + if selected_bookmark[playername] == nil then + return nil + end + local bkmrk=textlist_bkmrks[playername][selected_bookmark[playername]] + local write = { ["bkmrkname"] = bkmrk.bkmrkname, + x = bkmrk.x, + y = bkmrk.y, + z = bkmrk.z} + --print("dump(write)="..dump(write)) + selected_cgpsmap[playername]:set_name("compassgps:cgpsmap_marked") + selected_cgpsmap[playername]:set_metadata(minetest.serialize(write)) + player:set_wielded_item(selected_cgpsmap[playername]) + end + end + end + if (formname == "compassgps:read") then + if not player then + return + end + if (fields["read"]) then + --print("***cgpsmap fields=read***") + local meta = minetest.deserialize(selected_cgpsmap[player:get_player_name()]:get_metadata()) + --print("dump(meta)="..dump(meta)) + local bkmrkname = fields["name"] + --print("bkmrkname from fields[name]="..bkmrkname) + local pos = { x = meta["x"] + 0, + y = meta["y"] + 0, + z = meta["z"] + 0 } + local playername = player:get_player_name() + --print(bkmrkname) + compassgps.set_bookmark(playername, bkmrkname, "P", pos) + end + end + + if (selected_cgpsmap == nil) then + return + end + local playername = player:get_player_name() + if (playername == nil) then + return + end + if (selected_cgpsmap[playername] == nil) then + return + end + if fields["rename"] then + local bkmrkname = fields["name"] + local meta = minetest.deserialize(selected_cgpsmap[player:get_player_name()]:get_metadata()) + if meta~=nil and bkmrkname~=nil then + local pos = { x = meta["x"] + 0, + y = meta["y"] + 0, + z = meta["z"] + 0 } + selected_cgpsmap[playername]:set_metadata(minetest.serialize({ ["bkmrkname"] = bkmrkname, + x = pos.x, + y = pos.y, + z = pos.z})) + player:set_wielded_item(selected_cgpsmap[playername]) --new name is saved in marked cpgsmap + end + end + end) diff --git a/mods/compassgps/depends.txt b/mods/compassgps/depends.txt new file mode 100644 index 0000000..9207dab --- /dev/null +++ b/mods/compassgps/depends.txt @@ -0,0 +1,2 @@ +default +intllib? diff --git a/mods/compassgps/init.lua b/mods/compassgps/init.lua new file mode 100644 index 0000000..09e2525 --- /dev/null +++ b/mods/compassgps/init.lua @@ -0,0 +1,1298 @@ +--compassgps 2.1 + +--This fork was written by Kilarin (Donald Hines) +--Original code by Echo, PilzAdam, and TeTpaAka is WTFPL. +--My changes are CC0 (No rights reserved) +--textures: original compass textures: CC BY-SA by Echo +-- compass b textures: CC BY-SA by Bas080 (slight modifications by Kilarin) +-- compass c textures: CC BY-SA by Andre Goble mailto:spootonium@gmail.com +-- (slight modifications by Kilarin) + +--fixed bug that caused compass to jump around in inventory +--fixed bug causing removed bookmarks not to be saved +--expanded bookmark list from dropdown to textlist +--added pos and distance to display list +--added hud showing current pos -> target pos : distance + +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if (minetest.get_modpath("intllib")) then + S = intllib.Getter() +else + S = function ( s ) return s end +end + +local hud_default_x=0.4 +local hud_default_y=0.01 +local hud_default_color="FFFF00" +local compass_default_type="a" +local compass_valid_types={"a","b","c"} +local activewidth=8 --until I can find some way to get it from minetest +local max_shared=10 --how many shared bookmarks a user with shared_bookmarks priv can make. +local show_shared_on_singleplayer=false --show shared and admin checkboxes on singleplayer +--the ONLY reason to change this variable to true is for testing. shared and admin bookmarks +--make no sense in a single player game. + +minetest.register_privilege("shared_bookmarks", + S("Can create shared bookmarks for use by anyone with a compassgps")) +--minetest.register_privilege("shared_bookmarks", { +-- description = "Can create shared bookmarks for use by anyone with a compassgps", +-- give_to_singleplayer = false,}) + +compassgps = { } +local player_hud = { }; +local bookmarks = { } +local point_to = {} +local sort_function = {} +local distance_function ={} +local hud_pos = {} +local hud_color = {} +local compass_type = {} +local view_type_P = {} +local view_type_S = {} +local view_type_A = {} +local textlist_clicked = {} +textlist_bkmrks = {} +local singleplayer = false +local target = {} +local pos = {} +local dir = 90 +local default_bookmark = {} +local backwardscompatsave = "NO" + + +print(S("compassgps reading bookmarks")) +local file = io.open(minetest.get_worldpath().."/bookmarks", "r") +if file then + bookmarks = minetest.deserialize(file:read("*all")) + file:close() +end + +--local remove + + +--the sort functions and distance functions have to be defined ABOVE the +--"main" block or will be nil + +function compassgps.sort_by_distance(table,a,b,player) + --print("sort_by_distance a="..compassgps.pos_to_string(table[a]).." b="..pos_to_string(table[b])) + local playerpos = player:getpos() + local name=player:get_player_name() + --return compassgps.distance3d(playerpos,table[a]) < compassgps.distance3d(playerpos,table[b]) + if distance_function[name] then + return distance_function[name](playerpos,table[a]) < + distance_function[name](playerpos,table[b]) + else + return false --this should NEVER happen + end +end --sort_by_distance + +function compassgps.sort_by_name(table,a,b,player) + local atype="P" --default to P + if table[a].type then atype=table[a].type end + local btype="P" + if table[b].type then btype=table[b].type end + if atype == btype then + local aplayer="" + if table[a].player then aplayer=table[a].player end + local bplayer="" + if table[b].player then bplayer=table[b].player end + if aplayer == bplayer then + return a < b --compare on bookmark name + else + return aplayer < bplayer --compare on player name + end --compare player name + else + return atype < btype --compare on bookmark type + end -- compare type +end --sort_by_name + + +function compassgps.distance2d(pos1in,pos2in) +local pos1=compassgps.round_digits_vector(pos1in,0) +local pos2=compassgps.round_digits_vector(pos2in,0) +return math.sqrt((pos2.x-pos1.x)^2+(pos2.z-pos1.z)^2) +end --distance2d + + +--calculate distance between two points +function compassgps.distance3d(pos1in,pos2in) +--round to nearest node +--print(" pos1in="..compassgps.pos_to_string(pos1in).." pos2in="..compassgps.pos_to_string(pos2in)) +local pos1=compassgps.round_digits_vector(pos1in,0) +local pos2=compassgps.round_digits_vector(pos2in,0) +return math.sqrt((pos2.x-pos1.x)^2+(pos2.z-pos1.z)^2+(pos2.y-pos1.y)^2) +end --distance3d + + + +-- ********************************************************** +print(S("compassgps reading settings")) +if minetest.is_singleplayer() and show_shared_on_singleplayer==false then + singleplayer=true +else + singleplayer=false +end + +local settings = { } +local file = io.open(minetest.get_worldpath().."/compassgps_settings", "r") +if file then + settings = minetest.deserialize(file:read("*all")) + file:close() +end +--now transfer these to the correct variables +for name,stng in pairs(settings) do + --if settings[name].point_name then + -- point_name[name]=settings[name].point_name + --end + if settings[name].point_to and settings[name].point_to.bkmrkname then + point_to[name]=settings[name].point_to + else + point_to[name]=nil + end + if settings[name].sort_function then + if settings[name].sort_function == "name" then + sort_function[name]=compassgps.sort_by_name + else + sort_function[name]=compassgps.sort_by_distance + end + end + if settings[name].distance_function then + if settings[name].distance_function == "2d" then + distance_function[name]=compassgps.distance2d + else + distance_function[name]=compassgps.distance3d + end + end + if settings[name].hud_pos then + hud_pos[name]=settings[name].hud_pos + end + if settings[name].hud_color then + hud_color[name]=settings[name].hud_color + end + if settings[name].compass_type then + compass_type[name]=settings[name].compass_type + end + --saved as strings so its easier to check for nil + if settings[name].view_type_P then + view_type_P[name]=settings[name].view_type_P + else + view_type_P[name]="true" + end --view_type_P + if settings[name].view_type_S then + view_type_S[name]=settings[name].view_type_S + else + view_type_S[name]="false" + end --view_type_S + if settings[name].view_type_A then + view_type_A[name]=settings[name].view_type_A + else + view_type_A[name]="false" + end --view_type_A + + if singleplayer then + view_type_P[name]="true" + view_type_A[name]="false" + view_type_S[name]="false" + end--override view types + +end --for + + +function compassgps.bookmark_to_string(bkmrk) + if not bkmrk then return "{nil}" end + local str="{" + if bkmrk.player then str=str..bkmrk.player + else str=str.."player=nil" end + str=str.." : " + if bkmrk.bkmrkname then str=str..bkmrk.bkmrkname + else str=str.."bkmrkname=nil" end + str=str.." : "..compassgps.pos_to_string(bkmrk).." : " + if bkmrk.type then str=str..bkmrk.type + else str=str.."type=nil" end + str=str.."}" + return str + end -- bookmark_to_string + + +function compassgps.bookmark_name_string(bkmrk) + --print("bookmark_name_string: "..compassgps.bookmark_to_string(bkmrk)) + if bkmrk.type=="A" then + return "*admin*:"..bkmrk.player.."> "..bkmrk.bkmrkname + elseif bkmrk.type=="S" then + return "*shared*:"..bkmrk.player.."> "..bkmrk.bkmrkname + else + return bkmrk.bkmrkname + end +end --bookmark_name_string + + +function compassgps.bookmark_name_pos_dist(bkmrk,playername,playerpos) + if distance_function[playername] == nil then + return "" + end + return compassgps.bookmark_name_string(bkmrk).." : "..compassgps.pos_to_string(bkmrk).. + " : "..compassgps.round_digits(distance_function[playername](playerpos,bkmrk),2) +end --gookmark_name_pos_dist + + +function compassgps.count_shared(playername) + local c=0 + for k,v in pairs(bookmarks) do + if v.player and v.player==playername and v.type and v.type=="S" then + c=c+1 + end --if + end --for + return c +end--count_shared + + + +--********************************************************* +--mode "L" create list for displaying bookmarks in gui +--mode "C" display private bookmarks only in chat +--mode "M" similar to "L" but with current position (for maps) +function compassgps.bookmark_loop(mode,playername,findidx) + --print("bookmark_loop top") + local player = minetest.get_player_by_name(playername) + local playerpos = player:getpos() + local list="" + local bkmrkidx=1 + local i=1 + if mode=="L" or mode=="M" then + local spawnbkmrk=compassgps.get_default_bookmark(playername,1) + textlist_bkmrks[playername]={} + if mode=="M" then + local cpos=compassgps.round_pos(playerpos) + list = S("current position : ")..compassgps.pos_to_string({x=cpos.x,y=cpos.y,z=cpos.z,player=playername,type="P",bkmrkname=playername.."'s map"})..",".. + compassgps.bookmark_name_pos_dist(spawnbkmrk,playername,playerpos) + textlist_bkmrks[playername][1]={x=cpos.x,y=cpos.y,z=cpos.z,player=playername,type="P",bkmrkname=S("%s's map"):format(playername)} + textlist_bkmrks[playername][2]=spawnbkmrk + i=2 + mode="L" + else + list = compassgps.bookmark_name_pos_dist(spawnbkmrk,playername,playerpos) + textlist_bkmrks[playername][1]=spawnbkmrk + end --initialize list + + --add all spawn position from beds mod, sethome mod and the default spawn point + spawnbkmrk=compassgps.get_default_bookmark(playername,2) + if spawnbkmrk~=nil then + i=i+1 + list = list..","..compassgps.bookmark_name_pos_dist(spawnbkmrk,playername,playerpos) + textlist_bkmrks[playername][i]=spawnbkmrk + end + spawnbkmrk=compassgps.get_default_bookmark(playername,3) + if spawnbkmrk~=nil then + i=i+1 + list = list..","..compassgps.bookmark_name_pos_dist(spawnbkmrk,playername,playerpos) + textlist_bkmrks[playername][i]=spawnbkmrk + end + textlist_clicked[playername]=1 + end + + --bkmrkidx will be used to highlight the currently selected item in the list + backwardscompatsave="NO" + + for k,v in spairs(bookmarks,sort_function[playername],player) do + --backwards compatibility + --since version 1.5, all bookmarks will have a player and type, but + --bookmarks from the old compass mods and previous versions of this + --mod will not. Because the original mod did not put a seperator between + --the playername and the bookmark name, the only way to seperate them + --is when you have the player name. this if says that if v.player is + --not defined and the begining of the bookmark matches the playername + --then set v.player and v.type and set a flag to save the bookmarks + --print("bookmark_loop unmod "..compassgps.bookmark_to_string(v)) + if not v.player then --if playername is not set, fix it + local pos1, pos2 = string.find(k, playername, 0) + if pos1==1 and pos2 then --add playername and type to bookmark + v.player=playername + v.type="P" + v.bkmrkname=string.sub(k,string.len(v.player)+1) + backwardscompatsave="YES" + end --if pos1==1 + end --if not v.player backwards compatibility + + --even though we set v.player above, that was for bookmarks that match + --this playername, so there could still be other players bookmarks that + --do not have v.player defined, thats why we have to check it again. + local vplayernm="" + if v.player then vplayernm=v.player end + local vtype="P" + if v.type then vtype=v.type end + local vbkmrkname=k + if v.bkmrkname then vbkmrkname=v.bkmrkname end + --now vplayernm,vtype,vbkmrkname are guaranteed to be defined + + --admin and shared bookmarks + if (mode=="L") and + ( (vtype=="A" and view_type_A[playername]=="true") or + (vtype=="S" and view_type_S[playername]=="true") ) then + i=i+1 + list = list..","..compassgps.bookmark_name_pos_dist(v,playername,playerpos) + textlist_bkmrks[playername][i]=v + --print("bookmark_loop AS "..i.." "..compassgps.bookmark_to_string(textlist_bkmrks[playername][i])) + --private bookmarks + elseif vtype=="P" and vplayernm==playername and view_type_P[playername]=="true" then + i=i+1 + if mode=="L" then + list = list..","..compassgps.bookmark_name_pos_dist(v,playername,playerpos) + --list = list..","..vbkmrkname.." : "..compassgps.pos_to_string(v).. + -- " : "..compassgps.round_digits(distance_function[playername](playerpos,v),2) + textlist_bkmrks[playername][i]=v + --print("bookmark_loop P "..i.." "..compassgps.bookmark_to_string(textlist_bkmrks[playername][i])) + elseif mode=="C" then + --minetest.chat_send_player(playername, vbkmrkname..": "..compassgps.pos_to_string(v)) + minetest.chat_send_player(playername, compassgps.bookmark_name_pos_dist(v,playername,playerpos)) + end + end --if vtype + + --print("bookmark_loop mode="..mode.." bkmrkidx="..bkmrkidx.." vbkmkrname="..vbkmrkname.." point_to="..point_to[playername].bkmrkname.." vplayer="..vplayer.." point_to="..point_to[playername].player) + --set testlist_clicked to the currently selected item in the list + if point_to[playername]~=nil then -- don't crash when point_to[playername] is nil + if mode=="L" and bkmrkidx==1 and vbkmrkname==point_to[playername].bkmrkname + and vplayernm==point_to[playername].player then + bkmrkidx=i + textlist_clicked[playername]=i + --point_to is the bookmark this player's compass is already pointing to + --when we open the list, if we found a bookmark that matches that item, we want + --to highlight it (by setting bkmrkidx to the index to highlight) and we want + --to set textlist_clicked to match that item. We need textlist_clicked because + --textlist does not return the currently selected item when you click a button, + --so we must keep the currently selected item in memory + --elseif mode=="I" and i==findidx then + -- return bkmrkname --found the item we were looking for, we are done. + end --if mode=L + end --for spairs + end --point_to[playername]~=nil + + if backwardscompatsave=="YES" then compassgps.write_bookmarks() end + + if mode=="L" then + return list,bkmrkidx + --elseif mode=="I" then + -- return "default" --didn't find it, so return default. + end --if mode=="L" + +end --bookmark_loop + + + + + + +function compassgps.get_confirm_formspec(playername,bkmrkidx) + --print("get_confirm_remove_formspec") + local player = minetest.get_player_by_name(playername) + if not compassgps.verify_bookmark_parms("remove_bookmark",player,playername,bkmrkidx) + then return end + local bkmrk=textlist_bkmrks[playername][bkmrkidx] + + return "compassgps:confirm_remove", "size[8,2;]".. + "label[0,0.2;"..S("Remove bookmark: ")..compassgps.bookmark_name_string(bkmrk).." ?]".. + "button[0,0.7;4,1;confirm_remove_yes;"..S("Yes").."]".. + "button[4,0.7;4,1;confirm_remove_no;"..S("No").."]" +end + + +function compassgps.check_view_type_all_blank(playername) + --view_type values are not all set when you first bring up the form + --so we check to ensure that view_type_A and S are default false for sp and true for mp + --and that if all values are false we set view_type_P to true + local defaultvalue="true" + if singleplayer then + defaultvalue="false" + end + if (not view_type_A[playername]) then + view_type_A[playername]=defaultvalue + end + if (not view_type_S[playername]) then + view_type_S[playername]=defaultvalue + end + if (not view_type_P[playername]) + or (view_type_P[playername]=="false" and view_type_S[playername]=="false" + and view_type_A[playername]=="false") then + view_type_P[playername]="true" + end +end --check_view_type_all_blank + + + +minetest.register_on_player_receive_fields(function(player,formname,fields) + if (not player) then + return false; + end + + local playername = player:get_player_name(); + if (playername ~= "" and formname == "compassgps:bookmarks") then + --"bookmark" field is set EVERY time. I would like to detect someone hitting + --enter in that field, but the problem is, if someone types something into + --the bookmark field, and then clicks on a bookmark in the textlist, + --I would get back bookmark as set. So, the only way to detect that + --enter has been hit in the bookmark field is to check bookmark, and ensure + --every other field is NOT set. + --this leaves open the possibility of someone typing in the hudx or hudy + --field and hitting enter after typing in the bookmark field. Not likely + if (fields["new_bookmark"] and fields["bookmark"]) --hit the bookmark button + or ( (fields["bookmark"]) and (fields["bookmark"]~="") --bookmark field not blank + and (not fields["remove_bookmark"]) and (not fields["find_bookmark"]) + and (not fields["bookmark_list"]) and (not fields["sort_type"]) + and (not fields["distance_type"]) and (not fields["settings"]) + and (not fields["teleport"]) and (not fields["show_private"]) + and (not fields["show_shared"]) and (not fields["show_admin"]) + ) + then + local type="P" + if fields["new_shared_bookmark"] then + type="S" + elseif fields["new_admin_bookmark"] then + type="A" + end --shared or admin + compassgps.set_bookmark(playername, fields["bookmark"],type) + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["remove_bookmark"] and textlist_clicked[playername] then + local bkmrkidx=textlist_clicked[playername] + if textlist_bkmrks[playername][bkmrkidx].player ~= playername then + --only admins can delete someone elses shared bookmark + --check to see if the player has "privs" privliges + local player_privs + player_privs = minetest.get_player_privs(playername) + if not player_privs["privs"] then + minetest.chat_send_player(playername,S("you can not remove someone elses bookmark:").. + compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx])) + return + end --if not player_privs + end -- if player~=playername + + -- you can't remove default bookmarks (bed, home, spawnpoint) + if textlist_bkmrks[playername][bkmrkidx].bkmrkname==nil or textlist_bkmrks[playername][bkmrkidx].player==nil then + return + end + if bookmarks[textlist_bkmrks[playername][bkmrkidx].player..textlist_bkmrks[playername][bkmrkidx].bkmrkname]==nil then + return + end + + --if they got here, they have authority to del the bookmark, show confirm dialog + minetest.show_formspec(playername, compassgps.get_confirm_formspec(playername, bkmrkidx)) + elseif fields["find_bookmark"] and textlist_clicked[playername] then + --print("compassgps.fields find_bookmark triggered, playername="..playername.." textlist_clicked="..textlist_clicked[playername]) + compassgps.find_bookmark(playername,textlist_clicked[playername]) + elseif fields["bookmark_list"] then + local idx=tonumber(string.sub(fields["bookmark_list"],5)) + --textlist_clicked[playername]=compassgps.bookmark_from_idx(playername,idx) + --textlist_clicked[playername]=compassgps.bookmark_loop("I",playername,idx) + textlist_clicked[playername]=idx + --print("bookmark_list triggered textlist idx="..idx.." tlc="..textlist_clicked[playername]) + elseif fields["sort_type"] then + local idx=tonumber(string.sub(fields["sort_type"],5)) + if idx==1 then + sort_function[playername]=compassgps.sort_by_name + else + sort_function[playername]=compassgps.sort_by_distance + end --if name else distance + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["distance_type"] then + local idx=tonumber(string.sub(fields["distance_type"],5)) + if idx==1 then + distance_function[playername]=compassgps.distance3d + else + distance_function[playername]=compassgps.distance2d + end --if 2d else 3d + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["show_private"] then + view_type_P[playername]=tostring(fields["show_private"]) + compassgps.check_view_type_all_blank(playername) + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["show_shared"] then + view_type_S[playername]=tostring(fields["show_shared"]) + compassgps.check_view_type_all_blank(playername) + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["show_admin"] then + view_type_A[playername]=tostring(fields["show_admin"]) + compassgps.check_view_type_all_blank(playername) + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["teleport"] then + -- Teleport player. + compassgps.teleport_bookmark(playername, textlist_clicked[playername]) + elseif fields["settings"] then + --bring up settings screen + minetest.show_formspec(playername, compassgps.get_settings_formspec(playername)) + end --compassgps formspec + elseif (playername ~= "" and formname == "compassgps:settings") then + if fields["hud_pos"] then --and fields["hudx"] and fields["hudy"] then + --minetest.chat_send_all("hud_pos triggered") + if tonumber(fields["hudx"]) and tonumber(fields["hudy"]) then + hud_pos[playername].x=fields["hudx"] + hud_pos[playername].y=fields["hudy"] + if tonumber(hud_pos[playername].x)<0 or tonumber(hud_pos[playername].x)>1 + or tonumber(hud_pos[playername].y)<0 or tonumber(hud_pos[playername].y)>1 then + minetest.chat_send_player(playername,S("compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore")) + --compassgps.write_settings() --no need to save until you quit + end + else --not numbers + minetest.chat_send_player(playername,S("compassgps: hud coords are not numeric. Change to between 0 and 1")) + end --if x,y valid + if tonumber(fields["hudcolor"],16) then + hud_color[playername]=fields["hudcolor"] + else + minetest.chat_send_player(playername,S("compassgps: hud color not valid hex number")) + end --if color valid + elseif fields["compass_type_a"] then + compass_type[playername]="a" + elseif fields["compass_type_b"] then + compass_type[playername]="b" + elseif fields["compass_type_c"] then + compass_type[playername]="c" + end --if fields["hud_pos"] + elseif (playername ~= "" and formname == "compassgps:confirm_remove") then + if fields["confirm_remove_yes"] then + compassgps.remove_bookmark(playername, textlist_clicked[playername]) + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + elseif fields["confirm_remove_no"] then + minetest.show_formspec(playername, compassgps.get_compassgps_formspec(playername)) + end -- if fields["confirm_remove_yes"] + end -- form if +end) + + +--saves the bookmark list in minetest/words//bookmarks +function compassgps.write_bookmarks() + local file = io.open(minetest.get_worldpath().."/bookmarks", "w") + if file then + file:write(minetest.serialize(bookmarks)) + file:close() + end +end --write_bookmarks + + +--saves the settings in minetest/words//compassgps_settings +function compassgps.write_settings() + --loop through players and set settings + --(less error prone than trying to keep settings in sync all the time + print(S("compassgps writing settings")) + local players = minetest.get_connected_players() + for i,player in ipairs(players) do + local name = player:get_player_name(); + local sort_short="name" + --if you save the actual sort_function or distance_function, it saves the + --whole function in the serialized file! not what I wanted, and doesn't work right. + if sort_function[name] and sort_function[name]==compassgps.sort_by_distance then + sort_short="distance" + end + local dist_short="2d" + if distance_function[name] and distance_function[name]==compassgps.distance3d then + dist_short="3d" + end + settings[name]={point_to=point_to[name], + hud_pos=hud_pos[name], + sort_function=sort_short, + distance_function=dist_short, + hud_color=hud_color[name], + compass_type=compass_type[name], + view_type_P=view_type_P[name], + view_type_S=view_type_S[name], + view_type_A=view_type_A[name]} + end + --now write to file + local file = io.open(minetest.get_worldpath().."/compassgps_settings", "w") + if file then + file:write(minetest.serialize(settings)) + file:close() + end +end --write_settings + + +minetest.register_on_leaveplayer(function(player) + compassgps.write_settings() + end) + +minetest.register_on_shutdown(compassgps.write_settings) + + +function compassgps.clean_string(str) + --remove dangerous characters that will mess up the list of bookmarks + --the file can handle these fine, but the LIST for the textlist + --will interpret these as seperators + str=string.gsub(str,",",".") + str=string.gsub(str,";",".") + str=string.gsub(str,"%[","(") + str=string.gsub(str,"%]",")") + return str +end --clean_string + + + +function compassgps.set_bookmark(playername, bkmrkname, type, predefinedpos) + local player = minetest.get_player_by_name(playername) + if not player then + return + end + + local pos = player:getpos() + if predefinedpos ~= nil then + pos = predefinedpos + end + --we are marking a NODE, no need to keep all those fractions + pos=compassgps.round_pos(pos) + + bkmrkname=compassgps.clean_string(bkmrkname) + + if bkmrkname == "" then + minetest.chat_send_player(playername, S("Give the bookmark a name.")) + return + end + if bkmrkname == "default" or bkmrkname == "bed" or bkmrkname == "sethome" + or string.sub(bkmrkname,1,8) == "*shared*" + or string.sub(bkmrkname,1,7)=="*admin*" then + minetest.chat_send_player(playername, S("A bookmark with the name '%s' can't be created."):format(bkmrkname)) + return + end + if bookmarks[playername..bkmrkname] then + minetest.chat_send_player(playername, S("You already have a bookmark with that name.")) + return + end + + pos.type=type or "P" --Private Shared Admin + + if pos.type=="S" and compassgps.count_shared(playername) >= max_shared then + minetest.chat_send_player(playername, S("The maximum number of shared bookmarks any user can create is %d."):format(max_shared)) + return + end + + pos.bkmrkname=bkmrkname + pos.player=playername + + bookmarks[playername..bkmrkname] = pos + + compassgps.write_bookmarks() + minetest.chat_send_player(playername, S("Bookmark '%s' added at %s type=%s"):format(bkmrkname, compassgps.pos_to_string(pos), pos.type)) +end + + +minetest.register_chatcommand("set_bookmark", { + params = "", + description = S("set_bookmark: Sets a location bookmark for the player"), + func = function (playername, bkmrkname) + compassgps.set_bookmark(playername, bkmrkname, "P") + end, +}) + + + +--returns a pos that is rounded special case. round 0 digits for X and Z, +--round 1 digit for Y +function compassgps.round_pos(pos) + pos.x=compassgps.round_digits(pos.x,0) + pos.y=compassgps.round_digits(pos.y,1) + pos.z=compassgps.round_digits(pos.z,0) + return pos +end --round_pos + + + +function compassgps.round_digits(num,digits) + if num >= 0 then return math.floor(num*(10^digits)+0.5)/(10^digits) + else return math.ceil(num*(10^digits)-0.5)/(10^digits) + end +end --round_digits + +function compassgps.round_digits_vector(vec,digits) + return {x=compassgps.round_digits(vec.x,digits),y=compassgps.round_digits(vec.y,digits), + z=compassgps.round_digits(vec.z,digits)} +end --round_digits_vector + + +--because built in pos_to_string doesn't handle nil, and commas mess up textlist +--this rounds same rules as for setting bookmark or teleporting +--that way what you see in the hud matches where you teleport or bookmark +function compassgps.pos_to_string(pos) + if pos==nil then return "(nil)" + else + pos=compassgps.round_pos(pos) + return "("..pos.x.." "..pos.y.." "..pos.z..")" + end --pos==nill +end --pos_to_string + + + +minetest.register_chatcommand("list_bookmarks", { + params = "", + description = S("list_bookmarks: Lists all bookmarks of a player"), + func = function(name, param) + compassgps.bookmark_loop("C",name) + end, +}) + + +function compassgps.verify_bookmark_parms(from_function,player,playername,bkmrkidx) + --just being paranoid, probably none of these checks are necessary + if not player then + print(S("compassgps.%s player not found"):format(from_function)) + if not playername then print(S(" playername=nil")) + else print(S(" playername=%s"):format(playername)) + end --if not playername + return false + end --if not player + if not tonumber(bkmrkidx) then + print(S("compassgps.%s invalid bkrmkidx"):format(from_funtion)) + if not bkmrkidx then print(S(" bkmrkidx=nil")) + else print(" bkmrkidx="..bkmrkidx) + end --if not bkmrkidx + return false + end --if not tonumber(bkmrkidx) + if not textlist_bkmrks[playername][bkmrkidx] then + print(S("compassgps.%s invalid bookmark playername=%s bkmrkid=%s"):format(from_function, playername, bkmrkidx)) + minetest.chat_send_player(playername,S("compassgps:%s invalid bookmark"):format(from_function)) + return false + end --if not textlist_bkmrks + return true --if you got here it is all good +end --verify_bookmark_parms + + + +function compassgps.remove_bookmark(playername, bkmrkidx) + local player = minetest.get_player_by_name(playername) + if not compassgps.verify_bookmark_parms("remove_bookmark",player,playername,bkmrkidx) + then return end + + + + print(S("remove bookmark playername=%s bkmrkidx=%s"):format(playername, bkmrkidx)) + minetest.chat_send_player(playername, S("removed %s"):format( + compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))) + bookmarks[textlist_bkmrks[playername][bkmrkidx].player.. + textlist_bkmrks[playername][bkmrkidx].bkmrkname] = nil + compassgps.write_bookmarks() +end --remove_bookmarks + + + +function compassgps.remove_bookmark_byname(playername, bkmrkname) + local player = minetest.get_player_by_name(playername) + if not player then + return + end + if bkmrkname == "" then + minetest.chat_send_player(name, S("No bookmark was specified.")) + return + end + if not bookmarks[playername..bkmrkname] then + minetest.chat_send_player(playername, S("You have no bookmark with this name.")) + return + end + bookmarks[playername..bkmrkname] = nil + compassgps.write_bookmarks() + minetest.chat_send_player(playername, S("The bookmark "..bkmrkname.." has been successfully removed.")) +end + + + +minetest.register_chatcommand("remove_bookmark", { + params = "", + description = S("Removes the bookmark specified by "), + func = function(name, bkmrkname) + compassgps.remove_bookmark_byname(name,bkmrkname) + end, +}) + + +function compassgps.teleport_bookmark(playername, bkmrkidx) + local player = minetest.get_player_by_name(playername) + if not compassgps.verify_bookmark_parms("teleport_bookmark",player,playername,bkmrkidx) + then return end + print(S("compassgps teleporting player %s to %s"):format(playername, + compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))) + minetest.chat_send_player(playername, S("Teleporting to %s"):format( + compassgps.bookmark_name_string(textlist_bkmrks[playername][bkmrkidx]))) + player:setpos(textlist_bkmrks[playername][bkmrkidx]) +end --teleport_bookmark + + + +function compassgps.find_bookmark_byname(playername, bkmrkname) + local player = minetest.get_player_by_name(playername) + if not player then + return + end + if not bkmrkname or bkmrkname == "" then + minetest.chat_send_player(playername, S("No bookmark was specified.")) + return + end + if bkmrkname == "default" then + minetest.chat_send_player(playername, S("Pointing at default location.")) + point_to[playername] = compassgps.get_default_bookmark(playername,1) + return + end + if not bookmarks[playername..bkmrkname] then + minetest.chat_send_player(playername, S("You have no bookmark with this name.")) + return + end + point_to[playername] = bookmarks[playername..bkmrkname] + minetest.chat_send_player(playername, S("Pointing at %s."):format(bkmrkname)) +end + + + +function compassgps.find_bookmark(playername, bkmrkidx) + local player = minetest.get_player_by_name(playername) + if not compassgps.verify_bookmark_parms("find_bookmark",player,playername,bkmrkidx) + then return end + point_to[playername] = textlist_bkmrks[playername][bkmrkidx] + minetest.chat_send_player(playername, S("Pointing at %s."):format(point_to[playername].bkmrkname)) +end + + +minetest.register_chatcommand("find_bookmark", { + params = "", + description = S("Lets the compassgps point to the bookmark"), + func = function(playername, bkmrkname) + compassgps.find_bookmark_byname(playername,bkmrkname) + end, +}) + + + + + +-- compassgps mod + + + + +-- default to static spawnpoint +local static_spawnpoint = minetest.setting_get_pos("static_spawnpoint") +-- default to 0/0/0 if spawnpoint is not present or invalid +local default_spawn = static_spawnpoint or {x=0, y=0, z=0} + +local last_time_spawns_read = "default" +local beds_spawns = {} +local sethome_spawns = {} +function read_spawns() + -- read BlockMen beds-mod positions (added to default minetest game) + local beds_file = io.open(minetest.get_worldpath().."/beds_spawns", "r") + if beds_file then + while true do + local x = beds_file:read("*n") + if x == nil then + break + end + local y = beds_file:read("*n") + local z = beds_file:read("*n") + local name = beds_file:read("*l") + beds_spawns[name:sub(2)] = {x = x, y = y, z = z} + end + io.close(beds_file) + else + -- read PilzAdams beds-mod positions + beds_file = io.open(minetest.get_worldpath().."/beds_player_spawns", "r") + if beds_file then + beds_spawns = minetest.deserialize(beds_file:read("*all")) + beds_file:close() + end + end + + -- read sethome-mod positions + if minetest.get_modpath('sethome') then + local sethome_file = io.open(minetest.get_modpath('sethome')..'/homes', "r") + if sethome_file then + while true do + local x = sethome_file:read("*n") + if x == nil then + break + end + local y = sethome_file:read("*n") + local z = sethome_file:read("*n") + local name = sethome_file:read("*l") + sethome_spawns[name:sub(2)] = {x = x, y = y, z = z} + end + io.close(sethome_file) + end + end +end + + +function compassgps.compass_type_name(playername,imagenum,ctypein) + local ctype="a" + if ctypein then + ctype=ctypein + end + if playername~="" and compass_type[playername] then + ctype=compass_type[playername] + end + if ctype=="a" then + ctype="" + end + --print("compass type name return "..ctype..imagenum) + return ctype..imagenum +end + + +function compassgps.get_default_bookmark(name,num) + -- try to get position from beds-mod spawn + local pos = beds_spawns[name] + local posname="bed" + if pos~=nil and num==1 then + default_bookmark={x=pos.x,y=pos.y,z=pos.z,player=name,type="P",bkmrkname=posname} + return default_bookmark + elseif pos~=nil then + num=num-1 + end + -- fallback to sethome position + pos = sethome_spawns[name] + posname="home" + if pos~=nil and num==1 then + default_bookmark={x=pos.x,y=pos.y,z=pos.z,player=name,type="P",bkmrkname=posname} + return default_bookmark + elseif pos~=nil then + num=num-1 + end + if num>1 then + return + end + + -- fallback to default + pos = default_spawn; + posname="spawn" + default_bookmark={x=pos.x,y=pos.y,z=pos.z,player=name,type="P",bkmrkname=posname} + return default_bookmark +end --get_default_bookmark + +function compassgps.get_default_pos_and_name(name) + -- try to get position from PilzAdams bed-mod spawn + local pos = beds_spawns[name] + local posname="bed" + -- fallback to sethome position + if pos == nil then + pos = sethome_spawns[name] + posname="sethome" + end + -- fallback to default + if pos == nil then + pos = default_spawn; + posname="default" + end +default_bookmark={x=pos.x,y=pos.y,z=pos.z,player=name,type="P"} +return pos,posname +end --get_compassgps_target_pos + + + + +minetest.register_globalstep(function(dtime) + if last_time_spawns_read ~= os.date("%M") then + last_time_spawns_read = os.date("%M") + read_spawns() + end + local players = minetest.get_connected_players() + for i,player in ipairs(players) do + local playername = player:get_player_name(); + + local gotacompass=false + local wielded=false + local activeinv=nil + local stackidx=0 + --first check to see if the user has a compass, because if they don't + --there is no reason to waste time calculating bookmarks or spawnpoints. + local wielded_item = player:get_wielded_item():get_name() + if string.sub(wielded_item, 0, 11) == "compassgps:" and string.sub(wielded_item, 0, 18) ~= "compassgps:cgpsmap" then + --if the player is wielding a compass, change the wielded image + wielded=true + stackidx=player:get_wield_index() + gotacompass=true + else + --check to see if compass is in active inventory + if player:get_inventory() then + --is there a way to only check the activewidth items instead of entire list? + --problem being that arrays are not sorted in lua + for i,stack in ipairs(player:get_inventory():get_list("main")) do + if i<=activewidth and string.sub(stack:get_name(), 0, 11) == "compassgps:" and string.sub(stack:get_name(),0,18) ~= "compassgps:cgpsmap" then + activeinv=stack --store the stack so we can update it later with new image + stackidx=i --store the index so we can add image at correct location + gotacompass=true + break + end --if i<=activewidth + end --for loop + end -- get_inventory + end --if wielded else + + + --dont mess with the rest of this if they don't have a compass + if gotacompass then + --if they don't have a bookmark set, use the default + point_to[playername]=point_to[playername] or compassgps.get_default_bookmark(playername,1) + target=point_to[playername] --just to take up less space + pos = player:getpos() + dir = player:get_look_yaw() + local angle_north = math.deg(math.atan2(target.x - pos.x, target.z - pos.z)) + if angle_north < 0 then angle_north = angle_north + 360 end + local angle_dir = 90 - math.deg(dir) + local angle_relative = (angle_north - angle_dir) % 360 + local compass_image = math.floor((angle_relative/30) + 0.5)%12 + + + --update compass image to point at target + if wielded then + player:set_wielded_item("compassgps:".. + compassgps.compass_type_name(playername,compass_image)) + elseif activeinv then + --player:get_inventory():remove_item("main", activeinv:get_name()) + player:get_inventory():set_stack("main",stackidx,"compassgps:".. + compassgps.compass_type_name(playername,compass_image)) + end --if wielded elsif activin + + + --update the hud with playerpos -> target pos : distance to target + distance_function[playername]=distance_function[playername] or compassgps.distance3d + --if distance_function[playername]==nil then + -- distance_function[playername]=compassgps.distance3d + --end + + + local hudx=tonumber(hud_default_x) + local hudy=tonumber(hud_default_y) + if hud_pos[playername] then + hudx=tonumber(hud_pos[playername].x) + hudy=tonumber(hud_pos[playername].y) + else + hud_pos[playername]={x=hud_default_x, y=hud_default_y} + end + + local hudcolor=tonumber(hud_default_color, 16) + if hud_color[playername] then + hudcolor=tonumber(hud_color[playername], 16) + else + hud_color[playername]=hud_default_color + end + + local compasstype=compass_default_type + if compass_type[playername] and + (compass_type[playername]=="a" or compass_type[playername]=="b" or compass_type[playername]=="c") then + compasstype=compass_type[playername] + else + compass_type[playername]=compass_default_type + end + + local h=nil + if hudx>=0 and hudx<=1 and hudy>=0 and hudy<=1 then + h = player:hud_add({ + hud_elem_type = "text"; + position = {x=hudx, y=hudy}; + text = compassgps.pos_to_string(pos).." -> ".. + compassgps.bookmark_name_pos_dist(target,playername,pos); + --text = compassgps.pos_to_string(pos).." -> "..target.bkmrkname.. + -- " "..compassgps.pos_to_string(target).." : ".. + -- compassgps.round_digits(distance_function[playername](pos,target),2); + number = hudcolor; + scale = 20; + }); + end --if x and y in range + if (player_hud[playername]) then + --remove the previous element + player:hud_remove(player_hud[playername]); + end + player_hud[playername] = h; --store this element for removal next time + --this elseif is triggered if gotacompass=false + elseif (player_hud[playername]) then --remove the hud if player no longer has compass + player:hud_remove(player_hud[playername]); + player_hud[playername]=nil + end --if gotacompass + end --for i,player in ipairs(players) +end) -- register_globalstep + + + + + + + + + +function compassgps.sort_by_coords(table,a,b) + if table[a].x==table[b].x then + if table[a].z==table[b].z then + return table[a].y = Entfernt den Wegpunkt der mit angegeben ist. +Settings = Einstellungen +Shared = Geteilt +Show: = Zeige: +Sort by: = Sortiere nach: +Teleporting to %s = Teleportiere zu %s +The bookmark = Der Wegpunkt +The maximum number of shared bookmarks any user can create is %d. = Jeder Nutzer kann nur %d geteilte Wegpunkte erstellen. +Yes = Ja +You already have a bookmark with that name. = Sie haben bereits einen Wegpunkt mit diesem Namen. +You have no bookmark with this name. = Sie haben keinen Wegpunkt mit diesem Namen. +bookmark = Wegpunkt +compassgps reading bookmarks = compassgps liest die Wegpunkte. +compassgps reading settings = compassgps liest die Einstellungen. +compassgps = Kompass +compassgps teleporting player %s to %s = compassgps teleportiert Spieler %s nach %s. +compassgps writing settings = compassgps schreibt die Einstellungen. +compassgps.%s invalid bkrmkidx = compassgps.%s ungültige bkmrkidx. +compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s = compassgps.%s ungültiger Wegpunkt Spielername\=%s bkmrkidx\=%s. +compassgps.%s player not found = compassgps.%s Spieler nicht gefunden. +compassgps: hud color not valid hex number = compassgps: HUD Farbe ist keine zulässige Hexadezimalzahl. +compassgps: hud coords are not numeric. Change to between 0 and 1 = compassgps: HUD Koordinaten sind keine Zahlen. Ändern sie diese zu Werten zwischen 0 und 1. +compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore = compassgps: HUD Koordinaten sind außerhalb des zulässigen Bereichs. Ändern sie diese zu Werten zwischen 0 und 1 um das HUD wiederherzustellen. +compassgps:%s invalid bookmark = compassgps.%s ungültiger Wegpunkt +create admin = Erstelle Administratorwegpunkt +create bookmark = Erstelle Wegpunkt +create shared = Erstelle geteilten Wegpunkt +current position : = Momentane Position : +distance = Entfernung +find selected bookmark = Finde den ausgewählten Wegpunkt +list_bookmarks: Lists all bookmarks of a player = list_bookmarks: Zeigt alle Wegpunkte eines Spielers. +name = Name +remove bookmark = Entferne den Wegpunkt +remove bookmark playername\=%s bkmrkidx\=%s = Entferne den Wegpunkt Spielername\=%s bkmrkidx\=%s +removed %s = %s entfernt. +set_bookmark: Sets a location bookmark for the player = set_bookmark: Setzt einen Wegpunkt für den Spieler. +teleport to bookmark = Teleportiere zu dem Wegpunkt. +you can not remove someone elses bookmark: = Sie können den Wegpunkt eines anderen Spielers nicht entfernen: +CompassGPS Map (blank) = CompassGPS Karte (leer) +CompassGPS Map (marked) = CompassGPS Karte (markiert) +Write to cgpsmap = Schreibe auf die Karte +copy bookmark to your compassgps = Kopiere den Wegpunkt in ihren Kompass. +bookmark name: = Name des Wegpunkts: +bookmark pos: = Position des Wegpunkts: diff --git a/mods/compassgps/locale/template.txt b/mods/compassgps/locale/template.txt new file mode 100644 index 0000000..20af318 --- /dev/null +++ b/mods/compassgps/locale/template.txt @@ -0,0 +1,63 @@ + bkmrkidx\=nil = + playername\=%s = + playername\=nil = +%s's map = +A bookmark with the name '%s' can't be created. = +Admin = +Bookmark '%s' added at %s type\=%s = +Change hud: = +Color: = +Dist: = +Compass Type: = +Give the bookmark a name. = +Lets the compassgps point to the bookmark = +No = +No bookmark was specified. = +Pointing at %s. = +Pointing at default location. = +Private = +Remove bookmark: = +Removes the bookmark specified by = +Settings = +Shared = +Show: = +Sort by: = +Teleporting to %s = +The bookmark = +The maximum number of shared bookmarks any user can create is %d. = +Yes = +You already have a bookmark with that name. = +You have no bookmark with this name. = +bookmark = +compassgps reading bookmarks = +compassgps reading settings = +compassgps = +compassgps teleporting player %s to %s = +compassgps writing settings = +compassgps.%s invalid bkrmkidx = +compassgps.%s invalid bookmark playername\=%s bkmrkid\=%s = +compassgps.%s player not found = +compassgps: hud color not valid hex number = +compassgps: hud coords are not numeric. Change to between 0 and 1 = +compassgps: hud coords out of range, hud will not be displayed. Change to between 0 and 1 to restore = +compassgps:%s invalid bookmark = +create admin = +create bookmark = +create shared = +current position : = +distance = +find selected bookmark = +list_bookmarks: Lists all bookmarks of a player = +name = +remove bookmark = +remove bookmark playername\=%s bkmrkidx\=%s = +removed %s = +set_bookmark: Sets a location bookmark for the player = +teleport to bookmark = +you can not remove someone elses bookmark: = +CompassGPS Map (blank) = +CompassGPS Map (marked) = +Write to cgpsmap = +copy bookmark to your compassgps = +bookmark name: = +bookmark pos: = diff --git a/mods/compassgps/textures/cgpsmap-blank.png b/mods/compassgps/textures/cgpsmap-blank.png new file mode 100644 index 0000000..f3289f3 Binary files /dev/null and b/mods/compassgps/textures/cgpsmap-blank.png differ diff --git a/mods/compassgps/textures/cgpsmap-marked.png b/mods/compassgps/textures/cgpsmap-marked.png new file mode 100644 index 0000000..a4bfd7c Binary files /dev/null and b/mods/compassgps/textures/cgpsmap-marked.png differ diff --git a/mods/compassgps/textures/compass_0.png b/mods/compassgps/textures/compass_0.png new file mode 100644 index 0000000..bb33a80 Binary files /dev/null and b/mods/compassgps/textures/compass_0.png differ diff --git a/mods/compassgps/textures/compass_1.png b/mods/compassgps/textures/compass_1.png new file mode 100644 index 0000000..f764682 Binary files /dev/null and b/mods/compassgps/textures/compass_1.png differ diff --git a/mods/compassgps/textures/compass_10.png b/mods/compassgps/textures/compass_10.png new file mode 100644 index 0000000..7b44a28 Binary files /dev/null and b/mods/compassgps/textures/compass_10.png differ diff --git a/mods/compassgps/textures/compass_11.png b/mods/compassgps/textures/compass_11.png new file mode 100644 index 0000000..2cf7fc0 Binary files /dev/null and b/mods/compassgps/textures/compass_11.png differ diff --git a/mods/compassgps/textures/compass_2.png b/mods/compassgps/textures/compass_2.png new file mode 100644 index 0000000..a4712f0 Binary files /dev/null and b/mods/compassgps/textures/compass_2.png differ diff --git a/mods/compassgps/textures/compass_3.png b/mods/compassgps/textures/compass_3.png new file mode 100644 index 0000000..3b07e41 Binary files /dev/null and b/mods/compassgps/textures/compass_3.png differ diff --git a/mods/compassgps/textures/compass_4.png b/mods/compassgps/textures/compass_4.png new file mode 100644 index 0000000..511497a Binary files /dev/null and b/mods/compassgps/textures/compass_4.png differ diff --git a/mods/compassgps/textures/compass_5.png b/mods/compassgps/textures/compass_5.png new file mode 100644 index 0000000..8ea4db9 Binary files /dev/null and b/mods/compassgps/textures/compass_5.png differ diff --git a/mods/compassgps/textures/compass_6.png b/mods/compassgps/textures/compass_6.png new file mode 100644 index 0000000..85b09ff Binary files /dev/null and b/mods/compassgps/textures/compass_6.png differ diff --git a/mods/compassgps/textures/compass_7.png b/mods/compassgps/textures/compass_7.png new file mode 100644 index 0000000..6479781 Binary files /dev/null and b/mods/compassgps/textures/compass_7.png differ diff --git a/mods/compassgps/textures/compass_8.png b/mods/compassgps/textures/compass_8.png new file mode 100644 index 0000000..6b5a711 Binary files /dev/null and b/mods/compassgps/textures/compass_8.png differ diff --git a/mods/compassgps/textures/compass_9.png b/mods/compassgps/textures/compass_9.png new file mode 100644 index 0000000..5243b79 Binary files /dev/null and b/mods/compassgps/textures/compass_9.png differ diff --git a/mods/compassgps/textures/compass_b0.png b/mods/compassgps/textures/compass_b0.png new file mode 100644 index 0000000..890da15 Binary files /dev/null and b/mods/compassgps/textures/compass_b0.png differ diff --git a/mods/compassgps/textures/compass_b1.png b/mods/compassgps/textures/compass_b1.png new file mode 100644 index 0000000..357a241 Binary files /dev/null and b/mods/compassgps/textures/compass_b1.png differ diff --git a/mods/compassgps/textures/compass_b10.png b/mods/compassgps/textures/compass_b10.png new file mode 100644 index 0000000..817a622 Binary files /dev/null and b/mods/compassgps/textures/compass_b10.png differ diff --git a/mods/compassgps/textures/compass_b11.png b/mods/compassgps/textures/compass_b11.png new file mode 100644 index 0000000..b990fc2 Binary files /dev/null and b/mods/compassgps/textures/compass_b11.png differ diff --git a/mods/compassgps/textures/compass_b2.png b/mods/compassgps/textures/compass_b2.png new file mode 100644 index 0000000..36b3313 Binary files /dev/null and b/mods/compassgps/textures/compass_b2.png differ diff --git a/mods/compassgps/textures/compass_b3.png b/mods/compassgps/textures/compass_b3.png new file mode 100644 index 0000000..16f547b Binary files /dev/null and b/mods/compassgps/textures/compass_b3.png differ diff --git a/mods/compassgps/textures/compass_b4.png b/mods/compassgps/textures/compass_b4.png new file mode 100644 index 0000000..812b784 Binary files /dev/null and b/mods/compassgps/textures/compass_b4.png differ diff --git a/mods/compassgps/textures/compass_b5.png b/mods/compassgps/textures/compass_b5.png new file mode 100644 index 0000000..5d46b1b Binary files /dev/null and b/mods/compassgps/textures/compass_b5.png differ diff --git a/mods/compassgps/textures/compass_b6.png b/mods/compassgps/textures/compass_b6.png new file mode 100644 index 0000000..4102718 Binary files /dev/null and b/mods/compassgps/textures/compass_b6.png differ diff --git a/mods/compassgps/textures/compass_b7.png b/mods/compassgps/textures/compass_b7.png new file mode 100644 index 0000000..73627a3 Binary files /dev/null and b/mods/compassgps/textures/compass_b7.png differ diff --git a/mods/compassgps/textures/compass_b8.png b/mods/compassgps/textures/compass_b8.png new file mode 100644 index 0000000..27dc766 Binary files /dev/null and b/mods/compassgps/textures/compass_b8.png differ diff --git a/mods/compassgps/textures/compass_b9.png b/mods/compassgps/textures/compass_b9.png new file mode 100644 index 0000000..970e53f Binary files /dev/null and b/mods/compassgps/textures/compass_b9.png differ diff --git a/mods/compassgps/textures/compass_c0.png b/mods/compassgps/textures/compass_c0.png new file mode 100644 index 0000000..e4ec72f Binary files /dev/null and b/mods/compassgps/textures/compass_c0.png differ diff --git a/mods/compassgps/textures/compass_c1.png b/mods/compassgps/textures/compass_c1.png new file mode 100644 index 0000000..74e2c58 Binary files /dev/null and b/mods/compassgps/textures/compass_c1.png differ diff --git a/mods/compassgps/textures/compass_c10.png b/mods/compassgps/textures/compass_c10.png new file mode 100644 index 0000000..c4b3e13 Binary files /dev/null and b/mods/compassgps/textures/compass_c10.png differ diff --git a/mods/compassgps/textures/compass_c11.png b/mods/compassgps/textures/compass_c11.png new file mode 100644 index 0000000..5468ead Binary files /dev/null and b/mods/compassgps/textures/compass_c11.png differ diff --git a/mods/compassgps/textures/compass_c2.png b/mods/compassgps/textures/compass_c2.png new file mode 100644 index 0000000..431b687 Binary files /dev/null and b/mods/compassgps/textures/compass_c2.png differ diff --git a/mods/compassgps/textures/compass_c3.png b/mods/compassgps/textures/compass_c3.png new file mode 100644 index 0000000..8ea342f Binary files /dev/null and b/mods/compassgps/textures/compass_c3.png differ diff --git a/mods/compassgps/textures/compass_c4.png b/mods/compassgps/textures/compass_c4.png new file mode 100644 index 0000000..d38a4b1 Binary files /dev/null and b/mods/compassgps/textures/compass_c4.png differ diff --git a/mods/compassgps/textures/compass_c5.png b/mods/compassgps/textures/compass_c5.png new file mode 100644 index 0000000..aff3ccb Binary files /dev/null and b/mods/compassgps/textures/compass_c5.png differ diff --git a/mods/compassgps/textures/compass_c6.png b/mods/compassgps/textures/compass_c6.png new file mode 100644 index 0000000..cffa6c6 Binary files /dev/null and b/mods/compassgps/textures/compass_c6.png differ diff --git a/mods/compassgps/textures/compass_c7.png b/mods/compassgps/textures/compass_c7.png new file mode 100644 index 0000000..962bcb8 Binary files /dev/null and b/mods/compassgps/textures/compass_c7.png differ diff --git a/mods/compassgps/textures/compass_c8.png b/mods/compassgps/textures/compass_c8.png new file mode 100644 index 0000000..4f98604 Binary files /dev/null and b/mods/compassgps/textures/compass_c8.png differ diff --git a/mods/compassgps/textures/compass_c9.png b/mods/compassgps/textures/compass_c9.png new file mode 100644 index 0000000..6fbf03c Binary files /dev/null and b/mods/compassgps/textures/compass_c9.png differ diff --git a/mods/compassgps/textures/compassgps_blank.png b/mods/compassgps/textures/compassgps_blank.png new file mode 100755 index 0000000..1b1e662 Binary files /dev/null and b/mods/compassgps/textures/compassgps_blank.png differ diff --git a/mods/creative/README.txt b/mods/creative/README.txt new file mode 100644 index 0000000..7d49b98 --- /dev/null +++ b/mods/creative/README.txt @@ -0,0 +1,22 @@ +Minetest 0.4 mod: creative +========================== + +Implements creative mode. + +Switch on by using the "creative_mode" setting. + +Registered items that +- have a description, and +- do not have the group not_in_creative_inventory +are added to the creative inventory. + +License of source code and media files: +--------------------------------------- +Copyright (C) 2012 Perttu Ahola (celeron55) + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. + diff --git a/mods/creative/depends.txt b/mods/creative/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/creative/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/creative/init.lua b/mods/creative/init.lua new file mode 100644 index 0000000..809c2aa --- /dev/null +++ b/mods/creative/init.lua @@ -0,0 +1,173 @@ +-- minetest/creative/init.lua + +creative_inventory = {} +creative_inventory.creative_inventory_size = 0 + +-- Create detached creative inventory after loading all mods +minetest.after(0, function() + local inv = minetest.create_detached_inventory("creative", { + allow_move = function(inv, from_list, from_index, to_list, to_index, count, player) + if minetest.setting_getbool("creative_mode") then + return count + else + return 0 + end + end, + allow_put = function(inv, listname, index, stack, player) + return 0 + end, + allow_take = function(inv, listname, index, stack, player) + if minetest.setting_getbool("creative_mode") then + return -1 + else + return 0 + end + end, + on_move = function(inv, from_list, from_index, to_list, to_index, count, player) + end, + on_put = function(inv, listname, index, stack, player) + end, + on_take = function(inv, listname, index, stack, player) + --print(player:get_player_name().." takes item from creative inventory; listname="..dump(listname)..", index="..dump(index)..", stack="..dump(stack)) + if stack then + minetest.log("action", player:get_player_name().." takes "..dump(stack:get_name()).." from creative inventory") + --print("stack:get_name()="..dump(stack:get_name())..", stack:get_count()="..dump(stack:get_count())) + end + end, + }) + local creative_list = {} + for name,def in pairs(minetest.registered_items) do + if (not def.groups.not_in_creative_inventory or def.groups.not_in_creative_inventory == 0) + and def.description and def.description ~= "" then + table.insert(creative_list, name) + end + end + table.sort(creative_list) + inv:set_size("main", #creative_list) + for _,itemstring in ipairs(creative_list) do + inv:add_item("main", ItemStack(itemstring)) + end + creative_inventory.creative_inventory_size = #creative_list + --print("creative inventory size: "..dump(creative_inventory.creative_inventory_size)) +end) + +-- Create the trash field +local trash = minetest.create_detached_inventory("creative_trash", { + -- Allow the stack to be placed and remove it in on_put() + -- This allows the creative inventory to restore the stack + allow_put = function(inv, listname, index, stack, player) + if minetest.setting_getbool("creative_mode") then + return stack:get_count() + else + return 0 + end + end, + on_put = function(inv, listname, index, stack, player) + inv:set_stack(listname, index, "") + end, +}) +trash:set_size("main", 1) + + +creative_inventory.set_creative_formspec = function(player, start_i, pagenum) + pagenum = math.floor(pagenum) + local pagemax = math.floor((creative_inventory.creative_inventory_size-1) / (6*4) + 1) + player:set_inventory_formspec( + "size[13,7.5]".. + --"image[6,0.6;1,2;player.png]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_player;main;5,3.5;8,1;]".. + "list[current_player;main;5,4.75;8,3;8]".. + "list[current_player;craft;8,0;3,3;]".. + "list[current_player;craftpreview;12,1;1,1;]".. + "image[11,1;1,1;gui_furnace_arrow_bg.png^[transformR270]".. + "list[detached:creative;main;0.3,0.5;4,6;"..tostring(start_i).."]".. + "label[2.0,6.55;"..tostring(pagenum).."/"..tostring(pagemax).."]".. + "button[0.3,6.5;1.6,1;creative_prev;<<]".. + "button[2.7,6.5;1.6,1;creative_next;>>]".. + "label[5,1.5;Trash:]".. + "list[detached:creative_trash;main;5,2;1,1;]".. + default.get_hotbar_bg(5,3.5) + ) +end +minetest.register_on_joinplayer(function(player) + -- If in creative mode, modify player's inventory forms + if not minetest.setting_getbool("creative_mode") then + return + end + creative_inventory.set_creative_formspec(player, 0, 1) +end) +minetest.register_on_player_receive_fields(function(player, formname, fields) + if not minetest.setting_getbool("creative_mode") then + return + end + -- Figure out current page from formspec + local current_page = 0 + local formspec = player:get_inventory_formspec() + local start_i = string.match(formspec, "list%[detached:creative;main;[%d.]+,[%d.]+;[%d.]+,[%d.]+;(%d+)%]") + start_i = tonumber(start_i) or 0 + + if fields.creative_prev then + start_i = start_i - 4*6 + end + if fields.creative_next then + start_i = start_i + 4*6 + end + + if start_i < 0 then + start_i = start_i + 4*6 + end + if start_i >= creative_inventory.creative_inventory_size then + start_i = start_i - 4*6 + end + + if start_i < 0 or start_i >= creative_inventory.creative_inventory_size then + start_i = 0 + end + + creative_inventory.set_creative_formspec(player, start_i, start_i / (6*4) + 1) +end) + +if minetest.setting_getbool("creative_mode") then + local digtime = 0.5 + minetest.register_item(":", { + type = "none", + wield_image = "wieldhand.png", + wield_scale = {x=1,y=1,z=2.5}, + range = 10, + tool_capabilities = { + full_punch_interval = 0.5, + max_drop_level = 3, + groupcaps = { + crumbly = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3}, + cracky = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3}, + snappy = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3}, + choppy = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3}, + oddly_breakable_by_hand = {times={[1]=digtime, [2]=digtime, [3]=digtime}, uses=0, maxlevel=3}, + }, + damage_groups = {fleshy = 10}, + } + }) + + minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack) + return true + end) + + function minetest.handle_node_drops(pos, drops, digger) + if not digger or not digger:is_player() then + return + end + local inv = digger:get_inventory() + if inv then + for _,item in ipairs(drops) do + item = ItemStack(item):get_name() + if not inv:contains_item("main", item) then + inv:add_item("main", item) + end + end + end + end + +end diff --git a/mods/default/README.txt b/mods/default/README.txt new file mode 100644 index 0000000..5e726ee --- /dev/null +++ b/mods/default/README.txt @@ -0,0 +1,204 @@ +Minetest 0.4 mod: default +========================== + +License of source code: +----------------------- +Copyright (C) 2011-2012 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Authors of media files +----------------------- +Everything not listed in here: +Copyright (C) 2010-2012 celeron55, Perttu Ahola + +Cisoun's WTFPL texture pack: + default_jungletree.png + default_jungletree_top.png + default_lava.png + default_leaves.png + default_sapling.png + default_sign_wall.png + default_stone.png + default_tree.png + default_tree_top.png + default_water.png + +Cisoun's conifers mod (WTFPL): + default_pine_needles.png + +Originating from G4JC's Almost MC Texture Pack: + default_torch.png + default_torch_on_ceiling.png + default_torch_on_floor.png + +VanessaE's animated torches (WTFPL): + default_torch_animated.png + default_torch_on_ceiling_animated.png + default_torch_on_floor_animated.png + default_torch_on_floor.png + +RealBadAngel's animated water (WTFPL): + default_water_source_animated.png + default_water_flowing_animated.png + +VanessaE (WTFPL): + default_nc_back.png + default_nc_front.png + default_nc_rb.png + default_nc_side.png + default_grass_*.png + default_desert_sand.png + default_desert_stone.png + default_desert_stone_brick.png + default_sand.png + +Calinou (CC BY-SA): + default_brick.png + default_papyrus.png + default_mineral_copper.png + default_glass_detail.png + +MirceaKitsune (WTFPL): + character.x + +Jordach (CC BY-SA 3.0): + character.png + +PilzAdam (WTFPL): + default_jungleleaves.png + default_junglesapling.png + default_junglewood.png + default_obsidian_glass.png + default_obsidian_shard.png + default_mineral_gold.png + default_snowball.png + +jojoa1997 (WTFPL): + default_obsidian.png + +InfinityProject (WTFPL): + default_mineral_diamond.png + +Splizard (CC BY-SA 3.0): + default_snow.png + default_snow_side.png + default_ice.png + default_pine_sapling.png + +Zeg9 (CC BY-SA 3.0): + default_coal_block.png + default_steel_block.png + default_copper_block.png + default_bronze_block.png + default_gold_block.png + +paramat (CC BY-SA 3.0): + wieldhand.png, based on character.png by Jordach (CC BY-SA 3.0) + default_pinetree.png + default_pinetree_top.png + default_pinewood.png + default_sandstone_brick.png + default_obsidian_brick.png + default_river_water.png + default_river_water_source_animated.png + default_river_water_flowing_animated.png + +brunob.santos (CC BY-SA 4.0): + default_desert_cobble.png + +BlockMen (CC BY-SA 3.0): + default_stone_brick.png + default_wood.png + default_clay_brick.png + default_iron_ingot.png + default_gold_ingot.png + default_tool_steelsword.png + default_diamond.png + default_diamond_block.png + default_book.png + default_tool_*.png + default_lava_source_animated.png + default_lava_flowing_animated.png + default_stick.png + default_chest_front.png + default_chest_lock.png + default_chest_side.png + default_chest_top.png + default_mineral_mese.png + default_meselamp.png + bubble.png + heart.png + gui_*.png + +Neuromancer (CC BY-SA 2.0): + default_cobble.png, based on texture by Brane praefect + default_mossycobble.png, based on texture by Brane praefect +Neuromancer (CC BY-SA 3.0): + default_dirt.png + default_furnace_*.png + +Philipbenr (CC BY-SA 3.0): + default_grass.png + default_grass_side.png + +Glass breaking sounds (CC BY 3.0): + 1: http://www.freesound.org/people/cmusounddesign/sounds/71947/ + 2: http://www.freesound.org/people/Tomlija/sounds/97669/ + 3: http://www.freesound.org/people/lsprice/sounds/88808/ + +Mito551 (sounds) (CC BY-SA): + default_dig_choppy.ogg + default_dig_cracky.ogg + default_dig_crumbly.1.ogg + default_dig_crumbly.2.ogg + default_dig_dig_immediate.ogg + default_dig_oddly_breakable_by_hand.ogg + default_dug_node.1.ogg + default_dug_node.2.ogg + default_grass_footstep.1.ogg + default_grass_footstep.2.ogg + default_grass_footstep.3.ogg + default_gravel_footstep.1.ogg + default_gravel_footstep.2.ogg + default_gravel_footstep.3.ogg + default_gravel_footstep.4.ogg + default_grass_footstep.1.ogg + default_place_node.1.ogg + default_place_node.2.ogg + default_place_node.3.ogg + default_place_node_hard.1.ogg + default_place_node_hard.2.ogg + default_snow_footstep.1.ogg + default_snow_footstep.2.ogg + default_hard_footstep.1.ogg + default_hard_footstep.2.ogg + default_hard_footstep.3.ogg + default_sand_footstep.1.ogg + default_sand_footstep.2.ogg + default_wood_footstep.1.ogg + default_wood_footstep.2.ogg + default_dirt_footstep.1.ogg + default_dirt_footstep.2.ogg + default_glass_footstep.ogg + +Gambit (WTFPL): + default_bronze_ingot.png + default_copper_ingot.png + default_copper_lump.png + default_iron_lump.png + default_gold_lump.png + default_clay_lump.png + default_coal.png + default_grass_*.png + default_paper.png diff --git a/mods/default/aliases.lua b/mods/default/aliases.lua new file mode 100644 index 0000000..7247751 --- /dev/null +++ b/mods/default/aliases.lua @@ -0,0 +1,72 @@ +-- mods/default/aliases.lua + +-- Aliases to support loading worlds using nodes following the old naming convention +-- These can also be helpful when using chat commands, for example /giveme +minetest.register_alias("stone", "default:stone") +minetest.register_alias("stone_with_coal", "default:stone_with_coal") +minetest.register_alias("stone_with_iron", "default:stone_with_iron") +minetest.register_alias("dirt_with_grass", "default:dirt_with_grass") +minetest.register_alias("dirt_with_grass_footsteps", "default:dirt_with_grass_footsteps") +minetest.register_alias("dirt", "default:dirt") +minetest.register_alias("sand", "default:sand") +minetest.register_alias("gravel", "default:gravel") +minetest.register_alias("sandstone", "default:sandstone") +minetest.register_alias("clay", "default:clay") +minetest.register_alias("brick", "default:brick") +minetest.register_alias("tree", "default:tree") +minetest.register_alias("jungletree", "default:jungletree") +minetest.register_alias("junglegrass", "default:junglegrass") +minetest.register_alias("leaves", "default:leaves") +minetest.register_alias("cactus", "default:cactus") +minetest.register_alias("papyrus", "default:papyrus") +minetest.register_alias("bookshelf", "default:bookshelf") +minetest.register_alias("glass", "default:glass") +minetest.register_alias("wooden_fence", "default:fence_wood") +minetest.register_alias("rail", "default:rail") +minetest.register_alias("ladder", "default:ladder") +minetest.register_alias("wood", "default:wood") +minetest.register_alias("mese", "default:mese") +minetest.register_alias("cloud", "default:cloud") +minetest.register_alias("water_flowing", "default:water_flowing") +minetest.register_alias("water_source", "default:water_source") +minetest.register_alias("lava_flowing", "default:lava_flowing") +minetest.register_alias("lava_source", "default:lava_source") +minetest.register_alias("torch", "default:torch") +minetest.register_alias("sign_wall", "default:sign_wall") +minetest.register_alias("furnace", "default:furnace") +minetest.register_alias("chest", "default:chest") +minetest.register_alias("locked_chest", "default:chest_locked") +minetest.register_alias("cobble", "default:cobble") +minetest.register_alias("mossycobble", "default:mossycobble") +minetest.register_alias("steelblock", "default:steelblock") +minetest.register_alias("nyancat", "default:nyancat") +minetest.register_alias("nyancat_rainbow", "default:nyancat_rainbow") +minetest.register_alias("sapling", "default:sapling") +minetest.register_alias("apple", "default:apple") + +minetest.register_alias("WPick", "default:pick_wood") +minetest.register_alias("STPick", "default:pick_stone") +minetest.register_alias("SteelPick", "default:pick_steel") +minetest.register_alias("MesePick", "default:pick_mese") +minetest.register_alias("WShovel", "default:shovel_wood") +minetest.register_alias("STShovel", "default:shovel_stone") +minetest.register_alias("SteelShovel", "default:shovel_steel") +minetest.register_alias("WAxe", "default:axe_wood") +minetest.register_alias("STAxe", "default:axe_stone") +minetest.register_alias("SteelAxe", "default:axe_steel") +minetest.register_alias("WSword", "default:sword_wood") +minetest.register_alias("STSword", "default:sword_stone") +minetest.register_alias("SteelSword", "default:sword_steel") + +minetest.register_alias("Stick", "default:stick") +minetest.register_alias("paper", "default:paper") +minetest.register_alias("book", "default:book") +minetest.register_alias("lump_of_coal", "default:coal_lump") +minetest.register_alias("lump_of_iron", "default:iron_lump") +minetest.register_alias("lump_of_clay", "default:clay_lump") +minetest.register_alias("steel_ingot", "default:steel_ingot") +minetest.register_alias("clay_brick", "default:clay_brick") +minetest.register_alias("snow", "default:snow") + +-- Mese now comes in the form of blocks, ore, crystal and fragments +minetest.register_alias("default:mese", "default:mese_block") diff --git a/mods/default/crafting.lua b/mods/default/crafting.lua new file mode 100644 index 0000000..354efa4 --- /dev/null +++ b/mods/default/crafting.lua @@ -0,0 +1,838 @@ +-- mods/default/crafting.lua + +minetest.register_craft({ + output = 'default:wood 4', + recipe = { + {'default:tree'}, + } +}) + +minetest.register_craft({ + output = 'default:junglewood 4', + recipe = { + {'default:jungletree'}, + } +}) + +minetest.register_craft({ + output = 'default:pinewood 4', + recipe = { + {'default:pinetree'}, + } +}) + +minetest.register_craft({ + output = 'default:stick 4', + recipe = { + {'group:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:fence_wood 2', + recipe = { + {'group:stick', 'group:stick', 'group:stick'}, + {'group:stick', 'group:stick', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sign_wall', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:torch 4', + recipe = { + {'default:coal_lump'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:pick_wood', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_stone', + recipe = { + {'group:stone', 'group:stone', 'group:stone'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_steel', + recipe = { + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_bronze', + recipe = { + {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_mese', + recipe = { + {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:pick_diamond', + recipe = { + {'default:diamond', 'default:diamond', 'default:diamond'}, + {'', 'group:stick', ''}, + {'', 'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_wood', + recipe = { + {'group:wood'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_stone', + recipe = { + {'group:stone'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_steel', + recipe = { + {'default:steel_ingot'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_bronze', + recipe = { + {'default:bronze_ingot'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_mese', + recipe = { + {'default:mese_crystal'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:shovel_diamond', + recipe = { + {'default:diamond'}, + {'group:stick'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_wood', + recipe = { + {'group:wood', 'group:wood'}, + {'group:wood', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_stone', + recipe = { + {'group:stone', 'group:stone'}, + {'group:stone', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_steel', + recipe = { + {'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_bronze', + recipe = { + {'default:bronze_ingot', 'default:bronze_ingot'}, + {'default:bronze_ingot', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_mese', + recipe = { + {'default:mese_crystal', 'default:mese_crystal'}, + {'default:mese_crystal', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_diamond', + recipe = { + {'default:diamond', 'default:diamond'}, + {'default:diamond', 'group:stick'}, + {'', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:axe_wood', + recipe = { + {'group:wood', 'group:wood'}, + {'group:stick', 'group:wood'}, + {'group:stick',''}, + } +}) + +minetest.register_craft({ + output = 'default:axe_stone', + recipe = { + {'group:stone', 'group:stone'}, + {'group:stick', 'group:stone'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:axe_steel', + recipe = { + {'default:steel_ingot', 'default:steel_ingot'}, + {'group:stick', 'default:steel_ingot'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:axe_bronze', + recipe = { + {'default:bronze_ingot', 'default:bronze_ingot'}, + {'group:stick', 'default:bronze_ingot'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:axe_mese', + recipe = { + {'default:mese_crystal', 'default:mese_crystal'}, + {'group:stick', 'default:mese_crystal'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:axe_diamond', + recipe = { + {'default:diamond', 'default:diamond'}, + {'group:stick', 'default:diamond'}, + {'group:stick', ''}, + } +}) + +minetest.register_craft({ + output = 'default:sword_wood', + recipe = { + {'group:wood'}, + {'group:wood'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_stone', + recipe = { + {'group:stone'}, + {'group:stone'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_steel', + recipe = { + {'default:steel_ingot'}, + {'default:steel_ingot'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_bronze', + recipe = { + {'default:bronze_ingot'}, + {'default:bronze_ingot'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_mese', + recipe = { + {'default:mese_crystal'}, + {'default:mese_crystal'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:sword_diamond', + recipe = { + {'default:diamond'}, + {'default:diamond'}, + {'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:rail 24', + recipe = { + {'default:steel_ingot', '', 'default:steel_ingot'}, + {'default:steel_ingot', 'group:stick', 'default:steel_ingot'}, + {'default:steel_ingot', '', 'default:steel_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:chest', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', '', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:chest_locked', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'default:steel_ingot', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:furnace', + recipe = { + {'group:stone', 'group:stone', 'group:stone'}, + {'group:stone', '', 'group:stone'}, + {'group:stone', 'group:stone', 'group:stone'}, + } +}) + +minetest.register_craft({ + type = "shapeless", + output = "default:bronze_ingot", + recipe = {"default:steel_ingot", "default:copper_ingot"}, +}) + +minetest.register_craft({ + output = 'default:coalblock', + recipe = { + {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'}, + {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'}, + {'default:coal_lump', 'default:coal_lump', 'default:coal_lump'}, + } +}) + +minetest.register_craft({ + output = 'default:coal_lump 9', + recipe = { + {'default:coalblock'}, + } +}) + +minetest.register_craft({ + output = 'default:steelblock', + recipe = { + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:steel_ingot 9', + recipe = { + {'default:steelblock'}, + } +}) + +minetest.register_craft({ + output = 'default:copperblock', + recipe = { + {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, + {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, + {'default:copper_ingot', 'default:copper_ingot', 'default:copper_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:copper_ingot 9', + recipe = { + {'default:copperblock'}, + } +}) + +minetest.register_craft({ + output = 'default:bronzeblock', + recipe = { + {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'}, + {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'}, + {'default:bronze_ingot', 'default:bronze_ingot', 'default:bronze_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:bronze_ingot 9', + recipe = { + {'default:bronzeblock'}, + } +}) + +minetest.register_craft({ + output = 'default:goldblock', + recipe = { + {'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'}, + {'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'}, + {'default:gold_ingot', 'default:gold_ingot', 'default:gold_ingot'}, + } +}) + +minetest.register_craft({ + output = 'default:gold_ingot 9', + recipe = { + {'default:goldblock'}, + } +}) + +minetest.register_craft({ + output = 'default:diamondblock', + recipe = { + {'default:diamond', 'default:diamond', 'default:diamond'}, + {'default:diamond', 'default:diamond', 'default:diamond'}, + {'default:diamond', 'default:diamond', 'default:diamond'}, + } +}) + +minetest.register_craft({ + output = 'default:diamond 9', + recipe = { + {'default:diamondblock'}, + } +}) + +minetest.register_craft({ + output = 'default:sandstone', + recipe = { + {'group:sand', 'group:sand'}, + {'group:sand', 'group:sand'}, + } +}) + +minetest.register_craft({ + output = 'default:sand 4', + recipe = { + {'default:sandstone'}, + } +}) + +minetest.register_craft({ + output = 'default:sandstonebrick 4', + recipe = { + {'default:sandstone', 'default:sandstone'}, + {'default:sandstone', 'default:sandstone'}, + } +}) + +minetest.register_craft({ + output = 'default:clay', + recipe = { + {'default:clay_lump', 'default:clay_lump'}, + {'default:clay_lump', 'default:clay_lump'}, + } +}) + +minetest.register_craft({ + output = 'default:brick', + recipe = { + {'default:clay_brick', 'default:clay_brick'}, + {'default:clay_brick', 'default:clay_brick'}, + } +}) + +minetest.register_craft({ + output = 'default:clay_brick 4', + recipe = { + {'default:brick'}, + } +}) + +minetest.register_craft({ + output = 'default:paper', + recipe = { + {'default:papyrus', 'default:papyrus', 'default:papyrus'}, + } +}) + +minetest.register_craft({ + output = 'default:book', + recipe = { + {'default:paper'}, + {'default:paper'}, + {'default:paper'}, + } +}) + +minetest.register_craft({ + output = 'default:bookshelf', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'default:book', 'default:book', 'default:book'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +minetest.register_craft({ + output = 'default:ladder', + recipe = { + {'group:stick', '', 'group:stick'}, + {'group:stick', 'group:stick', 'group:stick'}, + {'group:stick', '', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'default:mese', + recipe = { + {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'}, + {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'}, + {'default:mese_crystal', 'default:mese_crystal', 'default:mese_crystal'}, + } +}) + +minetest.register_craft({ + output = 'default:mese_crystal 9', + recipe = { + {'default:mese'}, + } +}) + +minetest.register_craft({ + output = 'default:mese_crystal_fragment 9', + recipe = { + {'default:mese_crystal'}, + } +}) + +minetest.register_craft({ + output = 'default:meselamp 1', + recipe = { + {'', 'default:mese_crystal',''}, + {'default:mese_crystal', 'default:glass', 'default:mese_crystal'}, + } +}) + +minetest.register_craft({ + output = 'default:obsidian_shard 9', + recipe = { + {'default:obsidian'} + } +}) + +minetest.register_craft({ + output = 'default:obsidian', + recipe = { + {'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'}, + {'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'}, + {'default:obsidian_shard', 'default:obsidian_shard', 'default:obsidian_shard'}, + } +}) + +minetest.register_craft({ + output = 'default:obsidianbrick 4', + recipe = { + {'default:obsidian', 'default:obsidian'}, + {'default:obsidian', 'default:obsidian'} + } +}) + +minetest.register_craft({ + output = 'default:stonebrick 4', + recipe = { + {'default:stone', 'default:stone'}, + {'default:stone', 'default:stone'}, + } +}) + +minetest.register_craft({ + output = 'default:desert_stonebrick 4', + recipe = { + {'default:desert_stone', 'default:desert_stone'}, + {'default:desert_stone', 'default:desert_stone'}, + } +}) + +minetest.register_craft({ + output = 'default:snowblock', + recipe = { + {'default:snow', 'default:snow', 'default:snow'}, + {'default:snow', 'default:snow', 'default:snow'}, + {'default:snow', 'default:snow', 'default:snow'}, + } +}) + +minetest.register_craft({ + output = 'default:snow 9', + recipe = { + {'default:snowblock'}, + } +}) + +-- +-- Crafting (tool repair) +-- +minetest.register_craft({ + type = "toolrepair", + additional_wear = -0.02, +}) + +-- +-- Cooking recipes +-- + +minetest.register_craft({ + type = "cooking", + output = "default:glass", + recipe = "group:sand", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:obsidian_glass", + recipe = "default:obsidian_shard", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:stone", + recipe = "default:cobble", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:stone", + recipe = "default:mossycobble", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:desert_stone", + recipe = "default:desert_cobble", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:steel_ingot", + recipe = "default:iron_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:copper_ingot", + recipe = "default:copper_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:gold_ingot", + recipe = "default:gold_lump", +}) + +minetest.register_craft({ + type = "cooking", + output = "default:clay_brick", + recipe = "default:clay_lump", +}) + +-- +-- Fuels +-- + +minetest.register_craft({ + type = "fuel", + recipe = "group:tree", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:junglegrass", + burntime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "group:leaves", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:cactus", + burntime = 15, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:papyrus", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:bookshelf", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:fence_wood", + burntime = 15, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:ladder", + burntime = 5, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "group:wood", + burntime = 7, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:lava_source", + burntime = 60, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:torch", + burntime = 4, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:sign_wall", + burntime = 10, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:chest_locked", + burntime = 30, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:nyancat", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:nyancat_rainbow", + burntime = 1, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:sapling", + burntime = 10, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:apple", + burntime = 3, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:coal_lump", + burntime = 40, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:coalblock", + burntime = 370, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:junglesapling", + burntime = 10, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:grass_1", + burntime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "default:pine_sapling", + burntime = 10, +}) + diff --git a/mods/default/craftitems.lua b/mods/default/craftitems.lua new file mode 100644 index 0000000..e095b22 --- /dev/null +++ b/mods/default/craftitems.lua @@ -0,0 +1,159 @@ +-- mods/default/craftitems.lua + +minetest.register_craftitem("default:stick", { + description = "Stick", + inventory_image = "default_stick.png", + groups = {stick=1, kindling=1}, +}) + +minetest.register_craftitem("default:paper", { + description = "Paper", + inventory_image = "default_paper.png", +}) + +local function book_on_use(itemstack, user, pointed_thing) + local player_name = user:get_player_name() + local data = minetest.deserialize(itemstack:get_metadata()) + local title, text, owner = "", "", player_name + if data then + title, text, owner = data.title, data.text, data.owner + end + local formspec + if owner == player_name then + formspec = "size[8,8]"..default.gui_bg.. + "field[0.5,1;7.5,0;title;Title:;".. + minetest.formspec_escape(title).."]".. + "textarea[0.5,1.5;7.5,7;text;Contents:;".. + minetest.formspec_escape(text).."]".. + "button_exit[2.5,7.5;3,1;save;Save]" + else + formspec = "size[8,8]"..default.gui_bg.. + "label[0.5,0.5;by "..owner.."]".. + "label[0.5,0;"..minetest.formspec_escape(title).."]".. + "textarea[0.5,1.5;7.5,7;;"..minetest.formspec_escape(text)..";]" + end + minetest.show_formspec(user:get_player_name(), "default:book", formspec) +end + +minetest.register_on_player_receive_fields(function(player, form_name, fields) + if form_name ~= "default:book" or not fields.save or + fields.title == "" or fields.text == "" then + return + end + local inv = player:get_inventory() + local stack = player:get_wielded_item() + local new_stack, data + if stack:get_name() ~= "default:book_written" then + local count = stack:get_count() + if count == 1 then + stack:set_name("default:book_written") + else + stack:set_count(count - 1) + new_stack = ItemStack("default:book_written") + end + else + data = minetest.deserialize(stack:get_metadata()) + end + if not data then data = {} end + data.title = fields.title + data.text = fields.text + data.owner = player:get_player_name() + local data_str = minetest.serialize(data) + if new_stack then + new_stack:set_metadata(data_str) + if inv:room_for_item("main", new_stack) then + inv:add_item("main", new_stack) + else + minetest.add_item(player:getpos(), new_stack) + end + else + stack:set_metadata(data_str) + end + player:set_wielded_item(stack) +end) + +minetest.register_craftitem("default:book", { + description = "Book", + inventory_image = "default_book.png", + groups = {book=1}, + on_use = book_on_use, +}) + +minetest.register_craftitem("default:book_written", { + description = "Book With Text", + inventory_image = "default_book.png", + groups = {book=1, not_in_creative_inventory=1}, + stack_max = 1, + on_use = book_on_use, +}) + +minetest.register_craftitem("default:coal_lump", { + description = "Coal Lump", + inventory_image = "default_coal_lump.png", + groups = {coal = 1} +}) + +minetest.register_craftitem("default:iron_lump", { + description = "Iron Lump", + inventory_image = "default_iron_lump.png", +}) + +minetest.register_craftitem("default:copper_lump", { + description = "Copper Lump", + inventory_image = "default_copper_lump.png", +}) + +minetest.register_craftitem("default:mese_crystal", { + description = "Mese Crystal", + inventory_image = "default_mese_crystal.png", +}) + +minetest.register_craftitem("default:gold_lump", { + description = "Gold Lump", + inventory_image = "default_gold_lump.png", +}) + +minetest.register_craftitem("default:diamond", { + description = "Diamond", + inventory_image = "default_diamond.png", +}) + +minetest.register_craftitem("default:clay_lump", { + description = "Clay Lump", + inventory_image = "default_clay_lump.png", +}) + +minetest.register_craftitem("default:steel_ingot", { + description = "Steel Ingot", + inventory_image = "default_steel_ingot.png", +}) + +minetest.register_craftitem("default:copper_ingot", { + description = "Copper Ingot", + inventory_image = "default_copper_ingot.png", +}) + +minetest.register_craftitem("default:bronze_ingot", { + description = "Bronze Ingot", + inventory_image = "default_bronze_ingot.png", +}) + +minetest.register_craftitem("default:gold_ingot", { + description = "Gold Ingot", + inventory_image = "default_gold_ingot.png" +}) + +minetest.register_craftitem("default:mese_crystal_fragment", { + description = "Mese Crystal Fragment", + inventory_image = "default_mese_crystal_fragment.png", +}) + +minetest.register_craftitem("default:clay_brick", { + description = "Clay Brick", + inventory_image = "default_clay_brick.png", +}) + +minetest.register_craftitem("default:obsidian_shard", { + description = "Obsidian Shard", + inventory_image = "default_obsidian_shard.png", +}) diff --git a/mods/default/functions.lua b/mods/default/functions.lua new file mode 100644 index 0000000..81d909d --- /dev/null +++ b/mods/default/functions.lua @@ -0,0 +1,325 @@ +-- mods/default/functions.lua + +-- +-- Sounds +-- + +function default.node_sound_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "", gain = 1.0} + table.dug = table.dug or + {name = "default_dug_node", gain = 0.25} + table.place = table.place or + {name = "default_place_node_hard", gain = 1.0} + return table +end + +function default.node_sound_stone_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_hard_footstep", gain = 0.5} + table.dug = table.dug or + {name = "default_hard_footstep", gain = 1.0} + default.node_sound_defaults(table) + return table +end + +function default.node_sound_dirt_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_dirt_footstep", gain = 1.0} + table.dug = table.dug or + {name = "default_dirt_footstep", gain = 1.5} + table.place = table.place or + {name = "default_place_node", gain = 1.0} + default.node_sound_defaults(table) + return table +end + +function default.node_sound_sand_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_sand_footstep", gain = 0.2} + table.dug = table.dug or + {name = "default_sand_footstep", gain = 0.4} + table.place = table.place or + {name = "default_place_node", gain = 1.0} + default.node_sound_defaults(table) + return table +end + +function default.node_sound_wood_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_wood_footstep", gain = 0.5} + table.dug = table.dug or + {name = "default_wood_footstep", gain = 1.0} + default.node_sound_defaults(table) + return table +end + +function default.node_sound_leaves_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_grass_footstep", gain = 0.35} + table.dug = table.dug or + {name = "default_grass_footstep", gain = 0.7} + table.dig = table.dig or + {name = "default_dig_crumbly", gain = 0.4} + table.place = table.place or + {name = "default_place_node", gain = 1.0} + default.node_sound_defaults(table) + return table +end + +function default.node_sound_glass_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_glass_footstep", gain = 0.5} + table.dug = table.dug or + {name = "default_break_glass", gain = 1.0} + default.node_sound_defaults(table) + return table +end + + +-- +-- Lavacooling +-- + +default.cool_lava_source = function(pos) + minetest.set_node(pos, {name = "default:obsidian"}) + minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25}) +end + +default.cool_lava_flowing = function(pos) + minetest.set_node(pos, {name = "default:stone"}) + minetest.sound_play("default_cool_lava", {pos = pos, gain = 0.25}) +end + +minetest.register_abm({ + nodenames = {"default:lava_flowing"}, + neighbors = {"group:water"}, + interval = 1, + chance = 1, + action = function(...) + default.cool_lava_flowing(...) + end, +}) + +minetest.register_abm({ + nodenames = {"default:lava_source"}, + neighbors = {"group:water"}, + interval = 1, + chance = 1, + action = function(...) + default.cool_lava_source(...) + end, +}) + + +-- +-- Papyrus and cactus growing +-- + +-- wrapping the functions in abm action is necessary to make overriding them possible + +function default.grow_cactus(pos, node) + if node.param2 >= 4 then + return + end + pos.y = pos.y - 1 + if minetest.get_item_group(minetest.get_node(pos).name, "sand") == 0 then + return + end + pos.y = pos.y + 1 + local height = 0 + while node.name == "default:cactus" and height < 4 do + height = height + 1 + pos.y = pos.y + 1 + node = minetest.get_node(pos) + end + if height == 4 or node.name ~= "air" then + return + end + minetest.set_node(pos, {name = "default:cactus"}) + return true +end + +function default.grow_papyrus(pos, node) + pos.y = pos.y - 1 + local name = minetest.get_node(pos).name + if name ~= "default:dirt_with_grass" and name ~= "default:dirt" then + return + end + if not minetest.find_node_near(pos, 3, {"group:water"}) then + return + end + pos.y = pos.y + 1 + local height = 0 + while node.name == "default:papyrus" and height < 4 do + height = height + 1 + pos.y = pos.y + 1 + node = minetest.get_node(pos) + end + if height == 4 or node.name ~= "air" then + return + end + minetest.set_node(pos, {name = "default:papyrus"}) + return true +end + +minetest.register_abm({ + nodenames = {"default:cactus"}, + neighbors = {"group:sand"}, + interval = 50, + chance = 20, + action = function(...) + default.grow_cactus(...) + end +}) + +minetest.register_abm({ + nodenames = {"default:papyrus"}, + neighbors = {"default:dirt", "default:dirt_with_grass"}, + interval = 50, + chance = 20, + action = function(...) + default.grow_papyrus(...) + end +}) + + +-- +-- dig upwards +-- + +function default.dig_up(pos, node, digger) + if digger == nil then return end + local np = {x = pos.x, y = pos.y + 1, z = pos.z} + local nn = minetest.get_node(np) + if nn.name == node.name then + minetest.node_dig(np, nn, digger) + end +end + + +-- +-- Leafdecay +-- + +default.leafdecay_trunk_cache = {} +default.leafdecay_enable_cache = true +-- Spread the load of finding trunks +default.leafdecay_trunk_find_allow_accumulator = 0 + +minetest.register_globalstep(function(dtime) + local finds_per_second = 5000 + default.leafdecay_trunk_find_allow_accumulator = + math.floor(dtime * finds_per_second) +end) + +default.after_place_leaves = function(pos, placer, itemstack, pointed_thing) + local node = minetest.get_node(pos) + node.param2 = 1 + minetest.set_node(pos, node) +end + +minetest.register_abm({ + nodenames = {"group:leafdecay"}, + neighbors = {"air", "group:liquid"}, + -- A low interval and a high inverse chance spreads the load + interval = 2, + chance = 5, + + action = function(p0, node, _, _) + --print("leafdecay ABM at "..p0.x..", "..p0.y..", "..p0.z..")") + local do_preserve = false + local d = minetest.registered_nodes[node.name].groups.leafdecay + if not d or d == 0 then + --print("not groups.leafdecay") + return + end + local n0 = minetest.get_node(p0) + if n0.param2 ~= 0 then + --print("param2 ~= 0") + return + end + local p0_hash = nil + if default.leafdecay_enable_cache then + p0_hash = minetest.hash_node_position(p0) + local trunkp = default.leafdecay_trunk_cache[p0_hash] + if trunkp then + local n = minetest.get_node(trunkp) + local reg = minetest.registered_nodes[n.name] + -- Assume ignore is a trunk, to make the thing + -- work at the border of the active area + if n.name == "ignore" or (reg and reg.groups.tree and + reg.groups.tree ~= 0) then + --print("cached trunk still exists") + return + end + --print("cached trunk is invalid") + -- Cache is invalid + table.remove(default.leafdecay_trunk_cache, p0_hash) + end + end + if default.leafdecay_trunk_find_allow_accumulator <= 0 then + return + end + default.leafdecay_trunk_find_allow_accumulator = + default.leafdecay_trunk_find_allow_accumulator - 1 + -- Assume ignore is a trunk, to make the thing + -- work at the border of the active area + local p1 = minetest.find_node_near(p0, d, {"ignore", "group:tree"}) + if p1 then + do_preserve = true + if default.leafdecay_enable_cache then + --print("caching trunk") + -- Cache the trunk + default.leafdecay_trunk_cache[p0_hash] = p1 + end + end + if not do_preserve then + -- Drop stuff other than the node itself + local itemstacks = minetest.get_node_drops(n0.name) + for _, itemname in ipairs(itemstacks) do + if minetest.get_item_group(n0.name, "leafdecay_drop") ~= 0 or + itemname ~= n0.name then + local p_drop = { + x = p0.x - 0.5 + math.random(), + y = p0.y - 0.5 + math.random(), + z = p0.z - 0.5 + math.random(), + } + minetest.add_item(p_drop, itemname) + end + end + -- Remove node + minetest.remove_node(p0) + nodeupdate(p0) + end + end +}) + + +-- +-- Grass murdering ;) +-- + +minetest.register_abm({ + nodenames = {"default:dirt_with_grass"}, + interval = 2, + chance = 20, + action = function(pos, node) + local above = {x = pos.x, y = pos.y + 1, z = pos.z} + local name = minetest.get_node(above).name + local nodedef = minetest.registered_nodes[name] + if name ~= "ignore" and nodedef and not ((nodedef.sunlight_propagates or + nodedef.paramtype == "light") and + nodedef.liquidtype == "none") then + minetest.set_node(pos, {name = "default:dirt"}) + end + end +}) + diff --git a/mods/default/furnace.lua b/mods/default/furnace.lua new file mode 100644 index 0000000..5a04fa8 --- /dev/null +++ b/mods/default/furnace.lua @@ -0,0 +1,284 @@ + +-- +-- Formspecs +-- + +local function active_formspec(fuel_percent, item_percent) + local formspec = + "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_name;src;2.75,0.5;1,1;]".. + "list[current_name;fuel;2.75,2.5;1,1;]".. + "image[2.75,1.5;1,1;default_furnace_fire_bg.png^[lowpart:".. + (100-fuel_percent)..":default_furnace_fire_fg.png]".. + "image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[lowpart:".. + (item_percent)..":gui_furnace_arrow_fg.png^[transformR270]".. + "list[current_name;dst;4.75,0.96;2,2;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + default.get_hotbar_bg(0, 4.25) + return formspec +end + +local inactive_formspec = + "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_name;src;2.75,0.5;1,1;]".. + "list[current_name;fuel;2.75,2.5;1,1;]".. + "image[2.75,1.5;1,1;default_furnace_fire_bg.png]".. + "image[3.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]".. + "list[current_name;dst;4.75,0.96;2,2;]".. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + default.get_hotbar_bg(0, 4.25) + +-- +-- Node callback functions that are the same for active and inactive furnace +-- + +local function can_dig(pos, player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("fuel") and inv:is_empty("dst") and inv:is_empty("src") +end + +local function allow_metadata_inventory_put(pos, listname, index, stack, player) + if minetest.is_protected(pos, player:get_player_name()) then + return 0 + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + if listname == "fuel" then + if minetest.get_craft_result({method="fuel", width=1, items={stack}}).time ~= 0 then + if inv:is_empty("src") then + meta:set_string("infotext", "Furnace is empty") + end + return stack:get_count() + else + return 0 + end + elseif listname == "src" then + return stack:get_count() + elseif listname == "dst" then + return 0 + end +end + +local function allow_metadata_inventory_move(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + return allow_metadata_inventory_put(pos, to_list, to_index, stack, player) +end + +local function allow_metadata_inventory_take(pos, listname, index, stack, player) + if minetest.is_protected(pos, player:get_player_name()) then + return 0 + end + return stack:get_count() +end + +-- +-- Node definitions +-- + +minetest.register_node("default:furnace", { + description = "Furnace", + tiles = { + "default_furnace_top.png", "default_furnace_bottom.png", + "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", "default_furnace_front.png" + }, + paramtype2 = "facedir", + groups = {cracky=2}, + legacy_facedir_simple = true, + is_ground_content = false, + drop = "default:cobble 3", + sounds = default.node_sound_stone_defaults(), + + can_dig = can_dig, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, +}) + +minetest.register_node("default:furnace_active", { + description = "Furnace", + tiles = { + "default_furnace_top.png", "default_furnace_bottom.png", + "default_furnace_side.png", "default_furnace_side.png", + "default_furnace_side.png", + { + image = "default_furnace_front_active.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 1.5 + }, + } + }, + paramtype2 = "facedir", + light_source = 8, + drop = "default:cobble 3", + groups = {cracky=2, not_in_creative_inventory=1}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), + + can_dig = can_dig, + + allow_metadata_inventory_put = allow_metadata_inventory_put, + allow_metadata_inventory_move = allow_metadata_inventory_move, + allow_metadata_inventory_take = allow_metadata_inventory_take, +}) + +-- +-- ABM +-- + +local function swap_node(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + return + end + node.name = name + minetest.swap_node(pos, node) +end + +minetest.register_abm({ + nodenames = {"default:furnace", "default:furnace_active"}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + -- + -- Inizialize metadata + -- + local meta = minetest.get_meta(pos) + local fuel_time = meta:get_float("fuel_time") or 0 + local src_time = meta:get_float("src_time") or 0 + local fuel_totaltime = meta:get_float("fuel_totaltime") or 0 + + -- + -- Inizialize inventory + -- + local inv = meta:get_inventory() + for listname, size in pairs({ + src = 1, + fuel = 1, + dst = 4, + }) do + if inv:get_size(listname) ~= size then + inv:set_size(listname, size) + end + end + local srclist = inv:get_list("src") + local fuellist = inv:get_list("fuel") + local dstlist = inv:get_list("dst") + + -- + -- Cooking + -- + + -- Check if we have cookable content + local cooked, aftercooked = minetest.get_craft_result({method = "cooking", width = 1, items = srclist}) + local cookable = true + + if cooked.time == 0 then + cookable = false + end + + -- Check if we have enough fuel to burn + if fuel_time < fuel_totaltime then + -- The furnace is currently active and has enough fuel + fuel_time = fuel_time + 1 + + -- If there is a cookable item then check if it is ready yet + if cookable then + src_time = src_time + 1 + if src_time >= cooked.time then + -- Place result in dst list if possible + if inv:room_for_item("dst", cooked.item) then + inv:add_item("dst", cooked.item) + inv:set_stack("src", 1, aftercooked.items[1]) + src_time = 0 + end + end + end + else + -- Furnace ran out of fuel + if cookable then + -- We need to get new fuel + local fuel, afterfuel = minetest.get_craft_result({method = "fuel", width = 1, items = fuellist}) + + if fuel.time == 0 then + -- No valid fuel in fuel list + fuel_totaltime = 0 + fuel_time = 0 + src_time = 0 + else + -- Take fuel from fuel list + inv:set_stack("fuel", 1, afterfuel.items[1]) + + fuel_totaltime = fuel.time + fuel_time = 0 + + end + else + -- We don't need to get new fuel since there is no cookable item + fuel_totaltime = 0 + fuel_time = 0 + src_time = 0 + end + end + + -- + -- Update formspec, infotext and node + -- + local formspec = inactive_formspec + local item_state = "" + local item_percent = 0 + if cookable then + item_percent = math.floor(src_time / cooked.time * 100) + item_state = item_percent .. "%" + else + if srclist[1]:is_empty() then + item_state = "Empty" + else + item_state = "Not cookable" + end + end + + local fuel_state = "Empty" + local active = "inactive " + if fuel_time <= fuel_totaltime and fuel_totaltime ~= 0 then + active = "active " + local fuel_percent = math.floor(fuel_time / fuel_totaltime * 100) + fuel_state = fuel_percent .. "%" + formspec = active_formspec(fuel_percent, item_percent) + swap_node(pos, "default:furnace_active") + else + if not fuellist[1]:is_empty() then + fuel_state = "0%" + end + swap_node(pos, "default:furnace") + end + + local infotext = "Furnace " .. active .. "(Item: " .. item_state .. "; Fuel: " .. fuel_state .. ")" + + -- + -- Set meta values + -- + meta:set_float("fuel_totaltime", fuel_totaltime) + meta:set_float("fuel_time", fuel_time) + meta:set_float("src_time", src_time) + meta:set_string("formspec", formspec) + meta:set_string("infotext", infotext) + end, +}) diff --git a/mods/default/init.lua b/mods/default/init.lua new file mode 100644 index 0000000..3f0efea --- /dev/null +++ b/mods/default/init.lua @@ -0,0 +1,46 @@ +-- Minetest 0.4 mod: default +-- See README.txt for licensing and other information. + +-- The API documentation in here was moved into game_api.txt + +-- Definitions made by this mod that other mods can use too +default = {} + +default.LIGHT_MAX = 14 + +-- GUI related stuff +default.gui_bg = "bgcolor[#080808BB;true]" +default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]" +default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]" + +function default.get_hotbar_bg(x,y) + local out = "" + for i=0,7,1 do + out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]" + end + return out +end + +default.gui_survival_form = "size[8,8.5]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_player;main;0,4.25;8,1;]".. + "list[current_player;main;0,5.5;8,3;8]".. + "list[current_player;craft;1.75,0.5;3,3;]".. + "list[current_player;craftpreview;5.75,1.5;1,1;]".. + "image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]".. + default.get_hotbar_bg(0,4.25) + +-- Load files +dofile(minetest.get_modpath("default").."/functions.lua") +dofile(minetest.get_modpath("default").."/nodes.lua") +dofile(minetest.get_modpath("default").."/furnace.lua") +dofile(minetest.get_modpath("default").."/tools.lua") +dofile(minetest.get_modpath("default").."/craftitems.lua") +dofile(minetest.get_modpath("default").."/crafting.lua") +dofile(minetest.get_modpath("default").."/mapgen.lua") +dofile(minetest.get_modpath("default").."/player.lua") +dofile(minetest.get_modpath("default").."/trees.lua") +dofile(minetest.get_modpath("default").."/aliases.lua") +dofile(minetest.get_modpath("default").."/legacy.lua") diff --git a/mods/default/legacy.lua b/mods/default/legacy.lua new file mode 100644 index 0000000..76fcc8e --- /dev/null +++ b/mods/default/legacy.lua @@ -0,0 +1,25 @@ +-- mods/default/legacy.lua + +-- Horrible crap to support old code registering falling nodes +-- Don't use this and never do what this does, it's completely wrong! +-- (More specifically, the client and the C++ code doesn't get the group) +function default.register_falling_node(nodename, texture) + minetest.log("error", debug.traceback()) + minetest.log('error', "WARNING: default.register_falling_node is deprecated") + if minetest.registered_nodes[nodename] then + minetest.registered_nodes[nodename].groups.falling_node = 1 + end +end + +function default.spawn_falling_node(p, nodename) + spawn_falling_node(p, nodename) +end + +-- Liquids +WATER_ALPHA = minetest.registered_nodes["default:water_source"].alpha +WATER_VISC = minetest.registered_nodes["default:water_source"].liquid_viscosity +LAVA_VISC = minetest.registered_nodes["default:lava_source"].liquid_viscosity +LIGHT_MAX = default.LIGHT_MAX + +-- Formspecs +default.gui_suvival_form = default.gui_survival_form diff --git a/mods/default/mapgen.lua b/mods/default/mapgen.lua new file mode 100644 index 0000000..378614e --- /dev/null +++ b/mods/default/mapgen.lua @@ -0,0 +1,711 @@ +-- +-- Aliases for map generator outputs +-- + + +minetest.register_alias("mapgen_stone", "default:stone") +minetest.register_alias("mapgen_dirt", "default:dirt") +minetest.register_alias("mapgen_dirt_with_grass", "default:dirt_with_grass") +minetest.register_alias("mapgen_sand", "default:sand") +minetest.register_alias("mapgen_water_source", "default:water_source") +minetest.register_alias("mapgen_river_water_source", "default:river_water_source") +minetest.register_alias("mapgen_lava_source", "default:lava_source") +minetest.register_alias("mapgen_gravel", "default:gravel") +minetest.register_alias("mapgen_desert_stone", "default:desert_stone") +minetest.register_alias("mapgen_desert_sand", "default:desert_sand") +minetest.register_alias("mapgen_dirt_with_snow", "default:dirt_with_snow") +minetest.register_alias("mapgen_snowblock", "default:snowblock") +minetest.register_alias("mapgen_snow", "default:snow") +minetest.register_alias("mapgen_ice", "default:ice") +minetest.register_alias("mapgen_sandstone", "default:sandstone") + +minetest.register_alias("mapgen_tree", "default:tree") +minetest.register_alias("mapgen_leaves", "default:leaves") +minetest.register_alias("mapgen_apple", "default:apple") +minetest.register_alias("mapgen_jungletree", "default:jungletree") +minetest.register_alias("mapgen_jungleleaves", "default:jungleleaves") +minetest.register_alias("mapgen_junglegrass", "default:junglegrass") +minetest.register_alias("mapgen_pinetree", "default:pinetree") +minetest.register_alias("mapgen_pine_needles", "default:pine_needles") + +minetest.register_alias("mapgen_cobble", "default:cobble") +minetest.register_alias("mapgen_stair_cobble", "stairs:stair_cobble") +minetest.register_alias("mapgen_mossycobble", "default:mossycobble") +minetest.register_alias("mapgen_sandstonebrick", "default:sandstonebrick") +minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebrick") + + +-- +-- Register ores +-- + + +-- Blob ore first to avoid other ores inside blobs + +function default.register_ores() + minetest.register_ore({ + ore_type = "blob", + ore = "default:clay", + wherein = {"default:sand"}, + clust_scarcity = 24*24*24, + clust_size = 7, + y_min = -15, + y_max = 0, + noise_threshhold = 0, + noise_params = { + offset=0.35, + scale=0.2, + spread={x=5, y=5, z=5}, + seed=-316, + octaves=1, + persist=0.5 + }, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "default:sand", + wherein = {"default:stone"}, + clust_scarcity = 24*24*24, + clust_size = 7, + y_min = -63, + y_max = 4, + noise_threshhold = 0, + noise_params = { + offset=0.35, + scale=0.2, + spread={x=5, y=5, z=5}, + seed=2316, + octaves=1, + persist=0.5 + }, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "default:dirt", + wherein = {"default:stone"}, + clust_scarcity = 24*24*24, + clust_size = 7, + y_min = -63, + y_max = 31000, + noise_threshhold = 0, + noise_params = { + offset=0.35, + scale=0.2, + spread={x=5, y=5, z=5}, + seed=17676, + octaves=1, + persist=0.5 + }, + }) + + minetest.register_ore({ + ore_type = "blob", + ore = "default:gravel", + wherein = {"default:stone"}, + clust_scarcity = 24*24*24, + clust_size = 7, + y_min = -31000, + y_max = 31000, + noise_threshhold = 0, + noise_params = { + offset=0.35, + scale=0.2, + spread={x=5, y=5, z=5}, + seed=766, + octaves=1, + persist=0.5 + }, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 8*8*8, + clust_num_ores = 8, + clust_size = 3, + y_min = -31000, + y_max = 64, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_coal", + wherein = "default:stone", + clust_scarcity = 24*24*24, + clust_num_ores = 27, + clust_size = 6, + y_min = -31000, + y_max = 0, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 12*12*12, + clust_num_ores = 3, + clust_size = 2, + y_min = -15, + y_max = 2, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 9*9*9, + clust_num_ores = 5, + clust_size = 3, + y_min = -63, + y_max = -16, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 7*7*7, + clust_num_ores = 5, + clust_size = 3, + y_min = -31000, + y_max = -64, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_iron", + wherein = "default:stone", + clust_scarcity = 24*24*24, + clust_num_ores = 27, + clust_size = 6, + y_min = -31000, + y_max = -64, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 18*18*18, + clust_num_ores = 3, + clust_size = 2, + y_min = -255, + y_max = -64, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_mese", + wherein = "default:stone", + clust_scarcity = 14*14*14, + clust_num_ores = 5, + clust_size = 3, + y_min = -31000, + y_max = -256, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:mese", + wherein = "default:stone", + clust_scarcity = 36*36*36, + clust_num_ores = 3, + clust_size = 2, + y_min = -31000, + y_max = -1024, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 15*15*15, + clust_num_ores = 3, + clust_size = 2, + y_min = -255, + y_max = -64, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_gold", + wherein = "default:stone", + clust_scarcity = 13*13*13, + clust_num_ores = 5, + clust_size = 3, + y_min = -31000, + y_max = -256, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 17*17*17, + clust_num_ores = 4, + clust_size = 3, + y_min = -255, + y_max = -128, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_diamond", + wherein = "default:stone", + clust_scarcity = 15*15*15, + clust_num_ores = 4, + clust_size = 3, + y_min = -31000, + y_max = -256, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_copper", + wherein = "default:stone", + clust_scarcity = 12*12*12, + clust_num_ores = 4, + clust_size = 3, + y_min = -63, + y_max = -16, + }) + + minetest.register_ore({ + ore_type = "scatter", + ore = "default:stone_with_copper", + wherein = "default:stone", + clust_scarcity = 9*9*9, + clust_num_ores = 5, + clust_size = 3, + y_min = -31000, + y_max = -64, + }) +end + + +-- +-- Register biomes +-- + + +function default.register_biomes() + minetest.clear_registered_biomes() + + minetest.register_biome({ + name = "default:grassland", + --node_dust = "", + node_top = "default:dirt_with_grass", + depth_top = 1, + node_filler = "default:dirt", + depth_filler = 1, + --node_stone = "", + --node_water_top = "", + --depth_water_top = , + --node_water = "", + y_min = 5, + y_max = 31000, + heat_point = 50, + humidity_point = 50, + }) + + minetest.register_biome({ + name = "default:grassland_ocean", + --node_dust = "", + node_top = "default:sand", + depth_top = 1, + node_filler = "default:sand", + depth_filler = 2, + --node_stone = "", + --node_water_top = "", + --depth_water_top = , + --node_water = "", + y_min = -31000, + y_max = 4, + heat_point = 50, + humidity_point = 50, + }) +end + + +-- +-- Register mgv6 decorations +-- + + +function default.register_mgv6_decorations() + + -- Papyrus + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 8, + noise_params = { + offset = -0.3, + scale = 0.7, + spread = {x=100, y=100, z=100}, + seed = 354, + octaves = 3, + persist = 0.7 + }, + y_min = 1, + y_max = 1, + decoration = "default:papyrus", + height = 2, + height_max = 4, + spawn_by = "default:water_source", + num_spawn_by = 1, + }) + + -- Cacti + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:desert_sand"}, + sidelen = 16, + noise_params = { + offset = -0.012, + scale = 0.024, + spread = {x=100, y=100, z=100}, + seed = 230, + octaves = 3, + persist = 0.6 + }, + y_min = 1, + y_max = 30, + decoration = "default:cactus", + height = 3, + height_max = 4, + }) + + -- Grasses + + for length = 1, 5 do + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.007, + spread = {x=100, y=100, z=100}, + seed = 329, + octaves = 3, + persist = 0.6 + }, + y_min = 1, + y_max = 30, + decoration = "default:grass_"..length, + }) + end + + -- Dry shrubs + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:desert_sand", "default:dirt_with_snow"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.035, + spread = {x=100, y=100, z=100}, + seed = 329, + octaves = 3, + persist = 0.6 + }, + y_min = 1, + y_max = 30, + decoration = "default:dry_shrub", + }) +end + + +-- +-- Register decorations +-- + + +function default.register_decorations() + + -- Flowers + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.03, + spread = {x=200, y=200, z=200}, + seed = 436, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "flowers:rose", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.03, + spread = {x=200, y=200, z=200}, + seed = 19822, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = 33, + y_max = 31000, + decoration = "flowers:tulip", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.03, + spread = {x=200, y=200, z=200}, + seed = 1220999, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "flowers:dandelion_yellow", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.03, + spread = {x=200, y=200, z=200}, + seed = 36662, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "flowers:geranium", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.03, + spread = {x=200, y=200, z=200}, + seed = 1133, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "flowers:viola", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.03, + spread = {x=200, y=200, z=200}, + seed = 73133, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "flowers:dandelion_white", + }) + + -- Grasses + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0.04, + scale = 0.04, + spread = {x=200, y=200, z=200}, + seed = 66440, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "default:grass_1", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0.02, + scale = 0.06, + spread = {x=200, y=200, z=200}, + seed = 66440, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "default:grass_2", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.08, + spread = {x=200, y=200, z=200}, + seed = 66440, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "default:grass_3", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.02, + scale = 0.10, + spread = {x=200, y=200, z=200}, + seed = 66440, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "default:grass_4", + }) + + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = -0.04, + scale = 0.12, + spread = {x=200, y=200, z=200}, + seed = 66440, + octaves = 3, + persist = 0.6 + }, + biomes = {"default:grassland"}, + y_min = -31000, + y_max = 31000, + decoration = "default:grass_5", + }) +end + + +-- +-- Detect mapgen to select functions +-- + + +-- Mods using singlenode mapgen can call these functions to enable +-- the use of minetest.generate_ores or minetest.generate_decorations + +local mg_params = minetest.get_mapgen_params() +if mg_params.mgname == "v6" then + default.register_ores() + default.register_mgv6_decorations() +elseif mg_params.mgname ~= "singlenode" then + default.register_ores() + default.register_biomes() + default.register_decorations() +end + + +-- +-- Generate nyan cats in all mapgens +-- + + +-- facedir: 0/1/2/3 (head node facedir value) +-- length: length of rainbow tail +function default.make_nyancat(pos, facedir, length) + local tailvec = {x=0, y=0, z=0} + if facedir == 0 then + tailvec.z = 1 + elseif facedir == 1 then + tailvec.x = 1 + elseif facedir == 2 then + tailvec.z = -1 + elseif facedir == 3 then + tailvec.x = -1 + else + --print("default.make_nyancat(): Invalid facedir: "+dump(facedir)) + facedir = 0 + tailvec.z = 1 + end + local p = {x=pos.x, y=pos.y, z=pos.z} + minetest.set_node(p, {name="default:nyancat", param2=facedir}) + for i=1,length do + p.x = p.x + tailvec.x + p.z = p.z + tailvec.z + minetest.set_node(p, {name="default:nyancat_rainbow", param2=facedir}) + end +end + + +function default.generate_nyancats(minp, maxp, seed) + local height_min = -31000 + local height_max = -32 + 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) + local volume = (maxp.x-minp.x+1)*(y_max-y_min+1)*(maxp.z-minp.z+1) + local pr = PseudoRandom(seed + 9324342) + local max_num_nyancats = math.floor(volume / (16*16*16)) + for i=1,max_num_nyancats do + if pr:next(0, 1000) == 0 then + local x0 = pr:next(minp.x, maxp.x) + local y0 = pr:next(minp.y, maxp.y) + local z0 = pr:next(minp.z, maxp.z) + local p0 = {x=x0, y=y0, z=z0} + default.make_nyancat(p0, pr:next(0,3), pr:next(3,15)) + end + end +end + + +minetest.register_on_generated(default.generate_nyancats) diff --git a/mods/default/models/character.b3d b/mods/default/models/character.b3d new file mode 100644 index 0000000..bc9d927 Binary files /dev/null and b/mods/default/models/character.b3d differ diff --git a/mods/default/models/character.blend b/mods/default/models/character.blend new file mode 100644 index 0000000..34c5624 Binary files /dev/null and b/mods/default/models/character.blend differ diff --git a/mods/default/models/character.png b/mods/default/models/character.png new file mode 100644 index 0000000..0502178 Binary files /dev/null and b/mods/default/models/character.png differ diff --git a/mods/default/nodes.lua b/mods/default/nodes.lua new file mode 100644 index 0000000..a1b7147 --- /dev/null +++ b/mods/default/nodes.lua @@ -0,0 +1,1614 @@ +-- mods/default/nodes.lua + +--[[ Index: + +Stone +----- +(1. Material 2. Cobble variant 3. Brick variant [4. Modified forms]) + +default:stone +default:cobble +default:stonebrick +default:mossycobble + +default:desert_stone +default:desert_cobble +default:desert_stonebrick + +default:sandstone +default:sandstonebrick + +default:obsidian +default:obsidianbrick + +Soft / Non-Stone +---------------- +(1. Material [2. Modified forms]) + +default:dirt +default:dirt_with_grass +default:dirt_with_grass_footsteps +default:dirt_with_snow + +default:sand +default:desert_sand + +default:gravel + +default:clay + +default:snow +default:snowblock + +default:ice + +Trees +----- +(1. Trunk 2. Fabricated trunk 3. Leaves 4. Sapling [5. Fruits]) + +default:tree +default:wood +default:leaves +default:sapling +default:apple + +default:jungletree +default:junglewood +default:jungleleaves +default:junglesapling + +default:pinetree +default:pinewood +default:pine_needles +default:pine_sapling + +Ores +---- +(1. In stone 2. Block) + +default:stone_with_coal +default:coalblock + +default:stone_with_iron +default:steelblock + +default:stone_with_copper +default:copperblock +default:bronzeblock + +default:stone_with_gold +default:goldblock + +default:stone_with_mese +default:mese + +default:stone_with_diamond +default:diamondblock + +Plantlife (non-cubic) +--------------------- +default:cactus +default:papyrus +default:dry_shrub +default:junglegrass +default:grass_1 +default:grass_2 +default:grass_3 +default:grass_4 +default:grass_5 + +Liquids +------- +(1. Source 2. Flowing) + +default:water_source +default:water_flowing + +default:river_water_source +default:river_water_flowing + +default:lava_source +default:lava_flowing + +Tools / "Advanced" crafting / Non-"natural" +------------------------------------------- +default:torch + +default:chest +default:chest_locked + +default:bookshelf + +default:sign_wall +default:ladder +default:fence_wood + +default:glass +default:obsidian_glass + +default:rail + +default:brick + +default:meselamp + +Misc +---- +default:cloud +default:nyancat +default:nyancat_rainbow + +--]] + +-- +-- Stone +-- + +minetest.register_node("default:stone", { + description = "Stone", + tiles = {"default_stone.png"}, + groups = {cracky=3, stone=1}, + drop = 'default:cobble', + legacy_mineral = true, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:cobble", { + description = "Cobblestone", + tiles = {"default_cobble.png"}, + is_ground_content = false, + groups = {cracky=3, stone=2}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:stonebrick", { + description = "Stone Brick", + tiles = {"default_stone_brick.png"}, + is_ground_content = false, + groups = {cracky=2, stone=1}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:mossycobble", { + description = "Mossy Cobblestone", + tiles = {"default_mossycobble.png"}, + is_ground_content = false, + groups = {cracky=3, stone=1}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:desert_stone", { + description = "Desert Stone", + tiles = {"default_desert_stone.png"}, + groups = {cracky=3, stone=1}, + drop = 'default:desert_cobble', + legacy_mineral = true, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:desert_cobble", { + description = "Desert Cobblestone", + tiles = {"default_desert_cobble.png"}, + is_ground_content = false, + groups = {cracky=3, stone=2}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:desert_stonebrick", { + description = "Desert Stone Brick", + tiles = {"default_desert_stone_brick.png"}, + is_ground_content = false, + groups = {cracky=2, stone=1}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:sandstone", { + description = "Sandstone", + tiles = {"default_sandstone.png"}, + groups = {crumbly=2,cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:sandstonebrick", { + description = "Sandstone Brick", + tiles = {"default_sandstone_brick.png"}, + is_ground_content = false, + groups = {cracky=2}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:obsidian", { + description = "Obsidian", + tiles = {"default_obsidian.png"}, + sounds = default.node_sound_stone_defaults(), + groups = {cracky=1,level=2}, +}) + +minetest.register_node("default:obsidianbrick", { + description = "Obsidian Brick", + tiles = {"default_obsidian_brick.png"}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), + groups = {cracky=1,level=2}, +}) + +-- +-- Soft / Non-Stone +-- + +minetest.register_node("default:dirt", { + description = "Dirt", + tiles = {"default_dirt.png"}, + groups = {crumbly=3,soil=1}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("default:dirt_with_grass", { + description = "Dirt with Grass", + tiles = {"default_grass.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, + groups = {crumbly=3,soil=1}, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.25}, + }), +}) + +minetest.register_node("default:dirt_with_grass_footsteps", { + description = "Dirt with Grass and Footsteps", + tiles = {"default_grass_footsteps.png", "default_dirt.png", "default_dirt.png^default_grass_side.png"}, + groups = {crumbly=3,soil=1,not_in_creative_inventory=1}, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.25}, + }), +}) + +minetest.register_node("default:dirt_with_snow", { + description = "Dirt with Snow", + tiles = {"default_snow.png", "default_dirt.png", "default_dirt.png^default_snow_side.png"}, + groups = {crumbly=3,soil=1}, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_snow_footstep", gain=0.25}, + }), +}) + + + +minetest.register_node("default:sand", { + description = "Sand", + tiles = {"default_sand.png"}, + groups = {crumbly=3, falling_node=1, sand=1}, + sounds = default.node_sound_sand_defaults(), +}) + +minetest.register_node("default:desert_sand", { + description = "Desert Sand", + tiles = {"default_desert_sand.png"}, + groups = {crumbly=3, falling_node=1, sand=1}, + sounds = default.node_sound_sand_defaults(), +}) + + + +minetest.register_node("default:gravel", { + description = "Gravel", + tiles = {"default_gravel.png"}, + 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}, + }), +}) + + + +minetest.register_node("default:clay", { + description = "Clay", + tiles = {"default_clay.png"}, + groups = {crumbly=3}, + drop = 'default:clay_lump 4', + sounds = default.node_sound_dirt_defaults(), +}) + + + +minetest.register_node("default:snow", { + description = "Snow", + tiles = {"default_snow.png"}, + inventory_image = "default_snowball.png", + wield_image = "default_snowball.png", + paramtype = "light", + buildable_to = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.5+2/16, 0.5}, + }, + }, + groups = {crumbly=3,falling_node=1}, + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_snow_footstep", gain=0.25}, + dug = {name="default_snow_footstep", gain=0.75}, + }), + + on_construct = function(pos) + pos.y = pos.y - 1 + if minetest.get_node(pos).name == "default:dirt_with_grass" then + minetest.set_node(pos, {name="default:dirt_with_snow"}) + end + end, +}) + + +minetest.register_node("default:snowblock", { + description = "Snow Block", + tiles = {"default_snow.png"}, + groups = {crumbly=3}, + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_snow_footstep", gain=0.25}, + dug = {name="default_snow_footstep", gain=0.75}, + }), +}) + + + +minetest.register_node("default:ice", { + description = "Ice", + tiles = {"default_ice.png"}, + is_ground_content = false, + paramtype = "light", + groups = {cracky=3}, + sounds = default.node_sound_glass_defaults(), +}) + +-- +-- Trees +-- + +minetest.register_node("default:tree", { + description = "Tree", + tiles = {"default_tree_top.png", "default_tree_top.png", "default_tree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) + +minetest.register_node("default:wood", { + description = "Wooden Planks", + tiles = {"default_wood.png"}, + is_ground_content = false, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("default:sapling", { + description = "Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"default_sapling.png"}, + inventory_image = "default_sapling.png", + wield_image = "default_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("default:leaves", { + description = "Leaves", + drawtype = "allfaces_optional", + waving = 1, + visual_scale = 1.3, + tiles = {"default_leaves.png"}, + paramtype = "light", + is_ground_content = false, + groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'default:sapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'default:leaves'}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:apple", { + description = "Apple", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"default_apple.png"}, + inventory_image = "default_apple.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + is_ground_content = false, + selection_box = { + type = "fixed", + fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2} + }, + groups = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1}, + on_use = minetest.item_eat(2), + sounds = default.node_sound_leaves_defaults(), + + after_place_node = function(pos, placer, itemstack) + if placer:is_player() then + minetest.set_node(pos, {name="default:apple", param2=1}) + end + end, +}) + + + +minetest.register_node("default:jungletree", { + description = "Jungle Tree", + tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) + +minetest.register_node("default:junglewood", { + description = "Junglewood Planks", + tiles = {"default_junglewood.png"}, + is_ground_content = false, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("default:jungleleaves", { + description = "Jungle Leaves", + drawtype = "allfaces_optional", + waving = 1, + visual_scale = 1.3, + tiles = {"default_jungleleaves.png"}, + paramtype = "light", + is_ground_content = false, + groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'default:junglesapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'default:jungleleaves'}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:junglesapling", { + description = "Jungle Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"default_junglesapling.png"}, + inventory_image = "default_junglesapling.png", + wield_image = "default_junglesapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, + sounds = default.node_sound_leaves_defaults(), +}) + + + +minetest.register_node("default:pinetree", { + description = "Pine Tree", + tiles = {"default_pinetree_top.png", "default_pinetree_top.png", "default_pinetree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) + +minetest.register_node("default:pinewood", { + description = "Pinewood Planks", + tiles = {"default_pinewood.png"}, + is_ground_content = false, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node("default:pine_needles",{ + description = "Pine Needles", + drawtype = "allfaces_optional", + visual_scale = 1.3, + tiles = {"default_pine_needles.png"}, + waving = 1, + paramtype = "light", + is_ground_content = false, + groups = {snappy=3, leafdecay=3, flammable=2, leaves=1}, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {"default:pine_sapling"}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {"default:pine_needles"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("default:pine_sapling", { + description = "Pine Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"default_pine_sapling.png"}, + inventory_image = "default_pine_sapling.png", + wield_image = "default_pine_sapling.png", + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +-- +-- Ores +-- + +minetest.register_node("default:stone_with_coal", { + description = "Coal Ore", + tiles = {"default_stone.png^default_mineral_coal.png"}, + groups = {cracky=3}, + drop = 'default:coal_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:coalblock", { + description = "Coal Block", + tiles = {"default_coal_block.png"}, + is_ground_content = false, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:stone_with_iron", { + description = "Iron Ore", + tiles = {"default_stone.png^default_mineral_iron.png"}, + groups = {cracky=2}, + drop = 'default:iron_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:steelblock", { + description = "Steel Block", + tiles = {"default_steel_block.png"}, + is_ground_content = false, + groups = {cracky=1,level=2}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:stone_with_copper", { + description = "Copper Ore", + tiles = {"default_stone.png^default_mineral_copper.png"}, + groups = {cracky=2}, + drop = 'default:copper_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:copperblock", { + description = "Copper Block", + tiles = {"default_copper_block.png"}, + is_ground_content = false, + groups = {cracky=1,level=2}, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:bronzeblock", { + description = "Bronze Block", + tiles = {"default_bronze_block.png"}, + is_ground_content = false, + groups = {cracky=1,level=2}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:stone_with_mese", { + description = "Mese Ore", + tiles = {"default_stone.png^default_mineral_mese.png"}, + paramtype = "light", + groups = {cracky = 1}, + drop = "default:mese_crystal", + sounds = default.node_sound_stone_defaults(), + light_source = 1, +}) + +minetest.register_node("default:mese", { + description = "Mese Block", + tiles = {"default_mese_block.png"}, + paramtype = "light", + groups = {cracky = 1, level = 2}, + sounds = default.node_sound_stone_defaults(), + light_source = 3, +}) + + + + +minetest.register_node("default:stone_with_gold", { + description = "Gold Ore", + tiles = {"default_stone.png^default_mineral_gold.png"}, + groups = {cracky=2}, + drop = "default:gold_lump", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:goldblock", { + description = "Gold Block", + tiles = {"default_gold_block.png"}, + is_ground_content = false, + groups = {cracky=1}, + sounds = default.node_sound_stone_defaults(), +}) + + + +minetest.register_node("default:stone_with_diamond", { + description = "Diamond Ore", + tiles = {"default_stone.png^default_mineral_diamond.png"}, + groups = {cracky=1}, + drop = "default:diamond", + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("default:diamondblock", { + description = "Diamond Block", + tiles = {"default_diamond_block.png"}, + is_ground_content = false, + groups = {cracky=1,level=3}, + sounds = default.node_sound_stone_defaults(), +}) + +-- +-- Plantlife (non-cubic) +-- + +minetest.register_node("default:cactus", { + description = "Cactus", + tiles = {"default_cactus_top.png", "default_cactus_top.png", "default_cactus_side.png"}, + paramtype2 = "facedir", + groups = {snappy=1,choppy=3,flammable=2}, + sounds = default.node_sound_wood_defaults(), + on_place = minetest.rotate_node, + + after_dig_node = function(pos, node, metadata, digger) + default.dig_up(pos, node, digger) + end, +}) + +minetest.register_node("default:papyrus", { + description = "Papyrus", + drawtype = "plantlike", + tiles = {"default_papyrus.png"}, + inventory_image = "default_papyrus.png", + wield_image = "default_papyrus.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + + after_dig_node = function(pos, node, metadata, digger) + default.dig_up(pos, node, digger) + end, +}) + +minetest.register_node("default:dry_shrub", { + description = "Dry Shrub", + drawtype = "plantlike", + waving = 1, + visual_scale = 1.0, + tiles = {"default_dry_shrub.png"}, + inventory_image = "default_dry_shrub.png", + wield_image = "default_dry_shrub.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy=3,flammable=3,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, +}) + +minetest.register_node("default:junglegrass", { + description = "Jungle Grass", + drawtype = "plantlike", + waving = 1, + visual_scale = 1.3, + tiles = {"default_junglegrass.png"}, + inventory_image = "default_junglegrass.png", + wield_image = "default_junglegrass.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = { + max_items = 2, + items = { + { + items = {'survival:cricket_raw'}, + rarity = 15, + }, + { + items = {'default:junglegrass_1'}, + }, + }, + }, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, +}) + +minetest.register_node("default:grass_1", { + description = "Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_grass_1.png"}, + -- Use texture of a taller grass stage in inventory + inventory_image = "default_grass_3.png", + wield_image = "default_grass_3.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + groups = {snappy=3,flammable=3,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, + + on_place = function(itemstack, placer, pointed_thing) + -- place a random grass node + local stack = ItemStack("default:grass_"..math.random(1,5)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count())) + end, +}) + +for i=2,5 do + minetest.register_node("default:grass_"..i, { + description = "Grass", + drawtype = "plantlike", + waving = 1, + tiles = {"default_grass_"..i..".png"}, + inventory_image = "default_grass_"..i..".png", + wield_image = "default_grass_"..i..".png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + buildable_to = true, + drop = { + max_items = 2, + items = { + { + items = {'survival:cricket_raw'}, + rarity = 15, + }, + { + items = {'default:grass_1'}, + }, + }, + }, + groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, + }) +end + +-- +-- Liquids +-- + +minetest.register_node("default:water_source", { + description = "Water Source", + inventory_image = minetest.inventorycube("default_water.png"), + drawtype = "liquid", + tiles = { + { + name = "default_water_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + }, + special_tiles = { + -- New-style water source material (mostly unused) + { + name = "default_water_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + backface_culling = false, + }, + }, + alpha = 160, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "source", + liquid_alternative_flowing = "default:water_flowing", + liquid_alternative_source = "default:water_source", + liquid_viscosity = 1, + post_effect_color = {a=120, r=30, g=60, b=90}, + groups = {water=3, liquid=3, puts_out_fire=1}, +}) + +minetest.register_node("default:water_flowing", { + description = "Flowing Water", + inventory_image = minetest.inventorycube("default_water.png"), + drawtype = "flowingliquid", + tiles = {"default_water.png"}, + special_tiles = { + { + name = "default_water_flowing_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.8, + }, + }, + { + name = "default_water_flowing_animated.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.8, + }, + }, + }, + alpha = 160, + paramtype = "light", + paramtype2 = "flowingliquid", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "flowing", + liquid_alternative_flowing = "default:water_flowing", + liquid_alternative_source = "default:water_source", + liquid_viscosity = 1, + post_effect_color = {a=120, r=30, g=60, b=90}, + groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, +}) + + +minetest.register_node("default:river_water_source", { + description = "River Water Source", + inventory_image = minetest.inventorycube("default_river_water.png"), + drawtype = "liquid", + tiles = { + { + name = "default_river_water_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + }, + }, + special_tiles = { + { + name = "default_river_water_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2.0, + }, + backface_culling = false, + }, + }, + alpha = 160, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "source", + liquid_alternative_flowing = "default:river_water_flowing", + liquid_alternative_source = "default:river_water_source", + liquid_viscosity = 1, + liquid_renewable = false, + liquid_range = 2, + post_effect_color = {a=120, r=30, g=76, b=90}, + groups = {water=3, liquid=3, puts_out_fire=1}, +}) + +minetest.register_node("default:river_water_flowing", { + description = "Flowing River Water", + inventory_image = minetest.inventorycube("default_river_water.png"), + drawtype = "flowingliquid", + tiles = {"default_river_water.png"}, + special_tiles = { + { + name = "default_river_water_flowing_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.8, + }, + }, + { + name = "default_river_water_flowing_animated.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 0.8, + }, + }, + }, + alpha = 160, + paramtype = "light", + paramtype2 = "flowingliquid", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "flowing", + liquid_alternative_flowing = "default:river_water_flowing", + liquid_alternative_source = "default:river_water_source", + liquid_viscosity = 1, + liquid_renewable = false, + liquid_range = 2, + post_effect_color = {a=120, r=30, g=76, b=90}, + groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, +}) + + + +minetest.register_node("default:lava_source", { + description = "Lava Source", + inventory_image = minetest.inventorycube("default_lava.png"), + drawtype = "liquid", + tiles = { + { + name = "default_lava_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0, + }, + }, + }, + special_tiles = { + -- New-style lava source material (mostly unused) + { + name = "default_lava_source_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0, + }, + backface_culling = false, + }, + }, + paramtype = "light", + light_source = default.LIGHT_MAX - 1, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "source", + liquid_alternative_flowing = "default:lava_flowing", + liquid_alternative_source = "default:lava_source", + liquid_viscosity = 7, + liquid_renewable = false, + damage_per_second = 4 * 2, + post_effect_color = {a=192, r=255, g=64, b=0}, + groups = {lava=3, liquid=2, hot=3, igniter=1}, +}) + +minetest.register_node("default:lava_flowing", { + description = "Flowing Lava", + inventory_image = minetest.inventorycube("default_lava.png"), + drawtype = "flowingliquid", + tiles = {"default_lava.png"}, + special_tiles = { + { + name = "default_lava_flowing_animated.png", + backface_culling = false, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.3, + }, + }, + { + name = "default_lava_flowing_animated.png", + backface_culling = true, + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.3, + }, + }, + }, + paramtype = "light", + paramtype2 = "flowingliquid", + light_source = default.LIGHT_MAX - 1, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + is_ground_content = false, + drop = "", + drowning = 1, + liquidtype = "flowing", + liquid_alternative_flowing = "default:lava_flowing", + liquid_alternative_source = "default:lava_source", + liquid_viscosity = 7, + liquid_renewable = false, + damage_per_second = 4 * 2, + post_effect_color = {a=192, r=255, g=64, b=0}, + groups = {lava=3, liquid=2, hot=3, igniter=1, not_in_creative_inventory=1}, +}) + +-- +-- Tools / "Advanced" crafting / Non-"natural" +-- + +minetest.register_node("default:torch", { + description = "Torch", + drawtype = "torchlike", + tiles = { + { + name = "default_torch_on_floor_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0 + }, + }, + { + name="default_torch_on_ceiling_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0 + }, + }, + { + name="default_torch_animated.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 3.0 + }, + }, + }, + inventory_image = "default_torch_on_floor.png", + wield_image = "default_torch_on_floor.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + light_source = default.LIGHT_MAX - 1, + selection_box = { + type = "wallmounted", + wall_top = {-0.1, 0.5-0.6, -0.1, 0.1, 0.5, 0.1}, + wall_bottom = {-0.1, -0.5, -0.1, 0.1, -0.5+0.6, 0.1}, + wall_side = {-0.5, -0.3, -0.1, -0.5+0.3, 0.3, 0.1}, + }, + groups = {choppy=2,dig_immediate=3,flammable=1,attached_node=1}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), +}) + + + +local chest_formspec = + "size[8,9]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[current_name;main;0,0.3;8,4;]".. + "list[current_player;main;0,4.85;8,1;]".. + "list[current_player;main;0,6.08;8,3;8]".. + default.get_hotbar_bg(0,4.85) + +local function get_locked_chest_formspec(pos) + local spos = pos.x .. "," .. pos.y .. "," ..pos.z + local formspec = + "size[8,9]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[nodemeta:".. spos .. ";main;0,0.3;8,4;]".. + "list[current_player;main;0,4.85;8,1;]".. + "list[current_player;main;0,6.08;8,3;8]".. + default.get_hotbar_bg(0,4.85) + return formspec +end + +local function has_locked_chest_privilege(meta, player) + if player:get_player_name() ~= meta:get_string("owner") then + return false + end + return true +end + +minetest.register_node("default:chest", { + description = "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}, + 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", chest_formspec) + meta:set_string("infotext", "Chest") + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + 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("default:chest_locked", { + description = "Locked Chest", + tiles = {"default_chest_top.png", "default_chest_top.png", "default_chest_side.png", + "default_chest_side.png", "default_chest_side.png", "default_chest_lock.png"}, + paramtype2 = "facedir", + groups = {choppy=2,oddly_breakable_by_hand=2}, + legacy_facedir_simple = true, + is_ground_content = false, + sounds = default.node_sound_wood_defaults(), + + after_place_node = function(pos, placer) + local meta = minetest.get_meta(pos) + meta:set_string("owner", placer:get_player_name() or "") + meta:set_string("infotext", "Locked Chest (owned by ".. + meta:get_string("owner")..")") + end, + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("infotext", "Locked Chest") + meta:set_string("owner", "") + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("main") and has_locked_chest_privilege(meta, player) + end, + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + return 0 + end + return count + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + return 0 + end + return stack:get_count() + end, + allow_metadata_inventory_take = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + if not has_locked_chest_privilege(meta, player) then + return 0 + end + return stack:get_count() + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + minetest.log("action", player:get_player_name().. + " moves stuff to locked 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 locked chest at "..minetest.pos_to_string(pos)) + end, + on_rightclick = function(pos, node, clicker) + local meta = minetest.get_meta(pos) + if has_locked_chest_privilege(meta, clicker) then + minetest.show_formspec( + clicker:get_player_name(), + "default:chest_locked", + get_locked_chest_formspec(pos) + ) + end + end, + on_blast = function() end, +}) + + + +local bookshelf_formspec = + "size[8,7;]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;books;0,0.3;8,2;]".. + "list[current_player;main;0,2.85;8,1;]".. + "list[current_player;main;0,4.08;8,3;8]".. + default.get_hotbar_bg(0,2.85) + +minetest.register_node("default:bookshelf", { + description = "Bookshelf", + tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, + is_ground_content = false, + groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", bookshelf_formspec) + local inv = meta:get_inventory() + inv:set_size("books", 8*2) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("books") + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local to_stack = inv:get_stack(listname, index) + if listname == "books" then + if minetest.get_item_group(stack:get_name(), "book") ~= 0 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + local to_stack = inv:get_stack(to_list, to_index) + if to_list == "books" then + if minetest.get_item_group(stack:get_name(), "book") ~= 0 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + 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 bookshelf 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 bookshelf 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 bookshelf at "..minetest.pos_to_string(pos)) + end, +}) + + + +minetest.register_node("default:sign_wall", { + description = "Sign", + drawtype = "nodebox", + tiles = {"default_sign.png"}, + inventory_image = "default_sign_wall.png", + wield_image = "default_sign_wall.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + node_box = { + type = "wallmounted", + wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125}, + wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125}, + wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}, + }, + groups = {choppy=2,dig_immediate=2,attached_node=1}, + legacy_wallmounted = true, + sounds = default.node_sound_defaults(), + + on_construct = function(pos) + --local n = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "field[text;;${text}]") + meta:set_string("infotext", "\"\"") + end, + on_receive_fields = function(pos, formname, fields, sender) + --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields)) + if minetest.is_protected(pos, sender:get_player_name()) then + minetest.record_protection_violation(pos, sender:get_player_name()) + return + end + local meta = minetest.get_meta(pos) + if not fields.text then return end + minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text.. + "\" to sign at "..minetest.pos_to_string(pos)) + meta:set_string("text", fields.text) + meta:set_string("infotext", '"'..fields.text..'"') + end, +}) + +minetest.register_node("default:ladder", { + description = "Ladder", + drawtype = "signlike", + tiles = {"default_ladder.png"}, + inventory_image = "default_ladder.png", + wield_image = "default_ladder.png", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + walkable = false, + climbable = true, + is_ground_content = false, + selection_box = { + type = "wallmounted", + --wall_top = = + --wall_bottom = = + --wall_side = = + }, + groups = {choppy=2,oddly_breakable_by_hand=3,flammable=2}, + legacy_wallmounted = true, + sounds = default.node_sound_wood_defaults(), +}) + +local fence_texture = "default_fence_overlay.png^default_wood.png^default_fence_overlay.png^[makealpha:255,126,126" +minetest.register_node("default:fence_wood", { + description = "Wooden Fence", + drawtype = "fencelike", + tiles = {"default_wood.png"}, + inventory_image = fence_texture, + wield_image = fence_texture, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=2}, + sounds = default.node_sound_wood_defaults(), +}) + + + +minetest.register_node("default:glass", { + description = "Glass", + drawtype = "glasslike_framed_optional", + tiles = {"default_glass.png", "default_glass_detail.png"}, + inventory_image = minetest.inventorycube("default_glass.png"), + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky=3,oddly_breakable_by_hand=3}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_node("default:obsidian_glass", { + description = "Obsidian Glass", + drawtype = "glasslike", + tiles = {"default_obsidian_glass.png"}, + paramtype = "light", + is_ground_content = false, + sunlight_propagates = true, + sounds = default.node_sound_glass_defaults(), + groups = {cracky=3,oddly_breakable_by_hand=3}, +}) + + + +minetest.register_node("default:rail", { + description = "Rail", + drawtype = "raillike", + tiles = {"default_rail.png", "default_rail_curved.png", "default_rail_t_junction.png", "default_rail_crossing.png"}, + inventory_image = "default_rail.png", + wield_image = "default_rail.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + is_ground_content = false, + selection_box = { + type = "fixed", + -- but how to specify the dimensions for curved and sideways rails? + fixed = {-1/2, -1/2, -1/2, 1/2, -1/2+1/16, 1/2}, + }, + groups = {bendy=2,dig_immediate=2,attached_node=1,connect_to_raillike=minetest.raillike_group("rail")}, +}) + + + +minetest.register_node("default:brick", { + description = "Brick Block", + tiles = {"default_brick.png"}, + is_ground_content = false, + groups = {cracky=3}, + sounds = default.node_sound_stone_defaults(), +}) + + +minetest.register_node("default:meselamp", { + description = "Mese Lamp", + drawtype = "glasslike", + tiles = {"default_meselamp.png"}, + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 3, oddly_breakable_by_hand = 3}, + sounds = default.node_sound_glass_defaults(), + light_source = default.LIGHT_MAX, +}) + +-- +-- Misc +-- + +minetest.register_node("default:cloud", { + description = "Cloud", + tiles = {"default_cloud.png"}, + is_ground_content = false, + sounds = default.node_sound_defaults(), + groups = {not_in_creative_inventory=1}, +}) + +minetest.register_node("default:nyancat", { + description = "Nyan Cat", + tiles = {"default_nc_side.png", "default_nc_side.png", "default_nc_side.png", + "default_nc_side.png", "default_nc_back.png", "default_nc_front.png"}, + paramtype2 = "facedir", + groups = {cracky=2}, + is_ground_content = false, + legacy_facedir_simple = true, + sounds = default.node_sound_defaults(), +}) + +minetest.register_node("default:nyancat_rainbow", { + description = "Nyan Cat Rainbow", + tiles = { + "default_nc_rb.png^[transformR90", "default_nc_rb.png^[transformR90", + "default_nc_rb.png", "default_nc_rb.png" + }, + paramtype2 = "facedir", + groups = {cracky=2}, + is_ground_content = false, + sounds = default.node_sound_defaults(), +}) diff --git a/mods/default/player.lua b/mods/default/player.lua new file mode 100644 index 0000000..e4fb2ad --- /dev/null +++ b/mods/default/player.lua @@ -0,0 +1,159 @@ +-- Minetest 0.4 mod: player +-- See README.txt for licensing and other information. + +-- Player animation blending +-- Note: This is currently broken due to a bug in Irrlicht, leave at 0 +local animation_blend = 0 + +default.registered_player_models = { } + +-- Local for speed. +local models = default.registered_player_models + +function default.player_register_model(name, def) + models[name] = def +end + +-- Default player appearance +default.player_register_model("character.b3d", { + animation_speed = 30, + textures = {"character.png", }, + animations = { + -- Standard animations. + stand = { x= 0, y= 79, }, + lay = { x=162, y=166, }, + walk = { x=168, y=187, }, + mine = { x=189, y=198, }, + walk_mine = { x=200, y=219, }, + -- Extra animations (not currently used by the game). + sit = { x= 81, y=160, }, + }, +}) + +-- Player stats and animations +local player_model = {} +local player_textures = {} +local player_anim = {} +local player_sneak = {} +default.player_attached = {} + +function default.player_get_animation(player) + local name = player:get_player_name() + return { + model = player_model[name], + textures = player_textures[name], + animation = player_anim[name], + } +end + +-- Called when a player's appearance needs to be updated +function default.player_set_model(player, model_name) + local name = player:get_player_name() + local model = models[model_name] + if model then + if player_model[name] == model_name then + return + end + player:set_properties({ + mesh = model_name, + textures = player_textures[name] or model.textures, + visual = "mesh", + visual_size = model.visual_size or {x=1, y=1}, + }) + default.player_set_animation(player, "stand") + else + player:set_properties({ + textures = { "player.png", "player_back.png", }, + visual = "upright_sprite", + }) + end + player_model[name] = model_name +end + +function default.player_set_textures(player, textures) + local name = player:get_player_name() + player_textures[name] = textures + player:set_properties({textures = textures,}) +end + +function default.player_set_animation(player, anim_name, speed) + local name = player:get_player_name() + if player_anim[name] == anim_name then + return + end + local model = player_model[name] and models[player_model[name]] + if not (model and model.animations[anim_name]) then + return + end + local anim = model.animations[anim_name] + player_anim[name] = anim_name + player:set_animation(anim, speed or model.animation_speed, animation_blend) +end + +-- Update appearance when the player joins +minetest.register_on_joinplayer(function(player) + default.player_attached[player:get_player_name()] = false + default.player_set_model(player, "character.b3d") + player:set_local_animation({x=0, y=79}, {x=168, y=187}, {x=189, y=198}, {x=200, y=219}, 30) + + -- set GUI + if not minetest.setting_getbool("creative_mode") then + player:set_inventory_formspec(default.gui_survival_form) + end + player:hud_set_hotbar_image("gui_hotbar.png") + player:hud_set_hotbar_selected_image("gui_hotbar_selected.png") +end) + +minetest.register_on_leaveplayer(function(player) + local name = player:get_player_name() + player_model[name] = nil + player_anim[name] = nil + player_textures[name] = nil +end) + +-- Localize for better performance. +local player_set_animation = default.player_set_animation +local player_attached = default.player_attached + +-- Check each player and apply animations +minetest.register_globalstep(function(dtime) + for _, player in pairs(minetest.get_connected_players()) do + local name = player:get_player_name() + local model_name = player_model[name] + local model = model_name and models[model_name] + if model and not player_attached[name] then + local controls = player:get_player_control() + local walking = false + local animation_speed_mod = model.animation_speed or 30 + + -- Determine if the player is walking + if controls.up or controls.down or controls.left or controls.right then + walking = true + end + + -- Determine if the player is sneaking, and reduce animation speed if so + if controls.sneak then + animation_speed_mod = animation_speed_mod / 2 + end + + -- Apply animations based on what the player is doing + if player:get_hp() == 0 then + player_set_animation(player, "lay") + elseif walking then + if player_sneak[name] ~= controls.sneak then + player_anim[name] = nil + player_sneak[name] = controls.sneak + end + if controls.LMB then + player_set_animation(player, "walk_mine", animation_speed_mod) + else + player_set_animation(player, "walk", animation_speed_mod) + end + elseif controls.LMB then + player_set_animation(player, "mine") + else + player_set_animation(player, "stand", animation_speed_mod) + end + end + end +end) diff --git a/mods/default/sounds/default_break_glass.1.ogg b/mods/default/sounds/default_break_glass.1.ogg new file mode 100644 index 0000000..b1ccc5f Binary files /dev/null and b/mods/default/sounds/default_break_glass.1.ogg differ diff --git a/mods/default/sounds/default_break_glass.2.ogg b/mods/default/sounds/default_break_glass.2.ogg new file mode 100644 index 0000000..b6cc9e8 Binary files /dev/null and b/mods/default/sounds/default_break_glass.2.ogg differ diff --git a/mods/default/sounds/default_break_glass.3.ogg b/mods/default/sounds/default_break_glass.3.ogg new file mode 100644 index 0000000..ae6a6bf Binary files /dev/null and b/mods/default/sounds/default_break_glass.3.ogg differ diff --git a/mods/default/sounds/default_cool_lava.1.ogg b/mods/default/sounds/default_cool_lava.1.ogg new file mode 100644 index 0000000..42506dd Binary files /dev/null and b/mods/default/sounds/default_cool_lava.1.ogg differ diff --git a/mods/default/sounds/default_cool_lava.2.ogg b/mods/default/sounds/default_cool_lava.2.ogg new file mode 100644 index 0000000..2747ab8 Binary files /dev/null and b/mods/default/sounds/default_cool_lava.2.ogg differ diff --git a/mods/default/sounds/default_cool_lava.3.ogg b/mods/default/sounds/default_cool_lava.3.ogg new file mode 100644 index 0000000..8baeac3 Binary files /dev/null and b/mods/default/sounds/default_cool_lava.3.ogg differ diff --git a/mods/default/sounds/default_dig_choppy.ogg b/mods/default/sounds/default_dig_choppy.ogg new file mode 100644 index 0000000..e2ecd84 Binary files /dev/null and b/mods/default/sounds/default_dig_choppy.ogg differ diff --git a/mods/default/sounds/default_dig_cracky.ogg b/mods/default/sounds/default_dig_cracky.ogg new file mode 100644 index 0000000..da11679 Binary files /dev/null and b/mods/default/sounds/default_dig_cracky.ogg differ diff --git a/mods/default/sounds/default_dig_crumbly.ogg b/mods/default/sounds/default_dig_crumbly.ogg new file mode 100644 index 0000000..a0b2a1f Binary files /dev/null and b/mods/default/sounds/default_dig_crumbly.ogg differ diff --git a/mods/default/sounds/default_dig_dig_immediate.ogg b/mods/default/sounds/default_dig_dig_immediate.ogg new file mode 100644 index 0000000..e65d766 Binary files /dev/null and b/mods/default/sounds/default_dig_dig_immediate.ogg differ diff --git a/mods/default/sounds/default_dig_oddly_breakable_by_hand.ogg b/mods/default/sounds/default_dig_oddly_breakable_by_hand.ogg new file mode 100644 index 0000000..ef4d7b1 Binary files /dev/null and b/mods/default/sounds/default_dig_oddly_breakable_by_hand.ogg differ diff --git a/mods/default/sounds/default_dirt_footstep.1.ogg b/mods/default/sounds/default_dirt_footstep.1.ogg new file mode 100644 index 0000000..84a197d Binary files /dev/null and b/mods/default/sounds/default_dirt_footstep.1.ogg differ diff --git a/mods/default/sounds/default_dirt_footstep.2.ogg b/mods/default/sounds/default_dirt_footstep.2.ogg new file mode 100644 index 0000000..2e23b8a Binary files /dev/null and b/mods/default/sounds/default_dirt_footstep.2.ogg differ diff --git a/mods/default/sounds/default_dug_node.1.ogg b/mods/default/sounds/default_dug_node.1.ogg new file mode 100644 index 0000000..c04975d Binary files /dev/null and b/mods/default/sounds/default_dug_node.1.ogg differ diff --git a/mods/default/sounds/default_dug_node.2.ogg b/mods/default/sounds/default_dug_node.2.ogg new file mode 100644 index 0000000..9f20926 Binary files /dev/null and b/mods/default/sounds/default_dug_node.2.ogg differ diff --git a/mods/default/sounds/default_glass_footstep.ogg b/mods/default/sounds/default_glass_footstep.ogg new file mode 100644 index 0000000..191287a Binary files /dev/null and b/mods/default/sounds/default_glass_footstep.ogg differ diff --git a/mods/default/sounds/default_grass_footstep.1.ogg b/mods/default/sounds/default_grass_footstep.1.ogg new file mode 100644 index 0000000..22d1ad6 Binary files /dev/null and b/mods/default/sounds/default_grass_footstep.1.ogg differ diff --git a/mods/default/sounds/default_grass_footstep.2.ogg b/mods/default/sounds/default_grass_footstep.2.ogg new file mode 100644 index 0000000..4ccd8a0 Binary files /dev/null and b/mods/default/sounds/default_grass_footstep.2.ogg differ diff --git a/mods/default/sounds/default_grass_footstep.3.ogg b/mods/default/sounds/default_grass_footstep.3.ogg new file mode 100644 index 0000000..20db84e Binary files /dev/null and b/mods/default/sounds/default_grass_footstep.3.ogg differ diff --git a/mods/default/sounds/default_gravel_footstep.1.ogg b/mods/default/sounds/default_gravel_footstep.1.ogg new file mode 100644 index 0000000..8d260ce Binary files /dev/null and b/mods/default/sounds/default_gravel_footstep.1.ogg differ diff --git a/mods/default/sounds/default_gravel_footstep.2.ogg b/mods/default/sounds/default_gravel_footstep.2.ogg new file mode 100644 index 0000000..2aba2c6 Binary files /dev/null and b/mods/default/sounds/default_gravel_footstep.2.ogg differ diff --git a/mods/default/sounds/default_gravel_footstep.3.ogg b/mods/default/sounds/default_gravel_footstep.3.ogg new file mode 100644 index 0000000..1bcd8a1 Binary files /dev/null and b/mods/default/sounds/default_gravel_footstep.3.ogg differ diff --git a/mods/default/sounds/default_gravel_footstep.4.ogg b/mods/default/sounds/default_gravel_footstep.4.ogg new file mode 100644 index 0000000..696c9ff Binary files /dev/null and b/mods/default/sounds/default_gravel_footstep.4.ogg differ diff --git a/mods/default/sounds/default_hard_footstep.1.ogg b/mods/default/sounds/default_hard_footstep.1.ogg new file mode 100644 index 0000000..1748bc5 Binary files /dev/null and b/mods/default/sounds/default_hard_footstep.1.ogg differ diff --git a/mods/default/sounds/default_hard_footstep.2.ogg b/mods/default/sounds/default_hard_footstep.2.ogg new file mode 100644 index 0000000..fe39fd7 Binary files /dev/null and b/mods/default/sounds/default_hard_footstep.2.ogg differ diff --git a/mods/default/sounds/default_hard_footstep.3.ogg b/mods/default/sounds/default_hard_footstep.3.ogg new file mode 100644 index 0000000..5030e06 Binary files /dev/null and b/mods/default/sounds/default_hard_footstep.3.ogg differ diff --git a/mods/default/sounds/default_place_node.1.ogg b/mods/default/sounds/default_place_node.1.ogg new file mode 100644 index 0000000..46b9756 Binary files /dev/null and b/mods/default/sounds/default_place_node.1.ogg differ diff --git a/mods/default/sounds/default_place_node.2.ogg b/mods/default/sounds/default_place_node.2.ogg new file mode 100644 index 0000000..d34c01a Binary files /dev/null and b/mods/default/sounds/default_place_node.2.ogg differ diff --git a/mods/default/sounds/default_place_node.3.ogg b/mods/default/sounds/default_place_node.3.ogg new file mode 100644 index 0000000..fc29365 Binary files /dev/null and b/mods/default/sounds/default_place_node.3.ogg differ diff --git a/mods/default/sounds/default_place_node_hard.1.ogg b/mods/default/sounds/default_place_node_hard.1.ogg new file mode 100644 index 0000000..9f97fac Binary files /dev/null and b/mods/default/sounds/default_place_node_hard.1.ogg differ diff --git a/mods/default/sounds/default_place_node_hard.2.ogg b/mods/default/sounds/default_place_node_hard.2.ogg new file mode 100644 index 0000000..1d3b3de Binary files /dev/null and b/mods/default/sounds/default_place_node_hard.2.ogg differ diff --git a/mods/default/sounds/default_sand_footstep.1.ogg b/mods/default/sounds/default_sand_footstep.1.ogg new file mode 100644 index 0000000..65b68c7 Binary files /dev/null and b/mods/default/sounds/default_sand_footstep.1.ogg differ diff --git a/mods/default/sounds/default_sand_footstep.2.ogg b/mods/default/sounds/default_sand_footstep.2.ogg new file mode 100644 index 0000000..57f35f3 Binary files /dev/null and b/mods/default/sounds/default_sand_footstep.2.ogg differ diff --git a/mods/default/sounds/default_snow_footstep.1.ogg b/mods/default/sounds/default_snow_footstep.1.ogg new file mode 100644 index 0000000..3260b91 Binary files /dev/null and b/mods/default/sounds/default_snow_footstep.1.ogg differ diff --git a/mods/default/sounds/default_snow_footstep.2.ogg b/mods/default/sounds/default_snow_footstep.2.ogg new file mode 100644 index 0000000..4aac1e7 Binary files /dev/null and b/mods/default/sounds/default_snow_footstep.2.ogg differ diff --git a/mods/default/sounds/default_snow_footstep.3.ogg b/mods/default/sounds/default_snow_footstep.3.ogg new file mode 100644 index 0000000..cf4235b Binary files /dev/null and b/mods/default/sounds/default_snow_footstep.3.ogg differ diff --git a/mods/default/sounds/default_wood_footstep.1.ogg b/mods/default/sounds/default_wood_footstep.1.ogg new file mode 100644 index 0000000..34f63a1 Binary files /dev/null and b/mods/default/sounds/default_wood_footstep.1.ogg differ diff --git a/mods/default/sounds/default_wood_footstep.2.ogg b/mods/default/sounds/default_wood_footstep.2.ogg new file mode 100644 index 0000000..124fc29 Binary files /dev/null and b/mods/default/sounds/default_wood_footstep.2.ogg differ diff --git a/mods/default/textures/bubble.png b/mods/default/textures/bubble.png new file mode 100644 index 0000000..100fe15 Binary files /dev/null and b/mods/default/textures/bubble.png differ diff --git a/mods/default/textures/crack_anylength.png b/mods/default/textures/crack_anylength.png new file mode 100644 index 0000000..297eced Binary files /dev/null and b/mods/default/textures/crack_anylength.png differ diff --git a/mods/default/textures/default_apple.png b/mods/default/textures/default_apple.png new file mode 100644 index 0000000..7549bfd Binary files /dev/null and b/mods/default/textures/default_apple.png differ diff --git a/mods/default/textures/default_book.png b/mods/default/textures/default_book.png new file mode 100644 index 0000000..15af2b6 Binary files /dev/null and b/mods/default/textures/default_book.png differ diff --git a/mods/default/textures/default_bookshelf.png b/mods/default/textures/default_bookshelf.png new file mode 100644 index 0000000..10d6483 Binary files /dev/null and b/mods/default/textures/default_bookshelf.png differ diff --git a/mods/default/textures/default_brick.png b/mods/default/textures/default_brick.png new file mode 100644 index 0000000..ab19121 Binary files /dev/null and b/mods/default/textures/default_brick.png differ diff --git a/mods/default/textures/default_bronze_block.png b/mods/default/textures/default_bronze_block.png new file mode 100644 index 0000000..1d0c9d5 Binary files /dev/null and b/mods/default/textures/default_bronze_block.png differ diff --git a/mods/default/textures/default_bronze_ingot.png b/mods/default/textures/default_bronze_ingot.png new file mode 100644 index 0000000..6cccdf6 Binary files /dev/null and b/mods/default/textures/default_bronze_ingot.png differ diff --git a/mods/default/textures/default_cactus_side.png b/mods/default/textures/default_cactus_side.png new file mode 100644 index 0000000..8d6c40c Binary files /dev/null and b/mods/default/textures/default_cactus_side.png differ diff --git a/mods/default/textures/default_cactus_top.png b/mods/default/textures/default_cactus_top.png new file mode 100644 index 0000000..cf46aa2 Binary files /dev/null and b/mods/default/textures/default_cactus_top.png differ diff --git a/mods/default/textures/default_chest_front.png b/mods/default/textures/default_chest_front.png new file mode 100644 index 0000000..85227d8 Binary files /dev/null and b/mods/default/textures/default_chest_front.png differ diff --git a/mods/default/textures/default_chest_lock.png b/mods/default/textures/default_chest_lock.png new file mode 100644 index 0000000..73f46c7 Binary files /dev/null and b/mods/default/textures/default_chest_lock.png differ diff --git a/mods/default/textures/default_chest_side.png b/mods/default/textures/default_chest_side.png new file mode 100644 index 0000000..44a65a4 Binary files /dev/null and b/mods/default/textures/default_chest_side.png differ diff --git a/mods/default/textures/default_chest_top.png b/mods/default/textures/default_chest_top.png new file mode 100644 index 0000000..f1a5cb5 Binary files /dev/null and b/mods/default/textures/default_chest_top.png differ diff --git a/mods/default/textures/default_clay.png b/mods/default/textures/default_clay.png new file mode 100644 index 0000000..76e5a40 Binary files /dev/null and b/mods/default/textures/default_clay.png differ diff --git a/mods/default/textures/default_clay_brick.png b/mods/default/textures/default_clay_brick.png new file mode 100644 index 0000000..dc7a431 Binary files /dev/null and b/mods/default/textures/default_clay_brick.png differ diff --git a/mods/default/textures/default_clay_lump.png b/mods/default/textures/default_clay_lump.png new file mode 100644 index 0000000..c1d0220 Binary files /dev/null and b/mods/default/textures/default_clay_lump.png differ diff --git a/mods/default/textures/default_cloud.png b/mods/default/textures/default_cloud.png new file mode 100644 index 0000000..faf0ec1 Binary files /dev/null and b/mods/default/textures/default_cloud.png differ diff --git a/mods/default/textures/default_coal_block.png b/mods/default/textures/default_coal_block.png new file mode 100644 index 0000000..6fe9ed9 Binary files /dev/null and b/mods/default/textures/default_coal_block.png differ diff --git a/mods/default/textures/default_coal_lump.png b/mods/default/textures/default_coal_lump.png new file mode 100644 index 0000000..792961d Binary files /dev/null and b/mods/default/textures/default_coal_lump.png differ diff --git a/mods/default/textures/default_cobble.png b/mods/default/textures/default_cobble.png new file mode 100644 index 0000000..d379840 Binary files /dev/null and b/mods/default/textures/default_cobble.png differ diff --git a/mods/default/textures/default_copper_block.png b/mods/default/textures/default_copper_block.png new file mode 100644 index 0000000..8533754 Binary files /dev/null and b/mods/default/textures/default_copper_block.png differ diff --git a/mods/default/textures/default_copper_ingot.png b/mods/default/textures/default_copper_ingot.png new file mode 100644 index 0000000..bcad9c0 Binary files /dev/null and b/mods/default/textures/default_copper_ingot.png differ diff --git a/mods/default/textures/default_copper_lump.png b/mods/default/textures/default_copper_lump.png new file mode 100644 index 0000000..998c592 Binary files /dev/null and b/mods/default/textures/default_copper_lump.png differ diff --git a/mods/default/textures/default_desert_cobble.png b/mods/default/textures/default_desert_cobble.png new file mode 100644 index 0000000..f914c98 Binary files /dev/null and b/mods/default/textures/default_desert_cobble.png differ diff --git a/mods/default/textures/default_desert_sand.png b/mods/default/textures/default_desert_sand.png new file mode 100644 index 0000000..371b8c7 Binary files /dev/null and b/mods/default/textures/default_desert_sand.png differ diff --git a/mods/default/textures/default_desert_stone.png b/mods/default/textures/default_desert_stone.png new file mode 100644 index 0000000..5d3aded Binary files /dev/null and b/mods/default/textures/default_desert_stone.png differ diff --git a/mods/default/textures/default_desert_stone_brick.png b/mods/default/textures/default_desert_stone_brick.png new file mode 100644 index 0000000..cc0f04a Binary files /dev/null and b/mods/default/textures/default_desert_stone_brick.png differ diff --git a/mods/default/textures/default_diamond.png b/mods/default/textures/default_diamond.png new file mode 100644 index 0000000..a8dac74 Binary files /dev/null and b/mods/default/textures/default_diamond.png differ diff --git a/mods/default/textures/default_diamond_block.png b/mods/default/textures/default_diamond_block.png new file mode 100644 index 0000000..69e10ee Binary files /dev/null and b/mods/default/textures/default_diamond_block.png differ diff --git a/mods/default/textures/default_dirt.png b/mods/default/textures/default_dirt.png new file mode 100644 index 0000000..ca7e4ae Binary files /dev/null and b/mods/default/textures/default_dirt.png differ diff --git a/mods/default/textures/default_dry_shrub.png b/mods/default/textures/default_dry_shrub.png new file mode 100644 index 0000000..e8a7f27 Binary files /dev/null and b/mods/default/textures/default_dry_shrub.png differ diff --git a/mods/default/textures/default_fence_overlay.png b/mods/default/textures/default_fence_overlay.png new file mode 100644 index 0000000..718184c Binary files /dev/null and b/mods/default/textures/default_fence_overlay.png differ diff --git a/mods/default/textures/default_furnace_bottom.png b/mods/default/textures/default_furnace_bottom.png new file mode 100644 index 0000000..b79ed06 Binary files /dev/null and b/mods/default/textures/default_furnace_bottom.png differ diff --git a/mods/default/textures/default_furnace_fire_bg.png b/mods/default/textures/default_furnace_fire_bg.png new file mode 100644 index 0000000..126204a Binary files /dev/null and b/mods/default/textures/default_furnace_fire_bg.png differ diff --git a/mods/default/textures/default_furnace_fire_fg.png b/mods/default/textures/default_furnace_fire_fg.png new file mode 100644 index 0000000..63888f3 Binary files /dev/null and b/mods/default/textures/default_furnace_fire_fg.png differ diff --git a/mods/default/textures/default_furnace_front.png b/mods/default/textures/default_furnace_front.png new file mode 100644 index 0000000..8c1798e Binary files /dev/null and b/mods/default/textures/default_furnace_front.png differ diff --git a/mods/default/textures/default_furnace_front_active.png b/mods/default/textures/default_furnace_front_active.png new file mode 100644 index 0000000..ea43ed9 Binary files /dev/null and b/mods/default/textures/default_furnace_front_active.png differ diff --git a/mods/default/textures/default_furnace_side.png b/mods/default/textures/default_furnace_side.png new file mode 100644 index 0000000..33408cf Binary files /dev/null and b/mods/default/textures/default_furnace_side.png differ diff --git a/mods/default/textures/default_furnace_top.png b/mods/default/textures/default_furnace_top.png new file mode 100644 index 0000000..b79ed06 Binary files /dev/null and b/mods/default/textures/default_furnace_top.png differ diff --git a/mods/default/textures/default_glass.png b/mods/default/textures/default_glass.png new file mode 100644 index 0000000..da25402 Binary files /dev/null and b/mods/default/textures/default_glass.png differ diff --git a/mods/default/textures/default_glass_detail.png b/mods/default/textures/default_glass_detail.png new file mode 100644 index 0000000..d38dbb7 Binary files /dev/null and b/mods/default/textures/default_glass_detail.png differ diff --git a/mods/default/textures/default_gold_block.png b/mods/default/textures/default_gold_block.png new file mode 100644 index 0000000..170d50b Binary files /dev/null and b/mods/default/textures/default_gold_block.png differ diff --git a/mods/default/textures/default_gold_ingot.png b/mods/default/textures/default_gold_ingot.png new file mode 100644 index 0000000..ba66471 Binary files /dev/null and b/mods/default/textures/default_gold_ingot.png differ diff --git a/mods/default/textures/default_gold_lump.png b/mods/default/textures/default_gold_lump.png new file mode 100644 index 0000000..d5a1be7 Binary files /dev/null and b/mods/default/textures/default_gold_lump.png differ diff --git a/mods/default/textures/default_grass.png b/mods/default/textures/default_grass.png new file mode 100644 index 0000000..7c17c6f Binary files /dev/null and b/mods/default/textures/default_grass.png differ diff --git a/mods/default/textures/default_grass_1.png b/mods/default/textures/default_grass_1.png new file mode 100644 index 0000000..5052930 Binary files /dev/null and b/mods/default/textures/default_grass_1.png differ diff --git a/mods/default/textures/default_grass_2.png b/mods/default/textures/default_grass_2.png new file mode 100644 index 0000000..9d99a6a Binary files /dev/null and b/mods/default/textures/default_grass_2.png differ diff --git a/mods/default/textures/default_grass_3.png b/mods/default/textures/default_grass_3.png new file mode 100644 index 0000000..4833df4 Binary files /dev/null and b/mods/default/textures/default_grass_3.png differ diff --git a/mods/default/textures/default_grass_4.png b/mods/default/textures/default_grass_4.png new file mode 100644 index 0000000..1496fb1 Binary files /dev/null and b/mods/default/textures/default_grass_4.png differ diff --git a/mods/default/textures/default_grass_5.png b/mods/default/textures/default_grass_5.png new file mode 100644 index 0000000..a212535 Binary files /dev/null and b/mods/default/textures/default_grass_5.png differ diff --git a/mods/default/textures/default_grass_footsteps.png b/mods/default/textures/default_grass_footsteps.png new file mode 100644 index 0000000..3741a0b Binary files /dev/null and b/mods/default/textures/default_grass_footsteps.png differ diff --git a/mods/default/textures/default_grass_side.png b/mods/default/textures/default_grass_side.png new file mode 100644 index 0000000..87ae3ca Binary files /dev/null and b/mods/default/textures/default_grass_side.png differ diff --git a/mods/default/textures/default_gravel.png b/mods/default/textures/default_gravel.png new file mode 100644 index 0000000..ad48fa4 Binary files /dev/null and b/mods/default/textures/default_gravel.png differ diff --git a/mods/default/textures/default_ice.png b/mods/default/textures/default_ice.png new file mode 100644 index 0000000..2046eac Binary files /dev/null and b/mods/default/textures/default_ice.png differ diff --git a/mods/default/textures/default_iron_lump.png b/mods/default/textures/default_iron_lump.png new file mode 100644 index 0000000..db61a94 Binary files /dev/null and b/mods/default/textures/default_iron_lump.png differ diff --git a/mods/default/textures/default_junglegrass.png b/mods/default/textures/default_junglegrass.png new file mode 100644 index 0000000..25abb71 Binary files /dev/null and b/mods/default/textures/default_junglegrass.png differ diff --git a/mods/default/textures/default_jungleleaves.png b/mods/default/textures/default_jungleleaves.png new file mode 100644 index 0000000..870b4bb Binary files /dev/null and b/mods/default/textures/default_jungleleaves.png differ diff --git a/mods/default/textures/default_junglesapling.png b/mods/default/textures/default_junglesapling.png new file mode 100644 index 0000000..05e1e50 Binary files /dev/null and b/mods/default/textures/default_junglesapling.png differ diff --git a/mods/default/textures/default_jungletree.png b/mods/default/textures/default_jungletree.png new file mode 100644 index 0000000..bf0403e Binary files /dev/null and b/mods/default/textures/default_jungletree.png differ diff --git a/mods/default/textures/default_jungletree_top.png b/mods/default/textures/default_jungletree_top.png new file mode 100644 index 0000000..e3a3ccc Binary files /dev/null and b/mods/default/textures/default_jungletree_top.png differ diff --git a/mods/default/textures/default_junglewood.png b/mods/default/textures/default_junglewood.png new file mode 100644 index 0000000..6198d26 Binary files /dev/null and b/mods/default/textures/default_junglewood.png differ diff --git a/mods/default/textures/default_ladder.png b/mods/default/textures/default_ladder.png new file mode 100644 index 0000000..c167fff Binary files /dev/null and b/mods/default/textures/default_ladder.png differ diff --git a/mods/default/textures/default_lava.png b/mods/default/textures/default_lava.png new file mode 100644 index 0000000..b0d429e Binary files /dev/null and b/mods/default/textures/default_lava.png differ diff --git a/mods/default/textures/default_lava_flowing_animated.png b/mods/default/textures/default_lava_flowing_animated.png new file mode 100644 index 0000000..2ec0746 Binary files /dev/null and b/mods/default/textures/default_lava_flowing_animated.png differ diff --git a/mods/default/textures/default_lava_source_animated.png b/mods/default/textures/default_lava_source_animated.png new file mode 100644 index 0000000..32267a6 Binary files /dev/null and b/mods/default/textures/default_lava_source_animated.png differ diff --git a/mods/default/textures/default_leaves.png b/mods/default/textures/default_leaves.png new file mode 100644 index 0000000..e39535c Binary files /dev/null and b/mods/default/textures/default_leaves.png differ diff --git a/mods/default/textures/default_mese_block.png b/mods/default/textures/default_mese_block.png new file mode 100644 index 0000000..2e6895d Binary files /dev/null and b/mods/default/textures/default_mese_block.png differ diff --git a/mods/default/textures/default_mese_crystal.png b/mods/default/textures/default_mese_crystal.png new file mode 100644 index 0000000..f1d71f1 Binary files /dev/null and b/mods/default/textures/default_mese_crystal.png differ diff --git a/mods/default/textures/default_mese_crystal_fragment.png b/mods/default/textures/default_mese_crystal_fragment.png new file mode 100644 index 0000000..d5416ab Binary files /dev/null and b/mods/default/textures/default_mese_crystal_fragment.png differ diff --git a/mods/default/textures/default_meselamp.png b/mods/default/textures/default_meselamp.png new file mode 100644 index 0000000..b227a25 Binary files /dev/null and b/mods/default/textures/default_meselamp.png differ diff --git a/mods/default/textures/default_mineral_coal.png b/mods/default/textures/default_mineral_coal.png new file mode 100644 index 0000000..6d1386b Binary files /dev/null and b/mods/default/textures/default_mineral_coal.png differ diff --git a/mods/default/textures/default_mineral_copper.png b/mods/default/textures/default_mineral_copper.png new file mode 100644 index 0000000..c4c518e Binary files /dev/null and b/mods/default/textures/default_mineral_copper.png differ diff --git a/mods/default/textures/default_mineral_diamond.png b/mods/default/textures/default_mineral_diamond.png new file mode 100644 index 0000000..39c0f83 Binary files /dev/null and b/mods/default/textures/default_mineral_diamond.png differ diff --git a/mods/default/textures/default_mineral_gold.png b/mods/default/textures/default_mineral_gold.png new file mode 100644 index 0000000..2220add Binary files /dev/null and b/mods/default/textures/default_mineral_gold.png differ diff --git a/mods/default/textures/default_mineral_iron.png b/mods/default/textures/default_mineral_iron.png new file mode 100644 index 0000000..bfec8b1 Binary files /dev/null and b/mods/default/textures/default_mineral_iron.png differ diff --git a/mods/default/textures/default_mineral_mese.png b/mods/default/textures/default_mineral_mese.png new file mode 100644 index 0000000..566d379 Binary files /dev/null and b/mods/default/textures/default_mineral_mese.png differ diff --git a/mods/default/textures/default_mossycobble.png b/mods/default/textures/default_mossycobble.png new file mode 100644 index 0000000..1ae7c91 Binary files /dev/null and b/mods/default/textures/default_mossycobble.png differ diff --git a/mods/default/textures/default_nc_back.png b/mods/default/textures/default_nc_back.png new file mode 100644 index 0000000..e479ace Binary files /dev/null and b/mods/default/textures/default_nc_back.png differ diff --git a/mods/default/textures/default_nc_front.png b/mods/default/textures/default_nc_front.png new file mode 100644 index 0000000..c9dd6a3 Binary files /dev/null and b/mods/default/textures/default_nc_front.png differ diff --git a/mods/default/textures/default_nc_rb.png b/mods/default/textures/default_nc_rb.png new file mode 100644 index 0000000..685a22c Binary files /dev/null and b/mods/default/textures/default_nc_rb.png differ diff --git a/mods/default/textures/default_nc_side.png b/mods/default/textures/default_nc_side.png new file mode 100644 index 0000000..3152c33 Binary files /dev/null and b/mods/default/textures/default_nc_side.png differ diff --git a/mods/default/textures/default_obsidian.png b/mods/default/textures/default_obsidian.png new file mode 100644 index 0000000..8f4a49c Binary files /dev/null and b/mods/default/textures/default_obsidian.png differ diff --git a/mods/default/textures/default_obsidian_brick.png b/mods/default/textures/default_obsidian_brick.png new file mode 100644 index 0000000..30c67ca Binary files /dev/null and b/mods/default/textures/default_obsidian_brick.png differ diff --git a/mods/default/textures/default_obsidian_glass.png b/mods/default/textures/default_obsidian_glass.png new file mode 100644 index 0000000..d5ac83d Binary files /dev/null and b/mods/default/textures/default_obsidian_glass.png differ diff --git a/mods/default/textures/default_obsidian_shard.png b/mods/default/textures/default_obsidian_shard.png new file mode 100644 index 0000000..a988d8c Binary files /dev/null and b/mods/default/textures/default_obsidian_shard.png differ diff --git a/mods/default/textures/default_paper.png b/mods/default/textures/default_paper.png new file mode 100644 index 0000000..8f23924 Binary files /dev/null and b/mods/default/textures/default_paper.png differ diff --git a/mods/default/textures/default_papyrus.png b/mods/default/textures/default_papyrus.png new file mode 100644 index 0000000..a85e809 Binary files /dev/null and b/mods/default/textures/default_papyrus.png differ diff --git a/mods/default/textures/default_pine_needles.png b/mods/default/textures/default_pine_needles.png new file mode 100644 index 0000000..1a32f63 Binary files /dev/null and b/mods/default/textures/default_pine_needles.png differ diff --git a/mods/default/textures/default_pine_sapling.png b/mods/default/textures/default_pine_sapling.png new file mode 100644 index 0000000..c30131d Binary files /dev/null and b/mods/default/textures/default_pine_sapling.png differ diff --git a/mods/default/textures/default_pinetree.png b/mods/default/textures/default_pinetree.png new file mode 100644 index 0000000..4a5328f Binary files /dev/null and b/mods/default/textures/default_pinetree.png differ diff --git a/mods/default/textures/default_pinetree_top.png b/mods/default/textures/default_pinetree_top.png new file mode 100644 index 0000000..8705710 Binary files /dev/null and b/mods/default/textures/default_pinetree_top.png differ diff --git a/mods/default/textures/default_pinewood.png b/mods/default/textures/default_pinewood.png new file mode 100644 index 0000000..6844ceb Binary files /dev/null and b/mods/default/textures/default_pinewood.png differ diff --git a/mods/default/textures/default_rail.png b/mods/default/textures/default_rail.png new file mode 100644 index 0000000..26fed02 Binary files /dev/null and b/mods/default/textures/default_rail.png differ diff --git a/mods/default/textures/default_rail_crossing.png b/mods/default/textures/default_rail_crossing.png new file mode 100644 index 0000000..ba66e01 Binary files /dev/null and b/mods/default/textures/default_rail_crossing.png differ diff --git a/mods/default/textures/default_rail_curved.png b/mods/default/textures/default_rail_curved.png new file mode 100644 index 0000000..9084ac2 Binary files /dev/null and b/mods/default/textures/default_rail_curved.png differ diff --git a/mods/default/textures/default_rail_t_junction.png b/mods/default/textures/default_rail_t_junction.png new file mode 100644 index 0000000..486c416 Binary files /dev/null and b/mods/default/textures/default_rail_t_junction.png differ diff --git a/mods/default/textures/default_river_water.png b/mods/default/textures/default_river_water.png new file mode 100644 index 0000000..3b55c5f Binary files /dev/null and b/mods/default/textures/default_river_water.png differ diff --git a/mods/default/textures/default_river_water_flowing_animated.png b/mods/default/textures/default_river_water_flowing_animated.png new file mode 100644 index 0000000..536acc5 Binary files /dev/null and b/mods/default/textures/default_river_water_flowing_animated.png differ diff --git a/mods/default/textures/default_river_water_source_animated.png b/mods/default/textures/default_river_water_source_animated.png new file mode 100644 index 0000000..daa5653 Binary files /dev/null and b/mods/default/textures/default_river_water_source_animated.png differ diff --git a/mods/default/textures/default_sand.png b/mods/default/textures/default_sand.png new file mode 100644 index 0000000..645a300 Binary files /dev/null and b/mods/default/textures/default_sand.png differ diff --git a/mods/default/textures/default_sandstone.png b/mods/default/textures/default_sandstone.png new file mode 100644 index 0000000..16e3d13 Binary files /dev/null and b/mods/default/textures/default_sandstone.png differ diff --git a/mods/default/textures/default_sandstone_brick.png b/mods/default/textures/default_sandstone_brick.png new file mode 100644 index 0000000..e7150e5 Binary files /dev/null and b/mods/default/textures/default_sandstone_brick.png differ diff --git a/mods/default/textures/default_sapling.png b/mods/default/textures/default_sapling.png new file mode 100644 index 0000000..3fd64f0 Binary files /dev/null and b/mods/default/textures/default_sapling.png differ diff --git a/mods/default/textures/default_sign.png b/mods/default/textures/default_sign.png new file mode 100644 index 0000000..912a372 Binary files /dev/null and b/mods/default/textures/default_sign.png differ diff --git a/mods/default/textures/default_sign_wall.png b/mods/default/textures/default_sign_wall.png new file mode 100644 index 0000000..56a7d2e Binary files /dev/null and b/mods/default/textures/default_sign_wall.png differ diff --git a/mods/default/textures/default_snow.png b/mods/default/textures/default_snow.png new file mode 100644 index 0000000..2a2439f Binary files /dev/null and b/mods/default/textures/default_snow.png differ diff --git a/mods/default/textures/default_snow_side.png b/mods/default/textures/default_snow_side.png new file mode 100644 index 0000000..3e98915 Binary files /dev/null and b/mods/default/textures/default_snow_side.png differ diff --git a/mods/default/textures/default_snowball.png b/mods/default/textures/default_snowball.png new file mode 100644 index 0000000..ecdba9a Binary files /dev/null and b/mods/default/textures/default_snowball.png differ diff --git a/mods/default/textures/default_steel_block.png b/mods/default/textures/default_steel_block.png new file mode 100644 index 0000000..7f49f61 Binary files /dev/null and b/mods/default/textures/default_steel_block.png differ diff --git a/mods/default/textures/default_steel_ingot.png b/mods/default/textures/default_steel_ingot.png new file mode 100644 index 0000000..8100b01 Binary files /dev/null and b/mods/default/textures/default_steel_ingot.png differ diff --git a/mods/default/textures/default_stick.png b/mods/default/textures/default_stick.png new file mode 100644 index 0000000..0378d07 Binary files /dev/null and b/mods/default/textures/default_stick.png differ diff --git a/mods/default/textures/default_stone.png b/mods/default/textures/default_stone.png new file mode 100644 index 0000000..63cb7c4 Binary files /dev/null and b/mods/default/textures/default_stone.png differ diff --git a/mods/default/textures/default_stone_brick.png b/mods/default/textures/default_stone_brick.png new file mode 100644 index 0000000..c254cc6 Binary files /dev/null and b/mods/default/textures/default_stone_brick.png differ diff --git a/mods/default/textures/default_tnt_bottom.png b/mods/default/textures/default_tnt_bottom.png new file mode 100644 index 0000000..4eda060 Binary files /dev/null and b/mods/default/textures/default_tnt_bottom.png differ diff --git a/mods/default/textures/default_tnt_side.png b/mods/default/textures/default_tnt_side.png new file mode 100644 index 0000000..947f862 Binary files /dev/null and b/mods/default/textures/default_tnt_side.png differ diff --git a/mods/default/textures/default_tnt_top.png b/mods/default/textures/default_tnt_top.png new file mode 100644 index 0000000..473c8fd Binary files /dev/null and b/mods/default/textures/default_tnt_top.png differ diff --git a/mods/default/textures/default_tool_bronzeaxe.png b/mods/default/textures/default_tool_bronzeaxe.png new file mode 100644 index 0000000..8ae43b5 Binary files /dev/null and b/mods/default/textures/default_tool_bronzeaxe.png differ diff --git a/mods/default/textures/default_tool_bronzepick.png b/mods/default/textures/default_tool_bronzepick.png new file mode 100644 index 0000000..c88a5f0 Binary files /dev/null and b/mods/default/textures/default_tool_bronzepick.png differ diff --git a/mods/default/textures/default_tool_bronzeshovel.png b/mods/default/textures/default_tool_bronzeshovel.png new file mode 100644 index 0000000..d7d800e Binary files /dev/null and b/mods/default/textures/default_tool_bronzeshovel.png differ diff --git a/mods/default/textures/default_tool_bronzesword.png b/mods/default/textures/default_tool_bronzesword.png new file mode 100644 index 0000000..cdab898 Binary files /dev/null and b/mods/default/textures/default_tool_bronzesword.png differ diff --git a/mods/default/textures/default_tool_diamondaxe.png b/mods/default/textures/default_tool_diamondaxe.png new file mode 100644 index 0000000..e32a0bf Binary files /dev/null and b/mods/default/textures/default_tool_diamondaxe.png differ diff --git a/mods/default/textures/default_tool_diamondpick.png b/mods/default/textures/default_tool_diamondpick.png new file mode 100644 index 0000000..f9883c6 Binary files /dev/null and b/mods/default/textures/default_tool_diamondpick.png differ diff --git a/mods/default/textures/default_tool_diamondshovel.png b/mods/default/textures/default_tool_diamondshovel.png new file mode 100644 index 0000000..d0fe24d Binary files /dev/null and b/mods/default/textures/default_tool_diamondshovel.png differ diff --git a/mods/default/textures/default_tool_diamondsword.png b/mods/default/textures/default_tool_diamondsword.png new file mode 100644 index 0000000..dbccd0e Binary files /dev/null and b/mods/default/textures/default_tool_diamondsword.png differ diff --git a/mods/default/textures/default_tool_meseaxe.png b/mods/default/textures/default_tool_meseaxe.png new file mode 100644 index 0000000..c01fb4f Binary files /dev/null and b/mods/default/textures/default_tool_meseaxe.png differ diff --git a/mods/default/textures/default_tool_mesepick.png b/mods/default/textures/default_tool_mesepick.png new file mode 100644 index 0000000..1b2e25b Binary files /dev/null and b/mods/default/textures/default_tool_mesepick.png differ diff --git a/mods/default/textures/default_tool_meseshovel.png b/mods/default/textures/default_tool_meseshovel.png new file mode 100644 index 0000000..00813a2 Binary files /dev/null and b/mods/default/textures/default_tool_meseshovel.png differ diff --git a/mods/default/textures/default_tool_mesesword.png b/mods/default/textures/default_tool_mesesword.png new file mode 100644 index 0000000..d395d3a Binary files /dev/null and b/mods/default/textures/default_tool_mesesword.png differ diff --git a/mods/default/textures/default_tool_steelaxe.png b/mods/default/textures/default_tool_steelaxe.png new file mode 100644 index 0000000..1528cad Binary files /dev/null and b/mods/default/textures/default_tool_steelaxe.png differ diff --git a/mods/default/textures/default_tool_steelpick.png b/mods/default/textures/default_tool_steelpick.png new file mode 100644 index 0000000..a7543a1 Binary files /dev/null and b/mods/default/textures/default_tool_steelpick.png differ diff --git a/mods/default/textures/default_tool_steelshovel.png b/mods/default/textures/default_tool_steelshovel.png new file mode 100644 index 0000000..65e4045 Binary files /dev/null and b/mods/default/textures/default_tool_steelshovel.png differ diff --git a/mods/default/textures/default_tool_steelsword.png b/mods/default/textures/default_tool_steelsword.png new file mode 100644 index 0000000..630a339 Binary files /dev/null and b/mods/default/textures/default_tool_steelsword.png differ diff --git a/mods/default/textures/default_tool_stoneaxe.png b/mods/default/textures/default_tool_stoneaxe.png new file mode 100644 index 0000000..cc36054 Binary files /dev/null and b/mods/default/textures/default_tool_stoneaxe.png differ diff --git a/mods/default/textures/default_tool_stonepick.png b/mods/default/textures/default_tool_stonepick.png new file mode 100644 index 0000000..237d739 Binary files /dev/null and b/mods/default/textures/default_tool_stonepick.png differ diff --git a/mods/default/textures/default_tool_stoneshovel.png b/mods/default/textures/default_tool_stoneshovel.png new file mode 100644 index 0000000..11711bd Binary files /dev/null and b/mods/default/textures/default_tool_stoneshovel.png differ diff --git a/mods/default/textures/default_tool_stonesword.png b/mods/default/textures/default_tool_stonesword.png new file mode 100644 index 0000000..1a493ac Binary files /dev/null and b/mods/default/textures/default_tool_stonesword.png differ diff --git a/mods/default/textures/default_tool_woodaxe.png b/mods/default/textures/default_tool_woodaxe.png new file mode 100644 index 0000000..68f1fd8 Binary files /dev/null and b/mods/default/textures/default_tool_woodaxe.png differ diff --git a/mods/default/textures/default_tool_woodpick.png b/mods/default/textures/default_tool_woodpick.png new file mode 100644 index 0000000..0aed583 Binary files /dev/null and b/mods/default/textures/default_tool_woodpick.png differ diff --git a/mods/default/textures/default_tool_woodshovel.png b/mods/default/textures/default_tool_woodshovel.png new file mode 100644 index 0000000..dcef2b5 Binary files /dev/null and b/mods/default/textures/default_tool_woodshovel.png differ diff --git a/mods/default/textures/default_tool_woodsword.png b/mods/default/textures/default_tool_woodsword.png new file mode 100644 index 0000000..c78ba50 Binary files /dev/null and b/mods/default/textures/default_tool_woodsword.png differ diff --git a/mods/default/textures/default_torch.png b/mods/default/textures/default_torch.png new file mode 100644 index 0000000..e21aac3 Binary files /dev/null and b/mods/default/textures/default_torch.png differ diff --git a/mods/default/textures/default_torch_animated.png b/mods/default/textures/default_torch_animated.png new file mode 100644 index 0000000..cdf33ef Binary files /dev/null and b/mods/default/textures/default_torch_animated.png differ diff --git a/mods/default/textures/default_torch_on_ceiling.png b/mods/default/textures/default_torch_on_ceiling.png new file mode 100644 index 0000000..89f41f5 Binary files /dev/null and b/mods/default/textures/default_torch_on_ceiling.png differ diff --git a/mods/default/textures/default_torch_on_ceiling_animated.png b/mods/default/textures/default_torch_on_ceiling_animated.png new file mode 100644 index 0000000..3a8b5ad Binary files /dev/null and b/mods/default/textures/default_torch_on_ceiling_animated.png differ diff --git a/mods/default/textures/default_torch_on_floor.png b/mods/default/textures/default_torch_on_floor.png new file mode 100644 index 0000000..bc4bdd6 Binary files /dev/null and b/mods/default/textures/default_torch_on_floor.png differ diff --git a/mods/default/textures/default_torch_on_floor_animated.png b/mods/default/textures/default_torch_on_floor_animated.png new file mode 100644 index 0000000..ad51c03 Binary files /dev/null and b/mods/default/textures/default_torch_on_floor_animated.png differ diff --git a/mods/default/textures/default_tree.png b/mods/default/textures/default_tree.png new file mode 100644 index 0000000..10e297b Binary files /dev/null and b/mods/default/textures/default_tree.png differ diff --git a/mods/default/textures/default_tree_top.png b/mods/default/textures/default_tree_top.png new file mode 100644 index 0000000..da99bce Binary files /dev/null and b/mods/default/textures/default_tree_top.png differ diff --git a/mods/default/textures/default_water.png b/mods/default/textures/default_water.png new file mode 100644 index 0000000..00500e9 Binary files /dev/null and b/mods/default/textures/default_water.png differ diff --git a/mods/default/textures/default_water_flowing_animated.png b/mods/default/textures/default_water_flowing_animated.png new file mode 100644 index 0000000..070d797 Binary files /dev/null and b/mods/default/textures/default_water_flowing_animated.png differ diff --git a/mods/default/textures/default_water_source_animated.png b/mods/default/textures/default_water_source_animated.png new file mode 100644 index 0000000..7e7f9ff Binary files /dev/null and b/mods/default/textures/default_water_source_animated.png differ diff --git a/mods/default/textures/default_wood.png b/mods/default/textures/default_wood.png new file mode 100644 index 0000000..af56d6c Binary files /dev/null and b/mods/default/textures/default_wood.png differ diff --git a/mods/default/textures/gui_formbg.png b/mods/default/textures/gui_formbg.png new file mode 100644 index 0000000..c543466 Binary files /dev/null and b/mods/default/textures/gui_formbg.png differ diff --git a/mods/default/textures/gui_furnace_arrow_bg.png b/mods/default/textures/gui_furnace_arrow_bg.png new file mode 100644 index 0000000..046d8cd Binary files /dev/null and b/mods/default/textures/gui_furnace_arrow_bg.png differ diff --git a/mods/default/textures/gui_furnace_arrow_fg.png b/mods/default/textures/gui_furnace_arrow_fg.png new file mode 100644 index 0000000..8d3c396 Binary files /dev/null and b/mods/default/textures/gui_furnace_arrow_fg.png differ diff --git a/mods/default/textures/gui_hb_bg.png b/mods/default/textures/gui_hb_bg.png new file mode 100644 index 0000000..99248e1 Binary files /dev/null and b/mods/default/textures/gui_hb_bg.png differ diff --git a/mods/default/textures/gui_hotbar.png b/mods/default/textures/gui_hotbar.png new file mode 100644 index 0000000..73fb3ca Binary files /dev/null and b/mods/default/textures/gui_hotbar.png differ diff --git a/mods/default/textures/gui_hotbar_selected.png b/mods/default/textures/gui_hotbar_selected.png new file mode 100644 index 0000000..40bafe6 Binary files /dev/null and b/mods/default/textures/gui_hotbar_selected.png differ diff --git a/mods/default/textures/heart.png b/mods/default/textures/heart.png new file mode 100644 index 0000000..fb8dcc7 Binary files /dev/null and b/mods/default/textures/heart.png differ diff --git a/mods/default/textures/player.png b/mods/default/textures/player.png new file mode 100644 index 0000000..6d61c43 Binary files /dev/null and b/mods/default/textures/player.png differ diff --git a/mods/default/textures/player_back.png b/mods/default/textures/player_back.png new file mode 100644 index 0000000..5e9ef05 Binary files /dev/null and b/mods/default/textures/player_back.png differ diff --git a/mods/default/textures/wieldhand.png b/mods/default/textures/wieldhand.png new file mode 100644 index 0000000..69f4b7b Binary files /dev/null and b/mods/default/textures/wieldhand.png differ diff --git a/mods/default/tools.lua b/mods/default/tools.lua new file mode 100644 index 0000000..a948886 --- /dev/null +++ b/mods/default/tools.lua @@ -0,0 +1,332 @@ +-- mods/default/tools.lua + +-- The hand +minetest.register_item(":", { + type = "none", + wield_image = "wieldhand.png", + wield_scale = {x=1,y=1,z=2.5}, + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level = 0, + groupcaps = { + crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1}, + snappy = {times={[3]=0.40}, uses=0, maxlevel=1}, + oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0} + }, + damage_groups = {fleshy=1}, + } +}) + +-- +-- Picks +-- + +minetest.register_tool("default:pick_wood", { + description = "Wooden Pickaxe", + inventory_image = "default_tool_woodpick.png", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level=0, + groupcaps={ + cracky = {times={[3]=1.60}, uses=10, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("default:pick_stone", { + description = "Stone Pickaxe", + inventory_image = "default_tool_stonepick.png", + tool_capabilities = { + full_punch_interval = 1.3, + max_drop_level=0, + groupcaps={ + cracky = {times={[2]=2.0, [3]=1.00}, uses=20, maxlevel=1}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("default:pick_steel", { + description = "Steel Pickaxe", + inventory_image = "default_tool_steelpick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("default:pick_bronze", { + description = "Bronze Pickaxe", + inventory_image = "default_tool_bronzepick.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + cracky = {times={[1]=4.00, [2]=1.60, [3]=0.80}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("default:pick_mese", { + description = "Mese Pickaxe", + inventory_image = "default_tool_mesepick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=2.4, [2]=1.2, [3]=0.60}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) +minetest.register_tool("default:pick_diamond", { + description = "Diamond Pickaxe", + inventory_image = "default_tool_diamondpick.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=3, + groupcaps={ + cracky = {times={[1]=2.0, [2]=1.0, [3]=0.50}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=5}, + }, +}) + +-- +-- Shovels +-- + +minetest.register_tool("default:shovel_wood", { + description = "Wooden Shovel", + inventory_image = "default_tool_woodshovel.png", + wield_image = "default_tool_woodshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level=0, + groupcaps={ + crumbly = {times={[1]=3.00, [2]=1.60, [3]=0.60}, uses=10, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("default:shovel_stone", { + description = "Stone Shovel", + inventory_image = "default_tool_stoneshovel.png", + wield_image = "default_tool_stoneshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.4, + max_drop_level=0, + groupcaps={ + crumbly = {times={[1]=1.80, [2]=1.20, [3]=0.50}, uses=20, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("default:shovel_steel", { + description = "Steel Shovel", + inventory_image = "default_tool_steelshovel.png", + wield_image = "default_tool_steelshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("default:shovel_bronze", { + description = "Bronze Shovel", + inventory_image = "default_tool_bronzeshovel.png", + wield_image = "default_tool_bronzeshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("default:shovel_mese", { + description = "Mese Shovel", + inventory_image = "default_tool_meseshovel.png", + wield_image = "default_tool_meseshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=3, + groupcaps={ + crumbly = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("default:shovel_diamond", { + description = "Diamond Shovel", + inventory_image = "default_tool_diamondshovel.png", + wield_image = "default_tool_diamondshovel.png^[transformR90", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=4}, + }, +}) + +-- +-- Axes +-- + +minetest.register_tool("default:axe_wood", { + description = "Wooden Axe", + inventory_image = "default_tool_woodaxe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=0, + groupcaps={ + choppy = {times={[2]=3.00, [3]=1.60}, uses=10, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + }, +}) +minetest.register_tool("default:axe_stone", { + description = "Stone Axe", + inventory_image = "default_tool_stoneaxe.png", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level=0, + groupcaps={ + choppy={times={[1]=3.00, [2]=2.00, [3]=1.30}, uses=20, maxlevel=1}, + }, + damage_groups = {fleshy=3}, + }, +}) +minetest.register_tool("default:axe_steel", { + description = "Steel Axe", + inventory_image = "default_tool_steelaxe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("default:axe_bronze", { + description = "Bronze Axe", + inventory_image = "default_tool_bronzeaxe.png", + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=4}, + }, +}) +minetest.register_tool("default:axe_mese", { + description = "Mese Axe", + inventory_image = "default_tool_meseaxe.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3}, + }, + damage_groups = {fleshy=6}, + }, +}) +minetest.register_tool("default:axe_diamond", { + description = "Diamond Axe", + inventory_image = "default_tool_diamondaxe.png", + tool_capabilities = { + full_punch_interval = 0.9, + max_drop_level=1, + groupcaps={ + choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=7}, + }, +}) + +-- +-- Swords +-- + +minetest.register_tool("default:sword_wood", { + description = "Wooden Sword", + inventory_image = "default_tool_woodsword.png", + tool_capabilities = { + full_punch_interval = 1, + max_drop_level=0, + groupcaps={ + snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1}, + }, + damage_groups = {fleshy=2}, + } +}) +minetest.register_tool("default:sword_stone", { + description = "Stone Sword", + inventory_image = "default_tool_stonesword.png", + tool_capabilities = { + full_punch_interval = 1.2, + max_drop_level=0, + groupcaps={ + snappy={times={[2]=1.4, [3]=0.40}, uses=20, maxlevel=1}, + }, + damage_groups = {fleshy=4}, + } +}) +minetest.register_tool("default:sword_steel", { + description = "Steel Sword", + inventory_image = "default_tool_steelsword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + } +}) +minetest.register_tool("default:sword_bronze", { + description = "Bronze Sword", + inventory_image = "default_tool_bronzesword.png", + tool_capabilities = { + full_punch_interval = 0.8, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2}, + }, + damage_groups = {fleshy=6}, + } +}) +minetest.register_tool("default:sword_mese", { + description = "Mese Sword", + inventory_image = "default_tool_mesesword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=7}, + } +}) +minetest.register_tool("default:sword_diamond", { + description = "Diamond Sword", + inventory_image = "default_tool_diamondsword.png", + tool_capabilities = { + full_punch_interval = 0.7, + max_drop_level=1, + groupcaps={ + snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=8}, + } +}) diff --git a/mods/default/trees.lua b/mods/default/trees.lua new file mode 100644 index 0000000..e8a6996 --- /dev/null +++ b/mods/default/trees.lua @@ -0,0 +1,344 @@ +-- +-- Grow trees +-- + +local random = math.random + +local function can_grow(pos) + local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) + if not node_under then + return false + end + local name_under = node_under.name + local is_soil = minetest.get_item_group(name_under, "soil") + if is_soil == 0 then + return false + end + return true +end + +-- Sapling ABMs + +minetest.register_abm({ + nodenames = {"default:sapling"}, + interval = 10, + chance = 50, + action = function(pos, node) + if not can_grow(pos) then + return + end + + minetest.log("action", "A sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + default.grow_tree(pos, random(1, 4) == 1) + end +}) + +minetest.register_abm({ + nodenames = {"default:junglesapling"}, + interval = 11, + chance = 50, + action = function(pos, node) + if not can_grow(pos) then + return + end + + minetest.log("action", "A jungle sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + default.grow_jungle_tree(pos) + end +}) + +minetest.register_abm({ + nodenames = {"default:pine_sapling"}, + interval = 12, + chance = 50, + action = function(pos, node) + if not can_grow(pos) then + return + end + + minetest.log("action", "A pine sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + default.grow_pine_tree(pos) + end +}) + +-- Appletree, jungletree function + +local function add_trunk_and_leaves(data, a, pos, tree_cid, leaves_cid, + height, size, iters, is_apple_tree) + local x, y, z = pos.x, pos.y, pos.z + local c_air = minetest.get_content_id("air") + local c_ignore = minetest.get_content_id("ignore") + local c_apple = minetest.get_content_id("food:apple") + + -- Trunk + for y_dist = 0, height - 1 do + local vi = a:index(x, y + y_dist, z) + local node_id = data[vi] + if y_dist == 0 or node_id == c_air or node_id == c_ignore + or node_id == leaves_cid then + data[vi] = tree_cid + end + end + + -- Force leaves near the trunk + for z_dist = -1, 1 do + for y_dist = -size, 1 do + local vi = a:index(x - 1, y + height + y_dist, z + z_dist) + for x_dist = -1, 1 do + if data[vi] == c_air or data[vi] == c_ignore then + if is_apple_tree and random(1, 8) == 1 then + data[vi] = c_apple + else + data[vi] = leaves_cid + end + end + vi = vi + 1 + end + end + end + + -- Randomly add leaves in 2x2x2 clusters. + for i = 1, iters do + local clust_x = x + random(-size, size - 1) + local clust_y = y + height + random(-size, 0) + local clust_z = z + random(-size, size - 1) + + for xi = 0, 1 do + for yi = 0, 1 do + for zi = 0, 1 do + local vi = a:index(clust_x + xi, clust_y + yi, clust_z + zi) + if data[vi] == c_air or data[vi] == c_ignore then + if is_apple_tree and random(1, 8) == 1 then + data[vi] = c_apple + else + data[vi] = leaves_cid + end + end + end + end + end + end +end + +-- Appletree + +function default.grow_tree(pos, is_apple_tree, bad) + --[[ + NOTE: Tree-placing code is currently duplicated in the engine + and in games that have saplings; both are deprecated but not + replaced yet + --]] + if bad then + error("Deprecated use of default.grow_tree") + end + + local x, y, z = pos.x, pos.y, pos.z + local height = random(4, 5) + local c_tree = minetest.get_content_id("default:tree") + local c_leaves = minetest.get_content_id("default:leaves") + + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map( + {x = pos.x - 2, y = pos.y, z = pos.z - 2}, + {x = pos.x + 2, y = pos.y + height + 1, z = pos.z + 2} + ) + local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) + local data = vm:get_data() + + add_trunk_and_leaves(data, a, pos, c_tree, c_leaves, height, 2, 8, is_apple_tree) + + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +-- Jungletree + +function default.grow_jungle_tree(pos, bad) + --[[ + NOTE: Jungletree-placing code is currently duplicated in the engine + and in games that have saplings; both are deprecated but not + replaced yet + --]] + if bad then + error("Deprecated use of default.grow_jungle_tree") + end + + local x, y, z = pos.x, pos.y, pos.z + local height = random(8, 12) + local c_air = minetest.get_content_id("air") + local c_ignore = minetest.get_content_id("ignore") + local c_jungletree = minetest.get_content_id("default:jungletree") + local c_jungleleaves = minetest.get_content_id("default:jungleleaves") + + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map( + {x = pos.x - 3, y = pos.y - 1, z = pos.z - 3}, + {x = pos.x + 3, y = pos.y + height + 1, z = pos.z + 3} + ) + local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) + local data = vm:get_data() + + add_trunk_and_leaves(data, a, pos, c_jungletree, c_jungleleaves, height, 3, 30, false) + + -- Roots + for z_dist = -1, 1 do + local vi_1 = a:index(x - 1, y - 1, z + z_dist) + local vi_2 = a:index(x - 1, y, z + z_dist) + for x_dist = -1, 1 do + if random(1, 3) >= 2 then + if data[vi_1] == c_air or data[vi_1] == c_ignore then + data[vi_1] = c_jungletree + elseif data[vi_2] == c_air or data[vi_2] == c_ignore then + data[vi_2] = c_jungletree + end + end + vi_1 = vi_1 + 1 + vi_2 = vi_2 + 1 + end + end + + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +-- Pinetree from mg mapgen mod, design by sfan5, pointy top added by paramat + +local function add_pine_needles(data, vi, c_air, c_ignore, c_snow, c_pine_needles) + if data[vi] == c_air or data[vi] == c_ignore or data[vi] == c_snow then + data[vi] = c_pine_needles + end +end + +local function add_snow(data, vi, c_air, c_ignore, c_snow) + if data[vi] == c_air or data[vi] == c_ignore then + data[vi] = c_snow + end +end + +function default.grow_pine_tree(pos) + local x, y, z = pos.x, pos.y, pos.z + local maxy = y + random(9, 13) -- Trunk top + + local c_air = minetest.get_content_id("air") + local c_ignore = minetest.get_content_id("ignore") + local c_pinetree = minetest.get_content_id("default:pinetree") + local c_pine_needles = minetest.get_content_id("default:pine_needles") + local c_snow = minetest.get_content_id("default:snow") + local c_snowblock = minetest.get_content_id("default:snowblock") + local c_dirtsnow = minetest.get_content_id("default:dirt_with_snow") + + local vm = minetest.get_voxel_manip() + local minp, maxp = vm:read_from_map( + {x = x - 3, y = y - 1, z = z - 3}, + {x = x + 3, y = maxy + 3, z = z + 3} + ) + local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) + local data = vm:get_data() + + -- Scan for snow nodes near sapling + local snow = false + for yy = y - 1, y + 1 do + for zz = z - 1, z + 1 do + local vi = a:index(x - 1, yy, zz) + for xx = x - 1, x + 1 do + local nodid = data[vi] + if nodid == c_snow + or nodid == c_snowblock + or nodid == c_dirtsnow then + snow = true + end + vi = vi + 1 + end + end + end + + -- Upper branches layer + local dev = 3 + for yy = maxy - 1, maxy + 1 do + for zz = z - dev, z + dev do + local vi = a:index(x - dev, yy, zz) + local via = a:index(x - dev, yy + 1, zz) + for xx = x - dev, x + dev do + if random() < 0.95 - dev * 0.05 then + add_pine_needles(data, vi, c_air, c_ignore, c_snow, + c_pine_needles) + if snow then + add_snow(data, via, c_air, c_ignore, c_snow) + end + end + vi = vi + 1 + via = via + 1 + end + end + dev = dev - 1 + end + + -- Centre top nodes + add_pine_needles(data, a:index(x, maxy + 1, z), c_air, c_ignore, c_snow, + c_pine_needles) + add_pine_needles(data, a:index(x, maxy + 2, z), c_air, c_ignore, c_snow, + c_pine_needles) -- Paramat added a pointy top node + if snow then + add_snow(data, a:index(x, maxy + 3, z), c_air, c_ignore, c_snow) + end + + -- Lower branches layer + local my = 0 + for i = 1, 20 do -- Random 2x2 squares of needles + local xi = x + random(-3, 2) + local yy = maxy + random(-6, -5) + local zi = z + random(-3, 2) + if yy > my then + my = yy + end + for zz = zi, zi+1 do + local vi = a:index(xi, yy, zz) + local via = a:index(xi, yy + 1, zz) + for xx = xi, xi + 1 do + add_pine_needles(data, vi, c_air, c_ignore, c_snow, + c_pine_needles) + if snow then + add_snow(data, via, c_air, c_ignore, c_snow) + end + vi = vi + 1 + via = via + 1 + end + end + end + + local dev = 2 + for yy = my + 1, my + 2 do + for zz = z - dev, z + dev do + local vi = a:index(x - dev, yy, zz) + local via = a:index(x - dev, yy + 1, zz) + for xx = x - dev, x + dev do + if random() < 0.95 - dev * 0.05 then + add_pine_needles(data, vi, c_air, c_ignore, c_snow, + c_pine_needles) + if snow then + add_snow(data, via, c_air, c_ignore, c_snow) + end + end + vi = vi + 1 + via = via + 1 + end + end + dev = dev - 1 + end + + -- Trunk + for yy = y, maxy do + local vi = a:index(x, yy, z) + data[vi] = c_pinetree + end + + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + diff --git a/mods/denseores/.DS_Store b/mods/denseores/.DS_Store new file mode 100644 index 0000000..aac07e5 Binary files /dev/null and b/mods/denseores/.DS_Store differ diff --git a/mods/denseores/Changelog.rtf b/mods/denseores/Changelog.rtf new file mode 100644 index 0000000..cb53c0a --- /dev/null +++ b/mods/denseores/Changelog.rtf @@ -0,0 +1,10 @@ +{\rtf1\ansi\ansicpg1252\cocoartf1344\cocoasubrtf720 +{\fonttbl\f0\fswiss\fcharset0 Helvetica;} +{\colortbl;\red255\green255\blue255;} +\margl1440\margr1440\vieww10800\viewh8400\viewkind0 +\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural + +\f0\fs24 \cf0 V.1.0.1\ +Retextures for about 1/3 the original textures\ +\ +V.1 Original Public Release!} \ No newline at end of file diff --git a/mods/denseores/copyright info.txt b/mods/denseores/copyright info.txt new file mode 100644 index 0000000..1eeea38 --- /dev/null +++ b/mods/denseores/copyright info.txt @@ -0,0 +1,10 @@ +Copyright (C) 1991, 1999 Free Software Foundation, Inc. +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + +Please tell me if I'm using "LGPL" corectly. diff --git a/mods/denseores/depends.txt b/mods/denseores/depends.txt new file mode 100644 index 0000000..5556828 --- /dev/null +++ b/mods/denseores/depends.txt @@ -0,0 +1,3 @@ +default +technic? +moreores? diff --git a/mods/denseores/init.lua b/mods/denseores/init.lua new file mode 100644 index 0000000..778447d --- /dev/null +++ b/mods/denseores/init.lua @@ -0,0 +1,434 @@ +--[ Mod By Benedict424 (Oswald) --] +--[ This build was finished on: 3-17-2015. --] + +--[[ +Moreores modification to Minetest. This adds ore density. +Copyright (C) 2015 Benedict + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +If you need to contact me, send a PM via Minetest Forums (benedict424). +--]] + + + +minetest.after(0, function() + print("DenseOres Mod Enabled") +end) + +--[[ +Order of everything here: +coal, iron, copper, gold, mese, diamond +Large, small +--]] + +denseores_modpath = minetest.get_modpath("denseores") + +--[ Small Items --] + +minetest.register_craftitem("denseores:small_coal_lump", { + description = "Small Coal Lump", + inventory_image = "small_coal_lump.png", +}) + +minetest.register_craftitem("denseores:small_iron_lump", { + description = "Small Iron Lump", + inventory_image = "small_iron_lump.png", +}) + +minetest.register_craftitem("denseores:small_copper_lump", { + description = "Small Copper Lump", + inventory_image = "small_copper_lump.png", +}) + +minetest.register_craftitem("denseores:small_gold_lump", { + description = "Small Gold Lump", + inventory_image = "small_gold_lump.png", +}) + +minetest.register_craftitem("denseores:small_mese_gem", { + description = "Small Mese Gem", + inventory_image = "small_mese_gem.png", +}) + +minetest.register_craftitem("denseores:small_diamond_gem", { + description = "Small Diamond Gem", + inventory_image = "small_diamond_gem.png", +}) + +--[ Large Ore Nodes --] + +minetest.register_node("denseores:large_coal_ore", { --coal + description = "Heavy Coal Ore", + tiles ={"default_stone.png^large_coal_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:large_coal_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_iron_ore", { --iron + description = "Heavy Iron Ore", + tiles ={"default_stone.png^large_iron_ore.png"}, + groups = {cracky=2}, + drop = 'denseores:large_iron_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_copper_ore", { --copper + description = "Heavy Copper Ore", + tiles ={"default_stone.png^large_copper_ore.png"}, + groups = {cracky=2}, + drop = 'denseores:large_copper_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_gold_ore", { --gold + description = "Heavy Gold Ore", + tiles ={"default_stone.png^large_gold_ore.png"}, + groups = {cracky=2}, + drop = 'denseores:large_gold_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_mese_ore", { --mese + description = "Heavy Mese Ore", + tiles ={"default_stone.png^large_mese_ore.png"}, + groups = {cracky=1}, + drop = 'denseores:large_mese_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_diamond_ore", { --diamond + description = "Heavy Diamond Ore", + tiles ={"default_stone.png^large_diamond_ore.png"}, + groups = {cracky=1}, + drop = 'denseores:large_diamond_ore', + sounds = default.node_sound_stone_defaults(), +}) + +--[ Small Ore Nodes --] + +minetest.register_node("denseores:small_coal_ore", { --coal + description = "Light Coal Ore", + tiles ={"default_stone.png^small_coal_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:small_coal_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_iron_ore", { --iron + description = "Light Iron Ore", + tiles ={"default_stone.png^small_iron_ore.png"}, + groups = {cracky=2}, + drop = 'denseores:small_iron_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_copper_ore", { --copper + description = "Light Copper Ore", + tiles ={"default_stone.png^small_copper_ore.png"}, + groups = {cracky=2}, + drop = 'denseores:small_copper_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_gold_ore", { --gold + description = "Light Gold Ore", + tiles ={"default_stone.png^small_gold_ore.png"}, + groups = {cracky=2}, + drop = 'denseores:small_gold_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_mese_ore", { --mese + description = "Light Mese Ore", + tiles ={"default_stone.png^small_mese_ore.png"}, + groups = {cracky=1}, + drop = 'denseores:small_mese_gem', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_diamond_ore", { --diamond + description = "Light Diamond Ore", + tiles ={"default_stone.png^small_diamond_ore.png"}, + groups = {cracky=1}, + drop = 'denseores:small_diamond_gem', + sounds = default.node_sound_stone_defaults(), +}) + +--[ Large Ore Defenitions --] + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_coal_ore", + wherein = "default:stone_with_coal", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_iron_ore", + wherein = "default:stone_with_iron", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 2, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_copper_ore", + wherein = "default:stone_with_copper", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 2, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_gold_ore", + wherein = "default:stone_with_gold", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 2, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_mese_ore", + wherein = "default:stone_with_mese", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = -64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_diamond_ore", + wherein = "default:stone_with_diamond", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = -128, +}) + +--[ Small Ore Defenitions --] + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_coal_ore", + wherein = "default:stone_with_coal", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_iron_ore", + wherein = "default:stone_with_iron", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 2, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_copper_ore", + wherein = "default:stone_with_copper", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = -16, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_gold_ore", + wherein = "default:stone_with_gold", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = -64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_mese_ore", + wherein = "default:stone_with_mese", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = -64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_diamond_ore", + wherein = "default:stone_with_diamond", + clust_scarcity = 14, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = -128, +}) + +--[ Crafting Recipies --] +--[ From Large to Normal --] + +minetest.register_craft( { + type = "shapeless", + output = "default:coal_lump 2", --coal + recipe = { + "denseores:large_coal_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:iron_lump 2", --iron + recipe = { + "denseores:large_iron_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:copper_lump 2", --copper + recipe = { + "denseores:large_copper_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:gold_lump 2", --gold + recipe = { + "denseores:large_gold_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:mese_crystal 2", --mese + recipe = { + "denseores:large_mese_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:diamond 2", --diamond + recipe = { + "denseores:large_diamond_ore", + } +}) + +--[ Crafting Recipies --] +--[ From Small to Normal --] + +minetest.register_craft( { + type = "shapeless", + output = "default:coal_lump 1", --coal + recipe = { + "denseores:small_coal_lump", + "denseores:small_coal_lump", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:iron_lump 1", --iron + recipe = { + "denseores:small_iron_lump", + "denseores:small_iron_lump", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:copper_lump 1", --copper + recipe = { + "denseores:small_copper_lump", + "denseores:small_copper_lump", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:gold_lump 1", --gold + recipe = { + "denseores:small_gold_lump", + "denseores:small_gold_lump", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:mese_crystal 1", --mese + recipe = { + "denseores:small_mese_gem", + "denseores:small_mese_gem", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "default:diamond 1", --diamond + recipe = { + "denseores:small_diamond_gem", + "denseores:small_diamond_gem", + } +}) + +-- Special things happen from this line down. + +minetest.register_craft({ + type = "fuel", + recipe = "denseores:small_coal_lump", + burntime = 20, +}) + + +-- Does moreores exist? Let's find out! +if minetest.get_modpath("moreores") then --Thank you Kazea of the Minetest Fourums. + dofile(denseores_modpath .. "/mo.lua") +end + +-- Does technic exist? Let's find out! +if minetest.get_modpath("technic") then + dofile(denseores_modpath .. "/tn.lua") +end + + diff --git a/mods/denseores/mo.lua b/mods/denseores/mo.lua new file mode 100644 index 0000000..7b031b8 --- /dev/null +++ b/mods/denseores/mo.lua @@ -0,0 +1,202 @@ +-- Mithril, Tin, Silver. That's my pattern. + +--[ Small Items --] +--[ Finished! --] + +minetest.register_craftitem("denseores:small_mithril_lump", { + description = "Small Mithrial Lump", + inventory_image = "small_mithril_lump.png", +}) + +minetest.register_craftitem("denseores:small_tin_lump", { + description = "Small Tin Lump", + inventory_image = "small_tin_lump.png", +}) + +minetest.register_craftitem("denseores:small_silver_lump", { + description = "Small Silver Lump", + inventory_image = "small_silver_lump.png", +}) + +--[ Large Ore Nodes --] +--[ Finished! --] + +minetest.register_node("denseores:large_mithril_ore", { + description = "Heavy Mithril Ore", + tiles ={"default_stone.png^large_mithril_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:large_mithril_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_tin_ore", { + description = "Heavy Tin Ore", + tiles ={"default_stone.png^large_tin_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:large_tin_ore', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:large_silver_ore", { + description = "Heavy Silver Ore", + tiles ={"default_stone.png^large_silver_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:large_silver_ore', + sounds = default.node_sound_stone_defaults(), +}) + +--[ Small Ore Nodes --] +--[ Finished! --] + +minetest.register_node("denseores:small_mithril_ore", { + description = "Light Mithril Ore", + tiles ={"default_stone.png^small_mithril_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:small_mithril_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_tin_ore", { + description = "Light Tin Ore", + tiles ={"default_stone.png^small_tin_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:small_tin_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("denseores:small_silver_ore", { + description = "Light Silver Ore", + tiles ={"default_stone.png^small_silver_ore.png"}, + groups = {cracky=3}, + drop = 'denseores:small_silver_lump', + sounds = default.node_sound_stone_defaults(), +}) + +--[ Large Ore Defenitions --] +--[ Finished! --] + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_mithril_ore", + wherein = "moreores:mineral_mithril", + clust_scarcity = 12, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_tin_ore", + wherein = "moreores:mineral_tin", + clust_scarcity = 12, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:large_silver_ore", + wherein = "moreores:mineral_silver", + clust_scarcity = 12, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +--[ Small Ore Defenitions --] +--[ Finished! --] + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_mithril_ore", + wherein = "moreores:mineral_mithril", + clust_scarcity = 12, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_tin_ore", + wherein = "moreores:mineral_tin", + clust_scarcity = 12, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "denseores:small_silver_ore", + wherein = "moreores:mineral_silver", + clust_scarcity = 12, + clust_num_ores = 2, + clust_size = 2, + height_min = -31000, + height_max = 64, +}) + +--[ Crafting Recipies --] +--[ From Large to Normal --] + +minetest.register_craft( { + type = "shapeless", + output = "moreores:mithril_lump 2", --mithril + recipe = { + "denseores:large_mithril_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "moreores:tin_lump 2", --tin + recipe = { + "denseores:large_tin_ore", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "moreores:silver_lump 2", --silver + recipe = { + "denseores:large_silver_ore", + } +}) + +--[ Crafting Recipies --] +--[ From Small to Normal --] + +minetest.register_craft( { + type = "shapeless", + output = "moreores:mithril_lump 1", --mithril + recipe = { + "denseores:small_mithril_lump", + "denseores:small_mithril_lump", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "moreores:tin_lump 1", --tin + recipe = { + "denseores:small_tin_lump", + "denseores:small_tin_lump", + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "moreores:silver_lump 1", --silver + recipe = { + "denseores:small_silver_lump", + "denseores:small_silver_lump", + } +}) diff --git a/mods/denseores/textures/.DS_Store b/mods/denseores/textures/.DS_Store new file mode 100644 index 0000000..c800ccd Binary files /dev/null and b/mods/denseores/textures/.DS_Store differ diff --git a/mods/denseores/textures/large_coal_ore.png b/mods/denseores/textures/large_coal_ore.png new file mode 100644 index 0000000..36afe8c Binary files /dev/null and b/mods/denseores/textures/large_coal_ore.png differ diff --git a/mods/denseores/textures/large_copper_ore.png b/mods/denseores/textures/large_copper_ore.png new file mode 100644 index 0000000..4db25c6 Binary files /dev/null and b/mods/denseores/textures/large_copper_ore.png differ diff --git a/mods/denseores/textures/large_diamond_ore.png b/mods/denseores/textures/large_diamond_ore.png new file mode 100644 index 0000000..82f2fb4 Binary files /dev/null and b/mods/denseores/textures/large_diamond_ore.png differ diff --git a/mods/denseores/textures/large_gold_ore.png b/mods/denseores/textures/large_gold_ore.png new file mode 100644 index 0000000..7a215a2 Binary files /dev/null and b/mods/denseores/textures/large_gold_ore.png differ diff --git a/mods/denseores/textures/large_iron_ore.png b/mods/denseores/textures/large_iron_ore.png new file mode 100644 index 0000000..769018b Binary files /dev/null and b/mods/denseores/textures/large_iron_ore.png differ diff --git a/mods/denseores/textures/large_mese_ore.png b/mods/denseores/textures/large_mese_ore.png new file mode 100644 index 0000000..9b48648 Binary files /dev/null and b/mods/denseores/textures/large_mese_ore.png differ diff --git a/mods/denseores/textures/large_mithril_ore.png b/mods/denseores/textures/large_mithril_ore.png new file mode 100644 index 0000000..2662696 Binary files /dev/null and b/mods/denseores/textures/large_mithril_ore.png differ diff --git a/mods/denseores/textures/large_silver_ore.png b/mods/denseores/textures/large_silver_ore.png new file mode 100644 index 0000000..88b31df Binary files /dev/null and b/mods/denseores/textures/large_silver_ore.png differ diff --git a/mods/denseores/textures/large_tin_ore.png b/mods/denseores/textures/large_tin_ore.png new file mode 100644 index 0000000..ace2a3b Binary files /dev/null and b/mods/denseores/textures/large_tin_ore.png differ diff --git a/mods/denseores/textures/small_coal_lump.png b/mods/denseores/textures/small_coal_lump.png new file mode 100644 index 0000000..ee38d1f Binary files /dev/null and b/mods/denseores/textures/small_coal_lump.png differ diff --git a/mods/denseores/textures/small_coal_ore.png b/mods/denseores/textures/small_coal_ore.png new file mode 100644 index 0000000..b77ea69 Binary files /dev/null and b/mods/denseores/textures/small_coal_ore.png differ diff --git a/mods/denseores/textures/small_copper_lump.png b/mods/denseores/textures/small_copper_lump.png new file mode 100644 index 0000000..a4262cb Binary files /dev/null and b/mods/denseores/textures/small_copper_lump.png differ diff --git a/mods/denseores/textures/small_copper_ore.png b/mods/denseores/textures/small_copper_ore.png new file mode 100644 index 0000000..92885aa Binary files /dev/null and b/mods/denseores/textures/small_copper_ore.png differ diff --git a/mods/denseores/textures/small_diamond_gem.png b/mods/denseores/textures/small_diamond_gem.png new file mode 100644 index 0000000..7d498d0 Binary files /dev/null and b/mods/denseores/textures/small_diamond_gem.png differ diff --git a/mods/denseores/textures/small_diamond_ore.png b/mods/denseores/textures/small_diamond_ore.png new file mode 100644 index 0000000..9f2e76c Binary files /dev/null and b/mods/denseores/textures/small_diamond_ore.png differ diff --git a/mods/denseores/textures/small_gold_lump.png b/mods/denseores/textures/small_gold_lump.png new file mode 100644 index 0000000..d8be0ef Binary files /dev/null and b/mods/denseores/textures/small_gold_lump.png differ diff --git a/mods/denseores/textures/small_gold_ore.png b/mods/denseores/textures/small_gold_ore.png new file mode 100644 index 0000000..95c2a1a Binary files /dev/null and b/mods/denseores/textures/small_gold_ore.png differ diff --git a/mods/denseores/textures/small_iron_lump.png b/mods/denseores/textures/small_iron_lump.png new file mode 100644 index 0000000..0ab28cd Binary files /dev/null and b/mods/denseores/textures/small_iron_lump.png differ diff --git a/mods/denseores/textures/small_iron_ore.png b/mods/denseores/textures/small_iron_ore.png new file mode 100644 index 0000000..21af044 Binary files /dev/null and b/mods/denseores/textures/small_iron_ore.png differ diff --git a/mods/denseores/textures/small_mese_gem.png b/mods/denseores/textures/small_mese_gem.png new file mode 100644 index 0000000..25e9730 Binary files /dev/null and b/mods/denseores/textures/small_mese_gem.png differ diff --git a/mods/denseores/textures/small_mese_ore.png b/mods/denseores/textures/small_mese_ore.png new file mode 100644 index 0000000..fb2f5a6 Binary files /dev/null and b/mods/denseores/textures/small_mese_ore.png differ diff --git a/mods/denseores/textures/small_mithril_lump.png b/mods/denseores/textures/small_mithril_lump.png new file mode 100644 index 0000000..716f41d Binary files /dev/null and b/mods/denseores/textures/small_mithril_lump.png differ diff --git a/mods/denseores/textures/small_mithril_ore.png b/mods/denseores/textures/small_mithril_ore.png new file mode 100644 index 0000000..372e3ae Binary files /dev/null and b/mods/denseores/textures/small_mithril_ore.png differ diff --git a/mods/denseores/textures/small_silver_lump.png b/mods/denseores/textures/small_silver_lump.png new file mode 100644 index 0000000..894a00a Binary files /dev/null and b/mods/denseores/textures/small_silver_lump.png differ diff --git a/mods/denseores/textures/small_silver_ore.png b/mods/denseores/textures/small_silver_ore.png new file mode 100644 index 0000000..a45b9f9 Binary files /dev/null and b/mods/denseores/textures/small_silver_ore.png differ diff --git a/mods/denseores/textures/small_tin_lump.png b/mods/denseores/textures/small_tin_lump.png new file mode 100644 index 0000000..9dbd66b Binary files /dev/null and b/mods/denseores/textures/small_tin_lump.png differ diff --git a/mods/denseores/textures/small_tin_ore.png b/mods/denseores/textures/small_tin_ore.png new file mode 100644 index 0000000..1cafc0a Binary files /dev/null and b/mods/denseores/textures/small_tin_ore.png differ diff --git a/mods/denseores/tn.lua b/mods/denseores/tn.lua new file mode 100644 index 0000000..f2fe733 --- /dev/null +++ b/mods/denseores/tn.lua @@ -0,0 +1,38 @@ +-- Heavy Ore to Dust + + +local recipes = { + {"denseores:large_coal_ore", "technic:coal_dust 4"}, + {"denseores:large_iron_ore", "technic:wrought_iron_dust 4"}, + {"denseores:large_copper_ore", "technic:copper_dust 4"}, + {"denseores:large_gold_ore", "technic:gold_dust 4"}, + {"denseores:large_mese_ore", "default:mese_crystal 2"}, + {"denseores:large_diamond_ore", "default:diamond 2"}, +-- Light Ore to Dust + {"denseores:small_coal_lump", "technic:coal_dust 1"}, + {"denseores:small_iron_lump", "technic:wrought_iron_dust 1"}, + {"denseores:small_copper_lump", "technic:copper_dust 1"}, + {"denseores:small_gold_lump", "technic:gold_dust 1"}, +} + +if minetest.get_modpath("moreores") then + table.insert(recipes, {"denseores:large_mithril_ore", "technic:mithril_dust 4"}) + table.insert(recipes, {"denseores:large_tin_ore", "technic:tin_dust 4"}) + table.insert(recipes, {"denseores:large_silver_ore", "technic:silver_dust 4"}) + + table.insert(recipes, {"denseores:small_mithril_lump", "technic:mithril_dust 1"}) + table.insert(recipes, {"denseores:small_tin_lump", "technic:tin_dust 1"}) + table.insert(recipes, {"denseores:small_silver_lump", "technic:silver_dust 1"}) +end + + +for _, data in pairs(recipes) do + technic.register_grinder_recipe({input = {data[1]}, output = data[2]}) +end + +--[[ +function technic.register_recipe(typename, data) + minetest.after(0.01, register_recipe, grinding, data) +end +--]] + diff --git a/mods/doors/README.txt b/mods/doors/README.txt new file mode 100644 index 0000000..146af8e --- /dev/null +++ b/mods/doors/README.txt @@ -0,0 +1,46 @@ +Minetest 0.4 mod: doors +======================= +version: 1.3 + +License of source code: +----------------------- +Copyright (C) 2012 PilzAdam +modified by BlockMen (added sounds, glassdoors[glass, obsidian glass], trapdoor) + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. + +License of textures +-------------------------------------- +following Textures created by Fernando Zapata (CC BY-SA 3.0): + door_wood.png + door_wood_a.png + door_wood_a_r.png + door_wood_b.png + door_wood_b_r.png + +following Textures created by BlockMen (WTFPL): + door_trapdoor.png + door_obsidian_glass_side.png + +following textures created by celeron55 (CC BY-SA 3.0): + door_trapdoor_side.png + door_glass_a.png + door_glass_b.png + +following Textures created by PenguinDad (CC BY-SA 4.0): + door_glass.png + door_obsidian_glass.png + +All other textures (created by PilzAdam): WTFPL + + +License of sounds +-------------------------------------- +Opening-Sound created by CGEffex (CC BY 3.0), modified by BlockMen + door_open.ogg +Closing-Sound created by bennstir (CC BY 3.0) + door_close.ogg diff --git a/mods/doors/depends.txt b/mods/doors/depends.txt new file mode 100644 index 0000000..5e28bee --- /dev/null +++ b/mods/doors/depends.txt @@ -0,0 +1,2 @@ +default +screwdriver? diff --git a/mods/doors/init.lua b/mods/doors/init.lua new file mode 100644 index 0000000..a553565 --- /dev/null +++ b/mods/doors/init.lua @@ -0,0 +1,502 @@ +doors = {} + +-- Registers a door +function doors.register_door(name, def) + def.groups.not_in_creative_inventory = 1 + + local box = {{-0.5, -0.5, -0.5, 0.5, 0.5, -0.5+1.5/16}} + + if not def.node_box_bottom then + def.node_box_bottom = box + end + if not def.node_box_top then + def.node_box_top = box + end + if not def.selection_box_bottom then + def.selection_box_bottom= box + end + if not def.selection_box_top then + def.selection_box_top = box + end + + if not def.sound_close_door then + def.sound_close_door = "doors_door_close" + end + if not def.sound_open_door then + def.sound_open_door = "doors_door_open" + end + + + minetest.register_craftitem(name, { + description = def.description, + inventory_image = def.inventory_image, + + on_place = function(itemstack, placer, pointed_thing) + if not pointed_thing.type == "node" then + return itemstack + end + + local ptu = pointed_thing.under + local nu = minetest.get_node(ptu) + if minetest.registered_nodes[nu.name].on_rightclick then + return minetest.registered_nodes[nu.name].on_rightclick(ptu, nu, placer, itemstack) + end + + local pt = pointed_thing.above + local pt2 = {x=pt.x, y=pt.y, z=pt.z} + pt2.y = pt2.y+1 + if + not minetest.registered_nodes[minetest.get_node(pt).name].buildable_to or + not minetest.registered_nodes[minetest.get_node(pt2).name].buildable_to or + not placer or + not placer:is_player() + then + return itemstack + end + + if minetest.is_protected(pt, placer:get_player_name()) or + minetest.is_protected(pt2, placer:get_player_name()) then + minetest.record_protection_violation(pt, placer:get_player_name()) + return itemstack + end + + local p2 = minetest.dir_to_facedir(placer:get_look_dir()) + local pt3 = {x=pt.x, y=pt.y, z=pt.z} + if p2 == 0 then + pt3.x = pt3.x-1 + elseif p2 == 1 then + pt3.z = pt3.z+1 + elseif p2 == 2 then + pt3.x = pt3.x+1 + elseif p2 == 3 then + pt3.z = pt3.z-1 + end + if minetest.get_item_group(minetest.get_node(pt3).name, "door") == 0 then + minetest.set_node(pt, {name=name.."_b_1", param2=p2}) + minetest.set_node(pt2, {name=name.."_t_1", param2=p2}) + else + minetest.set_node(pt, {name=name.."_b_2", param2=p2}) + minetest.set_node(pt2, {name=name.."_t_2", param2=p2}) + minetest.get_meta(pt):set_int("right", 1) + minetest.get_meta(pt2):set_int("right", 1) + end + + if def.only_placer_can_open then + local pn = placer:get_player_name() + local meta = minetest.get_meta(pt) + meta:set_string("doors_owner", pn) + meta:set_string("infotext", "Owned by "..pn) + meta = minetest.get_meta(pt2) + meta:set_string("doors_owner", pn) + meta:set_string("infotext", "Owned by "..pn) + end + + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end, + }) + + local tt = def.tiles_top + local tb = def.tiles_bottom + + local function after_dig_node(pos, name, digger) + local node = minetest.get_node(pos) + if node.name == name then + minetest.node_dig(pos, node, digger) + end + end + + local function check_and_blast(pos, name) + local node = minetest.get_node(pos) + if node.name == name then + minetest.remove_node(pos) + end + end + + local function make_on_blast(base_name, dir, door_type, other_door_type) + if def.only_placer_can_open then + return function() end + else + return function(pos, intensity) + check_and_blast(pos, base_name .. door_type) + pos.y = pos.y + dir + check_and_blast(pos, base_name .. other_door_type) + end + end + end + + local function on_rightclick(pos, dir, check_name, replace, replace_dir, params) + pos.y = pos.y+dir + if not minetest.get_node(pos).name == check_name then + return + end + local p2 = minetest.get_node(pos).param2 + p2 = params[p2+1] + + minetest.swap_node(pos, {name=replace_dir, param2=p2}) + + pos.y = pos.y-dir + minetest.swap_node(pos, {name=replace, param2=p2}) + + local snd_1 = def.sound_close_door + local snd_2 = def.sound_open_door + if params[1] == 3 then + snd_1 = def.sound_open_door + snd_2 = def.sound_close_door + end + + if minetest.get_meta(pos):get_int("right") ~= 0 then + minetest.sound_play(snd_1, {pos = pos, gain = 0.3, max_hear_distance = 10}) + else + minetest.sound_play(snd_2, {pos = pos, gain = 0.3, max_hear_distance = 10}) + end + end + + local function check_player_priv(pos, player) + if not def.only_placer_can_open then + return true + end + local meta = minetest.get_meta(pos) + local pn = player:get_player_name() + return meta:get_string("doors_owner") == pn + end + + local function on_rotate(pos, node, dir, user, check_name, mode, new_param2) + if not check_player_priv(pos, user) then + return false + end + if mode ~= screwdriver.ROTATE_FACE then + return false + end + + pos.y = pos.y + dir + if not minetest.get_node(pos).name == check_name then + return false + end + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return false + end + + local node2 = minetest.get_node(pos) + node2.param2 = (node2.param2 + 1) % 4 + minetest.swap_node(pos, node2) + + pos.y = pos.y - dir + node.param2 = (node.param2 + 1) % 4 + minetest.swap_node(pos, node) + return true + end + + minetest.register_node(name.."_b_1", { + tiles = {tb[2], tb[2], tb[2], tb[2], tb[1], tb[1].."^[transformfx"}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = name, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_bottom + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_bottom + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y+1 + after_dig_node(pos, name.."_t_1", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, 1, name.."_t_1", name.."_b_2", name.."_t_2", {1,2,3,0}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, 1, user, name.."_t_1", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, 1, "_b_1", "_t_1") + }) + + minetest.register_node(name.."_t_1", { + tiles = {tt[2], tt[2], tt[2], tt[2], tt[1], tt[1].."^[transformfx"}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = "", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_top + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_top + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y-1 + after_dig_node(pos, name.."_b_1", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, -1, name.."_b_1", name.."_t_2", name.."_b_2", {1,2,3,0}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, -1, user, name.."_b_1", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, -1, "_t_1", "_b_1") + }) + + minetest.register_node(name.."_b_2", { + tiles = {tb[2], tb[2], tb[2], tb[2], tb[1].."^[transformfx", tb[1]}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = name, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_bottom + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_bottom + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y+1 + after_dig_node(pos, name.."_t_2", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, 1, name.."_t_2", name.."_b_1", name.."_t_1", {3,0,1,2}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, 1, user, name.."_t_2", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, 1, "_b_2", "_t_2") + }) + + minetest.register_node(name.."_t_2", { + tiles = {tt[2], tt[2], tt[2], tt[2], tt[1].."^[transformfx", tt[1]}, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + drop = "", + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = def.node_box_top + }, + selection_box = { + type = "fixed", + fixed = def.selection_box_top + }, + groups = def.groups, + + after_dig_node = function(pos, oldnode, oldmetadata, digger) + pos.y = pos.y-1 + after_dig_node(pos, name.."_b_2", digger) + end, + + on_rightclick = function(pos, node, clicker) + if check_player_priv(pos, clicker) then + on_rightclick(pos, -1, name.."_b_2", name.."_t_1", name.."_b_1", {3,0,1,2}) + end + end, + + on_rotate = function(pos, node, user, mode, new_param2) + return on_rotate(pos, node, -1, user, name.."_b_2", mode) + end, + + can_dig = check_player_priv, + sounds = def.sounds, + sunlight_propagates = def.sunlight, + on_blast = make_on_blast(name, -1, "_t_2", "_b_2") + }) + +end + +doors.register_door("doors:door_wood", { + description = "Wooden Door", + inventory_image = "doors_wood.png", + groups = {snappy=1,choppy=2,oddly_breakable_by_hand=2,flammable=2,door=1}, + tiles_bottom = {"doors_wood_b.png", "doors_brown.png"}, + tiles_top = {"doors_wood_a.png", "doors_brown.png"}, + sounds = default.node_sound_wood_defaults(), + sunlight = false, +}) + +minetest.register_craft({ + output = "doors:door_wood", + recipe = { + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"}, + {"group:wood", "group:wood"} + } +}) + +doors.register_door("doors:door_steel", { + description = "Steel Door", + inventory_image = "doors_steel.png", + groups = {snappy=1,bendy=2,cracky=1,melty=2,level=2,door=1}, + tiles_bottom = {"doors_steel_b.png", "doors_grey.png"}, + tiles_top = {"doors_steel_a.png", "doors_grey.png"}, + only_placer_can_open = true, + sounds = default.node_sound_wood_defaults(), + sunlight = false, +}) + +minetest.register_craft({ + output = "doors:door_steel", + recipe = { + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"}, + {"default:steel_ingot", "default:steel_ingot"} + } +}) + +doors.register_door("doors:door_glass", { + description = "Glass Door", + inventory_image = "doors_glass.png", + groups = {snappy=1,cracky=1,oddly_breakable_by_hand=3,door=1}, + tiles_bottom = {"doors_glass_b.png", "doors_glass_side.png"}, + tiles_top = {"doors_glass_a.png", "doors_glass_side.png"}, + sounds = default.node_sound_glass_defaults(), + sunlight = true, +}) + +minetest.register_craft({ + output = "doors:door_glass", + recipe = { + {"default:glass", "default:glass"}, + {"default:glass", "default:glass"}, + {"default:glass", "default:glass"} + } +}) + +doors.register_door("doors:door_obsidian_glass", { + description = "Obsidian Glass Door", + inventory_image = "doors_obsidian_glass.png", + groups = {snappy=1,cracky=1,oddly_breakable_by_hand=3,door=1}, + tiles_bottom = {"doors_obsidian_glass_b.png", "doors_obsidian_glass_side.png"}, + tiles_top = {"doors_obsidian_glass_a.png", "doors_obsidian_glass_side.png"}, + sounds = default.node_sound_glass_defaults(), + sunlight = true, +}) + +minetest.register_craft({ + output = "doors:door_obsidian_glass", + recipe = { + {"default:obsidian_glass", "default:obsidian_glass"}, + {"default:obsidian_glass", "default:obsidian_glass"}, + {"default:obsidian_glass", "default:obsidian_glass"} + } +}) + + +----trapdoor---- + +function doors.register_trapdoor(name, def) + local name_closed = name + local name_opened = name.."_open" + + def.on_rightclick = function (pos, node) + local newname = node.name == name_closed and name_opened or name_closed + local sound = false + if node.name == name_closed then sound = def.sound_open end + if node.name == name_opened then sound = def.sound_close end + if sound then + minetest.sound_play(sound, {pos = pos, gain = 0.3, max_hear_distance = 10}) + end + minetest.set_node(pos, {name = newname, param1 = node.param1, param2 = node.param2}) + end + + def.on_rotate = minetest.get_modpath("screwdriver") and screwdriver.rotate_simple + + -- Common trapdoor configuration + def.drawtype = "nodebox" + def.paramtype = "light" + def.paramtype2 = "facedir" + def.is_ground_content = false + + local def_opened = table.copy(def) + local def_closed = table.copy(def) + + def_closed.node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + } + def_closed.selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + } + def_closed.tiles = { def.tile_front, def.tile_front, def.tile_side, def.tile_side, + def.tile_side, def.tile_side } + + def_opened.node_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5} + } + def_opened.selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, 0.4, 0.5, 0.5, 0.5} + } + def_opened.tiles = { def.tile_side, def.tile_side, def.tile_side, def.tile_side, + def.tile_front, def.tile_front } + def_opened.drop = name_closed + def_opened.groups.not_in_creative_inventory = 1 + + minetest.register_node(name_opened, def_opened) + minetest.register_node(name_closed, def_closed) +end + + + +doors.register_trapdoor("doors:trapdoor", { + description = "Trapdoor", + inventory_image = "doors_trapdoor.png", + wield_image = "doors_trapdoor.png", + tile_front = "doors_trapdoor.png", + tile_side = "doors_trapdoor_side.png", + groups = {snappy=1, choppy=2, oddly_breakable_by_hand=2, flammable=2, door=1}, + sounds = default.node_sound_wood_defaults(), + sound_open = "doors_door_open", + sound_close = "doors_door_close" +}) + +minetest.register_craft({ + output = 'doors:trapdoor 2', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'group:wood', 'group:wood'}, + {'', '', ''}, + } +}) diff --git a/mods/doors/sounds/doors_door_close.ogg b/mods/doors/sounds/doors_door_close.ogg new file mode 100644 index 0000000..a39452b Binary files /dev/null and b/mods/doors/sounds/doors_door_close.ogg differ diff --git a/mods/doors/sounds/doors_door_open.ogg b/mods/doors/sounds/doors_door_open.ogg new file mode 100644 index 0000000..7ec7f48 Binary files /dev/null and b/mods/doors/sounds/doors_door_open.ogg differ diff --git a/mods/doors/textures/doors_brown.png b/mods/doors/textures/doors_brown.png new file mode 100644 index 0000000..8c8e3d8 Binary files /dev/null and b/mods/doors/textures/doors_brown.png differ diff --git a/mods/doors/textures/doors_glass.png b/mods/doors/textures/doors_glass.png new file mode 100644 index 0000000..49ec245 Binary files /dev/null and b/mods/doors/textures/doors_glass.png differ diff --git a/mods/doors/textures/doors_glass_a.png b/mods/doors/textures/doors_glass_a.png new file mode 100644 index 0000000..da25402 Binary files /dev/null and b/mods/doors/textures/doors_glass_a.png differ diff --git a/mods/doors/textures/doors_glass_b.png b/mods/doors/textures/doors_glass_b.png new file mode 100644 index 0000000..da25402 Binary files /dev/null and b/mods/doors/textures/doors_glass_b.png differ diff --git a/mods/doors/textures/doors_glass_side.png b/mods/doors/textures/doors_glass_side.png new file mode 100644 index 0000000..755672b Binary files /dev/null and b/mods/doors/textures/doors_glass_side.png differ diff --git a/mods/doors/textures/doors_grey.png b/mods/doors/textures/doors_grey.png new file mode 100644 index 0000000..ad110c7 Binary files /dev/null and b/mods/doors/textures/doors_grey.png differ diff --git a/mods/doors/textures/doors_obsidian_glass.png b/mods/doors/textures/doors_obsidian_glass.png new file mode 100644 index 0000000..c327720 Binary files /dev/null and b/mods/doors/textures/doors_obsidian_glass.png differ diff --git a/mods/doors/textures/doors_obsidian_glass_a.png b/mods/doors/textures/doors_obsidian_glass_a.png new file mode 100644 index 0000000..d5ac83d Binary files /dev/null and b/mods/doors/textures/doors_obsidian_glass_a.png differ diff --git a/mods/doors/textures/doors_obsidian_glass_b.png b/mods/doors/textures/doors_obsidian_glass_b.png new file mode 100644 index 0000000..d5ac83d Binary files /dev/null and b/mods/doors/textures/doors_obsidian_glass_b.png differ diff --git a/mods/doors/textures/doors_obsidian_glass_side.png b/mods/doors/textures/doors_obsidian_glass_side.png new file mode 100644 index 0000000..aa4c63a Binary files /dev/null and b/mods/doors/textures/doors_obsidian_glass_side.png differ diff --git a/mods/doors/textures/doors_steel.png b/mods/doors/textures/doors_steel.png new file mode 100644 index 0000000..042a1bc Binary files /dev/null and b/mods/doors/textures/doors_steel.png differ diff --git a/mods/doors/textures/doors_steel_a.png b/mods/doors/textures/doors_steel_a.png new file mode 100644 index 0000000..84ff11d Binary files /dev/null and b/mods/doors/textures/doors_steel_a.png differ diff --git a/mods/doors/textures/doors_steel_b.png b/mods/doors/textures/doors_steel_b.png new file mode 100644 index 0000000..77ffbe3 Binary files /dev/null and b/mods/doors/textures/doors_steel_b.png differ diff --git a/mods/doors/textures/doors_trapdoor.png b/mods/doors/textures/doors_trapdoor.png new file mode 100644 index 0000000..e92c8b2 Binary files /dev/null and b/mods/doors/textures/doors_trapdoor.png differ diff --git a/mods/doors/textures/doors_trapdoor_side.png b/mods/doors/textures/doors_trapdoor_side.png new file mode 100644 index 0000000..c860523 Binary files /dev/null and b/mods/doors/textures/doors_trapdoor_side.png differ diff --git a/mods/doors/textures/doors_wood.png b/mods/doors/textures/doors_wood.png new file mode 100644 index 0000000..d3a62ab Binary files /dev/null and b/mods/doors/textures/doors_wood.png differ diff --git a/mods/doors/textures/doors_wood_a.png b/mods/doors/textures/doors_wood_a.png new file mode 100644 index 0000000..86a747a Binary files /dev/null and b/mods/doors/textures/doors_wood_a.png differ diff --git a/mods/doors/textures/doors_wood_b.png b/mods/doors/textures/doors_wood_b.png new file mode 100644 index 0000000..9665098 Binary files /dev/null and b/mods/doors/textures/doors_wood_b.png differ diff --git a/mods/dye/README.txt b/mods/dye/README.txt new file mode 100644 index 0000000..d414c2c --- /dev/null +++ b/mods/dye/README.txt @@ -0,0 +1,15 @@ +Minetest 0.4 mod: dye +====================== + +See init.lua for documentation. + +License of source code and media files: +--------------------------------------- +Copyright (C) 2012 Perttu Ahola (celeron55) + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. + diff --git a/mods/dye/depends.txt b/mods/dye/depends.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/dye/init.lua b/mods/dye/init.lua new file mode 100644 index 0000000..d7d18f7 --- /dev/null +++ b/mods/dye/init.lua @@ -0,0 +1,87 @@ +-- minetest/dye/init.lua + +-- Other mods can use these for looping through available colors +dye = {} +dye.basecolors = {"white", "grey", "black", "red", "yellow", "green", "cyan", "blue", "magenta"} +dye.excolors = {"white", "lightgrey", "grey", "darkgrey", "black", "red", "orange", "yellow", "lime", "green", "aqua", "cyan", "sky_blue", "blue", "violet", "magenta", "red_violet"} + +-- Local stuff +local dyelocal = {} + +-- This collection of colors is partly a historic thing, partly something else. +dyelocal.dyes = { + {"white", "White dye", {dye=1, basecolor_white=1, excolor_white=1, unicolor_white=1}}, + {"grey", "Grey dye", {dye=1, basecolor_grey=1, excolor_grey=1, unicolor_grey=1}}, + {"dark_grey", "Dark grey dye", {dye=1, basecolor_grey=1, excolor_darkgrey=1, unicolor_darkgrey=1}}, + {"black", "Black dye", {dye=1, basecolor_black=1, excolor_black=1, unicolor_black=1}}, + {"violet", "Violet dye", {dye=1, basecolor_magenta=1, excolor_violet=1, unicolor_violet=1}}, + {"blue", "Blue dye", {dye=1, basecolor_blue=1, excolor_blue=1, unicolor_blue=1}}, + {"cyan", "Cyan dye", {dye=1, basecolor_cyan=1, excolor_cyan=1, unicolor_cyan=1}}, + {"dark_green", "Dark green dye",{dye=1, basecolor_green=1, excolor_green=1, unicolor_dark_green=1}}, + {"green", "Green dye", {dye=1, basecolor_green=1, excolor_green=1, unicolor_green=1}}, + {"yellow", "Yellow dye", {dye=1, basecolor_yellow=1, excolor_yellow=1, unicolor_yellow=1}}, + {"brown", "Brown dye", {dye=1, basecolor_brown=1, excolor_orange=1, unicolor_dark_orange=1}}, + {"orange", "Orange dye", {dye=1, basecolor_orange=1, excolor_orange=1, unicolor_orange=1}}, + {"red", "Red dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_red=1}}, + {"magenta", "Magenta dye", {dye=1, basecolor_magenta=1, excolor_red_violet=1,unicolor_red_violet=1}}, + {"pink", "Pink dye", {dye=1, basecolor_red=1, excolor_red=1, unicolor_light_red=1}}, +} + +-- Define items +for _, row in ipairs(dyelocal.dyes) do + local name = row[1] + local description = row[2] + local groups = row[3] + local item_name = "dye:"..name + local item_image = "dye_"..name..".png" + minetest.register_craftitem(item_name, { + inventory_image = item_image, + description = description, + groups = groups + }) + minetest.register_craft({ + type = "shapeless", + output = item_name.." 4", + recipe = {"group:flower,color_"..name}, + }) +end +-- manually add coal->black dye +minetest.register_craft({ + type = "shapeless", + output = "dye:black 4", + recipe = {"group:coal"}, +}) + +-- Mix recipes +-- Just mix everything to everything somehow sanely + +dyelocal.mixbases = {"magenta", "red", "orange", "brown", "yellow", "green", "dark_green", "cyan", "blue", "violet", "black", "dark_grey", "grey", "white"} + +dyelocal.mixes = { + -- magenta, red, orange, brown, yellow, green, dark_green, cyan, blue, violet, black, dark_grey, grey, white + white = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "violet", "grey", "grey", "white", "white"}, + grey = {"pink", "pink", "orange", "orange", "yellow", "green", "green", "grey", "cyan", "pink", "dark_grey","grey", "grey"}, + dark_grey={"brown","brown", "brown", "brown", "brown","dark_green","dark_green","blue","blue","violet","black", "black"}, + black = {"black", "black", "black", "black", "black", "black", "black", "black", "black", "black", "black"}, + violet= {"magenta","magenta","red", "brown", "red", "cyan", "brown", "blue", "violet","violet"}, + blue = {"violet", "magenta","brown","brown","dark_green","cyan","cyan", "cyan", "blue"}, + cyan = {"blue","brown","dark_green","dark_grey","green","cyan","dark_green","cyan"}, + dark_green={"brown","brown","brown", "brown", "green", "green", "dark_green"}, + green = {"brown", "yellow","yellow","dark_green","green","green"}, + yellow= {"red", "orange", "yellow","orange", "yellow"}, + brown = {"brown", "brown","orange", "brown"}, + orange= {"red", "orange","orange"}, + red = {"magenta","red"}, + magenta={"magenta"}, +} + +for one,results in pairs(dyelocal.mixes) do + for i,result in ipairs(results) do + local another = dyelocal.mixbases[i] + minetest.register_craft({ + type = "shapeless", + output = 'dye:'..result..' 2', + recipe = {'dye:'..one, 'dye:'..another}, + }) + end +end diff --git a/mods/dye/textures/dye_black.png b/mods/dye/textures/dye_black.png new file mode 100644 index 0000000..1055b6c Binary files /dev/null and b/mods/dye/textures/dye_black.png differ diff --git a/mods/dye/textures/dye_blue.png b/mods/dye/textures/dye_blue.png new file mode 100644 index 0000000..d1377c6 Binary files /dev/null and b/mods/dye/textures/dye_blue.png differ diff --git a/mods/dye/textures/dye_brown.png b/mods/dye/textures/dye_brown.png new file mode 100644 index 0000000..77d475c Binary files /dev/null and b/mods/dye/textures/dye_brown.png differ diff --git a/mods/dye/textures/dye_cyan.png b/mods/dye/textures/dye_cyan.png new file mode 100644 index 0000000..239d66c Binary files /dev/null and b/mods/dye/textures/dye_cyan.png differ diff --git a/mods/dye/textures/dye_dark_green.png b/mods/dye/textures/dye_dark_green.png new file mode 100644 index 0000000..9606ccf Binary files /dev/null and b/mods/dye/textures/dye_dark_green.png differ diff --git a/mods/dye/textures/dye_dark_grey.png b/mods/dye/textures/dye_dark_grey.png new file mode 100644 index 0000000..060737b Binary files /dev/null and b/mods/dye/textures/dye_dark_grey.png differ diff --git a/mods/dye/textures/dye_green.png b/mods/dye/textures/dye_green.png new file mode 100644 index 0000000..0d99ee1 Binary files /dev/null and b/mods/dye/textures/dye_green.png differ diff --git a/mods/dye/textures/dye_grey.png b/mods/dye/textures/dye_grey.png new file mode 100644 index 0000000..5efb028 Binary files /dev/null and b/mods/dye/textures/dye_grey.png differ diff --git a/mods/dye/textures/dye_magenta.png b/mods/dye/textures/dye_magenta.png new file mode 100644 index 0000000..c84df62 Binary files /dev/null and b/mods/dye/textures/dye_magenta.png differ diff --git a/mods/dye/textures/dye_orange.png b/mods/dye/textures/dye_orange.png new file mode 100644 index 0000000..0844907 Binary files /dev/null and b/mods/dye/textures/dye_orange.png differ diff --git a/mods/dye/textures/dye_pink.png b/mods/dye/textures/dye_pink.png new file mode 100644 index 0000000..c3dec22 Binary files /dev/null and b/mods/dye/textures/dye_pink.png differ diff --git a/mods/dye/textures/dye_red.png b/mods/dye/textures/dye_red.png new file mode 100644 index 0000000..14eafbf Binary files /dev/null and b/mods/dye/textures/dye_red.png differ diff --git a/mods/dye/textures/dye_violet.png b/mods/dye/textures/dye_violet.png new file mode 100644 index 0000000..600cbb4 Binary files /dev/null and b/mods/dye/textures/dye_violet.png differ diff --git a/mods/dye/textures/dye_white.png b/mods/dye/textures/dye_white.png new file mode 100644 index 0000000..2a840a4 Binary files /dev/null and b/mods/dye/textures/dye_white.png differ diff --git a/mods/dye/textures/dye_yellow.png b/mods/dye/textures/dye_yellow.png new file mode 100644 index 0000000..fe75775 Binary files /dev/null and b/mods/dye/textures/dye_yellow.png differ diff --git a/mods/farming/API.txt b/mods/farming/API.txt new file mode 100644 index 0000000..171c3c3 --- /dev/null +++ b/mods/farming/API.txt @@ -0,0 +1,28 @@ +farming.register_hoe(name, hoe definition) + -> Register a new hoe, see [hoe definition] + +farming.register_plant(name, Plant definition) + -> Register a new growing plant, see [Plant definition] + +Hoe Definition +{ + description = "", -- Description for tooltip + inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image + max_uses = 30, -- Uses until destroyed + material = "", -- Material for recipes + recipe = { -- Craft recipe, if material isn't used + {"air", "air", "air"}, + {"", "group:stick"}, + {"", "group:stick"}, + } +} + +Plant definition +{ + description = "", -- Description of seed item + inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image + steps = 8, -- How many steps the plant has to grow, until it can be harvested + ^ Always provide a plant texture for each step, format: modname_plantname_i.png (i = stepnumber) + minlight = 13, -- Minimum light to grow + maxlight = default.LIGHT_MAX -- Maximum light to grow +} \ No newline at end of file diff --git a/mods/farming/README.txt b/mods/farming/README.txt new file mode 100644 index 0000000..6724695 --- /dev/null +++ b/mods/farming/README.txt @@ -0,0 +1,48 @@ +Minetest 0.4 mod: farming +========================= + +License of source code: +----------------------- +Copyright (C) 2014 webdesigner97 + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + +License of media (textures): +---------------------------- +Created by PilzAdam (License: WTFPL): + farming_bread.png + farming_soil.png + farming_soil_wet.png + farming_soil_wet_side.png + farming_string.png + +Created by BlockMen (License: CC BY 3.0): + farming_tool_diamondhoe.png + farming_tool_mesehoe.png + farming_tool_bronzehoe.png + farming_tool_steelhoe.png + farming_tool_stonehoe.png + farming_tool_woodhoe.png + +Created by MasterGollum (License: WTFPL): + farming_straw.png + +Created by Gambit (License: WTFPL): + farming_wheat.png + farming_wheat_*.png + farming_cotton_*.png + farming_flour.png + farming_cotton_seed.png + farming_wheat_seed.png \ No newline at end of file diff --git a/mods/farming/api.lua b/mods/farming/api.lua new file mode 100644 index 0000000..4b6f561 --- /dev/null +++ b/mods/farming/api.lua @@ -0,0 +1,303 @@ +-- Wear out hoes, place soil +-- TODO Ignore group:flower +farming.hoe_on_use = function(itemstack, user, pointed_thing, uses) + local pt = pointed_thing + -- check if pointing at a node + if not pt then + return + end + if pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} + local above = minetest.get_node(p) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] then + return + end + if not minetest.registered_nodes[above.name] then + return + end + + -- check if the node above the pointed thing is air + if above.name ~= "air" then + return + end + + -- check if pointing at soil + if minetest.get_item_group(under.name, "soil") ~= 1 then + return + end + + -- check if (wet) soil defined + local regN = minetest.registered_nodes + if regN[under.name].soil == nil or regN[under.name].soil.wet == nil or regN[under.name].soil.dry == nil then + return + end + + -- turn the node into soil, wear out item and play sound + minetest.set_node(pt.under, {name = regN[under.name].soil.dry}) + minetest.sound_play("default_dig_crumbly", { + pos = pt.under, + gain = 0.5, + }) + + if not minetest.setting_getbool("creative_mode") then + itemstack:add_wear(65535/(uses-1)) + end + return itemstack +end + +-- Register new hoes +farming.register_hoe = function(name, def) + -- Check for : prefix (register new hoes in your mod's namespace) + if name:sub(1,1) ~= ":" then + name = ":" .. name + end + -- Check def table + if def.description == nil then + def.description = "Hoe" + end + if def.inventory_image == nil then + def.inventory_image = "unknown_item.png" + end + if def.recipe == nil then + def.recipe = { + {"air","air",""}, + {"","group:stick",""}, + {"","group:stick",""} + } + end + if def.max_uses == nil then + def.max_uses = 30 + end + -- Register the tool + minetest.register_tool(name, { + description = def.description, + inventory_image = def.inventory_image, + on_use = function(itemstack, user, pointed_thing) + return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses) + end + }) + -- Register its recipe + if def.material == nil then + minetest.register_craft({ + output = name:sub(2), + recipe = def.recipe + }) + else + minetest.register_craft({ + output = name:sub(2), + recipe = { + {def.material, def.material, ""}, + {"", "group:stick", ""}, + {"", "group:stick", ""} + } + }) + -- Reverse Recipe + minetest.register_craft({ + output = name:sub(2), + recipe = { + {"", def.material, def.material}, + {"", "group:stick", ""}, + {"", "group:stick", ""} + } + }) + end +end + +-- Seed placement +farming.place_seed = function(itemstack, placer, pointed_thing, plantname) + local pt = pointed_thing + -- check if pointing at a node + if not pt then + return + end + if pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + local above = minetest.get_node(pt.above) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] then + return + end + if not minetest.registered_nodes[above.name] then + return + end + + -- check if pointing at the top of the node + if pt.above.y ~= pt.under.y+1 then + return + end + + -- check if you can replace the node above the pointed node + if not minetest.registered_nodes[above.name].buildable_to then + return + end + + -- check if pointing at soil + if minetest.get_item_group(under.name, "soil") < 2 then + return + end + + -- add the node and remove 1 item from the itemstack + minetest.add_node(pt.above, {name = plantname, param2 = 1}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack +end + +-- Register plants +farming.register_plant = function(name, def) + local mname = name:split(":")[1] + local pname = name:split(":")[2] + + -- Check def table + if not def.description then + def.description = "Seed" + end + if not def.inventory_image then + def.inventory_image = "unknown_item.png" + end + if not def.steps then + return nil + end + if not def.minlight then + def.minlight = 1 + end + if not def.maxlight then + def.maxlight = 14 + end + if not def.fertility then + def.fertility = {} + end + + -- Register seed + local g = {seed = 1, snappy = 3, attached_node = 1} + for k, v in pairs(def.fertility) do + g[v] = 1 + end + minetest.register_node(":" .. mname .. ":seed_" .. pname, { + description = def.description, + tiles = {def.inventory_image}, + inventory_image = def.inventory_image, + wield_image = def.inventory_image, + drawtype = "signlike", + groups = g, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, + fertility = def.fertility, + on_place = function(itemstack, placer, pointed_thing) + return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":seed_" .. pname) + end + }) + + -- Register harvest + minetest.register_craftitem(":" .. mname .. ":" .. pname, { + description = pname:gsub("^%l", string.upper), + inventory_image = mname .. "_" .. pname .. ".png", + }) + + -- Register growing steps + for i=1,def.steps do + local drop = { + items = { + {items = {mname .. ":" .. pname}, rarity = 9 - i}, + {items = {mname .. ":" .. pname}, rarity= 18 - i * 2}, + {items = {mname .. ":seed_" .. pname}, rarity = 9 - i}, + {items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2}, + } + } + local nodegroups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1} + nodegroups[pname] = i + minetest.register_node(mname .. ":" .. pname .. "_" .. i, { + drawtype = "plantlike", + waving = 1, + tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"}, + paramtype = "light", + walkable = false, + buildable_to = true, + drop = drop, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}, + }, + groups = nodegroups, + sounds = default.node_sound_leaves_defaults(), + }) + end + + -- Growing ABM + minetest.register_abm({ + nodenames = {"group:" .. pname, "group:seed"}, + neighbors = {"group:soil"}, + interval = 90, + chance = 2, + action = function(pos, node) + local plant_height = minetest.get_item_group(node.name, pname) + + -- return if already full grown + if plant_height == def.steps then + return + end + + local node_def = minetest.registered_items[node.name] or nil + + -- grow seed + if minetest.get_item_group(node.name, "seed") and node_def.fertility then + local can_grow = false + local soil_node = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) + if not soil_node then + return + end + for _, v in pairs(node_def.fertility) do + if minetest.get_item_group(soil_node.name, v) ~= 0 then + can_grow = true + end + end + if can_grow then + minetest.set_node(pos, {name = node.name:gsub("seed_", "") .. "_1"}) + end + return + end + + -- check if on wet soil + pos.y = pos.y - 1 + local n = minetest.get_node(pos) + if minetest.get_item_group(n.name, "soil") < 3 then + return + end + pos.y = pos.y + 1 + + -- check light + local ll = minetest.get_node_light(pos) + + if not ll or ll < def.minlight or ll > def.maxlight then + return + end + + -- grow + minetest.set_node(pos, {name = mname .. ":" .. pname .. "_" .. plant_height + 1}) + end + }) + + -- Return + local r = { + seed = mname .. ":seed_" .. pname, + harvest = mname .. ":" .. pname + } + return r +end diff --git a/mods/farming/depends.txt b/mods/farming/depends.txt new file mode 100644 index 0000000..470ec30 --- /dev/null +++ b/mods/farming/depends.txt @@ -0,0 +1,2 @@ +default +wool diff --git a/mods/farming/hoes.lua b/mods/farming/hoes.lua new file mode 100644 index 0000000..31da19f --- /dev/null +++ b/mods/farming/hoes.lua @@ -0,0 +1,41 @@ +farming.register_hoe(":farming:hoe_wood", { + description = "Wooden Hoe", + inventory_image = "farming_tool_woodhoe.png", + max_uses = 30, + material = "group:wood" +}) + +farming.register_hoe(":farming:hoe_stone", { + description = "Stone Hoe", + inventory_image = "farming_tool_stonehoe.png", + max_uses = 90, + material = "group:stone" +}) + +farming.register_hoe(":farming:hoe_steel", { + description = "Steel Hoe", + inventory_image = "farming_tool_steelhoe.png", + max_uses = 200, + material = "default:steel_ingot" +}) + +farming.register_hoe(":farming:hoe_bronze", { + description = "Bronze Hoe", + inventory_image = "farming_tool_bronzehoe.png", + max_uses = 220, + material = "default:bronze_ingot" +}) + +farming.register_hoe(":farming:hoe_mese", { + description = "Mese Hoe", + inventory_image = "farming_tool_mesehoe.png", + max_uses = 350, + material = "default:mese_crystal" +}) + +farming.register_hoe(":farming:hoe_diamond", { + description = "Diamond Hoe", + inventory_image = "farming_tool_diamondhoe.png", + max_uses = 500, + material = "default:diamond" +}) diff --git a/mods/farming/init.lua b/mods/farming/init.lua new file mode 100644 index 0000000..6bc4822 --- /dev/null +++ b/mods/farming/init.lua @@ -0,0 +1,78 @@ +-- Global farming namespace +farming = {} +farming.path = minetest.get_modpath("farming") + +-- Load files +dofile(farming.path .. "/api.lua") +dofile(farming.path .. "/nodes.lua") +dofile(farming.path .. "/hoes.lua") + +-- WHEAT +farming.register_plant("farming:wheat", { + description = "Wheat seed", + inventory_image = "farming_wheat_seed.png", + steps = 8, + minlight = 13, + maxlight = default.LIGHT_MAX, + fertility = {"grassland"} +}) +minetest.register_craftitem("farming:flour", { + description = "Flour", + inventory_image = "farming_flour.png", +}) + +minetest.register_craftitem("farming:bread", { + description = "Bread", + inventory_image = "farming_bread.png", + on_use = minetest.item_eat(5), +}) + +minetest.register_craft({ + type = "shapeless", + output = "farming:flour", + recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"} +}) + +minetest.register_craft({ + type = "cooking", + cooktime = 15, + output = "farming:bread", + recipe = "farming:flour" +}) + +-- Cotton +farming.register_plant("farming:cotton", { + description = "Cotton seed", + inventory_image = "farming_cotton_seed.png", + steps = 8, + minlight = 13, + maxlight = default.LIGHT_MAX, + fertility = {"grassland", "desert"}, +}) + +minetest.register_alias("farming:string", "farming:cotton") + +minetest.register_craft({ + output = "wool:white", + recipe = { + {"farming:cotton", "farming:cotton"}, + {"farming:cotton", "farming:cotton"}, + } +}) + +-- Straw +minetest.register_craft({ + output = "farming:straw 3", + recipe = { + {"farming:wheat", "farming:wheat", "farming:wheat"}, + {"farming:wheat", "farming:wheat", "farming:wheat"}, + {"farming:wheat", "farming:wheat", "farming:wheat"}, + } +}) + +minetest.register_craft({ + output = "farming:wheat 3", + recipe = { + {"farming:straw"}, + } +}) diff --git a/mods/farming/nodes.lua b/mods/farming/nodes.lua new file mode 100644 index 0000000..c18e6aa --- /dev/null +++ b/mods/farming/nodes.lua @@ -0,0 +1,137 @@ +minetest.override_item("default:dirt", { + groups = {crumbly=3,soil=1}, + soil = { + base = "default:dirt", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.override_item("default:dirt_with_grass", { + groups = {crumbly=3,soil=1}, + soil = { + base = "default:dirt_with_grass", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.register_node("farming:soil", { + description = "Soil", + tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"}, + drop = "default:dirt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=2, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "default:dirt", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.register_node("farming:soil_wet", { + description = "Wet Soil", + tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"}, + drop = "default:dirt", + groups = {crumbly=3, not_in_creative_inventory=1, soil=3, wet = 1, grassland = 1, field = 1}, + sounds = default.node_sound_dirt_defaults(), + soil = { + base = "default:dirt", + dry = "farming:soil", + wet = "farming:soil_wet" + } +}) + +minetest.override_item("default:desert_sand", { + groups = {crumbly=3, falling_node=1, sand=1, soil = 1}, + soil = { + base = "default:desert_sand", + dry = "farming:desert_sand_soil", + wet = "farming:desert_sand_soil_wet" + } +}) +minetest.register_node("farming:desert_sand_soil", { + description = "Desert Sand Soil", + drop = "default:desert_sand", + tiles = {"farming_desert_sand_soil.png", "default_desert_sand.png"}, + groups = {crumbly=3, not_in_creative_inventory = 1, falling_node=1, sand=1, soil = 2, desert = 1, field = 1}, + sounds = default.node_sound_sand_defaults(), + soil = { + base = "default:desert_sand", + dry = "farming:desert_sand_soil", + wet = "farming:desert_sand_soil_wet" + } +}) + +minetest.register_node("farming:desert_sand_soil_wet", { + description = "Wet Desert Sand Soil", + drop = "default:desert_sand", + tiles = {"farming_desert_sand_soil_wet.png", "farming_desert_sand_soil_wet_side.png"}, + groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1, soil=3, wet = 1, desert = 1, field = 1}, + sounds = default.node_sound_sand_defaults(), + soil = { + base = "default:desert_sand", + dry = "farming:desert_sand_soil", + wet = "farming:desert_sand_soil_wet" + } +}) + +minetest.register_node("farming:straw", { + description = "Straw", + tiles = {"farming_straw.png"}, + is_ground_content = false, + groups = {snappy=3, flammable=4}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_abm({ + nodenames = {"group:field"}, + interval = 15, + chance = 4, + action = function(pos, node) + local n_def = minetest.registered_nodes[node.name] or nil + local wet = n_def.soil.wet or nil + local base = n_def.soil.base or nil + local dry = n_def.soil.dry or nil + if not n_def or not n_def.soil or not wet or not base or not dry then + return + end + + pos.y = pos.y + 1 + local nn = minetest.get_node_or_nil(pos) + if not nn or not nn.name then + return + end + local nn_def = minetest.registered_nodes[nn.name] or nil + pos.y = pos.y - 1 + + if nn_def and nn_def.walkable and minetest.get_item_group(nn.name, "plant") == 0 then + minetest.set_node(pos, {name = base}) + return + end + -- check if there is water nearby + local wet_lvl = minetest.get_item_group(node.name, "wet") + if minetest.find_node_near(pos, 3, {"group:water"}) then + -- if it is dry soil and not base node, turn it into wet soil + if wet_lvl == 0 then + minetest.set_node(pos, {name = wet}) + end + else + -- only turn back if there are no unloaded blocks (and therefore + -- possible water sources) nearby + if not minetest.find_node_near(pos, 3, {"ignore"}) then + -- turn it back into base if it is already dry + if wet_lvl == 0 then + -- only turn it back if there is no plant/seed on top of it + if minetest.get_item_group(nn.name, "plant") == 0 and minetest.get_item_group(nn.name, "seed") == 0 then + minetest.set_node(pos, {name = base}) + end + + -- if its wet turn it back into dry soil + elseif wet_lvl == 1 then + minetest.set_node(pos, {name = dry}) + end + end + end + end, +}) diff --git a/mods/farming/textures/farming_bread.png b/mods/farming/textures/farming_bread.png new file mode 100644 index 0000000..0c25678 Binary files /dev/null and b/mods/farming/textures/farming_bread.png differ diff --git a/mods/farming/textures/farming_cotton.png b/mods/farming/textures/farming_cotton.png new file mode 100644 index 0000000..e2bbfd7 Binary files /dev/null and b/mods/farming/textures/farming_cotton.png differ diff --git a/mods/farming/textures/farming_cotton_1.png b/mods/farming/textures/farming_cotton_1.png new file mode 100644 index 0000000..5fc2180 Binary files /dev/null and b/mods/farming/textures/farming_cotton_1.png differ diff --git a/mods/farming/textures/farming_cotton_2.png b/mods/farming/textures/farming_cotton_2.png new file mode 100644 index 0000000..db4f4a3 Binary files /dev/null and b/mods/farming/textures/farming_cotton_2.png differ diff --git a/mods/farming/textures/farming_cotton_3.png b/mods/farming/textures/farming_cotton_3.png new file mode 100644 index 0000000..df3d7a7 Binary files /dev/null and b/mods/farming/textures/farming_cotton_3.png differ diff --git a/mods/farming/textures/farming_cotton_4.png b/mods/farming/textures/farming_cotton_4.png new file mode 100644 index 0000000..f314b07 Binary files /dev/null and b/mods/farming/textures/farming_cotton_4.png differ diff --git a/mods/farming/textures/farming_cotton_5.png b/mods/farming/textures/farming_cotton_5.png new file mode 100644 index 0000000..3e89085 Binary files /dev/null and b/mods/farming/textures/farming_cotton_5.png differ diff --git a/mods/farming/textures/farming_cotton_6.png b/mods/farming/textures/farming_cotton_6.png new file mode 100644 index 0000000..f4bd4fb Binary files /dev/null and b/mods/farming/textures/farming_cotton_6.png differ diff --git a/mods/farming/textures/farming_cotton_7.png b/mods/farming/textures/farming_cotton_7.png new file mode 100644 index 0000000..466d40a Binary files /dev/null and b/mods/farming/textures/farming_cotton_7.png differ diff --git a/mods/farming/textures/farming_cotton_8.png b/mods/farming/textures/farming_cotton_8.png new file mode 100644 index 0000000..f835ba5 Binary files /dev/null and b/mods/farming/textures/farming_cotton_8.png differ diff --git a/mods/farming/textures/farming_cotton_seed.png b/mods/farming/textures/farming_cotton_seed.png new file mode 100644 index 0000000..f1d5b8a Binary files /dev/null and b/mods/farming/textures/farming_cotton_seed.png differ diff --git a/mods/farming/textures/farming_desert_sand_soil.png b/mods/farming/textures/farming_desert_sand_soil.png new file mode 100644 index 0000000..3c09ef0 Binary files /dev/null and b/mods/farming/textures/farming_desert_sand_soil.png differ diff --git a/mods/farming/textures/farming_desert_sand_soil_wet.png b/mods/farming/textures/farming_desert_sand_soil_wet.png new file mode 100644 index 0000000..facc83e Binary files /dev/null and b/mods/farming/textures/farming_desert_sand_soil_wet.png differ diff --git a/mods/farming/textures/farming_desert_sand_soil_wet_side.png b/mods/farming/textures/farming_desert_sand_soil_wet_side.png new file mode 100644 index 0000000..41e5a04 Binary files /dev/null and b/mods/farming/textures/farming_desert_sand_soil_wet_side.png differ diff --git a/mods/farming/textures/farming_flour.png b/mods/farming/textures/farming_flour.png new file mode 100644 index 0000000..b1a9783 Binary files /dev/null and b/mods/farming/textures/farming_flour.png differ diff --git a/mods/farming/textures/farming_soil.png b/mods/farming/textures/farming_soil.png new file mode 100644 index 0000000..5cd3e68 Binary files /dev/null and b/mods/farming/textures/farming_soil.png differ diff --git a/mods/farming/textures/farming_soil_wet.png b/mods/farming/textures/farming_soil_wet.png new file mode 100644 index 0000000..0b4487d Binary files /dev/null and b/mods/farming/textures/farming_soil_wet.png differ diff --git a/mods/farming/textures/farming_soil_wet_side.png b/mods/farming/textures/farming_soil_wet_side.png new file mode 100644 index 0000000..f0b1bd4 Binary files /dev/null and b/mods/farming/textures/farming_soil_wet_side.png differ diff --git a/mods/farming/textures/farming_straw.png b/mods/farming/textures/farming_straw.png new file mode 100644 index 0000000..f9f5fe7 Binary files /dev/null and b/mods/farming/textures/farming_straw.png differ diff --git a/mods/farming/textures/farming_tool_bronzehoe.png b/mods/farming/textures/farming_tool_bronzehoe.png new file mode 100644 index 0000000..2802d11 Binary files /dev/null and b/mods/farming/textures/farming_tool_bronzehoe.png differ diff --git a/mods/farming/textures/farming_tool_diamondhoe.png b/mods/farming/textures/farming_tool_diamondhoe.png new file mode 100644 index 0000000..66f1042 Binary files /dev/null and b/mods/farming/textures/farming_tool_diamondhoe.png differ diff --git a/mods/farming/textures/farming_tool_mesehoe.png b/mods/farming/textures/farming_tool_mesehoe.png new file mode 100644 index 0000000..4534fba Binary files /dev/null and b/mods/farming/textures/farming_tool_mesehoe.png differ diff --git a/mods/farming/textures/farming_tool_steelhoe.png b/mods/farming/textures/farming_tool_steelhoe.png new file mode 100644 index 0000000..d057af2 Binary files /dev/null and b/mods/farming/textures/farming_tool_steelhoe.png differ diff --git a/mods/farming/textures/farming_tool_stonehoe.png b/mods/farming/textures/farming_tool_stonehoe.png new file mode 100644 index 0000000..55d8123 Binary files /dev/null and b/mods/farming/textures/farming_tool_stonehoe.png differ diff --git a/mods/farming/textures/farming_tool_woodhoe.png b/mods/farming/textures/farming_tool_woodhoe.png new file mode 100644 index 0000000..a287152 Binary files /dev/null and b/mods/farming/textures/farming_tool_woodhoe.png differ diff --git a/mods/farming/textures/farming_wheat.png b/mods/farming/textures/farming_wheat.png new file mode 100644 index 0000000..1e0ad3b Binary files /dev/null and b/mods/farming/textures/farming_wheat.png differ diff --git a/mods/farming/textures/farming_wheat_1.png b/mods/farming/textures/farming_wheat_1.png new file mode 100644 index 0000000..c16ad94 Binary files /dev/null and b/mods/farming/textures/farming_wheat_1.png differ diff --git a/mods/farming/textures/farming_wheat_2.png b/mods/farming/textures/farming_wheat_2.png new file mode 100644 index 0000000..baddb4c Binary files /dev/null and b/mods/farming/textures/farming_wheat_2.png differ diff --git a/mods/farming/textures/farming_wheat_3.png b/mods/farming/textures/farming_wheat_3.png new file mode 100644 index 0000000..36ebb19 Binary files /dev/null and b/mods/farming/textures/farming_wheat_3.png differ diff --git a/mods/farming/textures/farming_wheat_4.png b/mods/farming/textures/farming_wheat_4.png new file mode 100644 index 0000000..735ed77 Binary files /dev/null and b/mods/farming/textures/farming_wheat_4.png differ diff --git a/mods/farming/textures/farming_wheat_5.png b/mods/farming/textures/farming_wheat_5.png new file mode 100644 index 0000000..f40b5f0 Binary files /dev/null and b/mods/farming/textures/farming_wheat_5.png differ diff --git a/mods/farming/textures/farming_wheat_6.png b/mods/farming/textures/farming_wheat_6.png new file mode 100644 index 0000000..e9c78e0 Binary files /dev/null and b/mods/farming/textures/farming_wheat_6.png differ diff --git a/mods/farming/textures/farming_wheat_7.png b/mods/farming/textures/farming_wheat_7.png new file mode 100644 index 0000000..cc26ca9 Binary files /dev/null and b/mods/farming/textures/farming_wheat_7.png differ diff --git a/mods/farming/textures/farming_wheat_8.png b/mods/farming/textures/farming_wheat_8.png new file mode 100644 index 0000000..d050093 Binary files /dev/null and b/mods/farming/textures/farming_wheat_8.png differ diff --git a/mods/farming/textures/farming_wheat_seed.png b/mods/farming/textures/farming_wheat_seed.png new file mode 100644 index 0000000..a9031fb Binary files /dev/null and b/mods/farming/textures/farming_wheat_seed.png differ diff --git a/mods/fire/README.txt b/mods/fire/README.txt new file mode 100644 index 0000000..fdbce15 --- /dev/null +++ b/mods/fire/README.txt @@ -0,0 +1,32 @@ +Minetest 0.4 mod: fire +====================== + +License of source code: +----------------------- +Copyright (C) 2012 Perttu Ahola (celeron55) + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Authors of media files +----------------------- +Everything not listed in here: +Copyright (C) 2012 Perttu Ahola (celeron55) + +fire_small.ogg sampled from: + http://www.freesound.org/people/dobroide/sounds/4211/ + +fire_large.ogg sampled from: + http://www.freesound.org/people/Dynamicell/sounds/17548/ + +fire_basic_flame_animated.png: + Muadtralk diff --git a/mods/fire/init.lua b/mods/fire/init.lua new file mode 100644 index 0000000..20b1dd2 --- /dev/null +++ b/mods/fire/init.lua @@ -0,0 +1,189 @@ +-- minetest/fire/init.lua + +fire = {} + +minetest.register_node("fire:basic_flame", { + description = "Fire", + drawtype = "firelike", + tiles = {{ + name="fire_basic_flame_animated.png", + animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}, + }}, + inventory_image = "fire_basic_flame.png", + light_source = 14, + groups = {igniter=2,dig_immediate=3}, + drop = '', + walkable = false, + buildable_to = true, + damage_per_second = 4, + + on_construct = function(pos) + minetest.after(0, fire.on_flame_add_at, pos) + end, + + on_destruct = function(pos) + minetest.after(0, fire.on_flame_remove_at, pos) + end, + + -- unaffected by explosions + on_blast = function() end, +}) + +fire.D = 6 +-- key: position hash of low corner of area +-- value: {handle=sound handle, name=sound name} +fire.sounds = {} + +function fire.get_area_p0p1(pos) + local p0 = { + x=math.floor(pos.x/fire.D)*fire.D, + y=math.floor(pos.y/fire.D)*fire.D, + z=math.floor(pos.z/fire.D)*fire.D, + } + local p1 = { + x=p0.x+fire.D-1, + y=p0.y+fire.D-1, + z=p0.z+fire.D-1 + } + return p0, p1 +end + +function fire.update_sounds_around(pos) + local p0, p1 = fire.get_area_p0p1(pos) + local cp = {x=(p0.x+p1.x)/2, y=(p0.y+p1.y)/2, z=(p0.z+p1.z)/2} + local flames_p = minetest.find_nodes_in_area(p0, p1, {"fire:basic_flame"}) + --print("number of flames at "..minetest.pos_to_string(p0).."/" + -- ..minetest.pos_to_string(p1)..": "..#flames_p) + local should_have_sound = (#flames_p > 0) + local wanted_sound = nil + if #flames_p >= 9 then + wanted_sound = {name="fire_large", gain=1.5} + elseif #flames_p > 0 then + wanted_sound = {name="fire_small", gain=1.5} + end + local p0_hash = minetest.hash_node_position(p0) + local sound = fire.sounds[p0_hash] + if not sound then + if should_have_sound then + fire.sounds[p0_hash] = { + handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}), + name = wanted_sound.name, + } + end + else + if not wanted_sound then + minetest.sound_stop(sound.handle) + fire.sounds[p0_hash] = nil + elseif sound.name ~= wanted_sound.name then + minetest.sound_stop(sound.handle) + fire.sounds[p0_hash] = { + handle = minetest.sound_play(wanted_sound, {pos=cp, max_hear_distance = 16, loop=true}), + name = wanted_sound.name, + } + end + end +end + +function fire.on_flame_add_at(pos) + fire.update_sounds_around(pos) +end + +function fire.on_flame_remove_at(pos) + fire.update_sounds_around(pos) +end + +function fire.find_pos_for_flame_around(pos) + return minetest.find_node_near(pos, 1, {"air"}) +end + +function fire.flame_should_extinguish(pos) + if minetest.setting_getbool("disable_fire") then return true end + --return minetest.find_node_near(pos, 1, {"group:puts_out_fire"}) + local p0 = {x=pos.x-2, y=pos.y, z=pos.z-2} + local p1 = {x=pos.x+2, y=pos.y, z=pos.z+2} + local ps = minetest.find_nodes_in_area(p0, p1, {"group:puts_out_fire"}) + return (#ps ~= 0) +end + +-- Ignite neighboring nodes +minetest.register_abm({ + nodenames = {"group:flammable"}, + neighbors = {"group:igniter"}, + interval = 5, + chance = 2, + action = function(p0, node, _, _) + -- If there is water or stuff like that around flame, don't ignite + if fire.flame_should_extinguish(p0) then + return + end + local p = fire.find_pos_for_flame_around(p0) + if p then + minetest.set_node(p, {name="fire:basic_flame"}) + end + end, +}) + +-- Rarely ignite things from far +minetest.register_abm({ + nodenames = {"group:igniter"}, + neighbors = {"air"}, + interval = 5, + chance = 10, + action = function(p0, node, _, _) + local reg = minetest.registered_nodes[node.name] + if not reg or not reg.groups.igniter or reg.groups.igniter < 2 then + return + end + local d = reg.groups.igniter + local p = minetest.find_node_near(p0, d, {"group:flammable"}) + if p then + -- If there is water or stuff like that around flame, don't ignite + if fire.flame_should_extinguish(p) then + return + end + local p2 = fire.find_pos_for_flame_around(p) + if p2 then + minetest.set_node(p2, {name="fire:basic_flame"}) + end + end + end, +}) + +-- Remove flammable nodes and flame +minetest.register_abm({ + nodenames = {"fire:basic_flame"}, + interval = 3, + chance = 2, + action = function(p0, node, _, _) + -- If there is water or stuff like that around flame, remove flame + if fire.flame_should_extinguish(p0) then + minetest.remove_node(p0) + return + end + -- Make the following things rarer + if math.random(1,3) == 1 then + return + end + -- If there are no flammable nodes around flame, remove flame + if not minetest.find_node_near(p0, 1, {"group:flammable"}) then + minetest.remove_node(p0) + return + end + if math.random(1,4) == 1 then + -- remove a flammable node around flame + local p = minetest.find_node_near(p0, 1, {"group:flammable"}) + if p then + -- If there is water or stuff like that around flame, don't remove + if fire.flame_should_extinguish(p0) then + return + end + minetest.remove_node(p) + nodeupdate(p) + end + else + -- remove flame + minetest.remove_node(p0) + end + end, +}) + diff --git a/mods/fire/sounds/fire_large.ogg b/mods/fire/sounds/fire_large.ogg new file mode 100644 index 0000000..fe78e62 Binary files /dev/null and b/mods/fire/sounds/fire_large.ogg differ diff --git a/mods/fire/sounds/fire_small.ogg b/mods/fire/sounds/fire_small.ogg new file mode 100644 index 0000000..5aac595 Binary files /dev/null and b/mods/fire/sounds/fire_small.ogg differ diff --git a/mods/fire/textures/fire_basic_flame.png b/mods/fire/textures/fire_basic_flame.png new file mode 100644 index 0000000..1da0702 Binary files /dev/null and b/mods/fire/textures/fire_basic_flame.png differ diff --git a/mods/fire/textures/fire_basic_flame_animated.png b/mods/fire/textures/fire_basic_flame_animated.png new file mode 100644 index 0000000..1cdd9fd Binary files /dev/null and b/mods/fire/textures/fire_basic_flame_animated.png differ diff --git a/mods/flowers/README.txt b/mods/flowers/README.txt new file mode 100644 index 0000000..04f96d9 --- /dev/null +++ b/mods/flowers/README.txt @@ -0,0 +1,16 @@ +Minetest 0.4 mod: flowers +========================= + +License of source code: +----------------------- +Copyright (C) 2012-2013 Ironzorg, VanessaE + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. + +License of media (textures and sounds) +-------------------------------------- +WTFPL diff --git a/mods/flowers/depends.txt b/mods/flowers/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/flowers/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/flowers/init.lua b/mods/flowers/init.lua new file mode 100644 index 0000000..672f8b5 --- /dev/null +++ b/mods/flowers/init.lua @@ -0,0 +1,104 @@ +-- Minetest 0.4 mod: default +-- See README.txt for licensing and other information. + +-- Namespace for functions +flowers = {} + +-- Map Generation +dofile(minetest.get_modpath("flowers").."/mapgen.lua") + +-- Aliases for original flowers mod +minetest.register_alias("flowers:flower_dandelion_white", "flowers:dandelion_white") +minetest.register_alias("flowers:flower_dandelion_yellow", "flowers:dandelion_yellow") +minetest.register_alias("flowers:flower_geranium", "flowers:geranium") +minetest.register_alias("flowers:flower_rose", "flowers:rose") +minetest.register_alias("flowers:flower_tulip", "flowers:tulip") +minetest.register_alias("flowers:flower_viola", "flowers:viola") + +-- Flower registration function +local function add_simple_flower(name, desc, box, f_groups) + -- Common flowers' groups + f_groups.snappy = 3 + f_groups.flammable = 2 + f_groups.flower = 1 + f_groups.flora = 1 + f_groups.attached_node = 1 + + minetest.register_node("flowers:"..name.."", { + description = desc, + drawtype = "plantlike", + tiles = { "flowers_" .. name .. ".png" }, + inventory_image = "flowers_" .. name .. ".png", + wield_image = "flowers_" .. name .. ".png", + sunlight_propagates = true, + paramtype = "light", + walkable = false, + stack_max = 99, + groups = f_groups, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = box + } + }) +end + +-- Registrations using the function above +flowers.datas = { + {"dandelion_yellow", "Yellow Dandelion", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_yellow=1}}, + {"geranium", "Blue Geranium", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_blue=1}}, + {"rose", "Rose", { -0.15, -0.5, -0.15, 0.15, 0.3, 0.15 }, {color_red=1}}, + {"tulip", "Orange Tulip", { -0.15, -0.5, -0.15, 0.15, 0.2, 0.15 }, {color_orange=1}}, + {"dandelion_white", "White dandelion", { -0.5, -0.5, -0.5, 0.5, -0.2, 0.5 }, {color_white=1}}, + {"viola", "Viola", { -0.5, -0.5, -0.5, 0.5, -0.2, 0.5 }, {color_violet=1}} +} + +for _,item in pairs(flowers.datas) do + add_simple_flower(unpack(item)) +end + +minetest.register_abm({ + nodenames = {"group:flora"}, + neighbors = {"default:dirt_with_grass", "default:desert_sand"}, + interval = 50, + chance = 25, + action = function(pos, node) + pos.y = pos.y - 1 + local under = minetest.get_node(pos) + pos.y = pos.y + 1 + if under.name == "default:desert_sand" then + minetest.set_node(pos, {name="default:dry_shrub"}) + elseif under.name ~= "default:dirt_with_grass" then + return + end + + local light = minetest.get_node_light(pos) + if not light or light < 13 then + return + end + + local pos0 = {x=pos.x-4,y=pos.y-4,z=pos.z-4} + local pos1 = {x=pos.x+4,y=pos.y+4,z=pos.z+4} + if #minetest.find_nodes_in_area(pos0, pos1, "group:flora_block") > 0 then + return + end + + local flowers = minetest.find_nodes_in_area(pos0, pos1, "group:flora") + if #flowers > 3 then + return + end + + local seedling = minetest.find_nodes_in_area(pos0, pos1, "default:dirt_with_grass") + if #seedling > 0 then + seedling = seedling[math.random(#seedling)] + seedling.y = seedling.y + 1 + light = minetest.get_node_light(seedling) + if not light or light < 13 then + return + end + if minetest.get_node(seedling).name == "air" then + minetest.set_node(seedling, {name=node.name}) + end + end + end, +}) diff --git a/mods/flowers/mapgen.lua b/mods/flowers/mapgen.lua new file mode 100644 index 0000000..aa0380a --- /dev/null +++ b/mods/flowers/mapgen.lua @@ -0,0 +1,35 @@ +local function register_flower(name) + minetest.register_decoration({ + deco_type = "simple", + place_on = {"default:dirt_with_grass"}, + sidelen = 16, + noise_params = { + offset = 0, + scale = 0.006, + spread = {x=100, y=100, z=100}, + seed = 436, + octaves = 3, + persist = 0.6 + }, + y_min = 1, + y_max = 30, + decoration = "flowers:"..name, + }) +end + +function flowers.register_mgv6_decorations() + register_flower("rose") + register_flower("tulip") + register_flower("dandelion_yellow") + register_flower("geranium") + register_flower("viola") + register_flower("dandelion_white") +end + +-- Enable in mapgen v6 only + +local mg_params = minetest.get_mapgen_params() +if mg_params.mgname == "v6" then + flowers.register_mgv6_decorations() +end + diff --git a/mods/flowers/textures/flowers_dandelion_white.png b/mods/flowers/textures/flowers_dandelion_white.png new file mode 100644 index 0000000..1bc02fb Binary files /dev/null and b/mods/flowers/textures/flowers_dandelion_white.png differ diff --git a/mods/flowers/textures/flowers_dandelion_yellow.png b/mods/flowers/textures/flowers_dandelion_yellow.png new file mode 100644 index 0000000..ec11c1c Binary files /dev/null and b/mods/flowers/textures/flowers_dandelion_yellow.png differ diff --git a/mods/flowers/textures/flowers_geranium.png b/mods/flowers/textures/flowers_geranium.png new file mode 100644 index 0000000..88de1d7 Binary files /dev/null and b/mods/flowers/textures/flowers_geranium.png differ diff --git a/mods/flowers/textures/flowers_rose.png b/mods/flowers/textures/flowers_rose.png new file mode 100644 index 0000000..e3b841d Binary files /dev/null and b/mods/flowers/textures/flowers_rose.png differ diff --git a/mods/flowers/textures/flowers_tulip.png b/mods/flowers/textures/flowers_tulip.png new file mode 100644 index 0000000..471fcd3 Binary files /dev/null and b/mods/flowers/textures/flowers_tulip.png differ diff --git a/mods/flowers/textures/flowers_viola.png b/mods/flowers/textures/flowers_viola.png new file mode 100644 index 0000000..ca2d750 Binary files /dev/null and b/mods/flowers/textures/flowers_viola.png differ diff --git a/mods/food/blends/smoker.blend b/mods/food/blends/smoker.blend new file mode 100644 index 0000000..eab90b6 Binary files /dev/null and b/mods/food/blends/smoker.blend differ diff --git a/mods/food/cooking_machines.lua b/mods/food/cooking_machines.lua new file mode 100644 index 0000000..fc71946 --- /dev/null +++ b/mods/food/cooking_machines.lua @@ -0,0 +1,97 @@ +--Node Definitions +minetest.register_node('food:smoker', { --This will allow for smoking meats + description = 'Smoker', + drawtype = 'mesh', + mesh = 'food_smoker.obj', + tiles = {name='food_smoker.png'}, + inventory_image = 'foodsmoker.png', + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.5, -.5, -.4, .5, .5, .4}, + }, + collision_box = { + type = 'fixed', + fixed = {-.5, -.5, -.4, .5, .5, .4}, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('fuel', 1) + inv:set_size('meat', 3*2) + meta:set_string('formspec', + 'size[8,7]'.. + 'label[0,0;Smoke meat to preserve it.]' .. + 'list[current_name;meat;1,.5;3,2;]'.. + 'list[current_name;fuel;5,1.5;1,1]'.. + 'list[current_player;main;0,3;8,4;]') + meta:set_string('infotext', 'Smoker') + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local node = minetest.get_node(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + --[[ +--------------- Thanks to Kaeza for this code + local function is_item_in_group(itemname, group) + local def = minetest.registered_items[name] + if not def then return end + return (def.groups and (def.groups[group] or 0)>0) + end + local item = inv:get_stack('fuel', 1) + local fuel_groups = {'tree'} -- Groups considered "fuel" + if item and (not item:is_empty()) then + for _, g in ipairs(fuel_groups) do + if is_item_in_group(item:get_name(), g) then + -- We found some fuel. Do something with it. + return + end + end + end +--------------- +--]] + if inv:contains_item('fuel', 'default:tree') or inv:contains_item('fuel', 'default:jungletree') then + minetest.swap_node(pos, {name = 'food:smoker_on', param2=node.param2}) + timer:start(8*60) --eight minutes to smoke meat + meta:set_string('infotext', 'Burning Smoker') + meta:set_string('formspec', + 'size[8,7]'.. + "label[0,0;Watched meat won't smoke]" .. + 'list[current_name;meat;1,.5;3,2;]'.. + 'list[current_name;fuel;5,1.5;1,1]'.. + 'list[current_player;main;0,3;8,4;]') + end + end, +}) + +minetest.register_node('food:smoker_on', { --Just a change in textures. + description = 'Smoker', + drawtype = 'mesh', + mesh = 'food_smoker.obj', + tiles = {name='food_smoker_on.png'}, + groups = {choppy=2, dig_immediate=2, not_in_creative_inventory=1}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.5, -.5, -.4, .5, .5, .4}, + }, + collision_box = { + type = 'fixed', + fixed = {-.5, -.5, -.4, .5, .5, .4}, + }, +}) + +--Craft Recipes +minetest.register_craft({ + output = 'food:smoker', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:wood', 'farming:cotton', 'group:wood'}, + {'group:wood', 'group:wood', 'default:furnace'}, + } +}) diff --git a/mods/food/depends.txt b/mods/food/depends.txt new file mode 100644 index 0000000..bfba00e --- /dev/null +++ b/mods/food/depends.txt @@ -0,0 +1 @@ +thirsty diff --git a/mods/food/fruits.lua b/mods/food/fruits.lua new file mode 100644 index 0000000..31a8cd8 --- /dev/null +++ b/mods/food/fruits.lua @@ -0,0 +1,48 @@ +--Selection Boxes +local s_fruit = { + type = "fixed", + fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2} + } + +--Group groups +local g_fruit = {fleshy=3,dig_immediate=3,flammable=2,leafdecay=3,leafdecay_drop=1} + +--Foods Table +local food_table = { --craft, desc, health, hydration, selection box, groups +{'apple', 'Apple', .25, .3, s_fruit, g_fruit}, +{'pear', 'Pear', .25, .3, s_fruit, g_fruit}, +{'banana', 'Banana', .2, .15, s_fruit, g_fruit}, +} + + +--Parse Table +for i in ipairs (food_table) do + local craft = food_table[i][1] + local desc = food_table[i][2] + local health = food_table[i][3] + local hydration = food_table[i][4] + local seclection = food_table[i][5] + local group = food_table[i][6] + +--Actual Node registration +minetest.register_node('food:'..craft, { + drawtype = 'plantlike', + paramtype = 'light', + sunlight_propagates = true, + walkable = false, + is_ground_content = false, + selection_box = selection, + tiles = {'food_'..craft..'.png'}, + description = desc, + groups = group, + inventory_image = 'food_'..craft..'.png', + on_use = function(itemstack, user, pointed_thing) + thirsty.drink(user, hydration, 20) + local eat_func = minetest.item_eat(health) + return eat_func(itemstack, user, pointed_thing) + end, + after_place_node = function(pos) + minetest.set_node(pos, {name = 'food_'..craft, param2=1}) + end, +}) +end diff --git a/mods/food/init.lua b/mods/food/init.lua new file mode 100644 index 0000000..14dab40 --- /dev/null +++ b/mods/food/init.lua @@ -0,0 +1,4 @@ +dofile(minetest.get_modpath('food')..'/spoiling.lua') --Mechanics for food to spoil +dofile(minetest.get_modpath('food')..'/fruits.lua') --Fruits, need I document things? +dofile(minetest.get_modpath('food')..'/meats.lua') --Again, I think it's obvious +dofile(minetest.get_modpath('food')..'/cooking_machines.lua') --Stoves, Smokers, things to cook the food. diff --git a/mods/food/meats.lua b/mods/food/meats.lua new file mode 100644 index 0000000..cacb954 --- /dev/null +++ b/mods/food/meats.lua @@ -0,0 +1,55 @@ +--Group groups +local raw_meat = {meat=1, meat_raw=1} +local cooked_meat = {meat=1, meat_cooked=1} +local smoked_meat = {meat=1, meat_smoked=1} +local spoiled_meat = {meat=1, meat_spoiled=1} +local salted_meat = {meat=1, meat_salted=1} +local dried_meat = {meat=1, meat_cooked=1, meat_dried=1} + +--Foods Table +local food_table = { --craft, desc, health, hydration, groups +{'steak_raw', 'Raw Steak', .4, .25, raw_meat}, +{'steak_cooked', 'Cooked Steak', .5, .1, cooked_meat}, +{'steak_smoked', 'Smoked Steak', .5, -.3, smoked_meat}, +{'steak_spoiled', 'Rotten Steak', -2, .1, spoiled_meat}, +{'steak_salted', 'Salted Steak', .5, -1, salted_meat}, +{'steak_dried', 'Dried Jerky', .75, -1.5, dried_meat} +} + + +--Parse Table +for i in ipairs (food_table) do + local craft = food_table[i][1] + local desc = food_table[i][2] + local health = food_table[i][3] + local hydration = food_table[i][4] + local group = food_table[i][5] + +--Actual craftitem registration +minetest.register_craftitem('food:'..craft, { + description = desc, + inventory_image = 'food_'..craft..'.png', + groups = group, + on_use = function(itemstack, user, pointed_thing) + thirsty.drink(user, hydration, 20) + local eat_func = minetest.item_eat(health) + return eat_func(itemstack, user, pointed_thing) + end, +}) +end + +minetest.register_craft({ + type = 'cooking', + output = 'food:steak_cooked', + recipe = 'food:steak_raw', + cooktime = 10, + }) + +minetest.register_craft({ + output = 'food:steak_salted', + recipe = { + {'survival:salt', 'survival:salt', 'survival:salt'}, + {'survival:salt', 'food:steak_raw', 'survival:salt'}, + {'survival:salt', 'survival:salt', 'survival:salt'}, + } +}) diff --git a/mods/food/models/food_smoker.obj b/mods/food/models/food_smoker.obj new file mode 100644 index 0000000..b1a887d --- /dev/null +++ b/mods/food/models/food_smoker.obj @@ -0,0 +1,117 @@ +# Blender v2.75 (sub 3) OBJ File: 'smoker.blend' +# www.blender.org +o Cube.001 +v 0.500000 -0.500000 -0.390000 +v 0.500000 0.500000 -0.390000 +v 0.500000 -0.500000 0.390000 +v 0.500000 0.500000 0.390000 +v -0.200000 -0.500000 -0.390000 +v -0.200000 0.500000 -0.390000 +v -0.200000 -0.500000 0.390000 +v -0.200000 0.500000 0.390000 +v 0.500000 -0.100000 -0.390000 +v 0.500000 -0.100000 0.390000 +v -0.200000 -0.100000 0.390000 +v -0.200000 -0.100000 -0.390000 +v 0.500000 0.500000 -0.195000 +v 0.500000 -0.500000 -0.195000 +v -0.200000 0.500000 -0.195000 +v -0.200000 -0.500000 -0.195000 +v -0.200000 -0.100000 -0.195000 +v 0.500000 -0.100000 -0.195000 +v -0.500000 -0.100000 0.390000 +v -0.500000 -0.500000 0.390000 +v -0.500000 -0.500000 -0.195000 +v -0.500000 -0.100000 -0.195000 +vt 0.172326 0.428327 +vt 0.172326 0.633234 +vt 0.032218 0.633234 +vt 0.032218 0.428327 +vt 0.382487 0.843395 +vt 0.627675 0.843395 +vt 0.627675 0.983502 +vt 0.382487 0.983502 +vt 0.837836 0.428327 +vt 0.837836 0.360024 +vt 0.977943 0.360024 +vt 0.977943 0.428327 +vt 0.627674 0.149863 +vt 0.382486 0.149863 +vt 0.382486 0.009756 +vt 0.627674 0.009756 +vt 0.000000 0.204907 +vt 0.000000 0.000000 +vt 0.245188 0.000000 +vt 0.245188 0.204907 +vt 0.627675 0.428327 +vt 0.627675 0.633234 +vt 0.382487 0.633234 +vt 0.382487 0.428327 +vt 0.627674 0.360024 +vt 0.382486 0.360025 +vt 0.172326 0.360025 +vt 0.837836 0.633234 +vt 0.000000 0.273210 +vt 0.245188 0.273210 +vt 0.732755 0.843395 +vt 0.732755 0.983502 +vt 0.032218 0.360025 +vt 1.000000 0.140108 +vt 0.795093 0.140108 +vt 0.795093 0.000000 +vt 1.000000 0.000000 +vt 0.795093 0.245188 +vt 0.654985 0.245188 +vt 0.654985 0.140108 +vt 1.000000 0.245188 +vt 0.350268 0.000000 +vt 0.350268 0.204907 +vn 1.000000 0.000000 0.000000 +vn 0.000000 0.000000 1.000000 +vn -1.000000 0.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 1.000000 0.000000 +s off +f 18/1/1 10/2/1 3/3/1 14/4/1 +f 10/5/2 11/6/2 7/7/2 3/8/2 +f 17/9/3 12/10/3 5/11/3 16/12/3 +f 12/13/4 9/14/4 1/15/4 5/16/4 +f 14/17/5 3/18/5 7/19/5 16/20/5 +f 15/21/6 8/22/6 4/23/6 13/24/6 +f 6/25/4 2/26/4 9/14/4 12/13/4 +f 15/21/3 6/25/3 12/10/3 17/9/3 +f 4/23/2 8/22/2 11/6/2 10/5/2 +f 13/24/1 4/23/1 10/2/1 18/1/1 +f 2/26/1 13/24/1 18/1/1 9/27/1 +f 8/22/3 15/21/3 17/9/3 11/28/3 +f 6/25/6 15/21/6 13/24/6 2/26/6 +f 1/29/5 14/17/5 16/20/5 5/30/5 +f 7/7/2 11/6/2 19/31/2 20/32/2 +f 9/27/1 18/1/1 14/4/1 1/33/1 +f 19/34/3 22/35/3 21/36/3 20/37/3 +f 17/38/4 16/39/4 21/40/4 22/35/4 +f 11/41/6 17/38/6 22/35/6 19/34/6 +f 16/20/5 7/19/5 20/42/5 21/43/5 +o Cube +v -0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v -0.500000 0.500000 -0.500000 +v 0.500000 0.500000 -0.500000 +v 0.500000 0.500000 0.500000 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 1.000000 0.000000 +vn -1.000000 0.000000 -0.000000 +vn 0.000000 -0.000000 -1.000000 +vn 1.000000 -0.000000 0.000000 +vn -0.000000 0.000000 1.000000 +s off +f 23//7 24//7 25//7 26//7 +f 27//8 30//8 29//8 28//8 +f 23//9 27//9 28//9 24//9 +f 24//10 28//10 29//10 25//10 +f 25//11 29//11 30//11 26//11 +f 27//12 23//12 26//12 30//12 diff --git a/mods/food/spoiling.lua b/mods/food/spoiling.lua new file mode 100644 index 0000000..96ef4bc --- /dev/null +++ b/mods/food/spoiling.lua @@ -0,0 +1,237 @@ +-------------------------------------------------------------------------------- +-- hildigerr/my_mobs/init.lua +-- +-- Additional mobs to extend upon +-- PilzAdam's Simple Mobs +-- +-- Includes: +-- Meat spoilage if it remains uncooked +-- +-- Written by wulfsdad -- December 2012 -- WTFPL -- Version 0.3 +-------------------------------------------------------------------------------- + +--Table of good and spoiled things. +local spoil_table = { --original, replacement, time(in seconds), chance(lower # = greater chance), var +{'food:steak_raw', 'food:steak_spoiled', 60, 20, 'a'}, +{'food:steak_cooked', 'food:steak_spoiled', 480, 50, 'b'}, +{'default:grass_1', 'more_fire:dried_grass', 60, 15, 'c'}, +} + +--Parse table. +for i in ipairs (spoil_table) do + local original = spoil_table[i][1] + local replacement = spoil_table[i][2] + local delay = spoil_table[i][3] + local chance = spoil_table[i][4] + local var = spoil_table[i][5] + +----CONFIG OPTIONS: +local ROT_IN_WATER_CHANCE = chance/2 --things twice as likely to rot in water. +local ROT_ON_GROUND_CHANCE = chance +local ROT_IN_POCKET_CHANCE = chance +local ROT_IN_STORAGE_CHANCE = chance +local ROT_WHILE_COOKING_CHANCE = chance +--Time to Rot intervals +local WATER_TIMER = delay +local GROUND_TIMER = delay*1.2 --things on the ground wait a little longer to rot. +local POCKET_TIMER = delay +local STORAGE_TIMER = delay + +---------------------------------SPOILING MEAT---------------------------------- +function spoil_meat( inv, title, chance, warn, owner ) +--inv = InvRef +--title = listname (string)-- TODO: make handle lists +--chance = [1-100] +--warn = boolean +--owner = player name (string) + for i=1,inv:get_size(title) do + local item = inv:get_stack(title, i) + if item:get_name() == original then + local qt = item:get_count() + local rotted = 0 + for j=1,qt do + if math.random(1,100) > chance then + rotted = rotted +1 + minetest.chat_send_player( "singleplayer", ""..rotted) + print ('testing '..original..' to see what all is running') + end -- if by chance + end -- end count rotten portion of stack + if rotted ~= 0 then + if rotted < qt then + if inv:room_for_item(title, ItemStack{name = replacement, count = rotted, wear=0, metadata=""}) then + item:take_item(rotted) + inv:add_item(title, ItemStack({name = replacement, count = rotted, wear=0, metadata=""})) + else -- not enough room + --so rot it all: + item:replace({name = replacement, count = qt, wear=0, metadata=""}) + end -- room for nu_stack if + else -- rotted == qt + item:replace({name = replacement, count = qt, wear=0, metadata=""}) + end -- if rotted < qt + inv:set_stack(title, i, item) + end -- if some meat spoiled + end -- if found raw meat + end -- for each inv slot [i] +end -- spoil_meat func + +--Rot Stored Meat +if not minetest.get_modpath("homedecor") then + minetest.register_abm({ + nodenames = { "default:chest", "default:chest_locked", + "my_mobs:cage_empty", "my_mobs:cage_rat", "my_mobs:cage_rabbit", + }, + interval = STORAGE_TIMER, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "main", + ROT_IN_STORAGE_CHANCE, + false, nil ) + end -- action func + }) + minetest.register_abm({ + nodenames = { "default:furnace" }, + interval = STORAGE_TIMER, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "fuel", + ROT_WHILE_COOKING_CHANCE, + false, nil ) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "src", + ROT_WHILE_COOKING_CHANCE, + false, nil ) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "dst", + ROT_WHILE_COOKING_CHANCE, + false, nil ) + end -- action func + }) +else + minetest.register_abm({ + nodenames = { "default:chest", "default:chest_locked", + "homedecor:kitchen_cabinet", "homedecor:kitchen_cabinet_half", + "homedecor:kitchen_cabinet_with_sink", "homedecor:nightstand_oak_one_drawer", + "homedecor:nightstand_oak_two_drawers", "homedecor:nightstand_mahogany_one_drawer", + "homedecor:nightstand_mahogany_two_drawers", + "my_mobs:cage_empty", "my_mobs:cage_rat", "my_mobs:cage_rabbit", + }, + interval = STORAGE_TIMER, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "main", + ROT_IN_STORAGE_CHANCE, + false, nil ) + end -- action func + }) + minetest.register_abm({ + nodenames = { "default:furnace","homedecor:oven" }, + interval = STORAGE_TIMER, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "fuel", + ROT_WHILE_COOKING_CHANCE, + false, nil ) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "src", + ROT_WHILE_COOKING_CHANCE, + false, nil ) + spoil_meat( minetest.env:get_meta(pos):get_inventory(), + "dst", + ROT_WHILE_COOKING_CHANCE, + false, nil ) + end -- action func + }) +end + + +--Rot Held Meat +local rotting_timer = 0 +minetest.register_globalstep( function(dtime) + rotting_timer = rotting_timer + dtime + if rotting_timer >= POCKET_TIMER then --TEST WiTH: 2 then -- + for _,player in ipairs(minetest.get_connected_players()) do + local who = player:get_player_name() + local stuff = player:get_inventory() + spoil_meat(stuff, "main", ROT_IN_POCKET_CHANCE, true, who) + spoil_meat(stuff, "craft", ROT_IN_POCKET_CHANCE, true, who) + end -- for each player + rotting_timer = 0 --reset the timer + end -- timer +end) + + +--Rot Droped Meat +minetest.register_abm({ + nodenames = {"air"}, + neighbors = { "group:stone", "group:sand", + --"group:soil" : + "default:dirt_with_grass", "default:dirt_with_grass_footsteps", "default:dirt", + --etc: + "default:gravel", "default:sandstone", "default:clay", + "default:brick", "default:wood", + }, + interval = GROUND_TIMER, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + if objs then + for i,j in ipairs(objs) do + local k = j:get_luaentity() + if k then + local str = k.itemstring + if str ~= nil then +-- if str == replacement then -- add fresh meat and reimplement +-- objs[i]:remove() +-- else + if str == original then + if math.random(1,100) > ROT_ON_GROUND_CHANCE then -- about 1/3 chance --TESTING + objs[i]:remove() + minetest.env:add_item(pos, replacement) + end -- if by chance + end -- if is meat + end -- itemstring exists + end -- luaidentity exists + end -- for objs + end -- objects exist + end -- func +}) + +minetest.register_abm({ + nodenames = {"default:water_source", "default:water_flowing"}, + neighbors = { "group:stone", "group:sand", + --"group:soil" : + "default:dirt_with_grass", "default:dirt_with_grass_footsteps", "default:dirt", + --etc: + "default:gravel", "default:sandstone", "default:clay", + "default:brick", "default:wood", + }, + interval = WATER_TIMER, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + if objs then + for i,j in ipairs(objs) do + local k = j:get_luaentity() + if k then + local str = k.itemstring + if str ~= nil then +-- if str == replacement then +-- objs[i]:remove() +-- else + if str == original then + if math.random(1,100) > ROT_IN_WATER_CHANCE then + objs[i]:remove() + minetest.env:add_item(pos, replacement) + end -- if by chance + end -- if is meat + end -- itemstring exists + end -- luaidentity exists + end -- for objs + end -- objects exist + end -- func +}) +end diff --git a/mods/food/textures/food_apple.png b/mods/food/textures/food_apple.png new file mode 100644 index 0000000..dc96d15 Binary files /dev/null and b/mods/food/textures/food_apple.png differ diff --git a/mods/food/textures/food_banana.png b/mods/food/textures/food_banana.png new file mode 100644 index 0000000..31440c5 Binary files /dev/null and b/mods/food/textures/food_banana.png differ diff --git a/mods/food/textures/food_pear.png b/mods/food/textures/food_pear.png new file mode 100644 index 0000000..dd8d0f5 Binary files /dev/null and b/mods/food/textures/food_pear.png differ diff --git a/mods/food/textures/food_smoker.png b/mods/food/textures/food_smoker.png new file mode 100644 index 0000000..53c7614 Binary files /dev/null and b/mods/food/textures/food_smoker.png differ diff --git a/mods/food/textures/food_smoker_on.png b/mods/food/textures/food_smoker_on.png new file mode 100644 index 0000000..a46188d Binary files /dev/null and b/mods/food/textures/food_smoker_on.png differ diff --git a/mods/food/textures/food_steak_cooked.png b/mods/food/textures/food_steak_cooked.png new file mode 100644 index 0000000..4ddc63c Binary files /dev/null and b/mods/food/textures/food_steak_cooked.png differ diff --git a/mods/food/textures/food_steak_raw.png b/mods/food/textures/food_steak_raw.png new file mode 100644 index 0000000..d587f9f Binary files /dev/null and b/mods/food/textures/food_steak_raw.png differ diff --git a/mods/food/textures/food_steak_salted.png b/mods/food/textures/food_steak_salted.png new file mode 100644 index 0000000..39a4da3 Binary files /dev/null and b/mods/food/textures/food_steak_salted.png differ diff --git a/mods/food/textures/food_steak_smoked.png b/mods/food/textures/food_steak_smoked.png new file mode 100644 index 0000000..eef4d23 Binary files /dev/null and b/mods/food/textures/food_steak_smoked.png differ diff --git a/mods/food/textures/food_steak_spoiled.png b/mods/food/textures/food_steak_spoiled.png new file mode 100644 index 0000000..7870b3d Binary files /dev/null and b/mods/food/textures/food_steak_spoiled.png differ diff --git a/mods/food/textures/foodsmoker.png b/mods/food/textures/foodsmoker.png new file mode 100644 index 0000000..742db20 Binary files /dev/null and b/mods/food/textures/foodsmoker.png differ diff --git a/mods/gate/README.txt b/mods/gate/README.txt new file mode 100644 index 0000000..bf63a19 --- /dev/null +++ b/mods/gate/README.txt @@ -0,0 +1,28 @@ +Minetest mod "Simple Fencegate" +=============================== +by BlockMen (c) 2014 + +Version: 1.0 + +About +~~~~~ +This mod adds a fence gate to Minetest, perserving the fence style of Minetest. +Also it makes jumping over fence impossible and fixes the collision box (not like a full block anymore). + +You can place the fence gates ONLY between to fence posts. + +Crafting: + +stick wood stick +stick wood stick + + + + +License of source code, textures: WTFPL + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. diff --git a/mods/gate/depends.txt b/mods/gate/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/mods/gate/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/mods/gate/init.lua b/mods/gate/init.lua new file mode 100644 index 0000000..f44e307 --- /dev/null +++ b/mods/gate/init.lua @@ -0,0 +1,130 @@ +local nb_gap = { + {-1, 0.1875, -0.0625, -0.5, 0.3125, 0.0625}, + {-1, -0.1875, -0.0625, -0.5, -0.3125, 0.0625}, + {0.5, 0.1875, -0.0625, 1, 0.3125, 0.0625}, + {0.5, -0.1875, -0.0625, 1, -0.3125, 0.0625} + } + +local nb_pil = { + {0.5, -0.5, -0.09375, 0.5625, 0.5, 0.09375}, + {-0.5625, -0.5, -0.09375, -0.5, 0.5, 0.09375}, + {-0.5, -0.3125, -0.0625, -0.375, 0.3125, 0.0625}, + {0.375, -0.3125, -0.0625, 0.5, 0.3125, 0.0625} + } + +local function can_place(pos, n0) + if not n0 or n0.name ~= "gate:fencegate" then + return + end + local p1 = {x = pos.x, y = pos.y, z = pos.z} + local p2 = {x = pos.x, y = pos.y, z = pos.z} + if n0.param2 == 1 or n0.param2 == 3 then + p1.z = p1.z - 1 + p2.z = p2.z + 1 + else + p1.x = p1.x - 1 + p2.x = p2.x + 1 + end + local n1 = minetest.get_node_or_nil(p1) + local n2 = minetest.get_node_or_nil(p2) + + if n1 and n1.name == "default:fence_wood" and n2 and + n2.name == "default:fence_wood" then + return false + end + minetest.remove_node(pos) + return true +end + +local function gate_rightclick(pos, node) + if node.name == "gate:fencegate" then + minetest.sound_play("door_open", {gain = 0.3, max_hear_distance = 10}) + minetest.set_node(pos, {name="gate:fencegate_open", param2=node.param2}) + else + minetest.sound_play("door_close", {gain = 0.3, max_hear_distance = 10}) + minetest.set_node(pos, {name="gate:fencegate", param2=node.param2}) + end +end + +local wood_rotated = "default_wood.png^[transformR90" + +minetest.register_node("gate:fencegate_open", { + tiles = {"default_wood.png", "default_wood.png", wood_rotated, + wood_rotated, wood_rotated, wood_rotated}, + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = true, + groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, not_in_inventory = 1}, + drop = 'gate:fencegate', + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, 0.4375, -0.375, 0.3125, 0.5}, + {0.375, -0.3125, 0.4375, 0.5, 0.3125, 0.5}, + {-0.5, 0.1875, 0.0625, -0.375, 0.3125, 0.4375}, + {-0.5, -0.1875, 0.0625, -0.375, -0.3125, 0.4375}, + {0.375, 0.1875, 0.0625, 0.5, 0.3125, 0.4375}, + {0.375, -0.1875, 0.0625, 0.5, -0.3125, 0.4375}, + nb_pil[1], nb_pil[2], + nb_pil[3], nb_pil[4], + nb_gap[1], nb_gap[2], + nb_gap[3], nb_gap[4], + } + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.3125, -0.0625, -0.375, 0.3125, 0.5}, + {0.375, -0.3125, -0.0625, 0.5, 0.3125, 0.5}, + } + }, + on_rightclick = gate_rightclick, +}) + +minetest.register_node("gate:fencegate", { + description = "Wooden fence gate", + tiles = {"default_wood.png", "default_wood.png", wood_rotated, + wood_rotated, wood_rotated, wood_rotated}, + inventory_image = "gate_fencegate.png", + wield_image = "gate_fencegate.png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = true, + groups = {snappy = 1, choppy = 2, oddly_breakable_by_hand = 2, flammable = 2}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = { + nb_pil[1], nb_pil[2], + nb_pil[3], nb_pil[4], + {-0.0625, -0.3125, -0.0625, 0.0625, 0.3125, 0.0625}, + {-1, 0.1875, -0.0625, 1, 0.3125, 0.0625}, + {-1, -0.1875, -0.0625, 1, -0.3125, 0.0625}, + } + }, + selection_box = { + type = "fixed", + fixed = {{-0.5, -0.3125, -0.0625, 0.5, 0.3125, 0.0625}} + }, + on_rightclick = gate_rightclick, +}) + +minetest.override_item("default:fence_wood", {node_box = { + type = "fixed", + fixed = { + {-0.2, -0.5, -0.2, 0.2, 1.0, 0.2}, + }, + }}) + +minetest.register_on_placenode(can_place) + +minetest.register_craft({ + output = 'gate:fencegate', + recipe = { + {'default:stick', 'group:wood', 'default:stick'}, + {'default:stick', 'group:wood', 'default:stick'}, + } +}) diff --git a/mods/gate/textures/gate_fencegate.png b/mods/gate/textures/gate_fencegate.png new file mode 100644 index 0000000..2e62a5b Binary files /dev/null and b/mods/gate/textures/gate_fencegate.png differ diff --git a/mods/give_initial_stuff/depends.txt b/mods/give_initial_stuff/depends.txt new file mode 100644 index 0000000..3a7daa1 --- /dev/null +++ b/mods/give_initial_stuff/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/mods/give_initial_stuff/init.lua b/mods/give_initial_stuff/init.lua new file mode 100644 index 0000000..4698bc3 --- /dev/null +++ b/mods/give_initial_stuff/init.lua @@ -0,0 +1,11 @@ +minetest.register_on_newplayer(function(player) + --print("on_newplayer") + if minetest.setting_getbool("give_initial_stuff") then + minetest.log("action", "Giving initial stuff to player "..player:get_player_name()) + player:get_inventory():add_item('main', 'default:torch 10') + player:get_inventory():add_item('main', 'survival:machete_steel') + player:get_inventory():add_item('main', {name="thirsty:bronze_canteen", count=1, wear=60, metadata=""}) + player:get_inventory():add_item('main', 'craft_guide:sign_wall') + end +end) + diff --git a/mods/glow/.gitignore b/mods/glow/.gitignore new file mode 100644 index 0000000..a27ba57 --- /dev/null +++ b/mods/glow/.gitignore @@ -0,0 +1 @@ +*.old \ No newline at end of file diff --git a/mods/glow/README b/mods/glow/README new file mode 100644 index 0000000..32e2eb5 --- /dev/null +++ b/mods/glow/README @@ -0,0 +1 @@ +A mod for Minetest which adds various glowing elements to enhance the ambiance of caves and the night landscape. diff --git a/mods/glow/depends.txt b/mods/glow/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/mods/glow/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/mods/glow/init.lua b/mods/glow/init.lua new file mode 100644 index 0000000..41e50ed --- /dev/null +++ b/mods/glow/init.lua @@ -0,0 +1,300 @@ +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if intllib then + S = intllib.Getter() +else + S = function(s) return s end +end + + +-- WORMS -------------------------------------------------- + +minetest.register_node("glow:cave_worms", { + description = S("Glow Worms"), + drawtype = "nodebox", + tiles = { "worms.png" }, + inventory_image = "worms.png", + wield_image = "worms.png", + groups = { dig_immediate = 2 }, + sounds = default.node_sound_stone_defaults(), + drop = "glow:cave_worms", + paramtype = "light", + light_source = 4, + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = false, + node_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, -15/32, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2}, + }, + on_place = minetest.rotate_node, +}) + +minetest.register_on_generated(function(minp, maxp, seed) + local stone_nodes = minetest.find_nodes_in_area(minp, maxp, "default:stone") + for key, pos in pairs(stone_nodes) do + local spot = minetest.find_node_near(pos, 1, "air") + if spot ~= nil and math.random() < 0.001 and not near_surface(spot) then + local posNeg = { x=pos.x-6, y=pos.y-6, z=pos.z-6 } + local posPos = { x=pos.x+6, y=pos.y+6, z=pos.z+6 } + local worms = minetest.find_nodes_in_area(posNeg, posPos, "glow:cave_worms") + local lava = minetest.find_nodes_in_area(posNeg, posPos, "default:lava_source") + local water = minetest.find_nodes_in_area(posNeg, posPos, "group:water") + if #worms == 0 and #lava == 0 and #water > 1 then + place_worms(spot) + end + end + end +end) + +minetest.register_abm({ + nodenames = { "default:stone" }, + neighbors = { "air" }, + interval = 120.0, + chance = 200, + action = function(pos, node, active_object_count, active_object_count_wider) + local spot = minetest.find_node_near(pos, 1, "air") + if spot ~= nil and not near_surface(spot) then + local posNeg = { x=pos.x-6, y=pos.y-6, z=pos.z-6 } + local posPos = { x=pos.x+6, y=pos.y+6, z=pos.z+6 } + local worms = minetest.find_nodes_in_area(posNeg, posPos, "glow:cave_worms") + local lava = minetest.find_nodes_in_area(posNeg, posPos, "default:lava_source") + local water = minetest.find_nodes_in_area(posNeg, posPos, "group:water") + if #worms == 0 and #lava == 0 and #water > 1 then + place_worms(spot) + end + end + end, +}) + +minetest.register_abm({ + nodenames = { "glow:cave_worms" }, + interval = 60.0, + chance = 10, + action = function(pos, node, active_object_count, active_object_count_wider) + local posNeg = { x=pos.x-2, y=pos.y-2, z=pos.z-2 } + local posPos = { x=pos.x+2, y=pos.y+2, z=pos.z+2 } + local worms = minetest.find_nodes_in_area(posNeg, posPos, "glow:cave_worms") + if #worms < 20 and math.random() < 0.7 then + local spot = minetest.find_node_near(pos, 3, "air") + if spot ~= nil and not near_surface(spot) then + place_worms(spot) + end + else + minetest.set_node(pos, { name = "air" }) + end + end, +}) + +function place_worms(pos) + local axes = { + { x=pos.x, y=pos.y-1, z=pos.z }, + { x=pos.x, y=pos.y, z=pos.z-1 }, + { x=pos.x, y=pos.y, z=pos.z+1 }, + { x=pos.x-1, y=pos.y, z=pos.z }, + { x=pos.x+1, y=pos.y, z=pos.z }, + { x=pos.x, y=pos.y+1, z=pos.z }, + } + for i, cpos in ipairs(axes) do + if minetest.get_node(cpos).name == "default:stone" then + local facedir = (i-1) * 4 + math.random(0, 3) -- see 6d facedir info + minetest.set_node(pos, { name = "glow:cave_worms", param2 = facedir }) + return + end + end +end + +function near_surface(pos) + for dx = -1, 1, 1 do + for dy = -1, 1, 1 do + for dz = -1, 1, 1 do + local dpos = { x=pos.x+dx, y=pos.y+dy, z=pos.z+dz } + local light = minetest.get_node_light(dpos, 0.5) -- 0.5 means noon + if light ~= nil and light > 5 then + return true + end + end + end + end + return false +end + +function is_facing(pos, nodename) + for d = -1, 1, 2 do + if nodename == minetest.get_node({pos.x+d, pos.y, pos.z }).name then return true end + if nodename == minetest.get_node({pos.x, pos.y+d, pos.z }).name then return true end + if nodename == minetest.get_node({pos.x, pos.y, pos.z+d}).name then return true end + end + return false +end + +-- clean up stupid way of doing worms --------------------- + +minetest.register_node("glow:stone_with_worms", { + description = S("Glow Worms in Stone"), + tiles = { "default_stone.png^worms.png" }, + is_ground_content = true, + groups = { cracky = 1 }, + sounds = default.node_sound_stone_defaults(), + drop = "glow:stone_with_worms", + paramtype = "light", + light_source = 4, +}) + +minetest.register_abm({ + nodenames = { "glow:stone_with_worms" }, + interval = 60.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.set_node(pos, { name = "default:stone" }) + end, +}) + + +-- SROOMS ------------------------------------------------- + +minetest.register_node("glow:shrooms", { + description = S("Glow Shrooms"), + drawtype = "plantlike", + tiles = { "shrooms.png" }, + inventory_image = "shrooms.png", + wield_image = "shrooms.png", + drop = 'glow:shrooms', + groups = { snappy=3, flammable=2, flower=1, flora=1, attached_node=1 }, + sunlight_propagates = true, + walkable = false, + pointable = true, + diggable = true, + climbable = false, + buildable_to = true, + paramtype = "light", + light_source = 3, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.4, -0.5, -0.4, 0.4, 0.0, 0.4 }, + }, +}) + +minetest.register_on_generated(function(minp, maxp, seed) + local tree_nodes = minetest.find_nodes_in_area(minp, maxp, "default:tree") + for key, pos in pairs(tree_nodes) do + local bpos = { x=pos.x, y=pos.y-1, z=pos.z } + if minetest.get_node(bpos).name ~= "default:tree" then + if math.random() < 0.2 then + add_shrooms(pos) + end + end + end +end) + +minetest.register_abm({ + nodenames = { "default:tree" }, + neighbors = { + "air", + "default:dirt", + }, + interval = 60.0, + chance = 60, + action = function(pos, node, active_object_count, active_object_count_wider) + local posNeg = { x=pos.x-1, y=pos.y-1, z=pos.z-1 } + local posPos = { x=pos.x+1, y=pos.y+1, z=pos.z+1 } + local shrooms = minetest.find_nodes_in_area(posNeg, posPos, "glow:shrooms") + if #shrooms == 0 or (#shrooms == 1 and math.random() < 0.3) then + add_shrooms(pos) + end + end, +}) + +minetest.register_abm({ + nodenames = { "glow:shrooms" }, + neighbors = { + "air", + "default:dirt_with_grass", + }, + interval = 40.0, + chance = 10, + action = function(pos, node, active_object_count, active_object_count_wider) + if math.random() < 0.3 then + add_shrooms(pos) + else + minetest.remove_node(pos) + end + end, +}) + +function add_shrooms(pos) + if minetest.find_node_near(pos, 2, "glow:shrooms") == nil then + for nx = -1, 1, 2 do + for ny = -1, 1, 1 do + for nz = -1, 1, 2 do + local tpos = { x=pos.x+nx, y=pos.y-1+ny, z=pos.z+nz } + if minetest.get_node(tpos).name == "default:dirt_with_grass" and math.random() < 0.2 then + local ppos = { x=tpos.x, y=tpos.y+1, z=tpos.z } + minetest.set_node(ppos, { name = "glow:shrooms" }) + end + end + end + end + end +end + + +-- FIREFLIES ---------------------------------------------- + +minetest.register_node("glow:fireflies", { + description = S("Fireflies"), + drawtype = "glasslike", + tiles = { + { + name = "fireflies.png", + animation = { + type = "vertical_frames", + aspect_w = 16, + aspect_h = 16, + length = 2, + }, + }, + }, + alpha = 100, + paramtype = "light", + light_source = 4, + walkable = false, + pointable = false, + diggable = false, + climbable = false, + buildable_to = true, +}) + +minetest.register_abm({ + nodenames = { "air" }, + neighbors = { + "default:grass_1", + "default:grass_2", + "default:grass_3", + "default:grass_4", + "default:grass_5", + }, + interval = 2.0, + chance = 300, + action = function(pos, node, active_object_count, active_object_count_wider) + if minetest.get_timeofday() > 0.74 or minetest.get_timeofday() < 0.22 then + if minetest.find_node_near(pos, 9, "glow:fireflies") == nil then + minetest.set_node(pos, {name = "glow:fireflies"}) + end + end + end, +}) + +minetest.register_abm({ + nodenames = {"glow:fireflies"}, + interval = 1.0, + chance = 2, + action = function(pos, node, active_object_count, active_object_count_wider) + minetest.remove_node(pos) + end, +}) diff --git a/mods/glow/locale/de.txt b/mods/glow/locale/de.txt new file mode 100644 index 0000000..584c390 --- /dev/null +++ b/mods/glow/locale/de.txt @@ -0,0 +1,5 @@ +# Translation by Xanthin + +Glow Worms in Stone = Gluehwuermchen im Stein +Glow Shrooms = Leuchtpilze +Fireflies = Leuchtkaefer diff --git a/mods/glow/locale/template.txt b/mods/glow/locale/template.txt new file mode 100644 index 0000000..c5c5495 --- /dev/null +++ b/mods/glow/locale/template.txt @@ -0,0 +1,5 @@ +# Template + +Glow Worms in Stone = +Glow Shrooms = +Fireflies = diff --git a/mods/glow/textures/fireflies.png b/mods/glow/textures/fireflies.png new file mode 100644 index 0000000..d08e0b1 Binary files /dev/null and b/mods/glow/textures/fireflies.png differ diff --git a/mods/glow/textures/shrooms.png b/mods/glow/textures/shrooms.png new file mode 100644 index 0000000..3e76a86 Binary files /dev/null and b/mods/glow/textures/shrooms.png differ diff --git a/mods/glow/textures/worms.png b/mods/glow/textures/worms.png new file mode 100644 index 0000000..82259b5 Binary files /dev/null and b/mods/glow/textures/worms.png differ diff --git a/mods/hiking/LICENSE b/mods/hiking/LICENSE new file mode 100644 index 0000000..3848122 --- /dev/null +++ b/mods/hiking/LICENSE @@ -0,0 +1,20 @@ +License: +Sourcecode: WTFPL (see below) +Graphics: WTFPL (see below) + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/hiking/README.mkd b/mods/hiking/README.mkd new file mode 100644 index 0000000..337c67b --- /dev/null +++ b/mods/hiking/README.mkd @@ -0,0 +1,84 @@ +Hiking signs are common where I come from (not glowing ones, but neither are +torches.) Missing them in minetest. Not any more! :-) + +Signs are applied to rocks, tree trunks, walls. And where there are no objects +to apply them to, often poles are used to mark the path. (Very useful in +winter.) There are four common colours used: red, blue, yellow and green. Red +and blue are mostly used for longer tracks, while yellow and green for local +ones or to connect blues and reds. + + +Signs: + +To craft a sign apply this simple recipe: + + white dye + colour dye + white dye + +To craft 6 arrows add more of the same colour dye as in: + + sign sign + sign sign more dye + sign sign + +and: + + sign sign + more dye sign sign + sign sign + + +Poles: + +To craft a pole put two sticks above each other: + + stick + stick + +To craft a pole with sign put either a sign above a pole or above two sticks: + + sign + pole + +or: + + sign + stick + stick + + +Illuminated: + +Add a torch and you will get a glowing sign. :-) + + +Describe: + +Oh, and by the way, right clicking the sign one can add a path id. Yes, hiking +trails have an id here. + + +-- Martian + + +License: +Sourcecode: WTFPL (see below) +Graphics: WTFPL (see below) + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/hiking/depends.txt b/mods/hiking/depends.txt new file mode 100644 index 0000000..2717bef --- /dev/null +++ b/mods/hiking/depends.txt @@ -0,0 +1,2 @@ +default +dye diff --git a/mods/hiking/init.lua b/mods/hiking/init.lua new file mode 100644 index 0000000..9fbf1b1 --- /dev/null +++ b/mods/hiking/init.lua @@ -0,0 +1,407 @@ +local function merge(a, b) + local c = {} + for k, v in pairs(a) do + c[k] = v + end + for k, v in pairs(b) do + c[k] = v + end + return c +end + +function firstToUpper(str) + return (str:gsub("^%l", string.upper)) +end + +local basic_properties = { + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "wallmounted", + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + node_box = { + type = "wallmounted", + wall_top = {-0.4375, 0.4375, -0.3125, 0.4375, 0.5, 0.3125}, + wall_bottom = {-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125}, + wall_side = {-0.5, -0.3125, -0.4375, -0.4375, 0.3125, 0.4375}, + }, + groups = {snappy=1}, --2,dig_immediate=2,attached_node=1}, + legacy_wallmounted = true, + --sounds = default.node_sound_defaults(), + on_construct = function(pos) + --local n = minetest.get_node(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", "field[text;;${text}]") + meta:set_string("infotext", "\"\"") + end, + on_receive_fields = function(pos, formname, fields, sender) + --print("Sign at "..minetest.pos_to_string(pos).." got "..dump(fields)) + if minetest.is_protected(pos, sender:get_player_name()) then + minetest.record_protection_violation(pos, sender:get_player_name()) + return + end + local meta = minetest.get_meta(pos) + if not fields.text then return end + minetest.log("action", (sender:get_player_name() or "").." wrote \""..fields.text.. + "\" to sign at "..minetest.pos_to_string(pos)) + meta:set_string("text", fields.text) + meta:set_string("infotext", '"'..fields.text..'"') + end, +} + +local illuminated_props = { light_source = 3 } + +local illuminated_properties = merge(basic_properties, illuminated_props) + +local colour_list = { "red", "blue", "green", "yellow", } + +local i +local colour + +for i, colour in ipairs(colour_list) do + +minetest.register_alias("hiking_"..colour.."_sign", "hiking:"..colour.."_sign") + +minetest.register_node("hiking:"..colour.."_sign", merge(basic_properties, { + description = firstToUpper(colour).." hiking sign", + tiles = {"hiking_"..colour.."_sign.png"}, + inventory_image = "hiking_"..colour.."_sign.png", + wield_image = "hiking_"..colour.."_sign.png", +})) + +minetest.register_node("hiking:illuminated_"..colour.."_sign", merge(illuminated_properties, { + description = "Illuminated "..colour.." hiking sign", + tiles = {"hiking_"..colour.."_sign.png"}, + inventory_image = "hiking_illuminated_"..colour.."_sign.png", + wield_image = "hiking_illuminated_"..colour.."_sign.png" +})) + +minetest.register_node("hiking:"..colour.."_arrow_right", merge(basic_properties, { + description = firstToUpper(colour).." right arrow sign", + tiles = {"hiking_"..colour.."_arrow_right.png"}, + inventory_image = "hiking_"..colour.."_arrow_right.png", + wield_image = "hiking_"..colour.."_arrow_right.png" +})) + +minetest.register_node("hiking:illuminated_"..colour.."_arrow_right", merge(illuminated_properties, { + description = "Illuminated "..colour.." right arrow sign", + tiles = {"hiking_"..colour.."_arrow_right.png"}, + inventory_image = "hiking_illuminated_"..colour.."_arrow_right.png", + wield_image = "hiking_illuminated_"..colour.."_arrow_right.png" +})) + +minetest.register_node("hiking:"..colour.."_arrow_left", merge(basic_properties, { + description = firstToUpper(colour).." left arrow sign", + tiles = {"hiking_"..colour.."_arrow_left.png"}, + inventory_image = "hiking_"..colour.."_arrow_left.png", + wield_image = "hiking_"..colour.."_arrow_left.png", +})) + +minetest.register_node("hiking:illuminated_"..colour.."_arrow_left", merge(illuminated_properties, { + description = "Illuminated "..colour.." left arrow sign", + tiles = {"hiking_"..colour.."_arrow_left.png"}, + inventory_image = "hiking_illuminated_"..colour.."_arrow_left.png", + wield_image = "hiking_illuminated_"..colour.."_arrow_left.png", +})) + +minetest.register_craft({ + output = "hiking:"..colour.."_sign 6", + recipe = { + {"dye:white"}, + {"dye:"..colour}, + {"dye:white"} + } +}) + +minetest.register_craft({ + output = "hiking:"..colour.."_arrow_right 6", + recipe = { + {"hiking:"..colour.."_sign","hiking:"..colour.."_sign","",}, + {"hiking:"..colour.."_sign","hiking:"..colour.."_sign","dye:"..colour,}, + {"hiking:"..colour.."_sign","hiking:"..colour.."_sign","",}, + } +}) + +minetest.register_craft({ + output = "hiking:"..colour.."_arrow_left 6", + recipe = { + {"","hiking:"..colour.."_sign","hiking:"..colour.."_sign",}, + {"dye:"..colour,"hiking:"..colour.."_sign","hiking:"..colour.."_sign",}, + {"","hiking:"..colour.."_sign","hiking:"..colour.."_sign",}, + } +}) + +minetest.register_craft({ + output = "hiking:"..colour.."_arrow_left", + recipe = { + {"dye:"..colour,"hiking:"..colour.."_sign"} + } +}) + +minetest.register_craft({ + output = "hiking:illuminated_"..colour.."_sign", + type = "shapeless", + recipe = { "default:torch", "hiking:"..colour.."_sign" } +}) + +minetest.register_craft({ + output = "hiking:illuminated_"..colour.."_arrow_left", + type = "shapeless", + recipe = { "default:torch", "hiking:"..colour.."_arrow_left" } +}) + +minetest.register_craft({ + output = "hiking:illuminated_"..colour.."_arrow_right", + type = "shapeless", + recipe = { "default:torch", "hiking:"..colour.."_arrow_right" } +}) + +end + +local hiking_pole_common = { + groups = {snappy=1, oddly_breakable_by_hand=2, }, + --sounds = default.node_sound_stone_defaults(), + paramtype = "light", + sunlight_propagates = true, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {{-0.03,-0.5,-0.03,0.03,0.5,0.03}}, + }, +} +local hiking_pole_bottom = merge(hiking_pole_common, { + buildable_to = true, +}) +local hiking_pole_middle = merge(hiking_pole_common, { + buildable_to = false, +}) +local hiking_pole_top = merge(hiking_pole_common, { + buildable_to = false, +}) + +local function mk_hiking_pole(id, name, top_face, moreprops, image) +minetest.register_node("hiking:"..id.."_bottom", merge(merge(hiking_pole_bottom, { + -- TODO: this should be always on ground + description = name.." (bottom)", + tiles = {"hiking_pole_sign_cap.png", "hiking_pole_sign_cap.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", }, + inventory_image = image, + wield_image = image, + + after_place_node = function(pos, placer, itemstack) + local node = minetest.env:get_node(pos) + local p = {x=pos.x, y=pos.y+1, z=pos.z} + node.name = "hiking:"..id.."_top" + if minetest.registered_nodes[minetest.env:get_node(p).name].buildable_to then + minetest.env:set_node(p, node) + else + minetest.env:remove_node(pos) + return true + end + end, + + after_destruct = function(pos, _) + local p = {x=pos.x, y=pos.y+1, z=pos.z} + if ( minetest.env:get_node(p).name == "hiking:"..id.."_top" ) then + minetest.env:remove_node(p) + end + end, + +}), moreprops)) + +minetest.register_node("hiking:"..id.."_top", merge(merge(hiking_pole_bottom, { + -- TODO: one should not build on top of this + -- TODO: should be always on top of pole_bottom + description = name.." (top)", + tiles = {"hiking_pole_sign_cap.png", "hiking_pole_sign_cap.png", top_face, top_face, top_face, top_face, }, + + on_dig = function(pos, _, _) + local p = {x=pos.x, y=pos.y-1, z=pos.z} + if ( minetest.env:get_node(p).name == "hiking:"..id.."_bottom" ) then + minetest.env:remove_node(p) + end + end, +}), moreprops)) +end + +local function mk_tall_hiking_pole(id, name, top_face, moreprops, image, height) +local h = math.max(height, 2) +minetest.register_node("hiking:"..id.."_bottom", merge(merge(hiking_pole_bottom, { + -- TODO: this should be always on ground + description = name.." (bottom)", + tiles = {"hiking_pole_sign_cap.png", "hiking_pole_sign_cap.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", }, + inventory_image = image, + wield_image = image, + + after_place_node = function(pos, placer, itemstack) + local node = minetest.env:get_node(pos) + local i + local p + for i = 1, h-1 do + p = {x=pos.x, y=pos.y+i, z=pos.z} + if not minetest.registered_nodes[minetest.env:get_node(p).name].buildable_to then + minetest.env:remove_node(pos) + return true + end + end + for i = 1, h-2 do + p = {x=pos.x, y=pos.y+i, z=pos.z} + node.name = "hiking:"..id.."_middle" + if minetest.registered_nodes[minetest.env:get_node(p).name].buildable_to then + minetest.env:set_node(p, node) + else + minetest.env:remove_node(pos) + return true + end + end + p = {x=pos.x, y=pos.y+h-1, z=pos.z} + node.name = "hiking:"..id.."_top" + if minetest.registered_nodes[minetest.env:get_node(p).name].buildable_to then + minetest.env:set_node(p, node) + else + minetest.env:remove_node(pos) + return true + end + end, + + after_destruct = function(pos, _) + local i + local p + for i = 1, h-1 do + p = {x=pos.x, y=pos.y+i, z=pos.z} + if ( minetest.env:get_node(p).name == "hiking:"..id.."_top" or minetest.env:get_node(p).name == "hiking:"..id.."_middle" ) then + minetest.env:remove_node(p) + else + return + end + end + end, + +}), moreprops)) + +minetest.register_node("hiking:"..id.."_middle", merge(merge(hiking_pole_middle, { + -- TODO: one should not build on top of this + -- TODO: should be always on top of pole_bottom + description = name.." (middle)", + tiles = {"hiking_pole_sign_cap.png", "hiking_pole_sign_cap.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", "hiking_pole_sign_bottom_.png", }, + + on_dig = function(pos, _, _) + local i + local p + for i = 1, h-2 do + p = {x=pos.x, y=pos.y-i, z=pos.z} + local n = minetest.env:get_node(p).name + if ( n == "hiking:"..id.."_bottom" ) then + minetest.env:remove_node(p) + return + elseif not ( n == "hiking:"..id.."_middle" ) then + -- TODO: ERROR! + return + end + end + end, +}), moreprops)) + +minetest.register_node("hiking:"..id.."_top", merge(merge(hiking_pole_bottom, { + -- TODO: one should not build on top of this + -- TODO: should be always on top of pole_bottom + description = name.." (top)", + tiles = {"hiking_pole_sign_cap.png", "hiking_pole_sign_cap.png", top_face, top_face, top_face, top_face, }, + + on_dig = function(pos, _, _) + local i + local p + for i = 1, h-1 do + p = {x=pos.x, y=pos.y-i, z=pos.z} + local n = minetest.env:get_node(p).name + if ( n == "hiking:"..id.."_bottom" ) then + minetest.env:remove_node(p) + return + elseif not ( n == "hiking:"..id.."_middle" ) then + -- TODO: ERROR! + return + end + end + end, +}), moreprops)) +end + +local function mk_hiking_pole_coloured(colour) + mk_hiking_pole(colour.."_pole", "Pole sign "..colour, "hiking_pole_sign_top_"..colour..".png", {}, "hiking_pole_sign_"..colour..".png") + minetest.register_craft({ + output = "hiking:"..colour.."_pole_bottom", + recipe = { + {"hiking:"..colour.."_sign",}, + {"default:stick",}, + {"default:stick",}, + } + }) + minetest.register_craft({ + output = "hiking:"..colour.."_pole_bottom", + type = "shapeless", + recipe = { "hiking:pole_bottom", "hiking:"..colour.."_sign" } + }) +end + +local function mk_hiking_pole_illuminated_coloured(colour) + mk_hiking_pole("illuminated_"..colour.."_pole", "Illuminated pole sign "..colour, "hiking_pole_sign_top_"..colour..".png", illuminated_props, "hiking_illuminated_pole_sign_"..colour..".png") + minetest.register_craft({ + output = "hiking:illuminated_"..colour.."_pole_bottom", + type = "shapeless", + recipe = { "default:torch", "hiking:"..colour.."_pole_bottom" } + }) + minetest.register_craft({ + output = "hiking:illuminated_"..colour.."_pole_bottom", + type = "shapeless", + recipe = { "hiking:pole_bottom", "hiking:illuminated_"..colour.."_sign" } + }) + minetest.register_craft({ + output = "hiking:illuminated_"..colour.."_pole_bottom", + type = "shapeless", + recipe = { "hiking:illuminated_pole_bottom", "hiking:"..colour.."_sign" } + }) +end + +mk_hiking_pole("pole", "Pole sign", "hiking_pole_sign_bottom_.png", {}, "hiking_pole_sign.png") +minetest.register_craft({ + output = "hiking:pole_bottom", + recipe = { + {"default:stick",}, + {"default:stick",}, + } +}) + +mk_tall_hiking_pole("tall_pole", "Tall pole sign", "hiking_pole_sign_bottom_.png", {}, "hiking_tall_pole_sign.png", 3) +minetest.register_craft({ + output = "hiking:tall_pole_bottom", + recipe = { + {"default:stick",}, + {"default:stick",}, + {"default:stick",}, + } +}) + +mk_tall_hiking_pole("very_tall_pole", "Very tall pole sign", "hiking_pole_sign_bottom_.png", {}, "hiking_very_tall_pole_sign.png", 4) +minetest.register_craft({ + output = "hiking:very_tall_pole_bottom", + recipe = { + {"default:stick",}, + {"hiking:tall_pole_bottom",}, + } +}) + +-- TODO: not full height is built +-- TODO: not everything gets removed on digging +mk_tall_hiking_pole("infinite_pole", "Infinite pole sign", "hiking_pole_sign_bottom_.png", {}, "hiking_infinite_pole_sign.png", 1024) + +mk_hiking_pole("illuminated_pole", "Illuminated pole sign", "hiking_illuminated_pole_sign_bottom_.png", illuminated_props, "hiking_illuminated_pole_sign.png") +minetest.register_craft({ + output = "hiking:illuminated_pole_bottom", + type = "shapeless", + recipe = { "hiking:pole_bottom", "default:torch" } +}) + +for i, colour in ipairs(colour_list) do + mk_hiking_pole_coloured(colour) + mk_hiking_pole_illuminated_coloured(colour) +end diff --git a/mods/hiking/textures/hiking_blue_arrow_left.png b/mods/hiking/textures/hiking_blue_arrow_left.png new file mode 100644 index 0000000..11b5055 Binary files /dev/null and b/mods/hiking/textures/hiking_blue_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_blue_arrow_right.png b/mods/hiking/textures/hiking_blue_arrow_right.png new file mode 100644 index 0000000..03ed2cc Binary files /dev/null and b/mods/hiking/textures/hiking_blue_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_blue_sign.png b/mods/hiking/textures/hiking_blue_sign.png new file mode 100644 index 0000000..a569f18 Binary files /dev/null and b/mods/hiking/textures/hiking_blue_sign.png differ diff --git a/mods/hiking/textures/hiking_green_arrow_left.png b/mods/hiking/textures/hiking_green_arrow_left.png new file mode 100644 index 0000000..48aa0d0 Binary files /dev/null and b/mods/hiking/textures/hiking_green_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_green_arrow_right.png b/mods/hiking/textures/hiking_green_arrow_right.png new file mode 100644 index 0000000..3715303 Binary files /dev/null and b/mods/hiking/textures/hiking_green_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_green_sign.png b/mods/hiking/textures/hiking_green_sign.png new file mode 100644 index 0000000..c89e868 Binary files /dev/null and b/mods/hiking/textures/hiking_green_sign.png differ diff --git a/mods/hiking/textures/hiking_illuminated_blue_arrow_left.png b/mods/hiking/textures/hiking_illuminated_blue_arrow_left.png new file mode 100644 index 0000000..b17cdfd Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_blue_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_illuminated_blue_arrow_right.png b/mods/hiking/textures/hiking_illuminated_blue_arrow_right.png new file mode 100644 index 0000000..7cb289a Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_blue_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_illuminated_blue_sign.png b/mods/hiking/textures/hiking_illuminated_blue_sign.png new file mode 100644 index 0000000..2093b0a Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_blue_sign.png differ diff --git a/mods/hiking/textures/hiking_illuminated_green_arrow_left.png b/mods/hiking/textures/hiking_illuminated_green_arrow_left.png new file mode 100644 index 0000000..c273f89 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_green_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_illuminated_green_arrow_right.png b/mods/hiking/textures/hiking_illuminated_green_arrow_right.png new file mode 100644 index 0000000..cc53ccf Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_green_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_illuminated_green_sign.png b/mods/hiking/textures/hiking_illuminated_green_sign.png new file mode 100644 index 0000000..2370d8b Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_green_sign.png differ diff --git a/mods/hiking/textures/hiking_illuminated_pole_sign.png b/mods/hiking/textures/hiking_illuminated_pole_sign.png new file mode 100644 index 0000000..84aeec9 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_pole_sign.png differ diff --git a/mods/hiking/textures/hiking_illuminated_pole_sign_blue.png b/mods/hiking/textures/hiking_illuminated_pole_sign_blue.png new file mode 100644 index 0000000..7af5188 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_pole_sign_blue.png differ diff --git a/mods/hiking/textures/hiking_illuminated_pole_sign_green.png b/mods/hiking/textures/hiking_illuminated_pole_sign_green.png new file mode 100644 index 0000000..96ed831 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_pole_sign_green.png differ diff --git a/mods/hiking/textures/hiking_illuminated_pole_sign_red.png b/mods/hiking/textures/hiking_illuminated_pole_sign_red.png new file mode 100644 index 0000000..f0519ab Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_pole_sign_red.png differ diff --git a/mods/hiking/textures/hiking_illuminated_pole_sign_yellow.png b/mods/hiking/textures/hiking_illuminated_pole_sign_yellow.png new file mode 100644 index 0000000..f85f932 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_pole_sign_yellow.png differ diff --git a/mods/hiking/textures/hiking_illuminated_red_arrow_left.png b/mods/hiking/textures/hiking_illuminated_red_arrow_left.png new file mode 100644 index 0000000..1363cd4 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_red_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_illuminated_red_arrow_right.png b/mods/hiking/textures/hiking_illuminated_red_arrow_right.png new file mode 100644 index 0000000..d7462a2 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_red_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_illuminated_red_sign.png b/mods/hiking/textures/hiking_illuminated_red_sign.png new file mode 100644 index 0000000..bc8e054 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_red_sign.png differ diff --git a/mods/hiking/textures/hiking_illuminated_yellow_arrow_left.png b/mods/hiking/textures/hiking_illuminated_yellow_arrow_left.png new file mode 100644 index 0000000..ca1ad91 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_yellow_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_illuminated_yellow_arrow_right.png b/mods/hiking/textures/hiking_illuminated_yellow_arrow_right.png new file mode 100644 index 0000000..ddb3705 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_yellow_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_illuminated_yellow_sign.png b/mods/hiking/textures/hiking_illuminated_yellow_sign.png new file mode 100644 index 0000000..5024651 Binary files /dev/null and b/mods/hiking/textures/hiking_illuminated_yellow_sign.png differ diff --git a/mods/hiking/textures/hiking_infinite_pole_sign.png b/mods/hiking/textures/hiking_infinite_pole_sign.png new file mode 100644 index 0000000..0a0aaf3 Binary files /dev/null and b/mods/hiking/textures/hiking_infinite_pole_sign.png differ diff --git a/mods/hiking/textures/hiking_pole_sign.png b/mods/hiking/textures/hiking_pole_sign.png new file mode 100644 index 0000000..b7e3990 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_blue.png b/mods/hiking/textures/hiking_pole_sign_blue.png new file mode 100644 index 0000000..4451cc8 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_blue.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_bottom.png b/mods/hiking/textures/hiking_pole_sign_bottom.png new file mode 100644 index 0000000..2a8a7cc Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_bottom.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_bottom_.png b/mods/hiking/textures/hiking_pole_sign_bottom_.png new file mode 100644 index 0000000..eaac55e Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_bottom_.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_cap.png b/mods/hiking/textures/hiking_pole_sign_cap.png new file mode 100644 index 0000000..ea21439 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_cap.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_green.png b/mods/hiking/textures/hiking_pole_sign_green.png new file mode 100644 index 0000000..483efa1 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_green.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_red.png b/mods/hiking/textures/hiking_pole_sign_red.png new file mode 100644 index 0000000..5430598 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_red.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_top_blue.png b/mods/hiking/textures/hiking_pole_sign_top_blue.png new file mode 100644 index 0000000..0ee8376 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_top_blue.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_top_green.png b/mods/hiking/textures/hiking_pole_sign_top_green.png new file mode 100644 index 0000000..68f6b26 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_top_green.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_top_red.png b/mods/hiking/textures/hiking_pole_sign_top_red.png new file mode 100644 index 0000000..5d673d5 Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_top_red.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_top_yellow.png b/mods/hiking/textures/hiking_pole_sign_top_yellow.png new file mode 100644 index 0000000..7e4f2ff Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_top_yellow.png differ diff --git a/mods/hiking/textures/hiking_pole_sign_yellow.png b/mods/hiking/textures/hiking_pole_sign_yellow.png new file mode 100644 index 0000000..e79fd0e Binary files /dev/null and b/mods/hiking/textures/hiking_pole_sign_yellow.png differ diff --git a/mods/hiking/textures/hiking_red_arrow_left.png b/mods/hiking/textures/hiking_red_arrow_left.png new file mode 100644 index 0000000..cb791ca Binary files /dev/null and b/mods/hiking/textures/hiking_red_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_red_arrow_right.png b/mods/hiking/textures/hiking_red_arrow_right.png new file mode 100644 index 0000000..da79b85 Binary files /dev/null and b/mods/hiking/textures/hiking_red_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_red_sign.png b/mods/hiking/textures/hiking_red_sign.png new file mode 100644 index 0000000..5ab21ca Binary files /dev/null and b/mods/hiking/textures/hiking_red_sign.png differ diff --git a/mods/hiking/textures/hiking_tall_pole_sign.png b/mods/hiking/textures/hiking_tall_pole_sign.png new file mode 100644 index 0000000..568cffb Binary files /dev/null and b/mods/hiking/textures/hiking_tall_pole_sign.png differ diff --git a/mods/hiking/textures/hiking_very_tall_pole_sign.png b/mods/hiking/textures/hiking_very_tall_pole_sign.png new file mode 100644 index 0000000..e3a9949 Binary files /dev/null and b/mods/hiking/textures/hiking_very_tall_pole_sign.png differ diff --git a/mods/hiking/textures/hiking_yellow_arrow_left.png b/mods/hiking/textures/hiking_yellow_arrow_left.png new file mode 100644 index 0000000..47b8573 Binary files /dev/null and b/mods/hiking/textures/hiking_yellow_arrow_left.png differ diff --git a/mods/hiking/textures/hiking_yellow_arrow_right.png b/mods/hiking/textures/hiking_yellow_arrow_right.png new file mode 100644 index 0000000..e5ab54c Binary files /dev/null and b/mods/hiking/textures/hiking_yellow_arrow_right.png differ diff --git a/mods/hiking/textures/hiking_yellow_sign.png b/mods/hiking/textures/hiking_yellow_sign.png new file mode 100644 index 0000000..a2cd7ce Binary files /dev/null and b/mods/hiking/textures/hiking_yellow_sign.png differ diff --git a/mods/hud/.gitattributes b/mods/hud/.gitattributes new file mode 100644 index 0000000..412eeda --- /dev/null +++ b/mods/hud/.gitattributes @@ -0,0 +1,22 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain diff --git a/mods/hud/.gitignore b/mods/hud/.gitignore new file mode 100644 index 0000000..b9d6bd9 --- /dev/null +++ b/mods/hud/.gitignore @@ -0,0 +1,215 @@ +################# +## Eclipse +################# + +*.pydevproject +.project +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.classpath +.settings/ +.loadpath + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# PDT-specific +.buildpath + + +################# +## Visual Studio +################# + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.sln.docstates + +# Build results + +[Dd]ebug/ +[Rr]elease/ +x64/ +build/ +[Bb]in/ +[Oo]bj/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +*_i.c +*_p.c +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.log +*.scc + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +*.ncrunch* +.*crunch*.local.xml + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.Publish.xml +*.pubxml + +# NuGet Packages Directory +## TODO: If you have NuGet Package Restore enabled, uncomment the next line +#packages/ + +# Windows Azure Build Output +csx +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# Others +sql/ +*.Cache +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.[Pp]ublish.xml +*.pfx +*.publishsettings + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file to a newer +# Visual Studio version. Backup files are not needed, because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +App_Data/*.mdf +App_Data/*.ldf + +############# +## Windows detritus +############# + +# Windows image file caches +Thumbs.db +ehthumbs.db + +# Folder config file +Desktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Mac crap +.DS_Store + + +############# +## Python +############# + +*.py[co] + +# Packages +*.egg +*.egg-info +dist/ +build/ +eggs/ +parts/ +var/ +sdist/ +develop-eggs/ +.installed.cfg + +# Installer logs +pip-log.txt + +# Unit test / coverage reports +.coverage +.tox + +#Translations +*.mo + +#Mr Developer +.mr.developer.cfg diff --git a/mods/hud/API.txt b/mods/hud/API.txt new file mode 100644 index 0000000..caeaf90 --- /dev/null +++ b/mods/hud/API.txt @@ -0,0 +1,33 @@ +function hud.register(name, def) + -- name: statbar name (health, air, hunger, armor already used by default) + -- def: (see below) + +hud.change_item(player, name, def) + -- player: player object + -- name: statbar name (health, air, hunger, armor already used by default) + -- def: table containing new values + -- currently supported: number, text and offset + +hud.remove_item(player, name) + +HUD item definition +{ + hud_elem_type = "statbar", -- currently only supported type (same as in lua-api.txt) + position = {x=, y=}, -- position of statbar (same as in lua-api.txt) + size = {x=24, y=24}, -- statbar texture size (default 24x24), needed to be scaled correctly + text = "hud_heart_fg.png", -- texture name (same as in lua-api.txt) + number = 20, -- number/2 = number of full textures(e.g. hearts) + max = 20, -- used to prevent "overflow" of statbars + alignment = {x=-1,y=-1}, -- alignment on screen (same as in lua-api.txt) + offset = HUD_HEALTH_OFFSET, + background = "hud_heart_bg.png", -- statbar background texture name + autohide_bg = false, -- hide statbar background textures when number = 0 + events = { -- called on events "damage" and "breath_changed" of players + { + type = "damage", + func = function(player) + -- do something here + end + } + }, +} diff --git a/mods/hud/LICENSE.txt b/mods/hud/LICENSE.txt new file mode 100644 index 0000000..4362b49 --- /dev/null +++ b/mods/hud/LICENSE.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/mods/hud/README.txt b/mods/hud/README.txt new file mode 100644 index 0000000..a890e6b --- /dev/null +++ b/mods/hud/README.txt @@ -0,0 +1,67 @@ +Minetest mod "Better HUD" +========================= +Version: 2.1.2 + +(c) Copyright BlockMen (2013-2015) + + +About this mod: +~~~~~~~~~~~~~~~ +This mod improves the HUD of Minetest and adds (hidden by default) statbars for Hunger and Armor. +Also it provides an API to add new statbars easily, see API.txt for more informations. + +Changes in builtin HUD items: +- Adds background for Health bar +- Uses better textures for Hotbar +- Uses texture for crosshair +- Positions of builtin statbars can be changed via "hud.conf" file +- Experimental "ItemWheel" that replaces the hotbar (must be enabled by adding "hud_item_wheel = true" in minetest.conf) + +This mod gets provided as Modpack aswell, which includes the hunger mod (https://github.com/BlockMen/hunger) +More information concerning the hunger mechanics can be get there. + +This mod supports the 3d_armor mod by stu (https://github.com/stujones11/minetest-3d_armor) + + + +License: +~~~~~~~~ +(c) Copyright BlockMen (2013-2015) + + +Code: +Licensed under the GNU LGPL version 2.1 or higher. +You can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License +as published by the Free Software Foundation; + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt + + +Textures: +hud_heart_fg.png - celeron55 (CC BY-SA 3.0), modified by BlockMen +hud_heart_bg.png - celeron55 (CC BY-SA 3.0), modified by BlockMen +hud_hunger_fg.png - PilzAdam (WTFPL), modified by BlockMen +hud_hunger_bg.png - PilzAdam (WTFPL), modified by BlockMen +wieldhand.png (from character.png) - Jordach (CC BY-SA 3.0), modified by BlockMen +hud_air_fg.png - kaeza (WTFPL), modified by BlockMen +hud_armor_fg.png - Stu (CC BY-SA 3.0), modified by BlockMen +hud_armor_bg.png - Stu (CC BY-SA 3.0), modified by BlockMen + + +Github: +~~~~~~~ +https://github.com/BlockMen/hud + +Forum: +~~~~~~ +https://forum.minetest.net/viewtopic.php?id=6342 + + +Changelog: +~~~~~~~~~~ +see changelog.txt diff --git a/mods/hud/api.lua b/mods/hud/api.lua new file mode 100644 index 0000000..c40d857 --- /dev/null +++ b/mods/hud/api.lua @@ -0,0 +1,209 @@ +-- global values +hud.registered_items = {} +hud.damage_events = {} +hud.breath_events = {} + +-- keep id handling internal +local hud_id = {} -- hud item ids +local sb_bg = {} -- statbar background ids + +-- localize often used table +local items = hud.registered_items + +local function throw_error(msg) + minetest.log("error", "Better HUD[error]: " .. msg) +end + + +-- +-- API +-- + +function hud.register(name, def) + if not name or not def then + throw_error("not enough parameters given") + return false + end + + --TODO: allow other elements + if def.hud_elem_type ~= "statbar" then + throw_error("The given HUD element is no statbar") + return false + end + if items[name] ~= nil then + throw_error("A statbar with that name already exists") + return false + end + + -- actually register + -- add background first since draworder is based on id :\ + if def.hud_elem_type == "statbar" and def.background ~= nil then + sb_bg[name] = table.copy(def) + sb_bg[name].text = def.background + if not def.autohide_bg and def.max then + sb_bg[name].number = def.max + end + end + -- add item itself + items[name] = def + + -- register events + if def.events then + for _,v in pairs(def.events) do + if v and v.type and v.func then + if v.type == "damage" then + table.insert(hud.damage_events, v) + end + + if v.type == "breath" then + table.insert(hud.breath_events, v) + end + end + end + end + + -- no error so far, return sucess + return true +end + +function hud.change_item(player, name, def) + if not player or not player:is_player() or not name or not def then + throw_error("Not enough parameters given to change HUD item") + return false + end + local i_name = player:get_player_name().."_"..name + local elem = hud_id[i_name] + if not elem then + throw_error("Given HUD element " .. dump(name) .. " does not exist".." h") + return false + end + + -- Only update if values supported and value actually changed + -- update supported values (currently number and text only) + if def.number and elem.number then + if def.number ~= elem.number then + if elem.max and def.number > elem.max and not def.max then + def.number = elem.max + end + if def.max then + elem.max = def.max + end + player:hud_change(elem.id, "number", def.number) + elem.number = def.number + -- hide background when set + local bg = hud_id[i_name.."_bg"] + if elem.autohide_bg then + if def.number < 1 then + player:hud_change(bg.id, "number", 0) + else + local num = bg.number + if bg.max then + num = bg.max + end + player:hud_change(bg.id, "number", num) + end + else + if bg and bg.max and bg.max < 1 and def.max and def.max > bg.max then + player:hud_change(bg.id, "number", def.max) + bg.max = def.max + end + end + end + end + if def.text and elem.text then + if def.text ~= elem.text then + player:hud_change(elem.id, "text", def.text) + elem.text = def.text + end + end + + if def.offset and elem.offset then + if def.item_name and def.offset == "item" then + local i_name2 = player:get_player_name().."_"..def.item_name + local elem2 = hud_id[i_name2] + if elem2 then + local p2 = elem2.offset + local p1 = elem.offset + player:hud_change(elem2.id, "offset", p1) + player:hud_change(elem.id, "offset", p2) + elem2.offset = p1 + elem.offset = p2 + if elem.background then + local elem3 = hud_id[i_name.."_bg"] + if elem3 and elem3.offset then + player:hud_change(elem3.id, "offset", p2) + elem3.offset = p2 + local elem4 = hud_id[i_name2.."_bg"] + if elem4 and elem4.offset then + player:hud_change(elem4.id, "offset", p1) + elem4.offset = p1 + end + end + end + end + else + player:hud_change(elem.id, "offset", def.offset) + elem.offset = def.offset + end + end + + return true +end + +function hud.remove_item(player, name) + if not player or not name then + throw_error("Not enough parameters given") + return false + end + local i_name = player:get_player_name().."_"..name + if hud_id[i_name] == nil then + throw_error("Given HUD element " .. dump(name) .. " does not exist") + return false + end + player:hud_remove(hud_id[i_name].id) + hud_id[i_name] = nil + + return true +end + + +-- +-- Add registered HUD items to joining players +-- + +-- Following code is placed here to keep HUD ids internal +local function add_hud_item(player, name, def) + if not player or not name or not def then + throw_error("not enough parameters given") + return false + end + local i_name = player:get_player_name().."_"..name + hud_id[i_name] = def + hud_id[i_name].id = player:hud_add(def) +end + +minetest.register_on_joinplayer(function(player) + + -- first: hide the default statbars + local hud_flags = player:hud_get_flags() + hud_flags.healthbar = false + hud_flags.breathbar = false + player:hud_set_flags(hud_flags) + + -- now add the backgrounds (e.g. for statbars) + for _,item in pairs(sb_bg) do + add_hud_item(player, _.."_bg", item) + end + -- and finally the actual HUD items + for _,item in pairs(items) do + add_hud_item(player, _, item) + end + + -- fancy hotbar (only when no crafting mod present) + if minetest.get_modpath("crafting") == nil then + minetest.after(0.5, function() + player:hud_set_hotbar_image("hud_hotbar.png") + player:hud_set_hotbar_selected_image("hud_hotbar_selected.png") + end) + end +end) diff --git a/mods/hud/armor.lua b/mods/hud/armor.lua new file mode 100644 index 0000000..7f0d0cf --- /dev/null +++ b/mods/hud/armor.lua @@ -0,0 +1,34 @@ +minetest.after(0, function() + if not armor.def then + minetest.after(2,minetest.chat_send_all,"#Better HUD: Please update your version of 3darmor") + HUD_SHOW_ARMOR = false + end +end) + +function hud.get_armor(player) + if not player or not armor.def then + return + end + local name = player:get_player_name() + local def = armor.def[name] or nil + if def and def.state and def.count then + hud.set_armor(name, def.state, def.count) + end +end + +function hud.set_armor(player_name, ges_state, items) + local max_items = 4 + if items == 5 then + max_items = items + end + local max = max_items * 65535 + local lvl = max - ges_state + lvl = lvl/max + if ges_state == 0 and items == 0 then + lvl = 0 + end + + hud.armor[player_name] = lvl* (items * (20 / max_items)) + + +end \ No newline at end of file diff --git a/mods/hud/builtin.lua b/mods/hud/builtin.lua new file mode 100644 index 0000000..057189c --- /dev/null +++ b/mods/hud/builtin.lua @@ -0,0 +1,114 @@ +HUD_IW_MAX = 8 +HUD_IW_TICK = 0.4 +if minetest.is_singleplayer() == true then + HUD_IW_TICK = 0.2 +end + +HUD_SB_SIZE = {x = 24, y = 24} + +HUD_HEALTH_POS = {x = 0.5,y = 1} +HUD_HEALTH_OFFSET = {x = -262, y = -87} +HUD_AIR_POS = {x = 0.5, y = 1} +HUD_AIR_OFFSET = {x = 15, y = -87} +HUD_HUNGER_POS = {x = 0.5, y = 1} +HUD_HUNGER_OFFSET = {x = 15, y = -110} +HUD_ARMOR_POS = {x = 0.5, y = 1} +HUD_ARMOR_OFFSET = {x = -262, y = -110} + +-- Reorder everything when using ItemWeel +hud.item_wheel = minetest.setting_getbool("hud_item_wheel") +if hud.item_wheel then + HUD_HEALTH_POS = {x = 0.5,y = 1} + HUD_HEALTH_OFFSET = {x = -385, y = -77} + HUD_AIR_POS = {x = 0.5, y = 1} + HUD_AIR_OFFSET = {x = 150, y = -77} + HUD_HUNGER_POS = {x = 0.5, y = 1} + HUD_HUNGER_OFFSET = {x = 180, y = -44} + HUD_ARMOR_POS = {x = 0.5, y = 1} + HUD_ARMOR_OFFSET = {x = -415, y = -44} +end + +-- read hud.conf settings +hud.read_conf() + +local damage_enabled = minetest.setting_getbool("enable_damage") + +hud.show_hunger = minetest.get_modpath("hunger") ~= nil +hud.show_armor = minetest.get_modpath("3d_armor") ~= nil + +-- check if some settings are invalid +local enable_hunger = minetest.setting_getbool("hud_hunger_enable") +if (enable_hunger == true or HUD_ENABLE_HUNGER == true) and not hud.show_hunger then + hud.notify_hunger(5) +end + +if damage_enabled then + hud.register("health", { + hud_elem_type = "statbar", + position = HUD_HEALTH_POS, + size = HUD_SB_SIZE, + text = "hud_heart_fg.png", + number = 20, + alignment = {x = -1, y = -1}, + offset = HUD_HEALTH_OFFSET, + background = "hud_heart_bg.png", + events = { + { + type = "damage", + func = function(player) + hud.change_item(player, "health", {number = player:get_hp()}) + end + } + }, + }) + + hud.register("air", { + hud_elem_type = "statbar", + position = HUD_AIR_POS, + size = HUD_SB_SIZE, + text = "hud_air_fg.png", + number = 0, + alignment = {x = -1, y = -1}, + offset = HUD_AIR_OFFSET, + background = nil, + events = { + { + type = "breath", + func = function(player) + local air = player:get_breath() + if air > 10 then + air = 0 + end + hud.change_item(player, "air", {number = air * 2}) + end + } + }, + }) + + hud.register("armor", { + hud_elem_type = "statbar", + position = HUD_ARMOR_POS, + size = HUD_SB_SIZE, + text = "hud_armor_fg.png", + number = 0, + alignment = {x = -1, y = -1}, + offset = HUD_ARMOR_OFFSET, + background = "hud_armor_bg.png", + autohide_bg = true, + max = 20, + }) + + hud.register("hunger", { + hud_elem_type = "statbar", + position = HUD_HUNGER_POS, + size = HUD_SB_SIZE, + text = "hud_hunger_fg.png", + number = 0, + alignment = {x = -1, y = -1}, + offset = HUD_HUNGER_OFFSET, + background = "hud_hunger_bg.png", + max = 0, + }) +else + hud.show_armor = false +end diff --git a/mods/hud/changelog.txt b/mods/hud/changelog.txt new file mode 100644 index 0000000..c41faf7 --- /dev/null +++ b/mods/hud/changelog.txt @@ -0,0 +1,127 @@ +2.1.2 +----- +- Fixed crash caused by animated nodes (reported by Krock) +- Fixed "freezing" of empty slots (reported by kilbith) + +2.1.1 +----- +- Added itemcounting/wearout info +- Added support for hud scaling +- Fixed typo causing endless updating +- Fixed image scaling of some textures (like glass) +- Improved ItemWheel image + +2.1 +--- +- Added "ItemWheel" (experimental) +- Fixed disapperaring hunger bar (reported by poet-nohit) + +2.0.1 +----- +- Fix disappearing hotbar (reported by poet-nohit) +- Fix unused global var +- Added one more check to catch probably incorrect players + +2.0 +--- +- Complete rewrite +- Moved hunger into seperate mod +- Added API +- Switched License to LGPL 2.1 + +===== ===== ===== +----- 0-1.x ----- +===== ===== ===== + +1.4.1 +----- +- ### + +1.4 +--- +- New hunger mechanics/added experimental player-action based hunger +- Better crosshair texture, switched to "new" default hand +- Added support for farming redo mod, kpgmobs and jkmod + +1.3.3 +----- +- Prevent crash with armor mod and missing player +- Add support for ethereal mod (by TenPlus1) + +1.3.2 +----- +- Fix dependecies (by Chris Beelby) +- Add support for creatures mod +- Add optional healing for food (by TenPlus1) + +1.3.1 +----- +- Add compatibility for statbar scaling +- Fix typo in depends.txt +- Lower maintimer tick + +1.3 +--- +- New way hunger is saved (all old files in world dirctory can get deleted [e.g. hud_BlockMen_hunger]) +- Fixed healing (not while drowning, fix after death) +- Add support for mods: seaplants[sea] and mobfcooking (by Xanthin) +- Tweaked hand image +- Player can die caus of starving now + +1.2 +--- +- Send statbar values only to client when changed +- Hide armor bar if not wearing armor +- More reliable food overrides (by CiaranG) +- Support for bushes_classic foods (plantlife modpack) (by CiaranG) +- Add support for mushroom mod food/poison (by CiaranG) +- Add support for mods: fruit and mush45 +- New images for hotbar, smaller armor icons + +1.1 +--- +- added support for stu's 3darmor mod +- restructured and cleaned up code +- added support for poisen food (damages player, but does not kill) + +1.0 +--- +- hunger is reset after death +- health and hunger bar is shown correct on all screen resolutions now +- switched to changed native hotbar image support +- fixed revival of player when drown +- hunger bar is not shown anymore if hunger is disabled +- hunger can be disabled by minetest.conf ("hud_hunger_enable = false") + +0.5 Beta +---------- +- removed the fancy borders of hud inventory bar and moved to new native support +- moved crosshair to native support too + +0.4 Beta +---------- +- enabled drowning + +0.3 Beta +---------- +- added fancy borders of hud inventory bar (only for screenheight <= 800) + +0.2.3 Beta +---------- +- added support for food of glooptest and bushes (commit by CheeseKeg) + +0.2.2 Beta +---------- +- added support for food of animalmaterials (mobf modpack),fishing + +0.2.1 Beta +---------- +- tweaked override of food +- added support for food of dwares, moretrees and simple mobs + +0.2 Beta +-------- +- added support of custom config files +- you can eat max. 50% more than before (although it isnt shown in hunger bar) +- you get healed with 8 breads and more (in hunger bar) now +- a bread (from farming) == 2 breads in hunger bar diff --git a/mods/hud/depends.txt b/mods/hud/depends.txt new file mode 100644 index 0000000..7be6dbb --- /dev/null +++ b/mods/hud/depends.txt @@ -0,0 +1 @@ +3d_armor? \ No newline at end of file diff --git a/mods/hud/functions.lua b/mods/hud/functions.lua new file mode 100644 index 0000000..a7063d9 --- /dev/null +++ b/mods/hud/functions.lua @@ -0,0 +1,46 @@ +function hud.read_conf() + local mod_path = minetest.get_modpath("hud") + local set = io.open(mod_path .. "/hud.conf", "r") + if set then + dofile(mod_path .. "/hud.conf") + set:close() + end +end + +function hud.notify_hunger(delay, use) + local txt_part = "enable" + if use then + txt_part = "use" + end + minetest.after(delay, function() + minetest.chat_send_all("#Better HUD: You can't " .. txt_part .. " hunger without the \"hunger\" mod") + minetest.chat_send_all(" Enable it or download it from \"https://github.com/BlockMen/hunger\"") + end) +end + +function hud.player_event(player, event) + --needed for first update called by on_join + minetest.after(0, function() + if event == "health_changed" then + for _,v in pairs(hud.damage_events) do + if v.func then + v.func(player) + end + end + end + + if event == "breath_changed" then + for _,v in pairs(hud.breath_events) do + if v.func then + v.func(player) + end + end + end + + if event == "hud_changed" then--called when flags changed + + end + end) +end + +core.register_playerevent(hud.player_event) diff --git a/mods/hud/hud.conf.example b/mods/hud/hud.conf.example new file mode 100644 index 0000000..f96041d --- /dev/null +++ b/mods/hud/hud.conf.example @@ -0,0 +1,35 @@ +--##Better HUD example config file## +------------------------------------ +-- This example moves the statbars in the down left and down right corners. By Echoes91 + +-- NOTICE -- +-- if damage is disabled no statbar is shown at all +-- Make sure that the statbars are shown correct on other screen resolutions aswell + + +HUD_SB_SIZE = {x = 24, y = 24} -- statbar icon size in pixel before (!) scaling + +-- +-- health bar +-- +HUD_HEALTH_POS = {x = 0, y = 1} -- min 0, max 1 +HUD_HEALTH_OFFSET = {x = 10, y = -30} -- offset in pixel + +-- +-- hunger bar +-- +HUD_HUNGER_POS = {x = 1, y = 1} -- min 0, max 1 +HUD_HUNGER_OFFSET = {x = -250, y = -30} -- offset in pixel + +-- +-- breath bar +-- +HUD_AIR_POS = {x = 1, y = 1} -- min 0, max 1 +HUD_AIR_OFFSET = {x = -250, y = -60} -- offset in pixel + +-- +-- armor bar +-- +HUD_ARMOR_POS = {x = 0, y = 1} -- min 0, max 1 +HUD_ARMOR_OFFSET = {x = 10, y = -60} -- offset in pixel + diff --git a/mods/hud/hunger.lua b/mods/hud/hunger.lua new file mode 100644 index 0000000..c9a53ae --- /dev/null +++ b/mods/hud/hunger.lua @@ -0,0 +1,392 @@ +-- Keep these for backwards compatibility +function hud.save_hunger(player) + hud.set_hunger(player) +end +function hud.load_hunger(player) + hud.get_hunger(player) +end + +-- Poison player +local function poisenp(tick, time, time_left, player) + time_left = time_left + tick + if time_left < time then + minetest.after(tick, poisenp, tick, time, time_left, player) + else + --reset hud image + end + if player:get_hp()-1 > 0 then + player:set_hp(player:get_hp()-1) + end + +end + +function hud.item_eat(hunger_change, replace_with_item, poisen, heal) + return function(itemstack, user, pointed_thing) + if itemstack:take_item() ~= nil and user ~= nil then + local name = user:get_player_name() + local h = tonumber(hud.hunger[name]) + local hp = user:get_hp() + + -- Saturation + if h < 30 and hunger_change then + h = h + hunger_change + if h > 30 then h = 30 end + hud.hunger[name] = h + hud.set_hunger(user) + end + -- Healing + if hp < 20 and heal then + hp = hp + heal + if hp > 20 then hp = 20 end + user:set_hp(hp) + end + -- Poison + if poisen then + --set hud-img + poisenp(1.0, poisen, 0, user) + end + + --sound:eat + itemstack:add_item(replace_with_item) + end + return itemstack + end +end + +local function overwrite(name, hunger_change, replace_with_item, poisen, heal) + local tab = minetest.registered_items[name] + if tab == nil then return end + tab.on_use = hud.item_eat(hunger_change, replace_with_item, poisen, heal) + minetest.registered_items[name] = tab +end + +overwrite("default:apple", 2) +if minetest.get_modpath("farming") ~= nil then + overwrite("farming:bread", 4) +end + +if minetest.get_modpath("mobs") ~= nil then + if mobs.mod ~= nil and mobs.mod == "redo" then + overwrite("mobs:cheese", 4) + overwrite("mobs:meat", 8) + overwrite("mobs:meat_raw", 4) + overwrite("mobs:rat_cooked", 4) + overwrite("mobs:honey", 2) + overwrite("mobs:pork_raw", 3, "", 3) + overwrite("mobs:pork_cooked", 8) + overwrite("mobs:chicken_cooked", 6) + overwrite("mobs:chicken_raw", 2, "", 3) + overwrite("mobs:chicken_egg_fried", 2) + if minetest.get_modpath("bucket") then + overwrite("mobs:bucket_milk", 3, "bucket:bucket_empty") + end + else + overwrite("mobs:meat", 6) + overwrite("mobs:meat_raw", 3) + overwrite("mobs:rat_cooked", 5) + end +end + +if minetest.get_modpath("moretrees") ~= nil then + overwrite("moretrees:coconut_milk", 1) + overwrite("moretrees:raw_coconut", 2) + overwrite("moretrees:acorn_muffin", 3) + overwrite("moretrees:spruce_nuts", 1) + overwrite("moretrees:pine_nuts", 1) + overwrite("moretrees:fir_nuts", 1) +end + +if minetest.get_modpath("dwarves") ~= nil then + overwrite("dwarves:beer", 2) + overwrite("dwarves:apple_cider", 1) + overwrite("dwarves:midus", 2) + overwrite("dwarves:tequila", 2) + overwrite("dwarves:tequila_with_lime", 2) + overwrite("dwarves:sake", 2) +end + +if minetest.get_modpath("animalmaterials") ~= nil then + overwrite("animalmaterials:milk", 2) + overwrite("animalmaterials:meat_raw", 3) + overwrite("animalmaterials:meat_pork", 3) + overwrite("animalmaterials:meat_beef", 3) + overwrite("animalmaterials:meat_chicken", 3) + overwrite("animalmaterials:meat_lamb", 3) + overwrite("animalmaterials:meat_venison", 3) + overwrite("animalmaterials:meat_undead", 3, "", 3) + overwrite("animalmaterials:meat_toxic", 3, "", 5) + overwrite("animalmaterials:meat_ostrich", 3) + overwrite("animalmaterials:fish_bluewhite", 2) + overwrite("animalmaterials:fish_clownfish", 2) +end + +if minetest.get_modpath("fishing") ~= nil then + overwrite("fishing:fish_raw", 2) + overwrite("fishing:fish_cooked", 5) + overwrite("fishing:sushi", 6) + overwrite("fishing:shark", 4) + overwrite("fishing:shark_cooked", 8) + overwrite("fishing:pike", 4) + overwrite("fishing:pike_cooked", 8) +end + +if minetest.get_modpath("glooptest") ~= nil then + overwrite("glooptest:kalite_lump", 1) +end + +if minetest.get_modpath("bushes") ~= nil then + overwrite("bushes:sugar", 1) + overwrite("bushes:strawberry", 2) + overwrite("bushes:berry_pie_raw", 3) + overwrite("bushes:berry_pie_cooked", 4) + overwrite("bushes:basket_pies", 15) +end + +if minetest.get_modpath("bushes_classic") then + -- bushes_classic mod, as found in the plantlife modpack + local berries = { + "strawberry", + "blackberry", + "blueberry", + "raspberry", + "gooseberry", + "mixed_berry"} + for _, berry in ipairs(berries) do + if berry ~= "mixed_berry" then + overwrite("bushes:"..berry, 1) + end + overwrite("bushes:"..berry.."_pie_raw", 2) + overwrite("bushes:"..berry.."_pie_cooked", 5) + overwrite("bushes:basket_"..berry, 15) + end +end + +if minetest.get_modpath("mushroom") ~= nil then + overwrite("mushroom:brown", 1) + overwrite("mushroom:red", 1, "", 3) + -- mushroom potions: red = strong poison, brown = light restorative + if minetest.get_modpath("vessels") then + overwrite("mushroom:brown_essence", 1, "vessels:glass_bottle", nil, 4) + overwrite("mushroom:poison", 1, "vessels:glass_bottle", 10) + end +end + +if minetest.get_modpath("docfarming") ~= nil then + overwrite("docfarming:carrot", 3) + overwrite("docfarming:cucumber", 2) + overwrite("docfarming:corn", 3) + overwrite("docfarming:potato", 4) + overwrite("docfarming:bakedpotato", 5) + overwrite("docfarming:raspberry", 3) +end + +if minetest.get_modpath("farming_plus") ~= nil then + overwrite("farming_plus:carrot_item", 3) + overwrite("farming_plus:banana", 2) + overwrite("farming_plus:orange_item", 2) + overwrite("farming:pumpkin_bread", 4) + overwrite("farming_plus:strawberry_item", 2) + overwrite("farming_plus:tomato_item", 2) + overwrite("farming_plus:potato_item", 4) + overwrite("farming_plus:rhubarb_item", 2) +end + +if minetest.get_modpath("mtfoods") ~= nil then + overwrite("mtfoods:dandelion_milk", 1) + overwrite("mtfoods:sugar", 1) + overwrite("mtfoods:short_bread", 4) + overwrite("mtfoods:cream", 1) + overwrite("mtfoods:chocolate", 2) + overwrite("mtfoods:cupcake", 2) + overwrite("mtfoods:strawberry_shortcake", 2) + overwrite("mtfoods:cake", 3) + overwrite("mtfoods:chocolate_cake", 3) + overwrite("mtfoods:carrot_cake", 3) + overwrite("mtfoods:pie_crust", 3) + overwrite("mtfoods:apple_pie", 3) + overwrite("mtfoods:rhubarb_pie", 2) + overwrite("mtfoods:banana_pie", 3) + overwrite("mtfoods:pumpkin_pie", 3) + overwrite("mtfoods:cookies", 2) + overwrite("mtfoods:mlt_burger", 5) + overwrite("mtfoods:potato_slices", 2) + overwrite("mtfoods:potato_chips", 3) + --mtfoods:medicine + overwrite("mtfoods:casserole", 3) + overwrite("mtfoods:glass_flute", 2) + overwrite("mtfoods:orange_juice", 2) + overwrite("mtfoods:apple_juice", 2) + overwrite("mtfoods:apple_cider", 2) + overwrite("mtfoods:cider_rack", 2) +end + +if minetest.get_modpath("fruit") ~= nil then + overwrite("fruit:apple", 2) + overwrite("fruit:pear", 2) + overwrite("fruit:bananna", 3) + overwrite("fruit:orange", 2) +end + +if minetest.get_modpath("mush45") ~= nil then + overwrite("mush45:meal", 4) +end + +if minetest.get_modpath("seaplants") ~= nil then + overwrite("seaplants:kelpgreen", 1) + overwrite("seaplants:kelpbrown", 1) + overwrite("seaplants:seagrassgreen", 1) + overwrite("seaplants:seagrassred", 1) + overwrite("seaplants:seasaladmix", 6) + overwrite("seaplants:kelpgreensalad", 1) + overwrite("seaplants:kelpbrownsalad", 1) + overwrite("seaplants:seagrassgreensalad", 1) + overwrite("seaplants:seagrassgreensalad", 1) +end + +if minetest.get_modpath("mobfcooking") ~= nil then + overwrite("mobfcooking:cooked_pork", 6) + overwrite("mobfcooking:cooked_ostrich", 6) + overwrite("mobfcooking:cooked_beef", 6) + overwrite("mobfcooking:cooked_chicken", 6) + overwrite("mobfcooking:cooked_lamb", 6) + overwrite("mobfcooking:cooked_venison", 6) + overwrite("mobfcooking:cooked_fish", 6) +end + +if minetest.get_modpath("creatures") ~= nil then + overwrite("creatures:meat", 6) + overwrite("creatures:flesh", 3) + overwrite("creatures:rotten_flesh", 3, "", 3) +end + +if minetest.get_modpath("ethereal") then + overwrite("ethereal:strawberry", 1) + overwrite("ethereal:banana", 4) + overwrite("ethereal:pine_nuts", 1) + overwrite("ethereal:bamboo_sprout", 0, "", 3) + overwrite("ethereal:fern_tubers", 1) + overwrite("ethereal:banana_bread", 7) + overwrite("ethereal:mushroom_plant", 2) + overwrite("ethereal:coconut_slice", 2) + overwrite("ethereal:golden_apple", 4, "", nil, 10) + overwrite("ethereal:wild_onion_plant", 2) + overwrite("ethereal:mushroom_soup", 4, "ethereal:bowl") + overwrite("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl") + overwrite("ethereal:hearty_stew", 6, "ethereal:bowl", 3) + overwrite("ethereal:hearty_stew_cooked", 10, "ethereal:bowl") + if minetest.get_modpath("bucket") then + overwrite("ethereal:bucket_cactus", 2, "bucket:bucket_empty") + end + overwrite("ethereal:fish_raw", 2) + overwrite("ethereal:fish_cooked", 5) + overwrite("ethereal:seaweed", 1) + overwrite("ethereal:yellowleaves", 1, "", nil, 1) + overwrite("ethereal:sashimi", 4) +end + +if minetest.get_modpath("farming") and farming.mod == "redo" then + overwrite("farming:bread", 6) + overwrite("farming:potato", 1) + overwrite("farming:baked_potato", 6) + overwrite("farming:cucumber", 4) + overwrite("farming:tomato", 4) + overwrite("farming:carrot", 3) + overwrite("farming:carrot_gold", 6, "", nil, 8) + overwrite("farming:corn", 3) + overwrite("farming:corn_cob", 5) + overwrite("farming:melon_slice", 2) + overwrite("farming:pumpkin_slice", 1) + overwrite("farming:pumpkin_bread", 9) + overwrite("farming:coffee_cup", 2, "farming:drinking_cup") + overwrite("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2) + overwrite("farming:cookie", 2) + overwrite("farming:chocolate_dark", 3) + overwrite("farming:donut", 4) + overwrite("farming:donut_chocolate", 6) + overwrite("farming:donut_apple", 6) + overwrite("farming:raspberries", 1) + overwrite("farming:blueberries", 1) + overwrite("farming:muffin_blueberry", 4) + if minetest.get_modpath("vessels") then + overwrite("farming:smoothie_raspberry", 2, "vessels:drinking_glass") + end + overwrite("farming:rhubarb", 1) + overwrite("farming:rhubarb_pie", 6) +end + +if minetest.get_modpath("kpgmobs") ~= nil then + overwrite("kpgmobs:uley", 3) + overwrite("kpgmobs:meat", 6) + overwrite("kpgmobs:rat_cooked", 5) + overwrite("kpgmobs:med_cooked", 4) + if minetest.get_modpath("bucket") then + overwrite("kpgmobs:bucket_milk", 4, "bucket:bucket_empty") + end +end + +if minetest.get_modpath("jkfarming") ~= nil then + overwrite("jkfarming:carrot", 3) + overwrite("jkfarming:corn", 3) + overwrite("jkfarming:melon_part", 2) + overwrite("jkfarming:cake", 3) +end + +if minetest.get_modpath("jkanimals") ~= nil then + overwrite("jkanimals:meat", 6) +end + +if minetest.get_modpath("jkwine") ~= nil then + overwrite("jkwine:grapes", 2) + overwrite("jkwine:winebottle", 1) +end + +if minetest.get_modpath("cooking") ~= nil then + overwrite("cooking:meat_beef_cooked", 4) + overwrite("cooking:fish_bluewhite_cooked", 3) + overwrite("cooking:fish_clownfish_cooked", 1) + overwrite("cooking:meat_chicken_cooked", 2) + overwrite("cooking:meat_cooked", 2) + overwrite("cooking:meat_pork_cooked", 3) + overwrite("cooking:meat_toxic_cooked", -3) + overwrite("cooking:meat_venison_cooked", 3) + overwrite("cooking:meat_undead_cooked", 1) +end + +-- ferns mod of plantlife_modpack +if minetest.get_modpath("ferns") ~= nil then + overwrite("ferns:fiddlehead", 1, "", 1) + overwrite("ferns:fiddlehead_roasted", 3) + overwrite("ferns:ferntuber_roasted", 3) + overwrite("ferns:horsetail_01", 1) +end + +-- player-action based hunger changes +function hud.handle_node_actions(pos, oldnode, player, ext) + if not player or not player:is_player() then + return + end + local name = player:get_player_name() + local exhaus = hud.exhaustion[name] + local new = HUD_HUNGER_EXHAUST_PLACE + -- placenode event + if not ext then + new = HUD_HUNGER_EXHAUST_DIG + end + -- assume its send by main timer when movement detected + if not pos and not oldnode then + new = HUD_HUNGER_EXHAUST_MOVE + end + exhaus = exhaus + new + if exhaus > HUD_HUNGER_EXHAUST_LVL then + exhaus = 0 + local h = tonumber(hud.hunger[name]) + h = h - 1 + if h < 0 then h = 0 end + hud.hunger[name] = h + hud.set_hunger(player) + end + hud.exhaustion[name] = exhaus +end + +minetest.register_on_placenode(hud.handle_node_actions) +minetest.register_on_dignode(hud.handle_node_actions) diff --git a/mods/hud/init.lua b/mods/hud/init.lua new file mode 100644 index 0000000..fe0f41f --- /dev/null +++ b/mods/hud/init.lua @@ -0,0 +1,11 @@ +hud = {} +local modpath = minetest.get_modpath("hud") + +dofile(modpath .. "/api.lua") +dofile(modpath .. "/functions.lua") +dofile(modpath .. "/builtin.lua") +dofile(modpath .. "/legacy.lua") +if hud.item_wheel then + dofile(modpath .. "/itemwheel.lua") +end + diff --git a/mods/hud/itemwheel.lua b/mods/hud/itemwheel.lua new file mode 100644 index 0000000..0c5fd01 --- /dev/null +++ b/mods/hud/itemwheel.lua @@ -0,0 +1,195 @@ +local hb = {} +local scale = tonumber(core.setting_get("hud_scaling")) or 1 + +local function update_wheel(player) + local name = player:get_player_name() + if not player or not name then + return + end + + local i = player:get_wield_index() + local i1 = i - 1 + local i3 = i + 1 + + -- it's a wheel + if i1 < 1 then + i1 = HUD_IW_MAX + end + if i3 > HUD_IW_MAX then + i3 = 1 + end + + -- get the displayed items + local inv = player:get_inventory() + local item = hb[name].item + local index = hb[name].index + local item2 = player:get_wielded_item():get_name() + + -- update all items when wielded has changed + if item and item2 and item ~= item2 or item == "wheel_init" or (index and index ~= i) then + local items = {} + items[1] = inv:get_stack("main", i1):get_name() or nil + items[2] = item2 + items[3] = inv:get_stack("main", i3):get_name() or nil + local num = player:get_wielded_item():get_count() + local wear = player:get_wielded_item():get_wear() + if num < 2 then + num = "" + else + num = tostring(num) + end + if wear > 0 then + num = tostring(100 - math.floor((wear/65535)*100)) .. "%" + end + + for n, m in pairs(items) do + -- some default values + local image = "hud_wielded.png" + local need_scale = false + local s1 = {x = 1*scale, y = 1*scale} + local s2 = {x = 3*scale, y = 3*scale} + if n ~= 2 then + s1 = {x = 0.6*scale, y = 0.6*scale} + s2 = {x = 2*scale, y = 2*scale} + end + + -- get the images + local def = minetest.registered_items[m] + if def then + if def.tiles and (def.tiles[1] and not def.tiles[1].name) then + image = minetest.inventorycube(def.tiles[1], def.tiles[6] or def.tiles[3] or def.tiles[1], def.tiles[3] or def.tiles[1]) + need_scale = true + end + if def.inventory_image and def.inventory_image ~= "" then + image = def.inventory_image + need_scale = false + end + if def.wielded_image and def.wielded_image ~= "" then + image = def.wielded_image + need_scale = false + end + -- needed for nodes with inventory cube inv imges, e.g. glass + if string.find(image, 'inventorycube') then + need_scale = true + end + end + + -- get the id and update hud elements + local id = hb[name].id[n] + if id and image then + if need_scale then + player:hud_change(id, "scale", s1) + else + player:hud_change(id, "scale", s2) + end + -- make previous and next item darker + --if n ~= 2 then + --image = image .. "^[colorize:#0005" + --end + player:hud_change(id, "text", image) + end + end + if hb[name].id[4] then + player:hud_change(hb[name].id[4], "text", num) + end + end + + -- update wielded buffer + if hb[name].id[2] ~= nil then + hb[name].item = item2 + hb[name].index = i + end +end + +minetest.register_on_joinplayer(function(player) + local name = player:get_player_name() + hb[name]= {} + hb[name].id = {} + hb[name].item = "wheel_init" + hb[name].index = 1 + + minetest.after(0.1, function() + + -- hide builtin hotbar + local hud_flags = player:hud_get_flags() + hud_flags.hotbar = false + player:hud_set_flags(hud_flags) + + player:hud_add({ + hud_elem_type = "image", + text = "hud_new.png", + position = {x = 0.5, y = 1}, + scale = {x = 1*scale, y = 1*scale}, + alignment = {x = 0, y = -1}, + offset = {x = 0, y = 0} + }) + + hb[name].id[1] = player:hud_add({ + hud_elem_type = "image", + text = "hud_wielded.png", + position = {x = 0.5, y = 1}, + scale = {x = 1*scale, y = 1*scale}, + alignment = {x = 0, y = -1}, + offset = {x = -75*scale, y = -8*scale} + }) + + hb[name].id[2] = player:hud_add({ + hud_elem_type = "image", + text = "hud_wielded.png", + position = {x = 0.5, y = 1}, + scale = {x = 3*scale, y = 3*scale}, + alignment = {x = 0, y = -1}, + offset = {x = 0, y = -12*scale} + }) + + hb[name].id[3] = player:hud_add({ + hud_elem_type = "image", + text = "hud_wielded.png", + position = {x = 0.5, y = 1}, + scale = {x = 1*scale, y = 1*scale}, + alignment = {x = 0, y = -1}, + offset = {x = 75*scale, y = -8*scale} + }) + + hb[name].id[4] = player:hud_add({ + hud_elem_type = "text", + position = {x = 0.5, y = 1}, + offset = {x = 35*scale, y = -55*scale}, + alignment = {x = 0, y = -1}, + number = 0xffffff, + text = "", + }) + + -- init item wheel + minetest.after(0, function() + hb[name].item = "wheel_init" + update_wheel(player) + end) + end) +end) + +local function update_wrapper(a, b, player) + local name = player:get_player_name() + if not name then + return + end + minetest.after(0, function() + hb[name].item = "wheel_init" + update_wheel(player) + end) +end + +minetest.register_on_placenode(update_wrapper) +minetest.register_on_dignode(update_wrapper) + + +local timer = 0 +minetest.register_globalstep(function(dtime) + timer = timer + dtime + if timer >= HUD_IW_TICK then + timer = 0 + for _, player in ipairs(minetest.get_connected_players()) do + update_wheel(player) + end + end--timer +end) \ No newline at end of file diff --git a/mods/hud/legacy.lua b/mods/hud/legacy.lua new file mode 100644 index 0000000..596ada3 --- /dev/null +++ b/mods/hud/legacy.lua @@ -0,0 +1,61 @@ +-- Armor +function hud.set_armor() +end + +if hud.show_armor then + local shields = minetest.get_modpath("shields") ~= nil + local armor_org_func = armor.update_armor + + local function get_armor_lvl(def) + -- items/protection based display + local lvl = def.level or 0 + local max = 63 -- full diamond armor + if shields then + max = 84.14 -- full diamond armor + diamond shield + end + -- TODO: is there a sane way to read out max values? + local ret = lvl/max + if ret > 1 then + ret = 1 + end + + return tonumber(20 * ret) + end + + function armor.update_armor(self, player) + armor_org_func(self, player) + local name = player:get_player_name() + local def = self.def + local armor_lvl = 0 + if def[name] and def[name].level then + armor_lvl = get_armor_lvl(def[name]) + end + hud.change_item(player, "armor", {number = armor_lvl}) + end +end + +-- Hunger related functions +if not hud.show_hunger then + function hud.set_hunger() + hud.notify_hunger(1, true) + end + + function hud.get_hunger() + hud.notify_hunger(1, true) + end + + function hud.item_eat(hp_change, replace_with_item) + return function(itemstack, user, pointed_thing) + hud.notify_hunger(1, true) + local func = minetest.item_eat(hp_change, replace_with_item) + return func(itemstack, user, pointed_thing) + end + end + + function hud.save_hunger() + hud.notify_hunger(1, true) + end + function hud.load_hunger(player) + hud.notify_hunger(1, true) + end +end diff --git a/mods/hud/textures/crosshair.png b/mods/hud/textures/crosshair.png new file mode 100644 index 0000000..a832298 Binary files /dev/null and b/mods/hud/textures/crosshair.png differ diff --git a/mods/hud/textures/hud_air_fg.png b/mods/hud/textures/hud_air_fg.png new file mode 100644 index 0000000..b62c9b0 Binary files /dev/null and b/mods/hud/textures/hud_air_fg.png differ diff --git a/mods/hud/textures/hud_armor_bg.png b/mods/hud/textures/hud_armor_bg.png new file mode 100644 index 0000000..3240100 Binary files /dev/null and b/mods/hud/textures/hud_armor_bg.png differ diff --git a/mods/hud/textures/hud_armor_fg.png b/mods/hud/textures/hud_armor_fg.png new file mode 100644 index 0000000..374f1a9 Binary files /dev/null and b/mods/hud/textures/hud_armor_fg.png differ diff --git a/mods/hud/textures/hud_heart_bg.png b/mods/hud/textures/hud_heart_bg.png new file mode 100644 index 0000000..e2be276 Binary files /dev/null and b/mods/hud/textures/hud_heart_bg.png differ diff --git a/mods/hud/textures/hud_heart_fg.png b/mods/hud/textures/hud_heart_fg.png new file mode 100644 index 0000000..dc213d8 Binary files /dev/null and b/mods/hud/textures/hud_heart_fg.png differ diff --git a/mods/hud/textures/hud_hotbar.png b/mods/hud/textures/hud_hotbar.png new file mode 100644 index 0000000..8c3df7c Binary files /dev/null and b/mods/hud/textures/hud_hotbar.png differ diff --git a/mods/hud/textures/hud_hotbar_selected.png b/mods/hud/textures/hud_hotbar_selected.png new file mode 100644 index 0000000..5334d6b Binary files /dev/null and b/mods/hud/textures/hud_hotbar_selected.png differ diff --git a/mods/hud/textures/hud_hunger_bg.png b/mods/hud/textures/hud_hunger_bg.png new file mode 100644 index 0000000..07e21e7 Binary files /dev/null and b/mods/hud/textures/hud_hunger_bg.png differ diff --git a/mods/hud/textures/hud_hunger_fg.png b/mods/hud/textures/hud_hunger_fg.png new file mode 100644 index 0000000..a5cc2a1 Binary files /dev/null and b/mods/hud/textures/hud_hunger_fg.png differ diff --git a/mods/hud/textures/hud_new.png b/mods/hud/textures/hud_new.png new file mode 100644 index 0000000..1882ae3 Binary files /dev/null and b/mods/hud/textures/hud_new.png differ diff --git a/mods/hud/textures/hud_wielded.png b/mods/hud/textures/hud_wielded.png new file mode 100644 index 0000000..2dc0e3d Binary files /dev/null and b/mods/hud/textures/hud_wielded.png differ diff --git a/mods/hud/textures/wieldhand.png b/mods/hud/textures/wieldhand.png new file mode 100644 index 0000000..2307ba4 Binary files /dev/null and b/mods/hud/textures/wieldhand.png differ diff --git a/mods/hunger/API.txt b/mods/hunger/API.txt new file mode 100644 index 0000000..9b350ff --- /dev/null +++ b/mods/hunger/API.txt @@ -0,0 +1,9 @@ +-- Register food with given values to change eating actions + +hunger.register_food(name, saturation, replace_with_item, poisen, heal, sound) + -- name: item name, e.g. "default:apple" + -- saturation: amount of added saturation + -- replace_with_item: item name that get returned after eating (can be nil) + -- poisen: duration in seconds (1hp damage per second, player can't die) (can be nil) + -- heal: added HP when eating this food (can be nil) + -- sound: costum eating sound (replaces default eating sound) (can be nil) diff --git a/mods/hunger/LICENSE.txt b/mods/hunger/LICENSE.txt new file mode 100644 index 0000000..4362b49 --- /dev/null +++ b/mods/hunger/LICENSE.txt @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff --git a/mods/hunger/README.txt b/mods/hunger/README.txt new file mode 100644 index 0000000..c658f6e --- /dev/null +++ b/mods/hunger/README.txt @@ -0,0 +1,91 @@ +Minetest mod "Hunger" +===================== +Version: 1.0 + +(c) Copyright BlockMen (2015) + + +About this mod: +~~~~~~~~~~~~~~~ +This mod adds hunger mechanics to Minetest, which are based on player actions and on time. +Also it changes the eating in Minetest, e.g. an Apple does not restore Health, but it rises your saturation. +Example: 1 apple fills up the hunger bar by 1 "bread" (statbar symbol). +Although the statbar show 20 hunger points (10 breads) on the HUD you can fill it up to 30 points. + +By default it supports a lot of food already (see full list below) and food that for registered via the API. +For more information how to register more food see API.txt + +Information: +This mod depends on the "Better HUD" mod (https://github.com/BlockMen/hud) to provide information about your current saturation. + + +License: +~~~~~~~~ +(c) Copyright BlockMen (2015) + + +Code: +Licensed under the GNU LGPL version 2.1 or higher. +You can redistribute it and/or modify it under +the terms of the GNU Lesser General Public License +as published by the Free Software Foundation; + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +See LICENSE.txt and http://www.gnu.org/licenses/lgpl-2.1.txt + + +Textures: +hunger_statbar_poisen.png - BlockMen (CC-BY 3.0) + +Sounds: +hunger_eat.ogg - BlockMen (CC-BY 3.0) + + +Github: +~~~~~~~ +https://github.com/BlockMen/hunger + +Forum: +~~~~~~ +- + +Changelog: +~~~~~~~~~~ +see changelog.txt + + +Dependencies: +~~~~~~~~~~~~~ +- Default +- Farming +- Better HUD (https://github.com/BlockMen/hud) + + +Supported food/mods: +~~~~~~~~~~~~~~~~~~~~ +- Apples (default) +- Animalmaterials (mobf modpack) +- Bread (default) +- Bushes +- bushes_classic +- Creatures +- Dwarves (beer and such) +- Docfarming +- Fishing +- Farming plus +- Farming (default and Tenplus1's fork) +- Food +- fruit +- Glooptest +- JKMod +- kpgmobs +- Mobfcooking +- Mooretrees +- Mtfoods +- mushroom +- mush45 +- Seaplants (sea) +- Simple mobs diff --git a/mods/hunger/changelog.txt b/mods/hunger/changelog.txt new file mode 100644 index 0000000..ba79ce2 --- /dev/null +++ b/mods/hunger/changelog.txt @@ -0,0 +1,6 @@ +1.0 +--- +- Partly rewritten (based on Better HUD hunger mechanics) +- Added API to register food +- Added eating sounds +- Hungerbar image changes when poisend diff --git a/mods/hunger/depends.txt b/mods/hunger/depends.txt new file mode 100644 index 0000000..a73cec4 --- /dev/null +++ b/mods/hunger/depends.txt @@ -0,0 +1,29 @@ +default +hud +animalmaterials? +bucket? +bushes? +bushes_classic? +cooking? +creatures? +docfarming? +dwarves? +ethereal? +farming? +farming_plus? +ferns? +fishing? +fruit? +glooptest? +jkanimals? +jkfarming? +jkwine? +kpgmobs? +mobfcooking? +mobs? +moretrees? +mtfoods? +mush45? +mushroom? +pizza? +seaplants? diff --git a/mods/hunger/food.lua b/mods/hunger/food.lua new file mode 100644 index 0000000..01092a1 --- /dev/null +++ b/mods/hunger/food.lua @@ -0,0 +1,307 @@ +local register_food = hunger.register_food + +register_food("default:apple", 2) + +if minetest.get_modpath("farming") ~= nil then + register_food("farming:bread", 4) +end + +if minetest.get_modpath("mobs") ~= nil then + if mobs.mod ~= nil and mobs.mod == "redo" then + register_food("mobs:cheese", 4) + register_food("mobs:meat", 8) + register_food("mobs:meat_raw", 4) + register_food("mobs:rat_cooked", 4) + register_food("mobs:honey", 2) + register_food("mobs:pork_raw", 3, "", 3) + register_food("mobs:pork_cooked", 8) + register_food("mobs:chicken_cooked", 6) + register_food("mobs:chicken_raw", 2, "", 3) + register_food("mobs:chicken_egg_fried", 2) + if minetest.get_modpath("bucket") then + register_food("mobs:bucket_milk", 3, "bucket:bucket_empty") + end + else + register_food("mobs:meat", 6) + register_food("mobs:meat_raw", 3) + register_food("mobs:rat_cooked", 5) + end +end + +if minetest.get_modpath("moretrees") ~= nil then + register_food("moretrees:coconut_milk", 1) + register_food("moretrees:raw_coconut", 2) + register_food("moretrees:acorn_muffin", 3) + register_food("moretrees:spruce_nuts", 1) + register_food("moretrees:pine_nuts", 1) + register_food("moretrees:fir_nuts", 1) +end + +if minetest.get_modpath("dwarves") ~= nil then + register_food("dwarves:beer", 2) + register_food("dwarves:apple_cider", 1) + register_food("dwarves:midus", 2) + register_food("dwarves:tequila", 2) + register_food("dwarves:tequila_with_lime", 2) + register_food("dwarves:sake", 2) +end + +if minetest.get_modpath("animalmaterials") ~= nil then + register_food("animalmaterials:milk", 2) + register_food("animalmaterials:meat_raw", 3) + register_food("animalmaterials:meat_pork", 3) + register_food("animalmaterials:meat_beef", 3) + register_food("animalmaterials:meat_chicken", 3) + register_food("animalmaterials:meat_lamb", 3) + register_food("animalmaterials:meat_venison", 3) + register_food("animalmaterials:meat_undead", 3, "", 3) + register_food("animalmaterials:meat_toxic", 3, "", 5) + register_food("animalmaterials:meat_ostrich", 3) + register_food("animalmaterials:fish_bluewhite", 2) + register_food("animalmaterials:fish_clownfish", 2) +end + +if minetest.get_modpath("fishing") ~= nil then + register_food("fishing:fish_raw", 2) + register_food("fishing:fish_cooked", 5) + register_food("fishing:sushi", 6) + register_food("fishing:shark", 4) + register_food("fishing:shark_cooked", 8) + register_food("fishing:pike", 4) + register_food("fishing:pike_cooked", 8) +end + +if minetest.get_modpath("glooptest") ~= nil then + register_food("glooptest:kalite_lump", 1) +end + +if minetest.get_modpath("bushes") ~= nil then + register_food("bushes:sugar", 1) + register_food("bushes:strawberry", 2) + register_food("bushes:berry_pie_raw", 3) + register_food("bushes:berry_pie_cooked", 4) + register_food("bushes:basket_pies", 15) +end + +if minetest.get_modpath("bushes_classic") then + -- bushes_classic mod, as found in the plantlife modpack + local berries = { + "strawberry", + "blackberry", + "blueberry", + "raspberry", + "gooseberry", + "mixed_berry"} + for _, berry in ipairs(berries) do + if berry ~= "mixed_berry" then + register_food("bushes:"..berry, 1) + end + register_food("bushes:"..berry.."_pie_raw", 2) + register_food("bushes:"..berry.."_pie_cooked", 5) + register_food("bushes:basket_"..berry, 15) + end +end + +if minetest.get_modpath("mushroom") ~= nil then + register_food("mushroom:brown", 1) + register_food("mushroom:red", 1, "", 3) + -- mushroom potions: red = strong poison, brown = light restorative + if minetest.get_modpath("vessels") then + register_food("mushroom:brown_essence", 1, "vessels:glass_bottle", nil, 4) + register_food("mushroom:poison", 1, "vessels:glass_bottle", 10) + end +end + +if minetest.get_modpath("docfarming") ~= nil then + register_food("docfarming:carrot", 3) + register_food("docfarming:cucumber", 2) + register_food("docfarming:corn", 3) + register_food("docfarming:potato", 4) + register_food("docfarming:bakedpotato", 5) + register_food("docfarming:raspberry", 3) +end + +if minetest.get_modpath("farming_plus") ~= nil then + register_food("farming_plus:carrot_item", 3) + register_food("farming_plus:banana", 2) + register_food("farming_plus:orange_item", 2) + register_food("farming:pumpkin_bread", 4) + register_food("farming_plus:strawberry_item", 2) + register_food("farming_plus:tomato_item", 2) + register_food("farming_plus:potato_item", 4) + register_food("farming_plus:rhubarb_item", 2) +end + +if minetest.get_modpath("mtfoods") ~= nil then + register_food("mtfoods:dandelion_milk", 1) + register_food("mtfoods:sugar", 1) + register_food("mtfoods:short_bread", 4) + register_food("mtfoods:cream", 1) + register_food("mtfoods:chocolate", 2) + register_food("mtfoods:cupcake", 2) + register_food("mtfoods:strawberry_shortcake", 2) + register_food("mtfoods:cake", 3) + register_food("mtfoods:chocolate_cake", 3) + register_food("mtfoods:carrot_cake", 3) + register_food("mtfoods:pie_crust", 3) + register_food("mtfoods:apple_pie", 3) + register_food("mtfoods:rhubarb_pie", 2) + register_food("mtfoods:banana_pie", 3) + register_food("mtfoods:pumpkin_pie", 3) + register_food("mtfoods:cookies", 2) + register_food("mtfoods:mlt_burger", 5) + register_food("mtfoods:potato_slices", 2) + register_food("mtfoods:potato_chips", 3) + --mtfoods:medicine + register_food("mtfoods:casserole", 3) + register_food("mtfoods:glass_flute", 2) + register_food("mtfoods:orange_juice", 2) + register_food("mtfoods:apple_juice", 2) + register_food("mtfoods:apple_cider", 2) + register_food("mtfoods:cider_rack", 2) +end + +if minetest.get_modpath("fruit") ~= nil then + register_food("fruit:apple", 2) + register_food("fruit:pear", 2) + register_food("fruit:bananna", 3) + register_food("fruit:orange", 2) +end + +if minetest.get_modpath("mush45") ~= nil then + register_food("mush45:meal", 4) +end + +if minetest.get_modpath("seaplants") ~= nil then + register_food("seaplants:kelpgreen", 1) + register_food("seaplants:kelpbrown", 1) + register_food("seaplants:seagrassgreen", 1) + register_food("seaplants:seagrassred", 1) + register_food("seaplants:seasaladmix", 6) + register_food("seaplants:kelpgreensalad", 1) + register_food("seaplants:kelpbrownsalad", 1) + register_food("seaplants:seagrassgreensalad", 1) + register_food("seaplants:seagrassgreensalad", 1) +end + +if minetest.get_modpath("mobfcooking") ~= nil then + register_food("mobfcooking:cooked_pork", 6) + register_food("mobfcooking:cooked_ostrich", 6) + register_food("mobfcooking:cooked_beef", 6) + register_food("mobfcooking:cooked_chicken", 6) + register_food("mobfcooking:cooked_lamb", 6) + register_food("mobfcooking:cooked_venison", 6) + register_food("mobfcooking:cooked_fish", 6) +end + +if minetest.get_modpath("creatures") ~= nil then + register_food("creatures:meat", 6) + register_food("creatures:flesh", 3) + register_food("creatures:rotten_flesh", 3, "", 3) +end + +if minetest.get_modpath("ethereal") then + register_food("ethereal:strawberry", 1) + register_food("ethereal:banana", 4) + register_food("ethereal:pine_nuts", 1) + register_food("ethereal:bamboo_sprout", 0, "", 3) + register_food("ethereal:fern_tubers", 1) + register_food("ethereal:banana_bread", 7) + register_food("ethereal:mushroom_plant", 2) + register_food("ethereal:coconut_slice", 2) + register_food("ethereal:golden_apple", 4, "", nil, 10) + register_food("ethereal:wild_onion_plant", 2) + register_food("ethereal:mushroom_soup", 4, "ethereal:bowl") + register_food("ethereal:mushroom_soup_cooked", 6, "ethereal:bowl") + register_food("ethereal:hearty_stew", 6, "ethereal:bowl", 3) + register_food("ethereal:hearty_stew_cooked", 10, "ethereal:bowl") + if minetest.get_modpath("bucket") then + register_food("ethereal:bucket_cactus", 2, "bucket:bucket_empty") + end + register_food("ethereal:fish_raw", 2) + register_food("ethereal:fish_cooked", 5) + register_food("ethereal:seaweed", 1) + register_food("ethereal:yellowleaves", 1, "", nil, 1) + register_food("ethereal:sashimi", 4) +end + +if minetest.get_modpath("farming") and farming.mod == "redo" then + register_food("farming:bread", 6) + register_food("farming:potato", 1) + register_food("farming:baked_potato", 6) + register_food("farming:cucumber", 4) + register_food("farming:tomato", 4) + register_food("farming:carrot", 3) + register_food("farming:carrot_gold", 6, "", nil, 8) + register_food("farming:corn", 3) + register_food("farming:corn_cob", 5) + register_food("farming:melon_slice", 2) + register_food("farming:pumpkin_slice", 1) + register_food("farming:pumpkin_bread", 9) + register_food("farming:coffee_cup", 2, "farming:drinking_cup") + register_food("farming:coffee_cup_hot", 3, "farming:drinking_cup", nil, 2) + register_food("farming:cookie", 2) + register_food("farming:chocolate_dark", 3) + register_food("farming:donut", 4) + register_food("farming:donut_chocolate", 6) + register_food("farming:donut_apple", 6) + register_food("farming:raspberries", 1) + register_food("farming:blueberries", 1) + register_food("farming:muffin_blueberry", 4) + if minetest.get_modpath("vessels") then + register_food("farming:smoothie_raspberry", 2, "vessels:drinking_glass") + end + register_food("farming:rhubarb", 1) + register_food("farming:rhubarb_pie", 6) +end + +if minetest.get_modpath("kpgmobs") ~= nil then + register_food("kpgmobs:uley", 3) + register_food("kpgmobs:meat", 6) + register_food("kpgmobs:rat_cooked", 5) + register_food("kpgmobs:med_cooked", 4) + if minetest.get_modpath("bucket") then + register_food("kpgmobs:bucket_milk", 4, "bucket:bucket_empty") + end +end + +if minetest.get_modpath("jkfarming") ~= nil then + register_food("jkfarming:carrot", 3) + register_food("jkfarming:corn", 3) + register_food("jkfarming:melon_part", 2) + register_food("jkfarming:cake", 3) +end + +if minetest.get_modpath("jkanimals") ~= nil then + register_food("jkanimals:meat", 6) +end + +if minetest.get_modpath("jkwine") ~= nil then + register_food("jkwine:grapes", 2) + register_food("jkwine:winebottle", 1) +end + +if minetest.get_modpath("cooking") ~= nil then + register_food("cooking:meat_beef_cooked", 4) + register_food("cooking:fish_bluewhite_cooked", 3) + register_food("cooking:fish_clownfish_cooked", 1) + register_food("cooking:meat_chicken_cooked", 2) + register_food("cooking:meat_cooked", 2) + register_food("cooking:meat_pork_cooked", 3) + register_food("cooking:meat_toxic_cooked", -3) + register_food("cooking:meat_venison_cooked", 3) + register_food("cooking:meat_undead_cooked", 1) +end + +-- ferns mod of plantlife_modpack +if minetest.get_modpath("ferns") ~= nil then + register_food("ferns:fiddlehead", 1, "", 1) + register_food("ferns:fiddlehead_roasted", 3) + register_food("ferns:ferntuber_roasted", 3) + register_food("ferns:horsetail_01", 1) +end + +if minetest.get_modpath("pizza") ~= nil then + register_food("pizza:pizza", 30, "", nil, 30) + register_food("pizza:pizzaslice", 5, "", nil, 5) +end diff --git a/mods/hunger/functions.lua b/mods/hunger/functions.lua new file mode 100644 index 0000000..d3c8af3 --- /dev/null +++ b/mods/hunger/functions.lua @@ -0,0 +1,236 @@ +-- read/write +function hunger.read(player) + local inv = player:get_inventory() + if not inv then + return nil + end + local hgp = inv:get_stack("hunger", 1):get_count() + if hgp == 0 then + hgp = 21 + inv:set_stack("hunger", 1, ItemStack({name = ":", count = hgp})) + else + hgp = hgp + end + if tonumber(hgp) > HUNGER_MAX + 1 then + hgp = HUNGER_MAX + 1 + end + return hgp - 1 +end + +function hunger.save(player) + local inv = player:get_inventory() + local name = player:get_player_name() + local value = hunger[name].lvl + if not inv or not value then + return nil + end + if value > HUNGER_MAX then + value = HUNGER_MAX + end + if value < 0 then + value = 0 + end + inv:set_stack("hunger", 1, ItemStack({name = ":", count = value + 1})) + return true +end + +function hunger.update_hunger(player, new_lvl) + local name = player:get_player_name() or nil + if not name then + return false + end + if minetest.setting_getbool("enable_damage") == false then + hunger[name] = 20 + return + end + local lvl = hunger[name].lvl + if new_lvl then + lvl = new_lvl + end + if lvl > HUNGER_MAX then + lvl = HUNGER_MAX + end + hunger[name].lvl = lvl + if lvl > 20 then + lvl = 20 + end + hud.change_item(player, "hunger", {number = lvl}) + hunger.save(player) +end +local update_hunger = hunger.update_hunger + +-- player-action based hunger changes +function hunger.handle_node_actions(pos, oldnode, player, ext) + if not player or not player:is_player() then + return + end + local name = player:get_player_name() + local exhaus = hunger[name].exhaus + if not exhaus then + hunger[name].exhaus = 0 + --return + end + + local new = HUNGER_EXHAUST_PLACE + + -- placenode event + if not ext then + new = HUNGER_EXHAUST_DIG + end + + -- assume its send by action_timer(globalstep) + if not pos and not oldnode then + new = HUNGER_EXHAUST_MOVE + end + + exhaus = exhaus + new + + if exhaus > HUNGER_EXHAUST_LVL then + exhaus = 0 + local h = tonumber(hunger[name].lvl) + if h > 0 then + update_hunger(player, h - 1) + end + end + + hunger[name].exhaus = exhaus +end + +-- Time based hunger functions +if minetest.setting_getbool("enable_damage") then + local hunger_timer = 0 + local health_timer = 0 + local action_timer = 0 + minetest.register_globalstep(function(dtime) + hunger_timer = hunger_timer + dtime + health_timer = health_timer + dtime + action_timer = action_timer + dtime + + if action_timer > HUNGER_MOVE_TICK then + for _,player in ipairs(minetest.get_connected_players()) do + local controls = player:get_player_control() + -- Determine if the player is walking + if controls.up or controls.down or controls.left or controls.right then + hunger.handle_node_actions(nil, nil, player) + end + end + action_timer = 0 + end + + -- lower saturation by 1 point after second(s) + if hunger_timer > HUNGER_TICK then + for _,player in ipairs(minetest.get_connected_players()) do + local name = player:get_player_name() + local tab = hunger[name] + if tab then + local hunger = tab.lvl + if hunger > 0 then + update_hunger(player, hunger - 1) + end + end + end + hunger_timer = 0 + end + + -- heal or damage player, depending on saturation + if health_timer > HUNGER_HEALTH_TICK then + for _,player in ipairs(minetest.get_connected_players()) do + local name = player:get_player_name() + local tab = hunger[name] + if tab then + local air = player:get_breath() or 0 + local hp = player:get_hp() + + -- heal player by 1 hp if not dead and saturation is > 15 (of 30) + if tonumber(tab.lvl) > HUNGER_HEAL_LVL and air > 0 then + player:set_hp(hp + HUNGER_HEAL) + end + + -- or damage player by 1 hp if saturation is < 2 (of 30) + if tonumber(tab.lvl) < HUNGER_STARVE_LVL then + player:set_hp(hp - HUNGER_STARVE) + end + end + end + + health_timer = 0 + end + end) +end + + +-- food functions +local food = hunger.food + +function hunger.register_food(name, hunger_change, replace_with_item, poisen, heal, sound) + food[name] = {} + food[name].saturation = hunger_change -- hunger points added + food[name].replace = replace_with_item -- what item is given back after eating + food[name].poisen = poisen -- time its poisening + food[name].healing = heal -- amount of HP + food[name].sound = sound -- special sound that is played when eating +end + +-- Poison player +local function poisenp(tick, time, time_left, player) + time_left = time_left + tick + if time_left < time then + minetest.after(tick, poisenp, tick, time, time_left, player) + else + hud.change_item(player, "hunger", {text = "hud_hunger_fg.png"}) + end + local hp = player:get_hp() -1 or 0 + if hp > 0 then + player:set_hp(hp) + end +end + +function hunger.eat(hp_change, replace_with_item, itemstack, user, pointed_thing) + local item = itemstack:get_name() + local def = food[item] + if not def then + def = {} + def.saturation = hp_change * 1.3 + def.replace = replace_with_item + end + local func = hunger.item_eat(def.saturation, def.replace, def.poisen, def.healing, def.sound) + return func(itemstack, user, pointed_thing) +end + +function hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound) + return function(itemstack, user, pointed_thing) + if itemstack:take_item() ~= nil and user ~= nil then + local name = user:get_player_name() + local sat = tonumber(hunger[name].lvl) + local hp = user:get_hp() + -- Saturation + if sat < HUNGER_MAX and hunger_change then + sat = sat + hunger_change + hunger.update_hunger(user, sat) + end + -- Healing + if hp < 20 and heal then + hp = hp + heal + if hp > 20 then + hp = 20 + end + user:set_hp(hp) + end + -- Poison + if poisen then + hud.change_item(user, "hunger", {text = "hunger_statbar_poisen.png"}) + poisenp(1.0, poisen, 0, user) + end + + -- eating sound + if not sound then + sound = "hunger_eat" + end + minetest.sound_play(sound, {to_player = name, gain = 0.7}) + + itemstack:add_item(replace_with_item) + end + + return itemstack + end +end diff --git a/mods/hunger/init.lua b/mods/hunger/init.lua new file mode 100644 index 0000000..ed855ec --- /dev/null +++ b/mods/hunger/init.lua @@ -0,0 +1,54 @@ +hunger = {} +hunger.food = {} + +HUNGER_TICK = 800 -- time in seconds after that 1 hunger point is taken +HUNGER_HEALTH_TICK = 4 -- time in seconds after player gets healed/damaged +HUNGER_MOVE_TICK = 0.5 -- time in seconds after the movement is checked + +HUNGER_EXHAUST_DIG = 3 -- exhaustion increased this value after digged node +HUNGER_EXHAUST_PLACE = 1 -- exhaustion increased this value after placed +HUNGER_EXHAUST_MOVE = 1.5 -- exhaustion increased this value if player movement detected +HUNGER_EXHAUST_LVL = 160 -- at what exhaustion player saturation gets lowered + +HUNGER_HEAL = 1 -- number of HP player gets healed after HUNGER_HEALTH_TICK +HUNGER_HEAL_LVL = 15 -- lower level of saturation needed to get healed +HUNGER_STARVE = 1 -- number of HP player gets damaged by hunger after HUNGER_HEALTH_TICK +HUNGER_STARVE_LVL = 3 -- level of staturation that causes starving + +HUNGER_MAX = 30 -- maximum level of saturation + + +local modpath = minetest.get_modpath("hunger") +dofile(modpath .. "/functions.lua") +dofile(modpath .. "/food.lua") +dofile(modpath .. "/legacy.lua") + + +-- Callbacks +if minetest.setting_getbool("enable_damage") then + minetest.register_on_joinplayer(function(player) + local inv = player:get_inventory() + inv:set_size("hunger", 1) + + local name = player:get_player_name() + hunger[name] = {} + hunger[name].lvl = hunger.read(player) + hunger[name].exhaus = 0 + local lvl = hunger[name].lvl + if lvl > 20 then + lvl = 20 + end + minetest.after(0.8, function() + hud.change_item(player, "hunger", {offset = "item", item_name = "air"}) + hud.change_item(player, "hunger", {number = lvl, max = 20}) + end) + end) + + -- for exhaustion + minetest.register_on_placenode(hunger.handle_node_actions) + minetest.register_on_dignode(hunger.handle_node_actions) + minetest.register_on_item_eat(hunger.eat) + minetest.register_on_respawnplayer(function(player) + hunger.update_hunger(player, 20) + end) +end diff --git a/mods/hunger/legacy.lua b/mods/hunger/legacy.lua new file mode 100644 index 0000000..7ad1fc9 --- /dev/null +++ b/mods/hunger/legacy.lua @@ -0,0 +1,5 @@ +hud.item_eat = hunger.item_eat +hud.set_hunger = hunger.save +hud.get_hunger = hunger.load +hud.save_hunger = hunger.save +hud.load_hunger = hunger.load \ No newline at end of file diff --git a/mods/hunger/sounds/hunger_eat.ogg b/mods/hunger/sounds/hunger_eat.ogg new file mode 100644 index 0000000..9855fda Binary files /dev/null and b/mods/hunger/sounds/hunger_eat.ogg differ diff --git a/mods/hunger/textures/hunger_statbar_poisen.png b/mods/hunger/textures/hunger_statbar_poisen.png new file mode 100644 index 0000000..0f80ad2 Binary files /dev/null and b/mods/hunger/textures/hunger_statbar_poisen.png differ diff --git a/mods/item_drop/README.txt b/mods/item_drop/README.txt new file mode 100644 index 0000000..fe43054 --- /dev/null +++ b/mods/item_drop/README.txt @@ -0,0 +1,42 @@ +===ITEM_DROP MOD for MINETEST-C55=== +by PilzAdam + +Introduction: +This mod adds Minecraft like drop/pick up of items to Minetest. + +How to install: +Unzip the archive an place it in minetest-base-directory/mods/minetest/ +if you have a windows client or a linux run-in-place client. If you have +a linux system-wide instalation place it in ~/.minetest/mods/minetest/. +If you want to install this mod only in one world create the folder +worldmods/ in your worlddirectory. +For further information or help see: +http://wiki.minetest.com/wiki/Installing_Mods + +How to use the mod: +Just install it an everything works. + +For developers: +You dont have to use get_drops() anymore because of changes in the +builtin files of minetest. + +License: +Sourcecode: WTFPL (see below) +Sound: WTFPL (see below) + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/item_drop/init.lua b/mods/item_drop/init.lua new file mode 100644 index 0000000..e4bce00 --- /dev/null +++ b/mods/item_drop/init.lua @@ -0,0 +1,116 @@ +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/item_drop/sounds/item_drop_pickup.1.ogg b/mods/item_drop/sounds/item_drop_pickup.1.ogg new file mode 100644 index 0000000..2ae432d Binary files /dev/null and b/mods/item_drop/sounds/item_drop_pickup.1.ogg differ diff --git a/mods/item_drop/sounds/item_drop_pickup.2.ogg b/mods/item_drop/sounds/item_drop_pickup.2.ogg new file mode 100644 index 0000000..f58bf08 Binary files /dev/null and b/mods/item_drop/sounds/item_drop_pickup.2.ogg differ diff --git a/mods/item_drop/sounds/item_drop_pickup.3.ogg b/mods/item_drop/sounds/item_drop_pickup.3.ogg new file mode 100644 index 0000000..cf57c94 Binary files /dev/null and b/mods/item_drop/sounds/item_drop_pickup.3.ogg differ diff --git a/mods/item_drop/sounds/item_drop_pickup.4.ogg b/mods/item_drop/sounds/item_drop_pickup.4.ogg new file mode 100644 index 0000000..bfe99d9 Binary files /dev/null and b/mods/item_drop/sounds/item_drop_pickup.4.ogg differ diff --git a/mods/mobapi/README.txt b/mods/mobapi/README.txt new file mode 100644 index 0000000..d0fb7cc --- /dev/null +++ b/mods/mobapi/README.txt @@ -0,0 +1,38 @@ +=== MOB API for MINETEST === +by PilzAdam, ElectricSolstice + +Inroduction: +This mod adds a basic api for mods to add mobs into the game. + +How to install: +Unzip the archive an place it in minetest-base-directory/mods/ +if you have a windows client or a linux run-in-place client. If you have +a linux system-wide instalation place it in ~/.minetest/mods/. +For further information or help see: +http://wiki.minetest.com/wiki/Installing_Mods + +How to use the mod: +See https://github.com/PilzAdam/mobs/wiki + +For developers: +The API documentation is moved to https://github.com/PilzAdam/mobs/wiki/API + +License: +Sourcecode: WTFPL (see below) + +See also: +http://minetest.net/ + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/mods/mobapi/depends.txt b/mods/mobapi/depends.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/mobapi/init.lua b/mods/mobapi/init.lua new file mode 100644 index 0000000..389b112 --- /dev/null +++ b/mods/mobapi/init.lua @@ -0,0 +1,555 @@ +mobapi = {} + +mobapi.default_definition = { + physical = true, + jump = function (self) + local v = self.object:getvelocity() + v.y = 5 + self.object:setvelocity(v) + end, + + + timer = 0, + env_damage_timer = 0, -- only if state = "attack" + attack = {player=nil, dist=nil}, + state = "stand", + v_start = false, + old_y = nil, + lifetimer = 600, + tamed = false, + + set_velocity = function(self, v) + local yaw = self.object:getyaw() + if self.drawtype == "side" then + yaw = yaw+(math.pi/2) + end + local x = math.sin(yaw) * -v + local z = math.cos(yaw) * v + self.object:setvelocity({x=x, y=self.object:getvelocity().y, z=z}) + end, + + get_velocity = function(self) + local v = self.object:getvelocity() + return (v.x^2 + v.z^2)^(0.5) + end, + + set_animation = function(self, type) + if not self.animation then + return + end + if not self.animation.current then + self.animation.current = "" + end + if type == "stand" and self.animation.current ~= "stand" then + if + self.animation.stand_start + and self.animation.stand_end + and self.animation.speed_normal + then + self.object:set_animation( + {x=self.animation.stand_start,y=self.animation.stand_end}, + self.animation.speed_normal, 0 + ) + self.animation.current = "stand" + end + elseif type == "walk" and self.animation.current ~= "walk" then + if + self.animation.walk_start + and self.animation.walk_end + and self.animation.speed_normal + then + self.object:set_animation( + {x=self.animation.walk_start,y=self.animation.walk_end}, + self.animation.speed_normal, 0 + ) + self.animation.current = "walk" + end + elseif type == "run" and self.animation.current ~= "run" then + if + self.animation.run_start + and self.animation.run_end + and self.animation.speed_run + then + self.object:set_animation( + {x=self.animation.run_start,y=self.animation.run_end}, + self.animation.speed_run, 0 + ) + self.animation.current = "run" + end + elseif type == "punch" and self.animation.current ~= "punch" then + if + self.animation.punch_start + and self.animation.punch_end + and self.animation.speed_normal + then + self.object:set_animation( + {x=self.animation.punch_start,y=self.animation.punch_end}, + self.animation.speed_normal, 0 + ) + self.animation.current = "punch" + end + end + end, + + on_step = function(self, dtime) + if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then + self.object:remove() + end + + self.lifetimer = self.lifetimer - dtime + if self.lifetimer <= 0 and not self.tamed then + local player_count = 0 + for _,obj in ipairs(minetest.get_objects_inside_radius(self.object:getpos(), 20)) do + if obj:is_player() then + player_count = player_count+1 + end + end + if player_count == 0 and self.state ~= "attack" then + self.object:remove() + return + end + end + + if self.object:getvelocity().y > 0.1 then + local yaw = self.object:getyaw() + if self.drawtype == "side" then + yaw = yaw+(math.pi/2) + end + local x = math.sin(yaw) * -2 + local z = math.cos(yaw) * 2 + self.object:setacceleration({x=x, y=-10, z=z}) + else + self.object:setacceleration({x=0, y=-10, z=0}) + end + + if self.disable_fall_damage and self.object:getvelocity().y == 0 then + if not self.old_y then + self.old_y = self.object:getpos().y + else + local d = self.old_y - self.object:getpos().y + if d > 5 then + local damage = d-5 + if self.sounds and self.sounds.damage_fall then + minetest.sound_play(self.sounds.damage_fall, {object = self.object}) + end + self.object:set_hp(self.object:get_hp()-damage) + if self.object:get_hp() == 0 then + if self.sounds and self.sounds.die then + minetest.sound_play(self.sounds.die, {object = self.object}) + end + self.object:remove() + end + end + self.old_y = self.object:getpos().y + end + end + + self.timer = self.timer+dtime + if self.state ~= "attack" then + if self.timer < 1 then + return + end + self.timer = 0 + end + + if self.sounds and self.sounds.random and math.random(1, 100) <= 1 then + minetest.sound_play(self.sounds.random, {object = self.object}) + end + + local do_env_damage = function(self) + local pos = self.object:getpos() + local n = minetest.get_node(pos) + + if self.light_damage and self.light_damage ~= 0 + and pos.y>0 + and minetest.get_node_light(pos) + and minetest.get_node_light(pos) > 4 + and minetest.get_timeofday() > 0.2 + and minetest.get_timeofday() < 0.8 + then + self.object:set_hp(self.object:get_hp()-self.light_damage) + if self.sounds and self.sounds.damage_light then + minetest.sound_play(self.sounds.damage_light, {object = self.object}) + end + if self.object:get_hp() == 0 then + if self.sounds and self.sounds.die then + minetest.sound_play(self.sounds.die, {object = self.object}) + end + self.object:remove() + end + end + + if self.water_damage and self.water_damage ~= 0 and + minetest.get_item_group(n.name, "water") ~= 0 + then + self.object:set_hp(self.object:get_hp()-self.water_damage) + if self.sounds and self.sounds.damage_water then + minetest.sound_play(self.sounds.damage_water, {object = self.object}) + end + if self.object:get_hp() == 0 then + if self.sounds and self.sounds.die then + minetest.sound_play(self.sounds.die, {object = self.object}) + end + self.object:remove() + end + end + + if self.lava_damage and self.lava_damage ~= 0 and + minetest.get_item_group(n.name, "lava") ~= 0 + then + self.object:set_hp(self.object:get_hp()-self.lava_damage) + if self.sounds and self.sounds.damage_lava then + minetest.sound_play(self.sounds.damage_lava, {object = self.object}) + end + if self.object:get_hp() == 0 then + if self.sounds and self.sounds.die then + minetest.sound_play(self.sounds.die, {object = self.object}) + end + self.object:remove() + end + end + end + + self.env_damage_timer = self.env_damage_timer + dtime + if self.state == "attack" and self.env_damage_timer > 1 then + self.env_damage_timer = 0 + do_env_damage(self) + elseif self.state ~= "attack" then + do_env_damage(self) + end + + if self.type == "monster" and minetest.setting_getbool("enable_damage") then + local s = self.object:getpos() + for _,player in pairs(minetest.get_connected_players()) do + local p = player:getpos() + local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 + if dist < self.view_range then + if self.attack.dist then + if dist < self.attack.dist then + self.attack.player = player + self.attack.dist = dist + end + else + self.state = "attack" + self.attack.player = player + self.attack.dist = dist + end + end + end + if self.attack.player then + local p = self.attack.player:getpos() + if not p or not s or not minetest.line_of_sight({x=s.x, y=s.y+1, z=s.z}, {x=p.x, y=p.y+1, z=p.z}) then + self.state = "stand" + self.attack = {player = nil, dist = nil} + end + end + end + + if self.follow and self.follow ~= "" and not self.following then + for _,player in pairs(minetest.get_connected_players()) do + local s = self.object:getpos() + local p = player:getpos() + local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 + if self.view_range and dist < self.view_range then + self.following = player + end + end + end + + if self.following and self.following:is_player() then + if self.following:get_wielded_item():get_name() ~= self.follow then + self.following = nil + self.v_start = false + else + local s = self.object:getpos() + local p = self.following:getpos() + local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 + if dist > self.view_range then + self.following = nil + self.v_start = false + else + local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z} + local yaw = math.atan(vec.z/vec.x)+math.pi/2 + if self.drawtype == "side" then + yaw = yaw+(math.pi/2) + end + if p.x > s.x then + yaw = yaw+math.pi + end + self.object:setyaw(yaw) + if dist > 2 then + if not self.v_start then + self.v_start = true + self.set_velocity(self, self.walk_velocity) + else + if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then + self:jump() + end + self.set_velocity(self, self.walk_velocity) + end + self:set_animation("walk") + else + self.v_start = false + self.set_velocity(self, 0) + self:set_animation("stand") + end + return + end + end + end + + if self.state == "stand" then + if math.random(1, 4) == 1 then + self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/180*math.pi)) + end + self.set_velocity(self, 0) + self.set_animation(self, "stand") + if math.random(1, 100) <= 50 then + self.set_velocity(self, self.walk_velocity) + self.state = "walk" + self.set_animation(self, "walk") + end + elseif self.state == "walk" then + if math.random(1, 100) <= 30 then + self.object:setyaw(self.object:getyaw()+((math.random(0,360)-180)/180*math.pi)) + end + if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then + self:jump() + end + self:set_animation("walk") + self.set_velocity(self, self.walk_velocity) + if math.random(1, 100) <= 10 then + self.set_velocity(self, 0) + self.state = "stand" + self:set_animation("stand") + end + elseif self.state == "attack" and self.attack_type == "dogfight" then + if not self.attack.player or not self.attack.player:is_player() then + self.state = "stand" + self:set_animation("stand") + self.attack = {player=nil, dist=nil} + return + end + local s = self.object:getpos() + local p = self.attack.player:getpos() + local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 + if dist > self.view_range or self.attack.player:get_hp() <= 0 then + self.state = "stand" + self.v_start = false + self.set_velocity(self, 0) + self.attack = {player=nil, dist=nil} + self:set_animation("stand") + return + else + self.attack.dist = dist + end + + local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z} + local yaw = math.atan(vec.z/vec.x)+math.pi/2 + if self.drawtype == "side" then + yaw = yaw+(math.pi/2) + end + if p.x > s.x then + yaw = yaw+math.pi + end + self.object:setyaw(yaw) + if self.attack.dist > 2 then + if not self.v_start then + self.v_start = true + self.set_velocity(self, self.run_velocity) + else + if self.jump and self.get_velocity(self) <= 0.5 and self.object:getvelocity().y == 0 then + self:jump() + end + self.set_velocity(self, self.run_velocity) + end + self:set_animation("run") + else + self.set_velocity(self, 0) + self:set_animation("punch") + self.v_start = false + if self.timer > 1 then + self.timer = 0 + if self.sounds and self.sounds.attack then + minetest.sound_play(self.sounds.attack, {object = self.object}) + end + self.attack.player:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups = {fleshy=self.damage} + }, vec) + end + end + elseif self.state == "attack" and self.attack_type == "shoot" then + if not self.attack.player or not self.attack.player:is_player() then + self.state = "stand" + self:set_animation("stand") + self.attack = {player=nil, dist=nil} + return + end + local s = self.object:getpos() + local p = self.attack.player:getpos() + local dist = ((p.x-s.x)^2 + (p.y-s.y)^2 + (p.z-s.z)^2)^0.5 + if dist > self.view_range or self.attack.player:get_hp() <= 0 then + self.state = "stand" + self.v_start = false + self.set_velocity(self, 0) + self.attack = {player=nil, dist=nil} + self:set_animation("stand") + return + else + self.attack.dist = dist + end + + local vec = {x=p.x-s.x, y=p.y-s.y, z=p.z-s.z} + local yaw = math.atan(vec.z/vec.x)+math.pi/2 + if self.drawtype == "side" then + yaw = yaw+(math.pi/2) + end + if p.x > s.x then + yaw = yaw+math.pi + end + self.object:setyaw(yaw) + self.set_velocity(self, 0) + + if self.timer > self.shoot_interval and math.random(1, 100) <= 60 then + self.timer = 0 + + self:set_animation("punch") + + if self.sounds and self.sounds.attack then + minetest.sound_play(self.sounds.attack, {object = self.object}) + end + + local p = self.object:getpos() + p.y = p.y + (self.collisionbox[2]+self.collisionbox[5])/2 + local obj = minetest.add_entity(p, self.arrow) + local amount = (vec.x^2+vec.y^2+vec.z^2)^0.5 + local v = obj:get_luaentity().velocity + vec.y = vec.y+1 + vec.x = vec.x*v/amount + vec.y = vec.y*v/amount + vec.z = vec.z*v/amount + obj:setvelocity(vec) + end + end + end, + + on_activate = function(self, staticdata, dtime_s) + self.object:set_armor_groups({fleshy=self.armor}) + self.object:setacceleration({x=0, y=-10, z=0}) + self.state = "stand" + self.attack = {player = nil, dist = nil} + self.object:setvelocity({x=0, y=self.object:getvelocity().y, z=0}) + self.object:setyaw(math.random(1, 360)/180*math.pi) + if self.type == "monster" and minetest.setting_getbool("only_peaceful_mobs") then + self.object:remove() + end + self.lifetimer = 600 - dtime_s + if staticdata then + local tmp = minetest.deserialize(staticdata) + if tmp and tmp.lifetimer then + self.lifetimer = tmp.lifetimer - dtime_s + end + if tmp and tmp.tamed then + self.tamed = tmp.tamed + end + end + if self.lifetimer <= 0 and not self.tamed then + self.object:remove() + end + end, + + get_staticdata = function(self) + local tmp = { + lifetimer = self.lifetimer, + tamed = self.tamed, + } + return minetest.serialize(tmp) + end, + + on_punch = function(self, hitter, time_from_last_punch, tool_capabilities) + -- drop items + if self.object:get_hp() > 0 then + if self.sounds and self.sounds.damage_punch then + minetest.sound_play(self.sounds.damage_punch, {object = self.object}) + end + return + end + if self.sounds and self.sounds.die then + minetest.sound_play(self.sounds.die, {object = self.object}) + end + 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 + end + end, + + __index = function(table,key) + return mobapi.default_definition[key] + end,} + +function mobapi:register_mob(name, def) + setmetatable (def,mobapi.default_definition) + minetest.register_entity(name, def) +end + +mobapi.spawning_mobs = {} +function mobapi:register_spawn(name, nodes, max_light, min_light, chance, active_object_count, max_height, spawn_func) + if minetest.setting_getbool(string.gsub(name,":","_").."_spawn") == true then return end + mobapi.spawning_mobs[name] = true + minetest.register_abm({ + nodenames = nodes, + neighbors = {"air"}, + interval = 30, + chance = chance, + action = function(pos, node, _, active_object_count_wider) + if active_object_count_wider > active_object_count then return end + if not mobapi.spawning_mobs[name] then return end + pos.y = pos.y+1 + if not minetest.get_node_light(pos) then return end + if minetest.get_node_light(pos) > max_light then return end + if minetest.get_node_light(pos) < min_light then return end + if pos.y > max_height then return end + if minetest.get_node(pos).name ~= "air" then return end + pos.y = pos.y+1 + if minetest.get_node(pos).name ~= "air" then return end + if spawn_func and not spawn_func(pos, node) then return end + if minetest.setting_getbool("display_mob_spawn") then + minetest.chat_send_all("[mobapi] Add "..name.." at "..minetest.pos_to_string(pos)) + end + minetest.add_entity(pos, name) + end + }) +end + +function mobapi:register_arrow(name, def) + minetest.register_entity(name, { + physical = false, + visual = def.visual, + visual_size = def.visual_size, + textures = def.textures, + velocity = def.velocity, + hit_player = def.hit_player, + hit_node = def.hit_node, + + on_step = function(self, dtime) + local pos = self.object:getpos() + if minetest.get_node(self.object:getpos()).name ~= "air" then + self.hit_node(self, pos, node) + self.object:remove() + return + end + pos.y = pos.y-1 + for _,player in pairs(minetest.get_objects_inside_radius(pos, 1)) do + if player:is_player() then + self.hit_player(self, player) + self.object:remove() + return + end + end + end + }) +end diff --git a/mods/more_fire/Credits.txt b/mods/more_fire/Credits.txt new file mode 100644 index 0000000..861c66a --- /dev/null +++ b/mods/more_fire/Credits.txt @@ -0,0 +1,20 @@ +Textures: +Flint image created by me with Blender. +Charcoal_Lump created from the default_coal_lump that ships with minetest. +campfire inventory image from Esteban on the minetest forum licensed CC by SA +Kindling inventory image created by modifying Esteban's campfire image. +Lighter image created by me with Blender. + + +Code: +3d torch code and nodebox's from Carbone, by Calinou CC0 1.0 Will be replaced with mesh torches once I figure that bit out. +Smokebomb and molotov cocktail coded by Napiophelios + +Inspiration: +Napiophelios, from the forum, who gave me some really good ideas from the old campfire mod, which I didn't even know about. + + +Sound Effects: +Sparker sound from BroAsis on Freesound. https://www.freesound.org/people/BroAsis/sounds/106853/ + +Thanks to everybody that gave advice and helped me fix problems. diff --git a/mods/more_fire/LICENSE b/mods/more_fire/LICENSE new file mode 100644 index 0000000..0cfba85 --- /dev/null +++ b/mods/more_fire/LICENSE @@ -0,0 +1,3 @@ +This mod is licensed CC by SA, I'd do it at CC 0, but I've used some CC by SA items, so I have to use that. When I replace everything with my own materials I'll change it to CC 0. + +Feel free to dissect and use portions of code or graphics for your own projects. diff --git a/mods/more_fire/abms.lua b/mods/more_fire/abms.lua new file mode 100644 index 0000000..e8cc47f --- /dev/null +++ b/mods/more_fire/abms.lua @@ -0,0 +1,156 @@ +minetest.register_abm({ -- Controls non-contained fire + nodenames = {'more_fire:embers','more_fire:campfire'}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local meta = minetest.env:get_meta(pos) + for i, name in ipairs({ + 'fuel_totaltime', + 'fuel_time', + }) do + if meta:get_string(name) == '' then + meta:set_float(name, 5.0) + end + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local was_active = false + if meta:get_float('fuel_time') < meta:get_float('fuel_totaltime') then + was_active = true + meta:set_float('fuel_time', meta:get_float('fuel_time') + 0.25) + end + if meta:get_float('fuel_time') < meta:get_float('fuel_totaltime') then + minetest.sound_play({name='fire_small'},{gain=0.07}, + {loop=true}) + local percent = math.floor(meta:get_float('fuel_time') / + meta:get_float('fuel_totaltime') * 100) + meta:set_string('infotext','Campfire active: '..percent..'%') + minetest.swap_node(pos, {name = 'more_fire:campfire'}) + meta:set_string('formspec', + 'size[8,6.75]'.. + default.gui_bg.. + default.gui_slots.. + 'background[5,5;1,1;more_fire_campfire_active.png;true]'.. + 'list[current_name;fuel;1,1.5;1,1;]'.. + 'list[current_player;main;0,2.75;8,1;]'.. + 'list[current_player;main;0,4;8,3;8]') + return + end + local fuel = nil + local fuellist = inv:get_list('fuel') + if fuellist then + fuel = minetest.get_craft_result({method = 'fuel', width = 1, items = fuellist}) + end + if fuel.time <= 0 then + local node = minetest.get_node(pos) + if node.name == 'more_fire:campfire' then + meta:set_string('infotext','Put more wood on the fire!') + minetest.swap_node(pos, {name = 'more_fire:embers'}) + local timer = minetest.get_node_timer(pos) + meta:set_string('formspec', more_fire.embers_formspec) + timer:start(180) + end + return + end + meta:set_string('fuel_totaltime', fuel.time) + meta:set_string('fuel_time', 0) + local stack = inv:get_stack('fuel', 1) + stack:take_item() + inv:set_stack('fuel', 1, stack) +end, +}) + +minetest.register_abm({ -- Controls the contained fires. + nodenames = {'more_fire:embers_contained', 'more_fire:campfire_contained'}, + interval = 1.0, + chance = 1, + action = function(pos, node, active_object_count, active_object_count_wider) + local meta = minetest.env:get_meta(pos) + for i, name in ipairs({ + 'fuel_totaltime', + 'fuel_time', + }) do + if meta:get_string(name) == '' then + meta:set_float(name, 0.0) + end + end + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local was_active = false + if meta:get_float('fuel_time') < meta:get_float('fuel_totaltime') then + was_active = true + meta:set_float('fuel_time', meta:get_float('fuel_time') + 0.25) + end + if meta:get_float('fuel_time') < meta:get_float('fuel_totaltime') then + minetest.sound_play({name='fire_small'},{gain=0.07}, + {loop=true}) + local percent = math.floor(meta:get_float('fuel_time') / + meta:get_float('fuel_totaltime') * 100) + meta:set_string('infotext','Campfire active: '..percent..'%') + minetest.swap_node(pos, {name = 'more_fire:campfire_contained'}) + meta:set_string('formspec', + 'size[8,6.75]'.. + default.gui_bg.. + default.gui_slots.. + 'background[5,5;1,1;more_fire_campfire_active.png;true]'.. + 'list[current_name;fuel;1,1.5;1,1;]'.. + 'list[current_player;main;0,2.75;8,1;]'.. + 'list[current_player;main;0,4;8,3;8]') + return + end + local fuel = nil + local fuellist = inv:get_list('fuel') + if fuellist then + fuel = minetest.get_craft_result({method = 'fuel', width = 1, items = fuellist}) + end + if fuel.time <= 0 then + local node = minetest.get_node(pos) + if node.name == 'more_fire:campfire_contained' then + meta:set_string('infotext','Put more wood on the fire!') + minetest.swap_node(pos, {name = 'more_fire:embers_contained'}) + meta:set_string('formspec', more_fire.embers_formspec) + local timer = minetest.get_node_timer(pos) + timer:start(190) + end + return + end + meta:set_string('fuel_totaltime', fuel.time) + meta:set_string('fuel_time', 0) + local stack = inv:get_stack('fuel', 1) + stack:take_item() + inv:set_stack('fuel', 1, stack) +end, +}) + +minetest.register_abm({ --smoke for embers + nodenames = {'more_fire:embers', 'more_fire:embers_contained'}, + interval = 1, + chance = 2, + action = function(pos, node) + if minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}).name == 'air' then + smoke_particles(pos) + end + end +}) + +minetest.register_abm({ --embers for fire + nodenames = {'more_fire:campfire', 'more_fire:campfire_contained'}, + interval = 1, + chance = 2, + action = function(pos, node) + if minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}).name == 'air' then + ember_particles(pos) + end + end +}) + +minetest.register_abm({ --lava + nodenames = {'default:lava_source', 'default:lava_flowing'}, + interval = 4, + chance = 15, + action = function(pos, node) + if minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}).name == 'air' then + lava_particles(pos) + end + end +}) diff --git a/mods/more_fire/changelog.txt b/mods/more_fire/changelog.txt new file mode 100644 index 0000000..6a98e1f --- /dev/null +++ b/mods/more_fire/changelog.txt @@ -0,0 +1,72 @@ +6-3-15: +Campfires and embers now have particles, smoke for the embers, and little sparks for the fires. Also lava now spawns little lava particles, the particles do nothing other than add a little visual effect. + +5-30-15: +Napiophelios put together some nice smoke bombs and molotov cocktails for this mod, I(Nathan) did a few tweaks, changed some alignment and took care of some depreciated functions to stop debug spamming. + +5-12-15: +Lanterns are here, both wall mounted a table top. Craft with a piece of glass above a string above a lump of iron. Yields one lantern, craft the lantern to change between wall mounted and table top. +Lanterns burn oil, twelve minutes of light for one bottle of oil. Put six leaves above a glass vessel to create lantern oil. + +4-15-15: +All fires now die after time. When you create embers either by lighting kindling or crafting directly you have about three minutes to add wood. After the wood all burns up you have three minutes to add more wood or the embers turn back into kindling and need to be activated with a lighter again. + +4-13-15: +Changed some how I add the drops to gravel, no longer do I replace the entire node, just add the new drop info to it. This should keep it from breaking anything that does the same to gravel. + +4-12-15: +Some major overhauling, not of code, but layout, no longer is everything stored in the init.lua, it's all broken down into neat files. +I added finite torches, change the settings in the config, right now you can only turn them on or off, settings are not retro-active, only torches placed after the update will burn out. When a torch burns out it turns into a torch stub which can be picked up and burnt as fuel. +I changed a couple textures down to 16x16, they had been 32x32. Renamed textures to follow proper naming methods, this won't change any placed nodes. + +11-22-14: +Changed a couple textures. +Currently using nodeboxes for torches, so they are no longer invisible. + +11-19-14: +Campfires are working altogether now. Craft kindling and add some fuel to it, and then click on it with the lighter until it starts on fire. + +11-12-14: +Removed the ABM for torches, and replaced the two nodes with just one. +Tweaked the lighter, it should last longer and light fires faster. Added a sparking sound effect as well. +The lighter takes damage every time it is used, regardless of if it starts a fire, or is used on kindling. + +11-11-14: +Charcoal blocks are now flammable. + +11-08-14: +Added a kindling that will created contained fire. +Updated the lighter to turn the two different kindling into the two different fires. + +11-05-14: +Corrected the texture for the Charcoal Block. +Added recipe to turn charcoal block back into charcoal lumps. + +11-04-14: +Added recipe for fire that uses torch and kindling. + +10-27-14: +Made the torches a tad bit smaller. +Removed all the formspec stuff from the campfires. I couldn't get them to work, so I'll come back to that when I learn more of the coding needed. +Removed the .mlt files from the models folder as I discovered they aren't needed and just give errors in the debug. + +10-26-14: +Added kindling, craft it from a stick, wood, and two other flammable grouped items. Light it with the lighter, which is made with flint and steel. + +10-25-14: +Torches stick to the wall or the floor according as they should. Copied code from the 3d_torch mod. + +10-24-14: +Campfires now have animated fire. Turns out that I was exporting the file wrong. :S + +10-22-14: +Added 3d models for the torch and campfires. Textures aren't perfect on the campfire yet. + +10-19-14: +Added the 'more_fire = {}' line and now the mod runs again, though the fire doesn't do anything when you right click on it. + +10-17-14: +Renamed and relocated the git repository to match the forum topic +Updated the fire so it can only be placed on the ground. +Added flint that drops from gravel. Will be used for fire starters. +Campfire now drops charcoal. diff --git a/mods/more_fire/config.txt b/mods/more_fire/config.txt new file mode 100644 index 0000000..2b72292 --- /dev/null +++ b/mods/more_fire/config.txt @@ -0,0 +1,9 @@ +--config file. +--Change the following line if you want torches to burn infinitly. +--(true/false) +--when true torches will burn out after a day. +finite_torches = true + +--Do you want smoke bombs and molotov cocktails, these can be dangerous in the hands of griefers. +--(true/false) +pyromania = true diff --git a/mods/more_fire/craftitems.lua b/mods/more_fire/craftitems.lua new file mode 100644 index 0000000..d505cad --- /dev/null +++ b/mods/more_fire/craftitems.lua @@ -0,0 +1,32 @@ +minetest.register_craftitem('more_fire:charcoal', { + description = 'Charcoal', + inventory_image = 'more_fire_charcoal_lump.png', + groups = {coal=1} +}) + +minetest.register_craftitem('more_fire:flintstone', { + description = 'Flintstone', + inventory_image = 'more_fire_flintstone.png', +}) + +minetest.register_craftitem('more_fire:lighter', { + description = 'Flint and Steel', + inventory_image = 'more_fire_lighter.png', +}) + +minetest.register_craftitem('more_fire:oil', { + description = 'lantern oil', + inventory_image = 'more_fire_oil.png', +}) + +minetest.register_craftitem('more_fire:dried_grass', { + description = 'dried grass', + inventory_image = 'more_fire_grass_dried.png', + groups = {kindling=1} +}) + +minetest.register_craftitem('more_fire:kindle', { + description = 'Kindling', + inventory_image = 'more_fire_kindle.png', + groups = {flammable=1, kindling=1, stick=1} +}) diff --git a/mods/more_fire/crafts.lua b/mods/more_fire/crafts.lua new file mode 100644 index 0000000..d2b1c7b --- /dev/null +++ b/mods/more_fire/crafts.lua @@ -0,0 +1,167 @@ +minetest.register_craft({ + output = 'more_fire:charcoal_block 1', + recipe = { + {'more_fire:charcoal', 'more_fire:charcoal', 'more_fire:charcoal'}, + {'more_fire:charcoal', 'more_fire:charcoal', 'more_fire:charcoal'}, + {'more_fire:charcoal', 'more_fire:charcoal', 'more_fire:charcoal'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:charcoal 9', + recipe = { + {'more_fire:charcoal_block'} + } +}) + +minetest.register_craft({ + output = 'more_fire:embers 1', + recipe = { + {'more_fire:kindling'}, + {'default:torch'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:embers 1', + recipe = { + {'group:kindling', 'default:torch', 'group:kindling'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:embers_contained 1', + recipe = { + {'', 'more_fire:embers', ''}, + {'default:cobble', 'default:cobble', 'default:cobble'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:embers_contained 1', + recipe = { + {'more_fire:kindling_contained'}, + {'default:torch'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:torch_weak 4', + recipe = { + {'group:kindling', 'group:kindling', 'group:kindling'}, + {'group:kindling', 'group:stick', 'group:kindling'}, + {'', 'group:stick', ''} + } +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'default:torch', + recipe = {'more_fire:torch_weak', 'group:coal'}, +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'more_fire:kindling 1', + recipe = {'group:kindling', 'group:wood', 'group:kindling', 'group:kindling', 'group:kindling'}, +}) + +minetest.register_craft({ + output = 'more_fire:kindling_contained 1', + recipe = { + {'','more_fire:kindling', ''}, + {'default:cobble','default:cobble','default:cobble'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:oil_lamp_off 1', + recipe = { + {'default:glass'}, + {'farming:cotton'}, + {'default:iron_lump'}, + } +}) + +minetest.register_craft({ + output = 'more_fire:oil 1', + recipe = { + {'group:leaves', 'group:leaves', 'group:leaves'}, + {'group:leaves', 'group:leaves', 'group:leaves'}, + {'', 'vessels:glass_bottle', ''}, + } +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'more_fire:lighter 1', + recipe = {'more_fire:flintstone', 'default:steel_ingot'} +}) + +minetest.register_craft({ + output = 'more_fire:oil_lamp_off 1', + recipe = { + {'more_fire:oil_lamp_table_off'} + } +}) + +minetest.register_craft({ + output = 'more_fire:oil_lamp_table_off 1', + recipe = { + {'more_fire:oil_lamp_off'} + } +}) + +minetest.register_craft({ + output = 'more_fire:marker 1', + recipe = { + {'more_fire:torch_stub', 'more_fire:torch_stub', 'more_fire:torch_stub'} + + } +}) + +-- cooking recipes +minetest.register_craft({ + type = 'cooking', + recipe = 'group:tree', + output = 'more_fire:charcoal', +}) + +minetest.register_craft({ + type = 'cooking', + recipe = 'default:stick', + output = 'more_fire:marker', +}) + +minetest.register_craft({ + type = 'cooking', + recipe = 'default:grass_1', + output = 'more_fire:dried_grass', + cooktime = 1, +}) + +-- fuel recipes +minetest.register_craft({ + type = 'fuel', + recipe = 'more_fire:charcoal', + burntime = 35, +}) + +minetest.register_craft({ + type = 'fuel', + recipe = 'more_fire:oil', + burntime = 10, +}) + +minetest.register_craft({ + type = 'fuel', + recipe = 'more_fire:charcoal_block', + burntime = 315, +}) + +minetest.register_craft({ + type = 'fuel', + recipe = 'more_fire:torch_stub', + burntime = 2, +}) diff --git a/mods/more_fire/depends.txt b/mods/more_fire/depends.txt new file mode 100644 index 0000000..c14f81b --- /dev/null +++ b/mods/more_fire/depends.txt @@ -0,0 +1,4 @@ +default +farming +fire +vessels diff --git a/mods/more_fire/functions.lua b/mods/more_fire/functions.lua new file mode 100644 index 0000000..e06d8d5 --- /dev/null +++ b/mods/more_fire/functions.lua @@ -0,0 +1,106 @@ +function default.get_hotbar_bg(x,y) + local out = '' + for i=0,7,1 do + out = out ..'image['..x+i..','..y..';1,1;gui_hb_bg.png]' + end + return out +end + +function more_fire.campfire(pos, percent, item_percent) + local formspec = + 'size[8,6.75]'.. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + 'background[5,5;1,1;more_fire_campfire_active.png;true]'.. + 'list[current_name;fuel;1,1.5;1,1;]'.. + 'list[current_player;main;0,2.75;8,1;]'.. + 'list[current_player;main;0,4;8,3;8]'.. + default.get_hotbar_bg(0,2.75) + return formspec +end + +function more_fire.get_campfire_formspec(pos, percent) + local meta = minetest.get_meta(pos)local inv = meta:get_inventory() + local fuellist = inv:get_list('fuel') + if fuellist then + end + return more_fire.campfire(pos, percent, item_percent) +end + +function burn(pointed_thing) --kindling doesn't always start from the first spark + local ignite_chance = math.random(5) + if ignite_chance == 1 + and string.find(minetest.get_node(pointed_thing.under).name, 'more_fire:kindling_contained') + then + minetest.set_node(pointed_thing.under, {name = 'more_fire:embers_contained'}) + elseif ignite_chance == 1 + and string.find(minetest.get_node(pointed_thing.under).name, 'more_fire:kindling') + then + minetest.set_node(pointed_thing.under, {name = 'more_fire:embers'}) + else --Do nothing + end +end + +function smoke_particles(pos) + minetest.add_particlespawner({ + amount = 1, -- how many particles do you want + time = 2, -- spawner stops after this time (use 0 for infinite) + minpos = {x=pos.x, y=pos.y, z=pos.z}, -- minimum offset + maxpos = {x=pos.x, y=pos.y, z=pos.z}, -- maximum offset + minvel = {x=-.1, y=0, z=-.1}, -- minimum velocity + maxvel = {x=.1, y=.4, z=.1}, -- maximum velocity + minacc = {x=-.05, y=.02, z=-.05}, -- minimum acceleration + maxacc = {x=.1, y=.1, z=.1}, -- maximim acceleration + minexptime = 3, -- minimum expiration time + maxexptime = 6, -- maximum expiration time + minsize = 3, -- minimum size (0.5 = half size) + maxsize = 8, -- maximum size (1=full resolution) + collisiondetection = false, -- do particles stop when they hit solid node + texture = 'more_fire_smoke.png', -- image to use (e.g. 'bubble.png' ) + vertical = false, -- upright/vertical image for rain +-- playername = 'singleplayer', -- particles only appear for this player + }) +end + +function ember_particles(pos) + minetest.add_particlespawner({ + amount = 1, + time = 2, + minpos = {x=pos.x, y=pos.y, z=pos.z}, + maxpos = {x=pos.x, y=pos.y, z=pos.z}, + minvel = {x=-.15, y=.3, z=-.15}, + maxvel = {x=.1, y=.6, z=.1}, + minacc = {x=-.05, y=.02, z=-.05}, + maxacc = {x=.1, y=.3, z=.1}, + minexptime = 1, + maxexptime = 3, + minsize = 1, + maxsize = 2, + collisiondetection = false, + texture = 'more_fire_embers.png', + vertical = false, +-- playername = 'singleplayer', + }) +end + +function lava_particles(pos) + minetest.add_particlespawner({ + amount = 2, + time = 1, + minpos = {x=pos.x, y=pos.y-.5, z=pos.z}, + maxpos = {x=pos.x, y=pos.y, z=pos.z}, + minvel = {x=-.4, y=1, z=-.4}, + maxvel = {x=.4, y=1.5, z=.4}, + minacc = {x=-.4, y=1, z=-.4}, + maxacc = {x=.4, y=1.5, z=.4}, + minexptime = 1, + maxexptime = 1.5, + minsize = .6, + maxsize = 2, + collisiondetection = false, + texture = 'more_fire_lava_blob.png', + vertical = false, +-- playername = 'singleplayer', + }) +end diff --git a/mods/more_fire/init.lua b/mods/more_fire/init.lua new file mode 100644 index 0000000..554e328 --- /dev/null +++ b/mods/more_fire/init.lua @@ -0,0 +1,33 @@ +-- A couple variables used throughout. +percent = 100 +-- GUI related stuff +default.gui_bg = 'bgcolor[#080808BB;true]' +default.gui_bg_img = 'background[5,5;1,1;gui_formbg.png;true]' +default.gui_slots = 'listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]' + +more_fire = {} + +-- formspecs +more_fire.embers_formspec = +'size[8,6.75]'.. +default.gui_bg.. +default.gui_bg_img.. +default.gui_slots.. +'listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]'.. +'background[5,5;1,1;more_fire_campfire_inactive.png;true]'.. +'list[current_name;fuel;1,1.5;1,1;]'.. +'list[current_player;main;0,2.75;8,1;]'.. +'list[current_player;main;0,4;8,3;8]'.. +default.get_hotbar_bg(0,2.75) + +dofile(minetest.get_modpath('more_fire')..'/config.txt') +dofile(minetest.get_modpath('more_fire')..'/functions.lua') +dofile(minetest.get_modpath('more_fire')..'/abms.lua') +dofile(minetest.get_modpath('more_fire')..'/nodes.lua') +dofile(minetest.get_modpath('more_fire')..'/craftitems.lua') +dofile(minetest.get_modpath('more_fire')..'/crafts.lua') +dofile(minetest.get_modpath('more_fire')..'/tools.lua') +if pyromania then + dofile(minetest.get_modpath('more_fire')..'/molotov.lua') + dofile(minetest.get_modpath('more_fire')..'/smokebomb.lua') +end diff --git a/mods/more_fire/lib/Vec3_1-0.lua b/mods/more_fire/lib/Vec3_1-0.lua new file mode 100644 index 0000000..85d91ae --- /dev/null +++ b/mods/more_fire/lib/Vec3_1-0.lua @@ -0,0 +1,398 @@ +local THIS_VERSION = "1.0" + +--- 3D vector class/operations. + -- + -- Note that methods can be called in either an object-oriented way: + -- v1 = Vec3(1, 2, 3) + -- v2 = v1:add({ x = 2, y = 2, z = 0 }) + -- or as simple functions: + -- Vec3.add({ x = 1, y = 2, z = 3 }, { x = 2, y = 2, z = 0 }) + -- + -- All methods that can be called on a Vec3 using ":" may be called on a table + -- using the second functional syntax, but the first parameter MUST have the + -- expected components "x", "y", and "z". If a vector is used as the second + -- paramter, it may instead be a list/array with numeric indices, like + -- { 1.0, 2.0, 3.0 } in place of { x = 1.0, y = 2.0, z = 3.0 }. + -- + -- @author prestidigitator (as registered at forum.minetest.net) + -- @copyright 2013, licensed under WTFPL + -- +local Vec3 = {} +local Vec3_meta = {} +local Vec3_inst_meta = {} + +Vec3.VERSION = THIS_VERSION + +setmetatable(Vec3, Vec3_meta) +Vec3_inst_meta.__index = Vec3 + +--- Constructs a Vec3 from three numbers. + -- + -- Call with one of: + -- Vec3.new(x, y, z) + -- Vec3(x, y, z) + -- + -- @return a new Vec3 object +local function Vec3_new(x, y, z) + local obj = { x = x or 0.0, y = y or 0.0, z = z or 0.0 } + setmetatable(obj, Vec3_inst_meta) + return obj +end +Vec3.new = Vec3_new + +--- Constructs a new copy of a Vec3. + -- + -- Call with one of: + -- vec:new_copy() + -- Vec3.new_copy(vec) + -- Vec3(vec) + -- + -- @return a new Vec3 object that is a copy of the parameter +local function Vec3_new_copy(v) + local obj = { x = v.x or v[1] or 0.0, + y = v.y or v[2] or 0.0, + z = v.z or v[3] or 0.0 } + setmetatable(obj, Vec3_inst_meta) + return obj +end +Vec3.new_copy = Vec3_new_copy + +Vec3_meta.__call = function(class, a, b, c) + if type(a) == "table" then + return Vec3.new_copy(a) + else + return Vec3.new(a, b, c) + end +end + +--- Computes the square of the length of a Vec3. + -- + -- Call with one of: + -- vec:len_sq() + -- Vec3.len_sq(vec) + -- + -- @return a number +local function Vec3_len_sq(v) + return v.x^2 + v.y^2 + v.z^2 +end +Vec3.len_sq = Vec3_len_sq + +--- Computes the length of a Vec3. + -- + -- Call with one of: + -- vec:len() + -- Vec3.len(vec) + -- + -- @return a number +local function Vec3_len(v) + return math.sqrt(v.x^2 + v.y^2 + v.z^2) +end +Vec3.len = Vec3_len + +--- Computes a unit vector pointing in the same direction as a Vec3. + -- Undefined for a zero-vector and may throw an error. + -- + -- Call with one of: + -- vec:unit() + -- Vec3.unit(vec) + -- + -- @return a new Vec3 with length 1.0 +local function Vec3_unit(v) + local len = math.sqrt(v.x^2 + v.y^2 + v.z^2) + return Vec3.new(v.x/len, v.y/len, v.z/len) +end +Vec3.unit = Vec3_unit + +--- Multiplies a Vec3 by a number. + -- + -- Call with one of: + -- vec:mul(m) + -- Vec3.mul(vec, m) + -- vec*m + -- m*vec + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_mul(v, m) + local mn = tonumber(m) + if not mn then error("Can't multiply vector by non-scalar") end + return Vec3.new(v.x*mn, v.y*mn, v.z*mn) +end +Vec3.mul = Vec3_mul +Vec3_inst_meta.__mul = function(a, b) + if type(a) == "table" then + return Vec3_mul(a, b) + else + return Vec3_mul(b, a) + end +end + +--- Divides a Vec3 by a number. + -- + -- Call with one of: + -- vec:div(m) + -- Vec3.div(vec, m) + -- vec/m + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_div(v, m) + return Vec3.new(v.x/m, v.y/m, v.z/m) +end +Vec3.div = Vec3_div +Vec3_inst_meta.__div = Vec3_div + +--- Negates a Vec3 (signs of all components are inverted). + -- + -- Call with one of: + -- vec:unm() + -- Vec3.unm(vec) + -- -vec + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_unm(v) + return Vec3.new(-v.x, -v.y, -v.z) +end +Vec3.unm = Vec3_unm +Vec3_inst_meta.__unm = Vec3_unm + +--- Adds two Vec3s or a Vec3 composed of three given components. + -- + -- Call with one of: + -- vec1:add(vec2) + -- vec1:add(x, y, z) + -- Vec3.add(vec1, vec2) + -- Vec3.add(vec1, x, y, z) + -- vec1 + vec2 + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_add(v, a, b, c) + if type(a) == "table" then + return Vec3.new(v.x + (a.x or a[1] or 0.0), + v.y + (a.y or a[2] or 0.0), + v.z + (a.z or a[3] or 0.0)) + else + return Vec3.new(v.x + a, v.y + b, v.z + c) + end +end +Vec3.add = Vec3_add + +--- Subtracts two Vec3s or a Vec3 composed of three given components. + -- + -- Call with one of: + -- vec1:sub(vec2) + -- vec1:sub(x, y, z) + -- Vec3.sub(vec1, vec2) + -- Vec3.sub(vec1, x, y, z) + -- vec1 - vec2 + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_sub(v, a, b, c) + if type(a) == "table" then + return Vec3.new(v.x - (a.x or a[1] or 0.0), + v.y - (a.y or a[2] or 0.0), + v.z - (a.z or a[3] or 0.0)) + else + return Vec3.new(v.x - a, v.y - b, v.z - c) + end +end +Vec3.sub = Vec3_sub + +--- Tests two Vec3s or a Vec3 composed of three given components for + -- exact component-wise equality. + -- + -- Call with one of: + -- vec1:eq(vec2) + -- vec1:eq(x, y, z) + -- Vec3.eq(vec1, vec2) + -- Vec3.eq(vec1, x, y, z) + -- vec1 == vec2 + -- vec1 ~= vec2 + -- Note that because of built-in Lua logic "==" and "~=" work ONLY if + -- vec1 and vec2 are actually Vec3s (not tables). + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_eq(v, a, b, c) + if type(a) == "table" then + return v.x == (a.x or a[1] or 0.0) and + v.y == (a.y or a[2] or 0.0) and + v.z == (a.z or a[3] or 0.0) + else + return v.x == a and v.y == b and v.z == c + end +end +Vec3.eq = Vec3_eq + +--- Takes the dot product of a Vec3 and a Vec3s or a Vec3 composed of + -- three given components. + -- + -- Call with one of: + -- vec1:dot(vec2) + -- vec1:dot(x, y, z) + -- Vec3.dot(vec1, vec2) + -- Vec3.dot(vec1, x, y, z) + -- + -- @return a number +local function Vec3_dot(v, a, b, c) + if type(a) == "table" then + return v.x * (a.x or a[1] or 0.0) + + v.y * (a.y or a[2] or 0.0) + + v.z * (a.z or a[3] or 0.0) + else + return v.x * a + v.y * b + v.z * c + end +end +Vec3.dot = Vec3_dot + +--- Takes the cross product of a Vec3 and a Vec3s or a Vec3 composed of + -- three given components. + -- + -- Call with one of: + -- vec1:cross(vec2) + -- vec1:cross(x, y, z) + -- Vec3.cross(vec1, vec2) + -- Vec3.cross(vec1, x, y, z) + -- + -- @return a new Vec3 with the result of the operation +local function Vec3_cross(v, a, b, c) + local ux, uy, uz + if type(a) == "table" then + ux = a.x or a[1] or 0.0 + uy = a.y or a[2] or 0.0 + uz = a.z or a[3] or 0.0 + else + ux = a or 0.0 + uy = b or 0.0 + uz = c or 0.0 + end + + return Vec3.new(v.y*uz - v.z*uy, v.z*ux - v.x*uz, v.x*uy - v.y*ux) +end +Vec3.cross = Vec3_cross + +--- Rotates this (the first) vector around the second vector by the + -- given angle. + -- + -- Call with one of: + -- vec:rot_around(axis, angle) + -- Vec3.rot_around(vec, axis, angle) + -- + -- @param axis + -- The axis about which to rotate. + -- @param angle + -- The angle by which to rotate this vector, in radians. + -- @return + -- a new Vec3 with the result of the operation. +local function Vec3_rot_around(v, axis, angle) + local uaxis = Vec3.new_copy(axis):unit() + + local alen = uaxis:dotvec(v) + local avec = uaxis:mul(alen) + + local pvec = Vec3.subvec(v, avec) + local rvec = uaxis:crossvec(v) + + local v1 = pvec:mul(math.cos(angle)) + local v2 = rvec:mul(math.sin(angle)) + + return avec:addvec(v1):addvec(v2) +end +Vec3.rot_around = Vec3_rot_around + +--- Adds two Vec3s. Optimized for pure Vec3/table operations by removing + -- type checking and conditionals. If called with Vec3-likes table(s), + -- ensure all expected components "x", "y", and "z" exist. + -- + -- Call with one of: + -- vec1:addvec(vec2) + -- Vec3.addvec(vec1, vec2) + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_addvec(v1, v2) + return Vec3.new(v1.x + v2.x, v1.y + v2.y, v1.z + v2.z) +end +Vec3.addvec = Vec3_addvec +Vec3_inst_meta.__add = Vec3_addvec + +--- Subtracts two Vec3s. Optimized for pure Vec3/table operations by + -- removing type checking and conditionals. If called with Vec3-likes + -- table(s), ensure all expected components "x", "y", and "z" exist. + -- + -- Call with one of: + -- vec1:subvec(vec2) + -- Vec3.subvec(vec1, vec2) + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_subvec(v1, v2) + return Vec3.new(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z) +end +Vec3.subvec = Vec3_subvec +Vec3_inst_meta.__sub = Vec3_subvec + +--- Tests two Vec3s for exact component-wise equality. Optimized for pure + -- Vec3/table operations by removing type checking and conditionals. + -- If called with Vec3-likes table(s), ensure all expected components + -- "x", "y", and "z" exist. + -- + -- Call with one of: + -- vec1:eqvec(vec2) + -- Vec3.eqvec(vec1, vec2) + -- + -- @return a new Vec3 object with the result of the operation +local function Vec3_eqvec(v1, v2) + return v1.x == v2.x and v1.y == v2.y and v1.z == v2.z +end +Vec3.eqvec = Vec3_eqvec +Vec3_inst_meta.__eq = Vec3_eqvec + +--- Takes the dot product of two Vec3s. Optimized for pure Vec3/table + -- operations by removing type checking and conditionals. If called + -- with Vec3-likes table(s), ensure all expected components "x", "y", + -- and "z" exist. + -- + -- Call with one of: + -- vec1:dotvec(vec2) + -- Vec3.dotvec(vec1, vec2) + -- + -- @return a number +local function Vec3_dotvec(v1, v2) + return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z +end +Vec3.dotvec = Vec3_dotvec + +--- Takes the cross product of two Vec3s. Optimized for pure Vec3/table + -- operations by removing type checking and conditionals. If called + -- with Vec3-likes table(s), ensure all expected components "x", "y", + -- and "z" exist. + -- + -- Call with one of: + -- vec1:crossvec(vec2) + -- Vec3.crossvec(vec1, vec2) + -- + -- @return a new Vec3 with the result of the operation +local function Vec3_crossvec(v1, v2) + return Vec3.new(v1.y*v2.z - v1.z*v2.y, + v1.z*v2.x - v1.x*v2.z, + v1.x*v2.y - v1.y*v2.x) +end +Vec3.crossvec = Vec3_crossvec + +--- Converts Vec3 to a string with format "(x,y,z)". + -- + -- Call with one of: + -- vec:tostring() + -- Vec3.tostring(vec) + -- tostring(vec) + -- + -- @return a string +local function Vec3_tostring(v) + return "(".. + (v.x or v[1] or "0") + ..",".. + (v.y or v[2] or "0") + ..",".. + (v.z or v[3] or "0") + ..")" +end +Vec3.tostring = Vec3_tostring +Vec3_inst_meta.__tostring = Vec3_tostring + +return Vec3 diff --git a/mods/more_fire/models/campfire.blend b/mods/more_fire/models/campfire.blend new file mode 100644 index 0000000..6e732cd Binary files /dev/null and b/mods/more_fire/models/campfire.blend differ diff --git a/mods/more_fire/models/lamp.blend b/mods/more_fire/models/lamp.blend new file mode 100644 index 0000000..a5bf528 Binary files /dev/null and b/mods/more_fire/models/lamp.blend differ diff --git a/mods/more_fire/models/lamp.blend1 b/mods/more_fire/models/lamp.blend1 new file mode 100644 index 0000000..e6ed3a1 Binary files /dev/null and b/mods/more_fire/models/lamp.blend1 differ diff --git a/mods/more_fire/models/more_fire_campfire.obj b/mods/more_fire/models/more_fire_campfire.obj new file mode 100644 index 0000000..ad81f6e --- /dev/null +++ b/mods/more_fire/models/more_fire_campfire.obj @@ -0,0 +1,133 @@ +# Blender v2.72 (sub 2) OBJ File: 'campfire.blend' +# www.blender.org +v 0.353153 -0.337287 0.000000 +v -0.366847 -0.337287 0.000000 +v -0.366847 0.382713 -0.000000 +v -0.186847 -0.337287 0.311769 +v 0.173153 -0.337287 -0.311769 +v -0.186846 0.382713 0.311769 +v 0.173154 0.382713 -0.311769 +v -0.186846 -0.337287 -0.311769 +v 0.173154 -0.337287 0.311769 +v -0.186846 0.382713 -0.311769 +v 0.173153 0.382713 0.311769 +v 0.353153 0.382713 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +g Flames.001_Cube.004_Fire +s off +f 4/1 5/2 7/3 6/4 +f 8/1 9/2 11/3 10/4 +f 1/1 2/2 3/3 12/4 +v 0.151217 -0.347540 0.439253 +v 0.151217 -0.207593 0.411057 +v 0.008458 -0.207593 0.411057 +v 0.008458 -0.347540 0.439253 +v 0.151217 -0.526542 -0.449208 +v 0.151217 -0.386595 -0.477403 +v 0.008458 -0.386595 -0.477403 +v 0.008458 -0.526542 -0.449208 +v -0.419949 -0.512482 0.485423 +v -0.419949 -0.369723 0.485423 +v -0.444739 -0.369723 0.344833 +v -0.444739 -0.512482 0.344833 +v 0.472595 -0.512482 0.328044 +v 0.472595 -0.369723 0.328044 +v 0.447805 -0.369723 0.187453 +v 0.447805 -0.512482 0.187453 +v 0.033402 -0.347540 0.433815 +v 0.025205 -0.207593 0.406838 +v -0.111388 -0.207593 0.448342 +v -0.103191 -0.347540 0.475320 +v -0.224900 -0.526542 -0.416268 +v -0.233097 -0.386595 -0.443246 +v -0.369690 -0.386595 -0.401741 +v -0.361493 -0.526542 -0.374763 +v 0.254175 -0.345963 0.293196 +v 0.254175 -0.277187 0.265611 +v 0.181422 -0.282425 0.252550 +v 0.181422 -0.351201 0.280135 +v 0.343511 -0.517901 -0.135488 +v 0.343511 -0.449125 -0.163073 +v 0.270757 -0.454364 -0.176133 +v 0.270757 -0.523140 -0.148548 +v -0.418506 -0.513914 0.100698 +v -0.418472 -0.439812 0.100704 +v -0.392481 -0.439819 0.031309 +v -0.392514 -0.513921 0.031304 +v 0.022046 -0.514125 0.265705 +v 0.022080 -0.440022 0.265710 +v 0.048071 -0.440029 0.196316 +v 0.048038 -0.514131 0.196310 +v -0.249910 -0.307656 -0.062181 +v -0.249882 -0.234638 -0.074807 +v -0.278776 -0.246254 -0.142048 +v -0.278804 -0.319272 -0.129422 +v 0.183295 -0.339072 -0.242901 +v 0.183323 -0.266053 -0.255527 +v 0.154429 -0.277669 -0.322768 +v 0.154401 -0.350687 -0.310143 +vt 0.418293 0.016195 +vt 0.418293 0.216092 +vt 0.218396 0.216092 +vt 0.218396 0.016195 +vt 0.002609 0.212891 +vt 0.002609 0.012994 +vt 0.989254 0.012994 +vt 0.989254 0.212891 +vt 0.010050 0.219323 +vt 0.010050 0.019426 +vt 0.996695 0.019426 +vt 0.996695 0.219323 +vt 0.618448 0.016195 +vt 0.618448 0.216092 +vt 0.418551 0.216092 +vt 0.418551 0.016195 +vt 0.010050 0.228781 +vt 0.010050 0.028884 +vt 0.996695 0.028884 +vt 0.996695 0.228781 +vt 0.005089 0.207467 +vt 0.005089 0.007570 +vt 0.991734 0.007570 +vt 0.991734 0.207467 +g Campfire_Cube.003_Logs-Stone +s off +f 20/5 19/6 18/7 17/8 +f 14/9 13/10 17/11 18/12 +f 15/13 14/14 18/15 19/16 +f 13/17 14/18 15/19 16/20 +f 13/21 16/22 20/23 17/24 +f 16/25 15/26 19/27 20/28 +f 28/5 27/6 26/7 25/8 +f 22/9 21/10 25/11 26/12 +f 23/13 22/14 26/15 27/16 +f 21/17 22/18 23/19 24/20 +f 21/21 24/22 28/23 25/24 +f 24/25 23/26 27/27 28/28 +f 36/5 35/6 34/7 33/8 +f 30/9 29/10 33/11 34/12 +f 31/13 30/14 34/15 35/16 +f 29/17 30/18 31/19 32/20 +f 29/21 32/22 36/23 33/24 +f 32/25 31/26 35/27 36/28 +f 44/5 43/6 42/7 41/8 +f 38/9 37/10 41/11 42/12 +f 39/13 38/14 42/15 43/16 +f 37/17 38/18 39/19 40/20 +f 37/21 40/22 44/23 41/24 +f 40/25 39/26 43/27 44/28 +f 52/5 51/6 50/7 49/8 +f 46/9 45/10 49/11 50/12 +f 47/13 46/14 50/15 51/16 +f 45/17 46/18 47/19 48/20 +f 45/21 48/22 52/23 49/24 +f 48/25 47/26 51/27 52/28 +f 60/5 59/6 58/7 57/8 +f 54/9 53/10 57/11 58/12 +f 55/13 54/14 58/15 59/16 +f 53/17 54/18 55/19 56/20 +f 53/21 56/22 60/23 57/24 +f 56/25 55/26 59/27 60/28 diff --git a/mods/more_fire/models/more_fire_contained_campfire.obj b/mods/more_fire/models/more_fire_contained_campfire.obj new file mode 100644 index 0000000..3b1324f --- /dev/null +++ b/mods/more_fire/models/more_fire_contained_campfire.obj @@ -0,0 +1,470 @@ +# Blender v2.72 (sub 2) OBJ File: 'campfire.blend' +# www.blender.org +v 0.353153 -0.337287 0.000000 +v -0.366847 -0.337287 0.000000 +v -0.366847 0.382713 -0.000000 +v -0.186847 -0.337287 0.311769 +v 0.173153 -0.337287 -0.311769 +v -0.186846 0.382713 0.311769 +v 0.173154 0.382713 -0.311769 +v -0.186846 -0.337287 -0.311769 +v 0.173154 -0.337287 0.311769 +v -0.186846 0.382713 -0.311769 +v 0.173153 0.382713 0.311769 +v 0.353153 0.382713 0.000000 +vt 0.000000 0.000000 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +g Flames_Cube.001_Fire +s off +f 4/1 5/2 7/3 6/4 +f 8/1 9/2 11/3 10/4 +f 1/1 2/2 3/3 12/4 +v 0.109850 -0.357143 0.305314 +v 0.109850 -0.248233 0.283371 +v -0.001248 -0.248233 0.283371 +v -0.001248 -0.357143 0.305314 +v 0.109850 -0.496446 -0.364085 +v 0.109850 -0.387536 -0.386027 +v -0.001248 -0.387536 -0.386027 +v -0.001248 -0.496446 -0.364085 +v -0.334643 -0.485504 0.341245 +v -0.334643 -0.374406 0.341245 +v -0.353935 -0.374406 0.231834 +v -0.353935 -0.485504 0.231834 +v 0.359953 -0.485504 0.218768 +v 0.359953 -0.374406 0.218768 +v 0.340661 -0.374406 0.109358 +v 0.340661 -0.485504 0.109358 +v 0.018164 -0.357143 0.301082 +v 0.011785 -0.248233 0.280088 +v -0.094515 -0.248233 0.312387 +v -0.088135 -0.357143 0.333382 +v -0.182852 -0.496446 -0.360470 +v -0.189231 -0.387536 -0.381465 +v -0.295531 -0.387536 -0.349165 +v -0.289151 -0.496446 -0.328171 +v 0.189974 -0.355916 0.191649 +v 0.189974 -0.302392 0.170182 +v 0.133356 -0.306469 0.160018 +v 0.133356 -0.359992 0.181485 +v 0.259497 -0.489722 -0.141961 +v 0.259497 -0.436199 -0.163429 +v 0.202879 -0.440275 -0.173592 +v 0.202879 -0.493798 -0.152125 +v -0.333520 -0.486619 0.041843 +v -0.333494 -0.428951 0.041848 +v -0.313267 -0.428956 -0.012156 +v -0.313293 -0.486624 -0.012161 +v 0.009327 -0.486782 0.170255 +v 0.009353 -0.429115 0.170259 +v 0.029580 -0.429120 0.116255 +v 0.029554 -0.486787 0.116251 +v -0.202316 -0.326105 -0.084912 +v -0.202294 -0.269280 -0.094738 +v -0.224779 -0.278320 -0.147066 +v -0.224801 -0.335144 -0.137240 +v 0.134814 -0.350553 -0.225553 +v 0.134835 -0.293728 -0.235379 +v 0.112350 -0.302768 -0.287707 +v 0.112328 -0.359592 -0.277881 +v 0.153727 -0.495469 0.450886 +v 0.130774 -0.495469 0.303732 +v 0.277929 -0.495469 0.280779 +v 0.300881 -0.495469 0.427933 +v 0.153727 -0.389072 0.450886 +v 0.130774 -0.389072 0.303732 +v 0.277929 -0.389072 0.280779 +v 0.300881 -0.389072 0.427933 +v -0.416606 -0.495469 -0.045338 +v -0.416606 -0.495469 -0.194272 +v -0.267672 -0.495469 -0.194272 +v -0.267672 -0.495469 -0.045338 +v -0.416606 -0.395652 -0.045338 +v -0.416606 -0.395652 -0.194272 +v -0.267672 -0.395652 -0.194272 +v -0.267672 -0.395652 -0.045338 +v -0.378793 -0.495469 0.237564 +v -0.480454 -0.495469 0.128724 +v -0.371615 -0.495469 0.027062 +v -0.269953 -0.495469 0.135902 +v -0.378793 -0.365755 0.237564 +v -0.480454 -0.365755 0.128724 +v -0.371615 -0.365755 0.027062 +v -0.269953 -0.365755 0.135902 +v -0.134183 -0.495469 -0.320969 +v -0.194093 -0.495469 -0.417106 +v -0.090445 -0.495469 -0.465129 +v -0.030535 -0.495469 -0.368992 +v -0.134183 -0.346536 -0.320969 +v -0.194093 -0.346536 -0.417106 +v -0.090445 -0.346536 -0.465129 +v -0.030535 -0.346536 -0.368992 +v 0.175251 -0.495469 -0.228071 +v 0.133971 -0.495469 -0.371169 +v 0.277070 -0.495469 -0.412449 +v 0.318350 -0.495469 -0.269350 +v 0.175251 -0.380117 -0.228071 +v 0.133971 -0.380117 -0.371169 +v 0.277070 -0.380117 -0.412449 +v 0.318350 -0.380117 -0.269350 +v 0.251956 -0.495469 0.058110 +v 0.281764 -0.495469 -0.087810 +v 0.427684 -0.495469 -0.058002 +v 0.397876 -0.495469 0.087918 +v 0.251956 -0.422654 0.058110 +v 0.281764 -0.422654 -0.087810 +v 0.427684 -0.422654 -0.058002 +v 0.397876 -0.422654 0.087918 +v -0.232717 -0.495469 0.492217 +v -0.255669 -0.495469 0.345062 +v -0.108515 -0.495469 0.322110 +v -0.085563 -0.495469 0.469264 +v -0.232717 -0.382356 0.492217 +v -0.255669 -0.382356 0.345062 +v -0.108515 -0.382356 0.322110 +v -0.085563 -0.382356 0.469264 +v -0.033985 -0.495469 0.350689 +v 0.113554 -0.495469 0.371024 +v 0.101929 -0.495469 0.455372 +v -0.045610 -0.495469 0.435037 +v -0.033985 -0.346536 0.350689 +v 0.113554 -0.346536 0.371024 +v 0.101929 -0.346536 0.455372 +v -0.045610 -0.346536 0.435037 +v 0.339073 -0.495469 0.300291 +v 0.404643 -0.495469 0.166568 +v 0.481092 -0.495469 0.204054 +v 0.415522 -0.495469 0.337777 +v 0.339073 -0.409221 0.300291 +v 0.404643 -0.409221 0.166568 +v 0.481092 -0.409221 0.204054 +v 0.415522 -0.409221 0.337777 +v -0.359990 -0.495469 0.467998 +v -0.461166 -0.495469 0.358706 +v -0.398683 -0.495469 0.300864 +v -0.297508 -0.495469 0.410156 +v -0.359990 -0.409788 0.467998 +v -0.461166 -0.409788 0.358706 +v -0.398683 -0.409788 0.300864 +v -0.297508 -0.409788 0.410156 +v -0.413457 -0.495469 -0.313766 +v -0.368533 -0.495469 -0.455763 +v -0.287353 -0.495469 -0.430081 +v -0.332277 -0.495469 -0.288084 +v -0.413457 -0.409221 -0.313766 +v -0.368533 -0.409221 -0.455763 +v -0.287353 -0.409221 -0.430081 +v -0.332277 -0.409221 -0.288084 +v 0.037431 -0.495469 -0.491183 +v 0.185487 -0.495469 -0.475036 +v 0.176256 -0.495469 -0.390393 +v 0.028200 -0.495469 -0.406539 +v 0.037431 -0.398994 -0.491183 +v 0.185487 -0.398994 -0.475036 +v 0.176256 -0.398994 -0.390393 +v 0.028200 -0.398994 -0.406539 +vt 0.343750 0.203125 +vt 0.156250 0.203125 +vt 0.156250 0.406250 +vt 0.343750 0.406250 +vt 0.015625 0.453125 +vt 1.000000 0.453125 +vt 1.000000 0.250000 +vt 0.015625 0.250000 +vt 0.015625 0.328125 +vt 1.000000 0.328125 +vt 1.000000 0.140625 +vt 0.015625 0.140625 +vt 0.781250 0.250000 +vt 0.578125 0.250000 +vt 0.578125 0.437500 +vt 0.781250 0.437500 +vt 0.015625 0.468750 +vt 1.000000 0.468750 +vt 1.000000 0.265625 +vt 0.015625 0.265625 +vt 0.015625 0.343750 +vt 1.000000 0.343750 +vt 0.921875 0.218750 +vt 0.718750 0.218750 +vt 0.718750 0.421875 +vt 0.921875 0.421875 +vt 0.000000 0.343750 +vt 0.984375 0.343750 +vt 0.984375 0.140625 +vt 0.000000 0.140625 +vt 0.000000 0.312500 +vt 1.000000 0.312500 +vt 1.000000 0.109375 +vt 0.000000 0.109375 +vt 0.828125 0.203125 +vt 0.625000 0.203125 +vt 0.625000 0.406250 +vt 0.828125 0.406250 +vt 0.015625 0.390625 +vt 1.000000 0.390625 +vt 1.000000 0.187500 +vt 0.015625 0.187500 +vt 0.000000 0.296875 +vt 1.000000 0.296875 +vt 1.000000 0.093750 +vt 0.000000 0.093750 +vt 0.343750 0.218750 +vt 0.140625 0.218750 +vt 0.140625 0.406250 +vt 0.002609 0.212891 +vt 0.989254 0.212891 +vt 0.989254 0.012994 +vt 0.002609 0.012994 +vt 0.010050 0.219323 +vt 0.996695 0.219323 +vt 0.996695 0.019426 +vt 0.010050 0.019426 +vt 0.593750 0.234375 +vt 0.406250 0.234375 +vt 0.406250 0.437500 +vt 0.593750 0.437500 +vt 0.010050 0.228781 +vt 0.996695 0.228781 +vt 0.996695 0.028884 +vt 0.010050 0.028884 +vt 0.005089 0.207467 +vt 0.991734 0.207467 +vt 0.991734 0.007570 +vt 0.005089 0.007570 +vt 0.625000 0.187500 +vt 0.421875 0.187500 +vt 0.421875 0.390625 +vt 0.625000 0.390625 +vt 0.796875 0.093750 +vt 0.593750 0.093750 +vt 0.593750 0.296875 +vt 0.796875 0.296875 +vt 0.640625 0.031250 +vt 0.437500 0.031250 +vt 0.437500 0.234375 +vt 0.640625 0.234375 +vt 0.984375 0.031250 +vt 0.781250 0.031250 +vt 0.781250 0.234375 +vt 0.984375 0.234375 +vt 0.687500 0.125000 +vt 0.484375 0.125000 +vt 0.484375 0.328125 +vt 0.687500 0.328125 +vt 0.328125 0.046875 +vt 0.125000 0.046875 +vt 0.125000 0.250000 +vt 0.328125 0.250000 +vt 0.140625 0.781250 +vt 0.250000 0.781250 +vt 0.250000 0.625000 +vt 0.140625 0.625000 +vt 0.453125 0.843750 +vt 0.531250 0.843750 +vt 0.531250 0.718750 +vt 0.453125 0.718750 +vt 0.421875 0.718750 +vt 0.265625 0.718750 +vt 0.265625 0.937500 +vt 0.421875 0.937500 +vt 0.500000 0.609375 +vt 0.500000 1.000000 +vt 0.734375 1.000000 +vt 0.734375 0.609375 +vt 1.000000 0.953125 +vt 1.000000 0.875000 +vt 0.859375 0.875000 +vt 0.859375 0.953125 +vt 0.750000 0.531250 +vt 0.562500 0.531250 +vt 0.562500 0.765625 +vt 0.750000 0.765625 +vt 0.082031 0.968750 +vt 0.136719 0.968750 +vt 0.136719 0.882812 +vt 0.082031 0.882812 +vt 0.781250 0.921875 +vt 0.781250 0.796875 +vt 0.609375 0.796875 +vt 0.609375 0.921875 +vt 0.359375 0.718750 +vt 0.484375 0.718750 +vt 0.484375 0.500000 +vt 0.359375 0.500000 +vt 0.058594 0.882812 +vt 0.058594 0.968750 +vt 0.117188 0.968750 +vt 0.117188 0.882812 +vt 0.023438 0.925781 +vt 0.078125 0.925781 +vt 0.078125 0.839844 +vt 0.023438 0.839844 +vt 0.578125 0.828125 +vt 0.468750 0.828125 +vt 0.468750 1.000000 +vt 0.578125 1.000000 +vt 0.078125 0.750000 +vt 0.234375 0.750000 +vt 0.234375 0.546875 +vt 0.078125 0.546875 +vt 0.750000 0.906250 +vt 0.953125 0.906250 +vt 0.953125 0.546875 +vt 0.750000 0.546875 +vt 0.406250 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.703125 +vt 0.406250 0.703125 +vt 0.531250 0.890625 +vt 0.718750 0.890625 +vt 0.718750 0.609375 +vt 0.531250 0.609375 +vt 0.125000 1.000000 +vt 0.250000 1.000000 +vt 0.250000 0.828125 +vt 0.125000 0.828125 +vt 0.515625 0.671875 +vt 0.328125 0.671875 +vt 0.328125 0.953125 +vt 0.515625 0.953125 +vt 0.296875 0.984375 +vt 0.484375 0.984375 +vt 0.484375 0.703125 +vt 0.296875 0.703125 +vt 0.500000 0.703125 +vt 0.609375 0.703125 +vt 0.609375 0.500000 +vt 0.500000 0.500000 +vt 0.082031 0.796875 +vt 0.023438 0.796875 +vt 0.023438 0.882812 +vt 0.703125 1.000000 +vt 0.984375 1.000000 +vt 0.984375 0.625000 +vt 0.703125 0.625000 +vt 0.718750 0.687500 +vt 0.843750 0.687500 +vt 0.843750 0.546875 +vt 0.718750 0.546875 +vt 0.042969 0.859375 +vt 0.101562 0.859375 +vt 0.101562 0.773438 +vt 0.042969 0.773438 +vt 0.031250 0.984375 +vt 0.312500 0.984375 +vt 0.312500 0.625000 +vt 0.031250 0.625000 +vt 0.023438 0.968750 +g Contained_Fire_Cube.000_Logs-Stone +s off +f 20/5 17/6 18/7 19/8 +f 14/9 18/10 17/11 13/12 +f 15/13 19/14 18/15 14/16 +f 13/17 16/18 15/19 14/20 +f 13/21 17/22 20/23 16/24 +f 16/25 20/26 19/15 15/16 +f 28/27 25/28 26/29 27/30 +f 22/31 26/32 25/33 21/34 +f 23/35 27/36 26/37 22/38 +f 21/39 24/40 23/41 22/42 +f 21/43 25/44 28/45 24/46 +f 24/47 28/48 27/49 23/50 +f 36/51 33/52 34/53 35/8 +f 30/54 34/55 33/56 29/57 +f 31/58 35/59 34/60 30/61 +f 29/62 32/63 31/64 30/65 +f 29/66 33/67 36/68 32/69 +f 32/70 36/71 35/72 31/73 +f 44/74 41/75 42/76 43/77 +f 38/54 42/55 41/56 37/57 +f 39/58 43/59 42/60 38/61 +f 37/78 40/79 39/80 38/81 +f 37/66 41/67 44/68 40/69 +f 40/70 44/71 43/72 39/73 +f 52/82 49/83 50/84 51/85 +f 46/54 50/55 49/56 45/57 +f 47/58 51/59 50/60 46/61 +f 45/86 48/87 47/88 46/89 +f 45/66 49/67 52/68 48/69 +f 48/70 52/71 51/72 47/73 +f 60/90 57/91 58/92 59/93 +f 54/54 58/55 57/56 53/57 +f 55/58 59/59 58/60 54/61 +f 53/94 56/95 55/96 54/97 +f 53/66 57/67 60/68 56/69 +f 56/70 60/71 59/72 55/73 +f 65/98 61/99 62/100 66/101 +f 66/102 62/103 63/104 67/105 +f 67/106 63/107 64/108 68/109 +f 68/110 64/111 61/112 65/113 +f 61/114 64/115 63/116 62/117 +f 68/118 65/119 66/120 67/121 +f 73/122 69/123 70/124 74/125 +f 74/126 70/127 71/128 75/129 +f 75/130 71/131 72/132 76/133 +f 76/134 72/135 69/136 73/137 +f 69/138 72/139 71/140 70/141 +f 76/142 73/143 74/144 75/145 +f 81/122 77/123 78/124 82/125 +f 82/146 78/147 79/148 83/149 +f 83/150 79/151 80/152 84/153 +f 84/134 80/135 77/136 81/137 +f 77/138 80/139 79/140 78/141 +f 84/154 81/155 82/156 83/157 +f 89/122 85/123 86/124 90/125 +f 90/158 86/159 87/160 91/161 +f 91/162 87/163 88/164 92/165 +f 92/134 88/135 85/136 89/137 +f 85/138 88/139 87/140 86/141 +f 92/166 89/167 90/168 91/169 +f 97/122 93/123 94/124 98/125 +f 98/170 94/171 95/172 99/173 +f 99/174 95/175 96/176 100/177 +f 100/134 96/135 93/136 97/137 +f 93/138 96/139 95/140 94/141 +f 100/178 97/179 98/180 99/125 +f 105/122 101/123 102/124 106/125 +f 106/181 102/182 103/183 107/184 +f 107/185 103/186 104/187 108/188 +f 108/134 104/135 101/136 105/137 +f 101/138 104/139 103/140 102/141 +f 108/178 105/179 106/180 107/125 +f 113/122 109/123 110/124 114/125 +f 114/189 110/190 111/191 115/192 +f 115/193 111/194 112/195 116/196 +f 116/134 112/135 109/136 113/137 +f 109/138 112/139 111/140 110/141 +f 116/178 113/179 114/180 115/125 +f 121/122 117/123 118/124 122/125 +f 122/189 118/190 119/191 123/192 +f 123/197 119/122 120/125 124/180 +f 124/134 120/135 117/136 121/137 +f 117/138 120/139 119/140 118/141 +f 124/178 121/179 122/180 123/125 +f 129/122 125/123 126/124 130/125 +f 130/189 126/190 127/191 131/192 +f 131/197 127/122 128/125 132/180 +f 132/134 128/135 125/136 129/137 +f 125/138 128/139 127/140 126/141 +f 132/178 129/179 130/180 131/125 +f 137/122 133/123 134/124 138/125 +f 138/189 134/190 135/191 139/192 +f 139/197 135/122 136/125 140/180 +f 140/134 136/135 133/136 137/137 +f 133/138 136/139 135/140 134/141 +f 140/178 137/179 138/180 139/125 +f 145/122 141/123 142/124 146/125 +f 146/189 142/190 143/191 147/192 +f 147/197 143/122 144/125 148/180 +f 148/134 144/135 141/136 145/137 +f 141/138 144/139 143/140 142/141 +f 148/178 145/179 146/180 147/125 +f 153/122 149/123 150/124 154/125 +f 154/189 150/190 151/191 155/192 +f 155/197 151/122 152/125 156/180 +f 156/134 152/135 149/136 153/137 +f 149/138 152/139 151/140 150/141 +f 156/178 153/179 154/180 155/125 diff --git a/mods/more_fire/models/more_fire_kindling.obj b/mods/more_fire/models/more_fire_kindling.obj new file mode 100644 index 0000000..5eb8dc8 --- /dev/null +++ b/mods/more_fire/models/more_fire_kindling.obj @@ -0,0 +1,112 @@ +# Blender v2.72 (sub 2) OBJ File: 'campfire.blend' +# www.blender.org +v 0.151217 -0.347540 0.439253 +v 0.151217 -0.207593 0.411057 +v 0.008458 -0.207593 0.411057 +v 0.008458 -0.347540 0.439253 +v 0.151217 -0.526542 -0.449208 +v 0.151217 -0.386595 -0.477403 +v 0.008458 -0.386595 -0.477403 +v 0.008458 -0.526542 -0.449208 +v -0.419949 -0.512482 0.485423 +v -0.419949 -0.369723 0.485423 +v -0.444739 -0.369723 0.344833 +v -0.444739 -0.512482 0.344833 +v 0.472595 -0.512482 0.328044 +v 0.472595 -0.369723 0.328044 +v 0.447805 -0.369723 0.187453 +v 0.447805 -0.512482 0.187453 +v 0.033402 -0.347540 0.433815 +v 0.025205 -0.207593 0.406838 +v -0.111388 -0.207593 0.448342 +v -0.103191 -0.347540 0.475320 +v -0.224900 -0.526542 -0.416268 +v -0.233097 -0.386595 -0.443246 +v -0.369690 -0.386595 -0.401741 +v -0.361493 -0.526542 -0.374763 +v 0.254175 -0.345963 0.293196 +v 0.254175 -0.277187 0.265611 +v 0.181422 -0.282425 0.252550 +v 0.181422 -0.351201 0.280135 +v 0.343511 -0.517901 -0.135488 +v 0.343511 -0.449125 -0.163073 +v 0.270757 -0.454364 -0.176133 +v 0.270757 -0.523140 -0.148548 +v -0.418506 -0.513914 0.100698 +v -0.418472 -0.439812 0.100704 +v -0.392481 -0.439819 0.031309 +v -0.392514 -0.513921 0.031304 +v 0.022046 -0.514125 0.265705 +v 0.022080 -0.440022 0.265710 +v 0.048071 -0.440029 0.196316 +v 0.048038 -0.514131 0.196310 +v -0.249910 -0.307656 -0.062181 +v -0.249882 -0.234638 -0.074807 +v -0.278776 -0.246254 -0.142048 +v -0.278804 -0.319272 -0.129422 +v 0.183295 -0.339072 -0.242901 +v 0.183323 -0.266053 -0.255527 +v 0.154429 -0.277669 -0.322768 +v 0.154401 -0.350687 -0.310143 +vt 0.418293 0.016195 +vt 0.418293 0.216092 +vt 0.218396 0.216092 +vt 0.218396 0.016195 +vt 0.002609 0.212891 +vt 0.002609 0.012994 +vt 0.989254 0.012994 +vt 0.989254 0.212891 +vt 0.010050 0.219323 +vt 0.010050 0.019426 +vt 0.996695 0.019426 +vt 0.996695 0.219323 +vt 0.618448 0.016195 +vt 0.618448 0.216092 +vt 0.418551 0.216092 +vt 0.418551 0.016195 +vt 0.010050 0.228781 +vt 0.010050 0.028884 +vt 0.996695 0.028884 +vt 0.996695 0.228781 +vt 0.005089 0.207467 +vt 0.005089 0.007570 +vt 0.991734 0.007570 +vt 0.991734 0.207467 +g Campfire_Cube.003_Logs-Stone +s off +f 8/1 7/2 6/3 5/4 +f 2/5 1/6 5/7 6/8 +f 3/9 2/10 6/11 7/12 +f 1/13 2/14 3/15 4/16 +f 1/17 4/18 8/19 5/20 +f 4/21 3/22 7/23 8/24 +f 16/1 15/2 14/3 13/4 +f 10/5 9/6 13/7 14/8 +f 11/9 10/10 14/11 15/12 +f 9/13 10/14 11/15 12/16 +f 9/17 12/18 16/19 13/20 +f 12/21 11/22 15/23 16/24 +f 24/1 23/2 22/3 21/4 +f 18/5 17/6 21/7 22/8 +f 19/9 18/10 22/11 23/12 +f 17/13 18/14 19/15 20/16 +f 17/17 20/18 24/19 21/20 +f 20/21 19/22 23/23 24/24 +f 32/1 31/2 30/3 29/4 +f 26/5 25/6 29/7 30/8 +f 27/9 26/10 30/11 31/12 +f 25/13 26/14 27/15 28/16 +f 25/17 28/18 32/19 29/20 +f 28/21 27/22 31/23 32/24 +f 40/1 39/2 38/3 37/4 +f 34/5 33/6 37/7 38/8 +f 35/9 34/10 38/11 39/12 +f 33/13 34/14 35/15 36/16 +f 33/17 36/18 40/19 37/20 +f 36/21 35/22 39/23 40/24 +f 48/1 47/2 46/3 45/4 +f 42/5 41/6 45/7 46/8 +f 43/9 42/10 46/11 47/12 +f 41/13 42/14 43/15 44/16 +f 41/17 44/18 48/19 45/20 +f 44/21 43/22 47/23 48/24 diff --git a/mods/more_fire/models/more_fire_kindling_contained.obj b/mods/more_fire/models/more_fire_kindling_contained.obj new file mode 100644 index 0000000..4a47a6e --- /dev/null +++ b/mods/more_fire/models/more_fire_kindling_contained.obj @@ -0,0 +1,449 @@ +# Blender v2.72 (sub 2) OBJ File: 'campfire.blend' +# www.blender.org +v 0.109850 -0.357143 0.305314 +v 0.109850 -0.248233 0.283371 +v -0.001248 -0.248233 0.283371 +v -0.001248 -0.357143 0.305314 +v 0.109850 -0.496446 -0.364085 +v 0.109850 -0.387536 -0.386027 +v -0.001248 -0.387536 -0.386027 +v -0.001248 -0.496446 -0.364085 +v -0.334643 -0.485504 0.341245 +v -0.334643 -0.374406 0.341245 +v -0.353935 -0.374406 0.231834 +v -0.353935 -0.485504 0.231834 +v 0.359953 -0.485504 0.218768 +v 0.359953 -0.374406 0.218768 +v 0.340661 -0.374406 0.109358 +v 0.340661 -0.485504 0.109358 +v 0.018164 -0.357143 0.301082 +v 0.011785 -0.248233 0.280088 +v -0.094515 -0.248233 0.312387 +v -0.088135 -0.357143 0.333382 +v -0.182852 -0.496446 -0.360470 +v -0.189231 -0.387536 -0.381465 +v -0.295531 -0.387536 -0.349165 +v -0.289151 -0.496446 -0.328171 +v 0.189974 -0.355916 0.191649 +v 0.189974 -0.302392 0.170182 +v 0.133356 -0.306469 0.160018 +v 0.133356 -0.359992 0.181485 +v 0.259497 -0.489722 -0.141961 +v 0.259497 -0.436199 -0.163429 +v 0.202879 -0.440275 -0.173592 +v 0.202879 -0.493798 -0.152125 +v -0.333520 -0.486619 0.041843 +v -0.333494 -0.428951 0.041848 +v -0.313267 -0.428956 -0.012156 +v -0.313293 -0.486624 -0.012161 +v 0.009327 -0.486782 0.170255 +v 0.009353 -0.429115 0.170259 +v 0.029580 -0.429120 0.116255 +v 0.029554 -0.486787 0.116251 +v -0.202316 -0.326105 -0.084912 +v -0.202294 -0.269280 -0.094738 +v -0.224779 -0.278320 -0.147066 +v -0.224801 -0.335144 -0.137240 +v 0.134814 -0.350553 -0.225553 +v 0.134835 -0.293728 -0.235379 +v 0.112350 -0.302768 -0.287707 +v 0.112328 -0.359592 -0.277881 +v 0.153727 -0.495469 0.450886 +v 0.130774 -0.495469 0.303732 +v 0.277929 -0.495469 0.280779 +v 0.300881 -0.495469 0.427933 +v 0.153727 -0.389072 0.450886 +v 0.130774 -0.389072 0.303732 +v 0.277929 -0.389072 0.280779 +v 0.300881 -0.389072 0.427933 +v -0.416606 -0.495469 -0.045338 +v -0.416606 -0.495469 -0.194272 +v -0.267672 -0.495469 -0.194272 +v -0.267672 -0.495469 -0.045338 +v -0.416606 -0.395652 -0.045338 +v -0.416606 -0.395652 -0.194272 +v -0.267672 -0.395652 -0.194272 +v -0.267672 -0.395652 -0.045338 +v -0.378793 -0.495469 0.237564 +v -0.480454 -0.495469 0.128724 +v -0.371615 -0.495469 0.027062 +v -0.269953 -0.495469 0.135902 +v -0.378793 -0.365755 0.237564 +v -0.480454 -0.365755 0.128724 +v -0.371615 -0.365755 0.027062 +v -0.269953 -0.365755 0.135902 +v -0.134183 -0.495469 -0.320969 +v -0.194093 -0.495469 -0.417106 +v -0.090445 -0.495469 -0.465129 +v -0.030535 -0.495469 -0.368992 +v -0.134183 -0.346536 -0.320969 +v -0.194093 -0.346536 -0.417106 +v -0.090445 -0.346536 -0.465129 +v -0.030535 -0.346536 -0.368992 +v 0.175251 -0.495469 -0.228071 +v 0.133971 -0.495469 -0.371169 +v 0.277070 -0.495469 -0.412449 +v 0.318350 -0.495469 -0.269350 +v 0.175251 -0.380117 -0.228071 +v 0.133971 -0.380117 -0.371169 +v 0.277070 -0.380117 -0.412449 +v 0.318350 -0.380117 -0.269350 +v 0.251956 -0.495469 0.058110 +v 0.281764 -0.495469 -0.087810 +v 0.427684 -0.495469 -0.058002 +v 0.397876 -0.495469 0.087918 +v 0.251956 -0.422654 0.058110 +v 0.281764 -0.422654 -0.087810 +v 0.427684 -0.422654 -0.058002 +v 0.397876 -0.422654 0.087918 +v -0.232717 -0.495469 0.492217 +v -0.255669 -0.495469 0.345062 +v -0.108515 -0.495469 0.322110 +v -0.085563 -0.495469 0.469264 +v -0.232717 -0.382356 0.492217 +v -0.255669 -0.382356 0.345062 +v -0.108515 -0.382356 0.322110 +v -0.085563 -0.382356 0.469264 +v -0.033985 -0.495469 0.350689 +v 0.113554 -0.495469 0.371024 +v 0.101929 -0.495469 0.455372 +v -0.045610 -0.495469 0.435037 +v -0.033985 -0.346536 0.350689 +v 0.113554 -0.346536 0.371024 +v 0.101929 -0.346536 0.455372 +v -0.045610 -0.346536 0.435037 +v 0.339073 -0.495469 0.300291 +v 0.404643 -0.495469 0.166568 +v 0.481092 -0.495469 0.204054 +v 0.415522 -0.495469 0.337777 +v 0.339073 -0.409221 0.300291 +v 0.404643 -0.409221 0.166568 +v 0.481092 -0.409221 0.204054 +v 0.415522 -0.409221 0.337777 +v -0.359990 -0.495469 0.467998 +v -0.461166 -0.495469 0.358706 +v -0.398683 -0.495469 0.300864 +v -0.297508 -0.495469 0.410156 +v -0.359990 -0.409788 0.467998 +v -0.461166 -0.409788 0.358706 +v -0.398683 -0.409788 0.300864 +v -0.297508 -0.409788 0.410156 +v -0.413457 -0.495469 -0.313766 +v -0.368533 -0.495469 -0.455763 +v -0.287353 -0.495469 -0.430081 +v -0.332277 -0.495469 -0.288084 +v -0.413457 -0.409221 -0.313766 +v -0.368533 -0.409221 -0.455763 +v -0.287353 -0.409221 -0.430081 +v -0.332277 -0.409221 -0.288084 +v 0.037431 -0.495469 -0.491183 +v 0.185487 -0.495469 -0.475036 +v 0.176256 -0.495469 -0.390393 +v 0.028200 -0.495469 -0.406539 +v 0.037431 -0.398994 -0.491183 +v 0.185487 -0.398994 -0.475036 +v 0.176256 -0.398994 -0.390393 +v 0.028200 -0.398994 -0.406539 +vt 0.343750 0.203125 +vt 0.156250 0.203125 +vt 0.156250 0.406250 +vt 0.343750 0.406250 +vt 0.015625 0.453125 +vt 1.000000 0.453125 +vt 1.000000 0.250000 +vt 0.015625 0.250000 +vt 0.015625 0.328125 +vt 1.000000 0.328125 +vt 1.000000 0.140625 +vt 0.015625 0.140625 +vt 0.781250 0.250000 +vt 0.578125 0.250000 +vt 0.578125 0.437500 +vt 0.781250 0.437500 +vt 0.015625 0.468750 +vt 1.000000 0.468750 +vt 1.000000 0.265625 +vt 0.015625 0.265625 +vt 0.015625 0.343750 +vt 1.000000 0.343750 +vt 0.921875 0.218750 +vt 0.718750 0.218750 +vt 0.718750 0.421875 +vt 0.921875 0.421875 +vt 0.000000 0.343750 +vt 0.984375 0.343750 +vt 0.984375 0.140625 +vt 0.000000 0.140625 +vt 0.000000 0.312500 +vt 1.000000 0.312500 +vt 1.000000 0.109375 +vt 0.000000 0.109375 +vt 0.828125 0.203125 +vt 0.625000 0.203125 +vt 0.625000 0.406250 +vt 0.828125 0.406250 +vt 0.015625 0.390625 +vt 1.000000 0.390625 +vt 1.000000 0.187500 +vt 0.015625 0.187500 +vt 0.000000 0.296875 +vt 1.000000 0.296875 +vt 1.000000 0.093750 +vt 0.000000 0.093750 +vt 0.343750 0.218750 +vt 0.140625 0.218750 +vt 0.140625 0.406250 +vt 0.002609 0.212891 +vt 0.989254 0.212891 +vt 0.989254 0.012994 +vt 0.002609 0.012994 +vt 0.010050 0.219323 +vt 0.996695 0.219323 +vt 0.996695 0.019426 +vt 0.010050 0.019426 +vt 0.593750 0.234375 +vt 0.406250 0.234375 +vt 0.406250 0.437500 +vt 0.593750 0.437500 +vt 0.010050 0.228781 +vt 0.996695 0.228781 +vt 0.996695 0.028884 +vt 0.010050 0.028884 +vt 0.005089 0.207467 +vt 0.991734 0.207467 +vt 0.991734 0.007570 +vt 0.005089 0.007570 +vt 0.625000 0.187500 +vt 0.421875 0.187500 +vt 0.421875 0.390625 +vt 0.625000 0.390625 +vt 0.796875 0.093750 +vt 0.593750 0.093750 +vt 0.593750 0.296875 +vt 0.796875 0.296875 +vt 0.640625 0.031250 +vt 0.437500 0.031250 +vt 0.437500 0.234375 +vt 0.640625 0.234375 +vt 0.984375 0.031250 +vt 0.781250 0.031250 +vt 0.781250 0.234375 +vt 0.984375 0.234375 +vt 0.687500 0.125000 +vt 0.484375 0.125000 +vt 0.484375 0.328125 +vt 0.687500 0.328125 +vt 0.328125 0.046875 +vt 0.125000 0.046875 +vt 0.125000 0.250000 +vt 0.328125 0.250000 +vt 0.140625 0.781250 +vt 0.250000 0.781250 +vt 0.250000 0.625000 +vt 0.140625 0.625000 +vt 0.453125 0.843750 +vt 0.531250 0.843750 +vt 0.531250 0.718750 +vt 0.453125 0.718750 +vt 0.421875 0.718750 +vt 0.265625 0.718750 +vt 0.265625 0.937500 +vt 0.421875 0.937500 +vt 0.500000 0.609375 +vt 0.500000 1.000000 +vt 0.734375 1.000000 +vt 0.734375 0.609375 +vt 1.000000 0.953125 +vt 1.000000 0.875000 +vt 0.859375 0.875000 +vt 0.859375 0.953125 +vt 0.750000 0.531250 +vt 0.562500 0.531250 +vt 0.562500 0.765625 +vt 0.750000 0.765625 +vt 0.082031 0.968750 +vt 0.136719 0.968750 +vt 0.136719 0.882812 +vt 0.082031 0.882812 +vt 0.781250 0.921875 +vt 0.781250 0.796875 +vt 0.609375 0.796875 +vt 0.609375 0.921875 +vt 0.359375 0.718750 +vt 0.484375 0.718750 +vt 0.484375 0.500000 +vt 0.359375 0.500000 +vt 0.058594 0.882812 +vt 0.058594 0.968750 +vt 0.117188 0.968750 +vt 0.117188 0.882812 +vt 0.023438 0.925781 +vt 0.078125 0.925781 +vt 0.078125 0.839844 +vt 0.023438 0.839844 +vt 0.578125 0.828125 +vt 0.468750 0.828125 +vt 0.468750 1.000000 +vt 0.578125 1.000000 +vt 0.078125 0.750000 +vt 0.234375 0.750000 +vt 0.234375 0.546875 +vt 0.078125 0.546875 +vt 0.750000 0.906250 +vt 0.953125 0.906250 +vt 0.953125 0.546875 +vt 0.750000 0.546875 +vt 0.406250 0.500000 +vt 0.250000 0.500000 +vt 0.250000 0.703125 +vt 0.406250 0.703125 +vt 0.531250 0.890625 +vt 0.718750 0.890625 +vt 0.718750 0.609375 +vt 0.531250 0.609375 +vt 0.125000 1.000000 +vt 0.250000 1.000000 +vt 0.250000 0.828125 +vt 0.125000 0.828125 +vt 0.515625 0.671875 +vt 0.328125 0.671875 +vt 0.328125 0.953125 +vt 0.515625 0.953125 +vt 0.296875 0.984375 +vt 0.484375 0.984375 +vt 0.484375 0.703125 +vt 0.296875 0.703125 +vt 0.500000 0.703125 +vt 0.609375 0.703125 +vt 0.609375 0.500000 +vt 0.500000 0.500000 +vt 0.082031 0.796875 +vt 0.023438 0.796875 +vt 0.023438 0.882812 +vt 0.703125 1.000000 +vt 0.984375 1.000000 +vt 0.984375 0.625000 +vt 0.703125 0.625000 +vt 0.718750 0.687500 +vt 0.843750 0.687500 +vt 0.843750 0.546875 +vt 0.718750 0.546875 +vt 0.042969 0.859375 +vt 0.101562 0.859375 +vt 0.101562 0.773438 +vt 0.042969 0.773438 +vt 0.031250 0.984375 +vt 0.312500 0.984375 +vt 0.312500 0.625000 +vt 0.031250 0.625000 +vt 0.023438 0.968750 +g Contained_Fire_Cube.000_Logs-Stone +s off +f 8/1 5/2 6/3 7/4 +f 2/5 6/6 5/7 1/8 +f 3/9 7/10 6/11 2/12 +f 1/13 4/14 3/15 2/16 +f 1/17 5/18 8/19 4/20 +f 4/21 8/22 7/11 3/12 +f 16/23 13/24 14/25 15/26 +f 10/27 14/28 13/29 9/30 +f 11/31 15/32 14/33 10/34 +f 9/35 12/36 11/37 10/38 +f 9/39 13/40 16/41 12/42 +f 12/43 16/44 15/45 11/46 +f 24/47 21/48 22/49 23/4 +f 18/50 22/51 21/52 17/53 +f 19/54 23/55 22/56 18/57 +f 17/58 20/59 19/60 18/61 +f 17/62 21/63 24/64 20/65 +f 20/66 24/67 23/68 19/69 +f 32/70 29/71 30/72 31/73 +f 26/50 30/51 29/52 25/53 +f 27/54 31/55 30/56 26/57 +f 25/74 28/75 27/76 26/77 +f 25/62 29/63 32/64 28/65 +f 28/66 32/67 31/68 27/69 +f 40/78 37/79 38/80 39/81 +f 34/50 38/51 37/52 33/53 +f 35/54 39/55 38/56 34/57 +f 33/82 36/83 35/84 34/85 +f 33/62 37/63 40/64 36/65 +f 36/66 40/67 39/68 35/69 +f 48/86 45/87 46/88 47/89 +f 42/50 46/51 45/52 41/53 +f 43/54 47/55 46/56 42/57 +f 41/90 44/91 43/92 42/93 +f 41/62 45/63 48/64 44/65 +f 44/66 48/67 47/68 43/69 +f 53/94 49/95 50/96 54/97 +f 54/98 50/99 51/100 55/101 +f 55/102 51/103 52/104 56/105 +f 56/106 52/107 49/108 53/109 +f 49/110 52/111 51/112 50/113 +f 56/114 53/115 54/116 55/117 +f 61/118 57/119 58/120 62/121 +f 62/122 58/123 59/124 63/125 +f 63/126 59/127 60/128 64/129 +f 64/130 60/131 57/132 61/133 +f 57/134 60/135 59/136 58/137 +f 64/138 61/139 62/140 63/141 +f 69/118 65/119 66/120 70/121 +f 70/142 66/143 67/144 71/145 +f 71/146 67/147 68/148 72/149 +f 72/130 68/131 65/132 69/133 +f 65/134 68/135 67/136 66/137 +f 72/150 69/151 70/152 71/153 +f 77/118 73/119 74/120 78/121 +f 78/154 74/155 75/156 79/157 +f 79/158 75/159 76/160 80/161 +f 80/130 76/131 73/132 77/133 +f 73/134 76/135 75/136 74/137 +f 80/162 77/163 78/164 79/165 +f 85/118 81/119 82/120 86/121 +f 86/166 82/167 83/168 87/169 +f 87/170 83/171 84/172 88/173 +f 88/130 84/131 81/132 85/133 +f 81/134 84/135 83/136 82/137 +f 88/174 85/175 86/176 87/121 +f 93/118 89/119 90/120 94/121 +f 94/177 90/178 91/179 95/180 +f 95/181 91/182 92/183 96/184 +f 96/130 92/131 89/132 93/133 +f 89/134 92/135 91/136 90/137 +f 96/174 93/175 94/176 95/121 +f 101/118 97/119 98/120 102/121 +f 102/185 98/186 99/187 103/188 +f 103/189 99/190 100/191 104/192 +f 104/130 100/131 97/132 101/133 +f 97/134 100/135 99/136 98/137 +f 104/174 101/175 102/176 103/121 +f 109/118 105/119 106/120 110/121 +f 110/185 106/186 107/187 111/188 +f 111/193 107/118 108/121 112/176 +f 112/130 108/131 105/132 109/133 +f 105/134 108/135 107/136 106/137 +f 112/174 109/175 110/176 111/121 +f 117/118 113/119 114/120 118/121 +f 118/185 114/186 115/187 119/188 +f 119/193 115/118 116/121 120/176 +f 120/130 116/131 113/132 117/133 +f 113/134 116/135 115/136 114/137 +f 120/174 117/175 118/176 119/121 +f 125/118 121/119 122/120 126/121 +f 126/185 122/186 123/187 127/188 +f 127/193 123/118 124/121 128/176 +f 128/130 124/131 121/132 125/133 +f 121/134 124/135 123/136 122/137 +f 128/174 125/175 126/176 127/121 +f 133/118 129/119 130/120 134/121 +f 134/185 130/186 131/187 135/188 +f 135/193 131/118 132/121 136/176 +f 136/130 132/131 129/132 133/133 +f 129/134 132/135 131/136 130/137 +f 136/174 133/175 134/176 135/121 +f 141/118 137/119 138/120 142/121 +f 142/185 138/186 139/187 143/188 +f 143/193 139/118 140/121 144/176 +f 144/130 140/131 137/132 141/133 +f 137/134 140/135 139/136 138/137 +f 144/174 141/175 142/176 143/121 diff --git a/mods/more_fire/models/more_fire_lamp_table.obj b/mods/more_fire/models/more_fire_lamp_table.obj new file mode 100644 index 0000000..4ab5483 --- /dev/null +++ b/mods/more_fire/models/more_fire_lamp_table.obj @@ -0,0 +1,160 @@ +# Blender v2.74 (sub 5) OBJ File: 'lamp.blend' +# www.blender.org +o TabletopLamp_Cube.002 +v 0.140000 -0.399025 -0.139882 +v 0.200000 0.200975 -0.199882 +v 0.140000 -0.399025 0.140118 +v 0.200000 0.200975 0.200118 +v -0.140000 -0.399025 -0.139882 +v -0.200000 0.200975 -0.199882 +v -0.140000 -0.399025 0.140118 +v -0.200000 0.200975 0.200118 +v 0.196000 -0.399025 -0.195882 +v 0.196000 -0.399025 0.196118 +v -0.196000 -0.399025 -0.195882 +v -0.196000 -0.399025 0.196118 +v 0.196000 -0.498858 -0.195882 +v 0.196000 -0.498858 0.196118 +v -0.196000 -0.498857 -0.195882 +v -0.196000 -0.498857 0.196118 +v 0.063585 -0.434677 0.063703 +v 0.063585 -0.434677 -0.063467 +v -0.063585 -0.434677 0.063703 +v -0.063585 -0.434677 -0.063467 +v 0.000000 -0.362197 -0.068012 +v 0.000000 -0.362197 0.067749 +v 0.000000 -0.296697 -0.029923 +v 0.000000 -0.296697 0.029661 +v 0.067880 -0.362197 -0.068012 +v 0.067880 -0.362197 0.067749 +v 0.029792 -0.296697 -0.029923 +v 0.029792 -0.296697 0.029661 +v -0.067880 -0.362197 -0.068011 +v -0.067880 -0.362197 0.067749 +v -0.029792 -0.296697 -0.029923 +v -0.029792 -0.296697 0.029661 +v 0.000000 -0.095525 -0.000131 +v 0.000000 -0.414885 -0.000131 +v 0.029792 -0.296697 -0.000131 +v 0.067880 -0.362197 -0.000131 +v -0.067880 -0.362197 -0.000131 +v -0.029792 -0.296697 -0.000131 +vt 0.000184 0.100646 +vt 0.245094 0.025548 +vt 0.321566 0.406010 +vt 0.150129 0.458578 +vt 0.500000 0.000184 +vt 0.500000 0.388255 +vt 0.754906 0.025548 +vt 0.678434 0.406010 +vt 0.999816 0.100646 +vt 0.849871 0.458578 +vt 0.126413 0.785921 +vt 0.324583 0.785910 +vt 0.364220 0.825542 +vt 0.086781 0.825558 +vt 0.364204 0.548103 +vt 0.086765 0.548119 +vt 0.086761 0.477462 +vt 0.364200 0.477446 +vt 0.324572 0.587740 +vt 0.126401 0.587751 +vt 0.538369 0.694413 +vt 0.828479 0.694413 +vt 0.828479 0.984522 +vt 0.538370 0.984522 +vt 0.434861 0.548099 +vt 0.434876 0.825538 +vt 0.016124 0.825562 +vt 0.016108 0.548123 +vt 0.364224 0.896199 +vt 0.086785 0.896215 +vt 0.128242 0.782956 +vt 0.128359 0.588263 +vt 0.184733 0.643133 +vt 0.183276 0.726280 +vt 0.266422 0.644797 +vt 0.267527 0.727647 +vt 0.321989 0.589472 +vt 0.323247 0.783309 +vt 0.710670 0.483156 +vt 0.731303 0.458009 +vt 0.938416 0.548420 +vt 0.722804 0.505829 +vt 0.668840 0.608672 +vt 0.623856 0.671057 +vt 0.584008 0.546251 +vt 0.665070 0.585205 +vt 0.730212 0.636289 +vt 0.709888 0.610891 +vt 0.722299 0.588369 +vt 0.669598 0.484873 +vt 0.665541 0.508292 +vt 0.625380 0.421942 +vt 0.710294 0.566741 +vt 0.676652 0.564725 +vt 0.670759 0.546782 +vt 0.721862 0.547095 +vt 0.710535 0.527308 +vt 0.676871 0.528913 +vn 0.995000 -0.099500 -0.000000 +vn 0.000000 -0.099500 0.995000 +vn -0.995000 -0.099500 0.000000 +vn -0.000000 -0.099500 -0.995000 +vn 0.000000 1.000000 0.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 -1.000000 0.000000 +vn -1.000000 0.000000 0.000000 +vn 1.000000 -0.000000 -0.000000 +vn 0.000000 0.000000 1.000000 +vn 0.000000 0.906200 0.422800 +vn 0.422800 0.906200 -0.000000 +vn -0.422800 0.906200 0.000000 +vn -0.000000 0.906200 -0.422800 +vn 0.692100 0.205000 -0.692100 +vn -0.340200 -0.876600 -0.340200 +vn -0.692100 0.205000 -0.692100 +vn 0.864500 0.502700 -0.000000 +vn 0.340200 -0.876600 -0.340200 +vn -0.864500 0.502700 0.000000 +vn -0.000000 0.502700 -0.864500 +vn 0.000000 0.502700 0.864500 +vn 0.692100 0.205000 0.692100 +vn -0.340200 -0.876600 0.340200 +vn -0.692100 0.205000 0.692100 +vn 0.340200 -0.876600 0.340200 +s off +f 2/1/1 4/2/1 3/3/1 1/4/1 +f 4/2/2 8/5/2 7/6/2 3/3/2 +f 8/5/3 6/7/3 5/8/3 7/6/3 +f 6/7/4 2/9/4 1/10/4 5/8/4 +f 3/11/5 7/12/5 12/13/5 10/14/5 +f 11/15/6 9/16/6 13/17/6 15/18/6 +f 5/19/5 1/20/5 9/16/5 11/15/5 +f 7/12/5 5/19/5 11/15/5 12/13/5 +f 1/20/5 3/11/5 10/14/5 9/16/5 +f 13/21/7 14/22/7 16/23/7 15/24/7 +f 12/13/8 11/15/8 15/25/8 16/26/8 +f 9/16/9 10/14/9 14/27/9 13/28/9 +f 10/14/10 12/13/10 16/29/10 14/30/10 +f 1/31/11 5/32/11 20/33/11 18/34/11 +f 19/35/5 17/36/5 18/34/5 20/33/5 +f 5/32/12 7/37/12 19/35/12 20/33/12 +f 3/38/13 1/31/13 18/34/13 17/36/13 +f 7/37/14 3/38/14 17/36/14 19/35/14 +f 27/39/15 23/40/15 33/41/15 35/42/15 +f 29/43/16 21/44/16 34/45/16 37/46/16 +f 23/47/17 31/48/17 38/49/17 33/41/17 +f 25/50/18 27/39/18 35/42/18 36/51/18 +f 21/52/19 25/50/19 36/51/19 34/45/19 +f 31/48/20 29/43/20 37/46/20 38/49/20 +f 27/39/21 25/50/21 21/52/21 23/40/21 +f 32/53/22 30/54/22 22/55/22 24/56/22 +f 35/42/23 33/41/23 24/56/23 28/57/23 +f 37/46/24 34/45/24 22/55/24 30/54/24 +f 23/47/21 21/44/21 29/43/21 31/48/21 +f 24/56/22 22/55/22 26/58/22 28/57/22 +f 33/41/25 38/49/25 32/53/25 24/56/25 +f 36/51/18 35/42/18 28/57/18 26/58/18 +f 34/45/26 36/51/26 26/58/26 22/55/26 +f 38/49/20 37/46/20 30/54/20 32/53/20 diff --git a/mods/more_fire/models/more_fire_lamp_wall.obj b/mods/more_fire/models/more_fire_lamp_wall.obj new file mode 100644 index 0000000..27c0902 --- /dev/null +++ b/mods/more_fire/models/more_fire_lamp_wall.obj @@ -0,0 +1,187 @@ +# Blender v2.74 (sub 5) OBJ File: 'lamp.blend' +# www.blender.org +o Cube.001 +v 0.140000 -0.280515 0.022415 +v 0.200000 0.319485 -0.037585 +v 0.140000 -0.280515 0.302415 +v 0.200000 0.319485 0.362415 +v -0.140000 -0.280515 0.022415 +v -0.200000 0.319485 -0.037585 +v -0.140000 -0.280515 0.302415 +v -0.200000 0.319485 0.362415 +v 0.196000 -0.280515 -0.033585 +v 0.196000 -0.280515 0.358415 +v -0.196000 -0.280515 -0.033585 +v -0.196000 -0.280515 0.358415 +v 0.196000 -0.380348 -0.033585 +v 0.196000 -0.380348 0.358415 +v -0.196000 -0.380348 -0.033585 +v -0.196000 -0.380348 0.358415 +v -0.117783 -0.280515 0.437568 +v 0.117783 -0.280515 0.437568 +v -0.117783 -0.380348 0.437568 +v 0.117783 -0.380348 0.437568 +v -0.222778 -0.190702 0.499030 +v 0.222778 -0.190702 0.499029 +v -0.222778 -0.380348 0.499030 +v 0.222778 -0.380348 0.499029 +v 0.063585 -0.316167 0.226000 +v 0.063585 -0.316167 0.098830 +v -0.063585 -0.316167 0.226000 +v -0.063585 -0.316167 0.098830 +v 0.000000 -0.243687 0.094285 +v 0.000000 -0.243687 0.230046 +v 0.000000 -0.178187 0.132373 +v 0.000000 -0.178187 0.191958 +v 0.067880 -0.243687 0.094285 +v 0.067880 -0.243687 0.230046 +v 0.029792 -0.178187 0.132373 +v 0.029792 -0.178187 0.191958 +v -0.067880 -0.243687 0.094285 +v -0.067880 -0.243687 0.230046 +v -0.029792 -0.178187 0.132373 +v -0.029792 -0.178187 0.191958 +v 0.000000 0.022985 0.162166 +v 0.000000 -0.296375 0.162166 +v 0.029792 -0.178187 0.162166 +v 0.067880 -0.243687 0.162166 +v -0.067880 -0.243687 0.162166 +v -0.029792 -0.178187 0.162166 +vt 0.000184 0.100646 +vt 0.245094 0.025548 +vt 0.321566 0.406010 +vt 0.150129 0.458578 +vt 0.500000 0.000184 +vt 0.500000 0.388255 +vt 0.754906 0.025548 +vt 0.678434 0.406010 +vt 0.999816 0.100646 +vt 0.849871 0.458578 +vt 0.314421 0.800681 +vt 0.318222 0.575143 +vt 0.363809 0.525366 +vt 0.362687 0.863618 +vt 0.105089 0.564675 +vt 0.089347 0.790322 +vt 0.017624 0.857183 +vt 0.018081 0.506752 +vt 0.138376 0.596328 +vt 0.130292 0.760686 +vt 0.605426 0.689137 +vt 0.886635 0.689137 +vt 0.886635 0.970346 +vt 0.605426 0.970346 +vt 0.354343 0.937588 +vt 0.465557 0.832974 +vt 0.442159 0.934100 +vt 0.361926 0.441181 +vt 0.570612 0.907416 +vt 0.489202 0.967153 +vt 0.441846 0.565238 +vt 0.426006 0.454242 +vt 0.943417 0.745248 +vt 0.943417 0.914235 +vt 0.570612 0.498898 +vt 0.485731 0.420788 +vt 0.987508 0.669927 +vt 0.987508 0.989556 +vt 0.315130 0.800066 +vt 0.132668 0.760847 +vt 0.188257 0.717364 +vt 0.266689 0.731056 +vt 0.186969 0.642567 +vt 0.267853 0.635424 +vt 0.138529 0.595618 +vt 0.318539 0.576008 +vt 0.710670 0.483156 +vt 0.731303 0.458009 +vt 0.938416 0.548420 +vt 0.722804 0.505829 +vt 0.668840 0.608672 +vt 0.623856 0.671057 +vt 0.584008 0.546251 +vt 0.665070 0.585205 +vt 0.730212 0.636289 +vt 0.709888 0.610891 +vt 0.722299 0.588369 +vt 0.669598 0.484873 +vt 0.665541 0.508292 +vt 0.625380 0.421942 +vt 0.710294 0.566741 +vt 0.676652 0.564725 +vt 0.670759 0.546782 +vt 0.721862 0.547095 +vt 0.710535 0.527308 +vt 0.676871 0.528913 +vn 0.995000 -0.099500 -0.000000 +vn 0.000000 -0.099500 0.995000 +vn -0.995000 -0.099500 0.000000 +vn -0.000000 -0.099500 -0.995000 +vn 0.000000 1.000000 0.000000 +vn -0.000000 0.000000 -1.000000 +vn -0.000000 -1.000000 0.000000 +vn 0.711300 -0.000000 0.702900 +vn -1.000000 0.000000 0.000000 +vn 1.000000 -0.000000 -0.000000 +vn 0.505200 0.000000 -0.863000 +vn -0.711300 0.000000 0.702900 +vn -0.000000 0.564800 -0.825300 +vn -0.505200 0.000000 -0.863000 +vn 0.000000 0.906200 0.422800 +vn 0.422800 0.906200 -0.000000 +vn -0.422800 0.906200 0.000000 +vn 0.000000 0.906200 -0.422800 +vn 0.692100 0.205000 -0.692100 +vn -0.340200 -0.876600 -0.340200 +vn -0.692100 0.205000 -0.692100 +vn 0.864500 0.502700 -0.000000 +vn 0.340200 -0.876600 -0.340200 +vn -0.864500 0.502700 0.000000 +vn -0.000000 0.502700 -0.864500 +vn 0.000000 0.502700 0.864500 +vn 0.692100 0.205000 0.692100 +vn -0.340200 -0.876600 0.340200 +vn -0.692100 0.205000 0.692100 +vn 0.340200 -0.876600 0.340200 +s off +f 2/1/1 4/2/1 3/3/1 1/4/1 +f 4/2/2 8/5/2 7/6/2 3/3/2 +f 8/5/3 6/7/3 5/8/3 7/6/3 +f 6/7/4 2/9/4 1/10/4 5/8/4 +f 3/11/5 7/12/5 12/13/5 10/14/5 +f 11/15/6 9/16/6 13/17/6 15/18/6 +f 5/19/5 1/20/5 9/16/5 11/15/5 +f 7/12/5 5/19/5 11/15/5 12/13/5 +f 1/20/5 3/11/5 10/14/5 9/16/5 +f 13/21/7 14/22/7 16/23/7 15/24/7 +f 14/25/8 10/14/8 18/26/8 20/27/8 +f 12/13/9 11/15/9 15/18/9 16/28/9 +f 9/16/10 10/14/10 14/25/10 13/17/10 +f 20/27/11 18/26/11 22/29/11 24/30/11 +f 10/14/5 12/13/5 17/31/5 18/26/5 +f 12/13/12 16/28/12 19/32/12 17/31/12 +f 16/23/7 14/22/7 20/33/7 19/34/7 +f 18/26/13 17/31/13 21/35/13 22/29/13 +f 17/31/14 19/32/14 23/36/14 21/35/14 +f 19/34/7 20/33/7 24/37/7 23/38/7 +f 1/39/15 5/40/15 28/41/15 26/42/15 +f 27/43/5 25/44/5 26/42/5 28/41/5 +f 5/40/16 7/45/16 27/43/16 28/41/16 +f 3/46/17 1/39/17 26/42/17 25/44/17 +f 7/45/18 3/46/18 25/44/18 27/43/18 +f 35/47/19 31/48/19 41/49/19 43/50/19 +f 37/51/20 29/52/20 42/53/20 45/54/20 +f 31/55/21 39/56/21 46/57/21 41/49/21 +f 33/58/22 35/47/22 43/50/22 44/59/22 +f 29/60/23 33/58/23 44/59/23 42/53/23 +f 39/56/24 37/51/24 45/54/24 46/57/24 +f 35/47/25 33/58/25 29/60/25 31/48/25 +f 40/61/26 38/62/26 30/63/26 32/64/26 +f 43/50/27 41/49/27 32/64/27 36/65/27 +f 45/54/28 42/53/28 30/63/28 38/62/28 +f 31/55/25 29/52/25 37/51/25 39/56/25 +f 32/64/26 30/63/26 34/66/26 36/65/26 +f 41/49/29 46/57/29 40/61/29 32/64/29 +f 44/59/22 43/50/22 36/65/22 34/66/22 +f 42/53/30 44/59/30 34/66/30 30/63/30 +f 46/57/24 45/54/24 38/62/24 40/61/24 diff --git a/mods/more_fire/models/more_fire_mark.obj b/mods/more_fire/models/more_fire_mark.obj new file mode 100644 index 0000000..f5e4cd7 --- /dev/null +++ b/mods/more_fire/models/more_fire_mark.obj @@ -0,0 +1,14 @@ +# Blender v2.74 (sub 5) OBJ File: '' +# www.blender.org +o Plane +v -0.500000 -0.479483 0.500000 +v 0.500000 -0.479483 0.500000 +v -0.500000 -0.479483 -0.500000 +v 0.500000 -0.479483 -0.500000 +vt 0.000100 0.000100 +vt 0.999900 0.000100 +vt 0.999900 0.999900 +vt 0.000100 0.999900 +vn 0.000000 1.000000 0.000000 +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 diff --git a/mods/more_fire/models/tiles.blend b/mods/more_fire/models/tiles.blend new file mode 100644 index 0000000..6a3fd48 Binary files /dev/null and b/mods/more_fire/models/tiles.blend differ diff --git a/mods/more_fire/models/torch.blend b/mods/more_fire/models/torch.blend new file mode 100644 index 0000000..efff6b4 Binary files /dev/null and b/mods/more_fire/models/torch.blend differ diff --git a/mods/more_fire/molotov.lua b/mods/more_fire/molotov.lua new file mode 100644 index 0000000..f201e22 --- /dev/null +++ b/mods/more_fire/molotov.lua @@ -0,0 +1,382 @@ + --Molotov Cocktail_[rev002] + --base code is from throwing enhanced and potions mods + + local MOD_NAME = minetest.get_current_modname() + local MOD_PATH = minetest.get_modpath(MOD_NAME) + local Vec3 = dofile(MOD_PATH..'/lib/Vec3_1-0.lua') + +minetest.register_craftitem('more_fire:molotov_cocktail', { + description = 'Molotov Cocktail', + inventory_image = 'more_fire_molotov_cocktail.png', + on_place = function(itemstack, user, pointed_thing) + itemstack:take_item() + minetest.sound_play('more_fire_shatter', {gain = 1.0}) + n = minetest.env:get_node(pointed_thing) +if pointed_thing.type == 'node' then +minetest.env:add_node(pointed_thing.above, {name='more_fire:napalm'}) +minetest.sound_play('more_fire_ignite', {pos,pos}) +end + --Shattered glass Particles + minetest.add_particlespawner({ + amount = 40, + time = 0.1, + minpos = pointed_thing.above, + maxpos = pointed_thing.above, + minvel = {x=2, y=0.2, z=2}, + maxvel = {x=-2, y=0.5, z=-2}, + minacc = {x=0, y=-6, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptim = 0.5, + maxexptime = 2, + minsize = 0.2, + maxsize = 5, + collisiondetection = true, + texture = 'more_fire_shatter.png'}) + --fire ember particles + minetest.add_particlespawner({ + amount = 100, + time = 0.1, + minpos = pointed_thing.above, + maxpos = pointed_thing.above, + minvel = {x=-2, y=0.5, z=-2}, + maxvel = {x=2, y=0.5, z=2}, + minacc = {x=0, y=-10, z=0}, + maxacc = {x=0, y=-6, z=0}, + minexptime = 2, + maxexptime = 3, + minsize = 0.25, + maxsize = 0.5, + collisiondetection = true, + texture = 'more_fire_spark.png'}) + local dir = Vec3(user:get_look_dir()) *20 + minetest.add_particle( + {x=user:getpos().x, y=user:getpos().y+1.5, z=user:getpos().z}, {x=dir.x, y=dir.y, z=dir.z}, {x=0, y=-10, z=0}, 0.2, + 6, false, 'more_fire_molotov_cocktail.png') + return itemstack + end, +}) + +local function throw_cocktail(item, player) + local playerpos = player:getpos() + local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.625,z=playerpos.z}, 'more_fire:molotov_entity') + local dir = player:get_look_dir() + obj:setvelocity({x=dir.x*30, y=dir.y*30, z=dir.z*30}) + obj:setacceleration({x=dir.x*-3, y=-dir.y^8*80-10, z=dir.z*-3}) + if not minetest.setting_getbool('creative_mode') then + item:take_item() + end + return item +end + +local radius = 5.0 + +local function add_effects(pos, radius) + minetest.add_particlespawner({ + amount = 10, + time = 0.2, + minpos = vector.subtract(pos, radius / 2), + maxpos = vector.add(pos, radius / 2), + minvel = {x=-2, y=-2, z=-2}, + maxvel = {x=2, y=-4, z=2}, + minacc = {x=0, y=-4, z=0}, + --~ maxacc = {x=-20, y=-50, z=-50}, + minexptime = 1, + maxexptime = 1.5, + minsize = 1, + maxsize = 2, + texture = 'more_fire_spark.png', + }) + minetest.add_particlespawner({ + amount = 10, + time = 0.2, + minpos = vector.subtract(pos, radius / 2), + maxpos = vector.add(pos, radius / 2), + minvel = {x=-1.25, y=-1.25, z=-1.25}, + maxvel = {x=0.5, y=-4, z=0.5}, + minacc = {x=1.25, y=-1.25, z=1.25}, + --~ maxacc = {x=-20, y=-50, z=-50}, + minexptime =1, + maxexptime = 1.5, + minsize = 1, + maxsize = 2, + texture = 'more_fire_spark.png', + }) +end + +local function napalm(pos) + minetest.sound_play('more_fire_ignite', {pos=pos, gain=1}) + minetest.set_node(pos, {name='more_fire:napalm'}) + minetest.get_node_timer(pos):start(5.0) + add_effects(pos, radius) +end + +local MORE_FIRE_MOLOTOV_ENTITY = { + timer=0, + collisionbox = {0,0,0,0,0,0}, + physical = false, + textures = {'more_fire_molotov_cocktail.png'}, + lastpos={}, +} + +MORE_FIRE_MOLOTOV_ENTITY.on_step = function(self, dtime) + self.timer = self.timer + dtime + local pos = self.object:getpos() + local node = minetest.get_node(pos) +minetest.add_particlespawner({ + amount = 10, + time = 0.5, + minpos = pos, + maxpos = pos, + minvel = {x=-0, y=0, z=-0.5}, + maxvel = {x=0, y=0, z=-0.75}, + minacc = vector.new(), + maxacc = vector.new(), + minexptime = 0.5, + maxexptime = 1, + minsize = 0.25, + maxsize = 0.5, + texture = 'more_fire_smoke.png', + }) + minetest.add_particlespawner({ + amount = 100, + time = 0.25, + minpos = pos, + maxpos = pos, + minvel = {x=-0, y=0, z=-0.5}, + maxvel = {x=0, y=0, z=-0.75}, + minacc = {x=0, y=0, z=-0.75}, + maxacc = {x=-0, y=0, z=-0.5}, + minexptime = 0.25, + maxexptime = 0.5, + minsize = 0.5, + maxsize = 0.75, + texture = 'more_fire_spark.png', + }) + if self.timer>0.2 then + local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1) + for k, obj in pairs(objs) do + if obj:get_luaentity() ~= nil then + if obj:get_luaentity().name ~= 'more_fire:molotov_entity' and obj:get_luaentity().name ~= '__builtin:item' then + if self.node ~= '' then + minetest.sound_play('more_fire_shatter', {gain = 1.0}) + for dx=-3,3 do + for dy=-3,3 do + for dz=-3,3 do + local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + local n = minetest.env:get_node(pos).name + if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <= 20 then + minetest.sound_play('more_fire_ignite', {pos = self.lastpos}) + minetest.env:set_node(p, {name='more_fire:napalm'}) + else + --minetest.env:remove_node(p) + minetest.sound_play('more_fire_ignite', {pos = self.lastpos}) + minetest.env:set_node(p, {name='fire:basic_flame'}) + end + end + end + end + end + self.object:remove() + end + else + if self.node ~= '' then + minetest.sound_play('more_fire_shatter', {gain = 1.0}) + for dx=-2,2 do + for dy=-2,2 do + for dz=-2,2 do + local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + local n = minetest.env:get_node(pos).name + if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <= 20 then + minetest.sound_play('more_fire_ignite', {pos = self.lastpos}) + minetest.env:set_node(p, {name='more_fire:napalm'}) + else + --minetest.env:remove_node(p) + minetest.sound_play('more_fire_ignite', {pos = self.lastpos}) + minetest.env:set_node(p, {name='fire:basic_flame'}) + end + end + end + end + end + self.object:remove() + end + end + end + + if self.lastpos.x~=nil then + if node.name ~= 'air' then + if self.node ~= '' then + minetest.sound_play('more_fire_shatter', {gain = 1.0}) + for dx=-1,1 do + for dy=-1,1 do + for dz=-1,1 do + local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} + local n = minetest.env:get_node(pos).name + if minetest.registered_nodes[n].groups.flammable or math.random(1, 100) <= 20 then + minetest.sound_play('more_fire_ignite', {pos = self.lastpos}) + minetest.env:set_node(p, {name='more_fire:napalm'}) + else + --minetest.env:remove_node(p) + minetest.sound_play('more_fire_ignite', {pos = self.lastpos}) + minetest.env:set_node(p, {name='fire:basic_flame'}) + end + end + end + end + end + self.object:remove() + napalm(self.lastpos) + end + end + self.lastpos={x=pos.x, y=pos.y, z=pos.z} +end + +minetest.register_entity('more_fire:molotov_entity', MORE_FIRE_MOLOTOV_ENTITY) + +minetest.override_item('more_fire:molotov_cocktail', {on_use = throw_cocktail}) + +minetest.register_node('more_fire:napalm', { + drawtype = 'firelike', + tiles = {{ + name='fire_basic_flame_animated.png', + animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}, + }}, + inventory_image = 'fire_basic_flame.png', + light_source = 14, + groups = {igniter=1,dig_immediate=3, not_in_creative_inventory =1, not_in_craft_guide=1}, + drop = '', + walkable = false, + buildable_to = true, + damage_per_second = 4, +}) + +minetest.register_abm({ + nodenames={'more_fire:napalm'}, + neighbors={'air'}, + interval = 1, + chance = 1, + action = function(pos,node,active_object_count,active_object_count_wider) + minetest.add_particlespawner({ + amount = 200, + time = 3, + minpos = pos, + maxpos = pos, + minvel = {x=2, y=-0.2, z=2}, + maxvel = {x=-2, y=-0.5, z=-2}, + minacc = {x=0, y=-6, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptime = 2, + maxexptime = 6, + minsize = 0.05, + maxsize = 0.5, + collisiondetection = false, + texture = 'more_fire_spark.png'}) + minetest.add_particlespawner({ + amount = 20, + time = 2, + minpos = pos, + maxpos = pos, + minvel = {x=-2, y=2, z=-2}, + maxvel = {x=1, y=3, z=1}, + minacc = {x=0, y=6, z=0}, + maxacc = {x=0, y=2, z=0}, + minexptime = 1, + maxexptime = 3, + minsize = 3, + maxsize = 5, + collisiondetection = false, + texture = 'more_fire_smoke.png'}) + minetest.add_particlespawner({ + amount = 10, + time = 4, + minpos = pos, + maxpos = pos, + minvel = {x=0, y= 3, z=0}, + maxvel = {x=0, y=5, z=0}, + minacc = {x=0.1, y=0.5, z=-0.1}, + maxacc = {x=-0.2, y=2, z=0.2}, + minexptime = 1, + maxexptime = 3, + minsize = 1, + maxsize = 3, + collisiondetection = false, + texture = 'more_fire_smoke.png'}) +local r = 0-- Radius for destroying + for x = pos.x-r, pos.x+r, 1 do + for y = pos.y-r, pos.y+r, 1 do + for z = pos.z-r, pos.z+r, 1 do + local cpos = {x=x,y=y,z=z} + if minetest.env:get_node(cpos).name == 'more_fire:napalm' then + minetest.env:set_node(cpos,{name='fire:basic_flame'}) + end + if math.random(0,1) == 1 + or minetest.env:get_node(cpos).name == 'more_fire:napalm' + then + minetest.env:remove_node(cpos) + end + end + end + end + end, +}) + +minetest.register_abm({ + nodenames={'fire:basic_flame'}, + neighbors={'air'}, + interval = 1, + chance = 2, + action = function(pos, node) + if + minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}).name == 'air' and + minetest.get_node({x=pos.x, y=pos.y+2.0, z=pos.z}).name == 'air' + then + minetest.add_particlespawner({ + amount = 30, + time = 2, + minpos = pos, + maxpos = pos, + minvel = {x=-2, y=2, z=-2}, + maxvel = {x=1, y=3, z=1}, + minacc = {x=0, y=6, z=0}, + maxacc = {x=0, y=2, z=0}, + minexptime = 1, + maxexptime = 3, + minsize = 10, + maxsize = 20, + collisiondetection = false, + texture = 'more_fire_smoke.png'}) + minetest.add_particlespawner({ + amount = 15, + time = 4, + minpos = pos, + maxpos = pos, + minvel = {x=0, y= 3, z=0}, + maxvel = {x=0, y=5, z=0}, + minacc = {x=0.1, y=0.5, z=-0.1}, + maxacc = {x=-0.2, y=2, z=0.2}, + minexptime = 1, + maxexptime = 3, + minsize = 5, + maxsize = 10, + collisiondetection = false, + texture ='more_fire_smoke.png'}) + end + end +}) + + --crafting recipes + minetest.register_craft( { +output = 'more_fire:molotov_cocktail', +recipe = { +{'farming:cotton'}, +{'more_fire:oil'}, +{'vessels:glass_bottle'}, +} +}) + +-- fuel recipes +minetest.register_craft({ + type = 'fuel', + recipe = 'more_fire:molotov_cocktail', + burntime = 5, +}) diff --git a/mods/more_fire/nodes.lua b/mods/more_fire/nodes.lua new file mode 100644 index 0000000..c68d8d3 --- /dev/null +++ b/mods/more_fire/nodes.lua @@ -0,0 +1,555 @@ +minetest.override_item('default:gravel', { + drop = { + max_items = 1, + items = { + { + items = {'more_fire:flintstone'}, + rarity = 15, + }, + { + items = {'default:gravel'}, + } + } + }, +}) + +minetest.register_node(':default:torch', { + description = 'Torch', + drawtype = 'nodebox', + tiles = { + {name = 'more_fire_torch_top.png'}, + {name = 'more_fire_torch_bottom.png'}, + {name = 'more_fire_torch_side.png'}, + }, + inventory_image = 'more_fire_torch_inv.png', + wield_image = 'more_fire_torch_inv.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + light_source = LIGHT_MAX - 1, + node_box = { + type = 'wallmounted', + wall_top = {-0.0625, -0.0625, -0.0625, 0.0625, 0.5 , 0.0625}, + wall_bottom = {-0.0625, -0.5 , -0.0625, 0.0625, 0.0625, 0.0625}, + wall_side = {-0.5 , -0.5 , -0.0625, -0.375, 0.0625, 0.0625}, + }, + selection_box = { + type = 'wallmounted', + wall_top = {-0.1, -0.05, -0.1, 0.1, 0.5 , 0.1}, + wall_bottom = {-0.1, -0.5 , -0.1, 0.1, 0.0625, 0.1}, + wall_side = {-0.35, -0.5 , -0.1, -0.5, 0.0625, 0.1}, + }, + groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, hot = 2, kindling=1}, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + if finite_torches == true then + local timer = minetest.get_node_timer(pos) + timer:start(960) + end + end, + on_timer = function(pos, elapsed) + local timer = minetest.get_node_timer(pos) + local node = minetest.get_node(pos) + minetest.swap_node(pos, {name = 'more_fire:torch_stub', param2 = node.param2}) + timer:stop() + end, +}) + +minetest.register_node('more_fire:torch_weak', { + description = 'Weak Torch', + drawtype = 'nodebox', + tiles = { + {name = 'more_fire_torch_top.png'}, + {name = 'more_fire_torch_bottom.png'}, + {name = 'more_fire_torch_side.png'}, + }, + inventory_image = 'more_fire_torch_inv.png', + wield_image = 'more_fire_torch_inv.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + light_source = LIGHT_MAX - 6, + node_box = { + type = 'wallmounted', + wall_top = {-0.0625, -0.0625, -0.0625, 0.0625, 0.5 , 0.0625}, + wall_bottom = {-0.0625, -0.5 , -0.0625, 0.0625, 0.0625, 0.0625}, + wall_side = {-0.5 , -0.5 , -0.0625, -0.375, 0.0625, 0.0625}, + }, + selection_box = { + type = 'wallmounted', + wall_top = {-0.1, -0.05, -0.1, 0.1, 0.5 , 0.1}, + wall_bottom = {-0.1, -0.5 , -0.1, 0.1, 0.0625, 0.1}, + wall_side = {-0.35, -0.5 , -0.1, -0.5, 0.0625, 0.1}, + }, + groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, hot = 2, kindling=1}, + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + if finite_torches == true then + local timer = minetest.get_node_timer(pos) + timer:start(480) + end + end, + on_timer = function(pos, elapsed) + local timer = minetest.get_node_timer(pos) + local node = minetest.get_node(pos) + minetest.swap_node(pos, {name = 'more_fire:torch_stub', param2 = node.param2}) + timer:stop() + end, +}) + +minetest.register_node('more_fire:torch_stub', { + description = 'burnt out torch', + drawtype = 'nodebox', + tiles = { + {name = 'more_fire_torch_stub_top.png'}, + {name = 'more_fire_torch_stub_bottom.png'}, + {name = 'more_fire_torch_stub_side.png'}, + }, + inventory_image = 'more_fire_torch_stub_inv.png', + wield_image = 'more_fire_torch_stub_inv.png', + paramtype = 'light', + paramtype2 = 'wallmounted', + sunlight_propagates = true, + is_ground_content = false, + walkable = false, + node_box = { + type = 'wallmounted', + wall_top = {-0.0625, 0.2, -0.0625, 0.0625, 0.5 , 0.0625}, + wall_bottom = {-0.0625, -0.5 , -0.0625, 0.0625, -0.2, 0.0625}, + wall_side = {-0.5 , -0.5 , -0.0625, -0.375, -0.2, 0.0625}, + }, + selection_box = { + type = 'wallmounted', + wall_top = {-0.1, 0.2, -0.1, 0.1, 0.5 , 0.1}, + wall_bottom = {-0.1, -0.5 , -0.1, 0.1, -0.2, 0.1}, + wall_side = {-0.35, -0.5 , -0.1, -0.5, -0.2, 0.1}, + }, + groups = {choppy = 2, dig_immediate = 3, flammable = 1, attached_node = 1, not_in_creative_inventory = 1, kindling=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_node('more_fire:charcoal_block', { + description = 'Charcoal Block', + tiles = {'more_fire_charcoal_block.png'}, + is_ground_content = true, + groups = {oddly_breakable_by_hand=2,cracky=3,flammable=1,}, +}) + +minetest.register_node('more_fire:kindling', { + description = 'Kindling', + drawtype = 'mesh', + mesh = 'more_fire_kindling.obj', + tiles = {'more_fire_campfire_logs.png'}, + inventory_image = 'more_fire_kindling.png', + wield_image = 'more_fire_kindling.png', + walkable = false, + is_ground_content = true, + groups = {dig_immediate=2, flammable=1,}, + paramtype = 'light', + drop = 'more_fire:kindle 4', + selection_box = { + type = 'fixed', + fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('fuel', 4) + end, +}) + +minetest.register_node('more_fire:embers', { + description = 'Campfire', + drawtype = 'mesh', + mesh = 'more_fire_kindling.obj', + tiles = {'more_fire_campfire_logs.png'}, + inventory_image = 'more_fire_campfire.png', + wield_image = 'more_fire_campfire.png', + walkable = false, + is_ground_content = true, + groups = {dig_immediate=3, flammable=1,}, + paramtype = 'light', + light_source = 5, + drop = 'more_fire:kindling', + selection_box = { + type = 'fixed', + fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local timer = minetest.get_node_timer(pos) + meta:set_string('formspec', more_fire.embers_formspec) + meta:set_string('infotext', 'Campfire'); + local inv = meta:get_inventory() + inv:set_size('fuel', 1) + timer:start(180) + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, + on_timer = function(pos, elapsed) + local timer = minetest.get_node_timer(pos) + timer:stop() + minetest.set_node(pos, {name = 'more_fire:kindling'}) + end, + after_place_node = function(pos) + local timer = minetest.get_node_timer(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local fuel = nil + local fuellist = inv:get_list('fuel') + if fuellist then + fuel = minetest.get_craft_result({method = 'fuel', width = 1, items = fuellist}) + end + if fuel.time <= 0 then + if inv:is_empty('fuel') then + timer:start(180) + end + end + end, +}) + +minetest.register_node('more_fire:campfire', { + description = 'Burning Campfire', + drawtype = 'mesh', + mesh = 'more_fire_campfire.obj', + tiles = { + {name='fire_basic_flame_animated.png', animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='more_fire_campfire_logs.png'}}, + inventory_image = 'more_fire_campfire.png', + wield_image = 'more_fire_campfire.png', + paramtype = 'light', + walkable = false, + damage_per_second = 1, + light_source = 14, + is_ground_content = true, + groups = {cracky=2,hot=2,attached_node=1,igniter=1,not_in_creative_inventory=1}, + selection_box = { + type = 'fixed', + fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, + }, + can_dig = function(pos,player) + local meta = minetest.env:get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, + get_staticdata = function(self) +end, +}) + +minetest.register_node('more_fire:kindling_contained', { + description = 'Contained Kindling', + drawtype = 'mesh', + mesh = 'more_fire_kindling_contained.obj', + tiles = {'more_fire_campfire_logs.png'}, + inventory_image = 'more_fire_kindling_contained.png', + wield_image = 'more_fire_kindling.png', + walkable = false, + is_ground_content = true, + groups = {dig_immediate=3,flammable=1}, + paramtype = 'light', + selection_box = { + type = 'fixed', + fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('fuel', 4) + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, +}) + +minetest.register_node('more_fire:embers_contained', { + description = 'Contained Campfire', + drawtype = 'mesh', + mesh = 'more_fire_kindling_contained.obj', + tiles = {'more_fire_campfire_logs.png'}, + walkable = false, + is_ground_content = true, + groups = {dig_immediate=3, flammable=1, not_in_creative_inventory=1}, + paramtype = 'light', + light_source = 5, + drop = 'more_fire:kindling_contained', + inventory_image = 'more_fire_campfire_contained.png', + wield_image = 'more_fire_campfire_contained.png', + selection_box = { + type = 'fixed', + fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local timer = minetest.get_node_timer(pos) + meta:set_string('formspec', more_fire.embers_formspec) + meta:set_string('infotext', 'Campfire'); + local inv = meta:get_inventory() + inv:set_size('fuel', 4) + timer:start(190) + print 'called the on_construct function.' + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, + on_timer = function(pos, elapsed) + local timer = minetest.get_node_timer(pos) + timer:stop() + minetest.set_node(pos, {name = 'more_fire:kindling_contained'}) + end, + after_place_node = function(pos) + local timer = minetest.get_node_timer(pos) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local fuel = nil + local fuellist = inv:get_list('fuel') + if fuellist then + fuel = minetest.get_craft_result({method = 'fuel', width = 1, items = fuellist}) + end + if fuel.time <= 0 then + if inv:is_empty('fuel') then + timer:start(190) + end + end +end, +}) + +minetest.register_node('more_fire:campfire_contained', { + description = 'Contained Campfire', + drawtype = 'mesh', + mesh = 'more_fire_contained_campfire.obj', + tiles = { + {name='fire_basic_flame_animated.png', animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}}, {name='more_fire_campfire_logs.png'}}, + inventory_image = 'more_fire_campfire_contained.png', + wield_image = 'more_fire_campfire_contained.png', + paramtype = 'light', + walkable = false, + damage_per_second = 1, + drop = 'more_fire:charcoal', + light_source = 14, + is_ground_content = true, + groups = {cracky=2,hot=2,attached_node=1,dig_immediate=3,not_in_creative_inventory=1}, + selection_box = { + type = 'fixed', + fixed = { -0.48, -0.5, -0.48, 0.48, 0.0, 0.48 }, + }, + can_dig = function(pos,player) + local meta = minetest.env:get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, + get_staticdata = function(self) + end, +}) + +minetest.register_node('more_fire:oil_lamp_on', { + description = 'oil lamp', + drawtype = 'mesh', + mesh = 'more_fire_lamp_wall.obj', + tiles = {'more_fire_lamp.png'}, + groups = {choppy=2, dig_immediate=2, not_in_creative_inventory=1}, + paramtype = 'light', + paramtype2 = 'facedir', + walkable = false, + light_source = LIGHT_MAX, + drop = 'more_fire:oil_lamp_off', + selection_box = { + type = 'fixed', + fixed = {-.2, -.4, -0.1, 0.2, .35, .5}, + }, + on_timer = function(pos, itemstack) + local node = minetest.get_node(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('fuel', 'more_fire:oil') then + local fuelstack = inv:get_stack('fuel', 1) + timer:start(12*60) + fuelstack:take_item() + inv:set_stack('fuel', 1, fuelstack) + if inv:is_empty('fuel') then + minetest.set_node(pos, {name = 'more_fire:oil_lamp_off', param2=node.param2}) + end + timer:stop() + elseif inv:is_empty('fuel') then + minetest.set_node(pos, {name = 'more_fire:oil_lamp_off', param2=node.param2}) + timer:stop() + end + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty('fuel') + end, +}) + +minetest.register_node('more_fire:oil_lamp_off', { + description = 'oil lamp', + drawtype = 'mesh', + mesh = 'more_fire_lamp_wall.obj', + tiles = {'more_fire_lamp.png'}, + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + walkable = false, + inventory_image = 'more_fire_lamp_inv.png', + wield_image = 'more_fire_lamp_inv.png', + light_source = 1, + selection_box = { + type = 'fixed', + fixed = {-.2, -.4, -0.1, 0.2, .35, .5}, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('fuel', 1) + meta:set_string('formspec', + 'size[8,6]'.. + 'label[2,.75;Add lantern oil for a bright flame.]' .. + 'list[current_name;fuel;1,.5;1,1]'.. + 'list[current_player;main;0,2;8,4;]') + meta:set_string('infotext', 'Oil Lantern') + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + local node = minetest.get_node(pos) + if inv:contains_item('fuel', 'more_fire:oil') then + minetest.swap_node(pos, {name = 'more_fire:oil_lamp_on', param2=node.param2}) + timer:start(12*60) --one oil unit will burn for 12 minutes + meta:set_string('infotext', 'Burning Oil Lamp') + meta:set_string('formspec', + 'size[8,6]'.. + 'label[2,.75;keep filled with lantern oil for a bright flame.]' .. + 'list[current_name;fuel;1,.5;1,1]'.. + 'list[current_player;main;0,2;8,4;]') + end + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, +}) + +minetest.register_node('more_fire:oil_lamp_table_on', { + description = 'oil lamp', + drawtype = 'mesh', + mesh = 'more_fire_lamp_table.obj', + tiles = {'more_fire_lamp.png'}, + groups = {choppy=2, dig_immediate=2, not_in_creative_inventory=1}, + paramtype = 'light', + paramtype2 = 'facedir', + walkable = false, + light_source = LIGHT_MAX, + drop = 'more_fire:oil_lamp_off', + selection_box = { + type = 'fixed', + fixed = {-.2, -.5, -0.2, 0.2, .25, .2}, + }, + on_timer = function(pos, itemstack) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('fuel', 'more_fire:oil') then + local fuelstack = inv:get_stack('fuel', 1) + timer:start(12*60) + fuelstack:take_item() + inv:set_stack('fuel', 1, fuelstack) + if inv:is_empty('fuel') then + minetest.set_node(pos, {name = 'more_fire:oil_lamp_table_off'}) + end + timer:stop() + elseif inv:is_empty('fuel') then + minetest.set_node(pos, {name = 'more_fire:oil_lamp_table_off'}) + timer:stop() + end + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty('fuel') + end, +}) + +minetest.register_node('more_fire:oil_lamp_table_off', { + description = 'oil lamp', + drawtype = 'mesh', + mesh = 'more_fire_lamp_table.obj', + tiles = {'more_fire_lamp.png'}, + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + walkable = false, + inventory_image = 'more_fire_lamp_table_inv.png', + wield_image = 'more_fire_lamp_table_inv.png', + light_source = 1, + selection_box = { + type = 'fixed', + fixed = {-.2, -.5, -0.2, 0.2, .25, .2}, + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('fuel', 1) + meta:set_string('formspec', + 'size[8,6]'.. + 'label[2,.75;Add lantern oil for a bright flame.]' .. + 'list[current_name;fuel;1,.5;1,1]'.. + 'list[current_player;main;0,2;8,4;]') + meta:set_string('infotext', 'Oil Lantern') + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('fuel', 'more_fire:oil') then + minetest.swap_node(pos, {name = 'more_fire:oil_lamp_table_on'}) + timer:start(12*60) --one oil unit will burn for 12 minutes + meta:set_string('infotext', 'Burning Oil Lamp') + meta:set_string('formspec', + 'size[8,6]'.. + 'label[2,.75;keep filled with lantern oil for a bright flame.]' .. + 'list[current_name;fuel;1,.5;1,1]'.. + 'list[current_player;main;0,2;8,4;]') + end + end, + can_dig = function(pos, player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + if not inv:is_empty('fuel') then + return false + end + return true + end, +}) diff --git a/mods/more_fire/readme.md b/mods/more_fire/readme.md new file mode 100644 index 0000000..5db7f10 --- /dev/null +++ b/mods/more_fire/readme.md @@ -0,0 +1,36 @@ +If you have any ideas for more fire related things please let me know, or consider forking the project on GIT. I'm always ready to add more good stuff. + +# Mod Contributors +Nathan +Napiophelios + +# More_fire +This is a Minetest mod that adds more/better fire related stuff + +## Forum Topic +https://forum.minetest.net/viewtopic.php?f=11&t=10372 + +## Licensing +CC0 + +## Dependencies +- default +- farming +- fire +- vessels + + +# +Items currently included: +- Campfires +- Finite torches, they burn out (configurable in config.txt) +- oil lanterns, use these instead of torches +- oil for the lanterns of course +- a lighter, for starting the campfires. +- charcoal, much like coal, but made by cooking wood +- a smoke bomb +- molotov cocktail + +# +Planned: +Cooking capabilities in the campfires. diff --git a/mods/more_fire/smokebomb.lua b/mods/more_fire/smokebomb.lua new file mode 100644 index 0000000..e586ab2 --- /dev/null +++ b/mods/more_fire/smokebomb.lua @@ -0,0 +1,293 @@ +--Smoke Bomb_[rev001] +--base code is from throwing enhanced and potions mods + + local MOD_NAME = minetest.get_current_modname() + local MOD_PATH = minetest.get_modpath(MOD_NAME) + local Vec3 = dofile(MOD_PATH..'/lib/Vec3_1-0.lua') + +minetest.register_craftitem('more_fire:smokebomb', { + description = 'Smoke Bomb', + inventory_image = 'more_fire_smokebomb.png', +on_place = function(itemstack, user, pointed_thing) + itemstack:take_item() + minetest.sound_play('more_fire_shatter', {gain = 1.0}) + --Shattered glass Particles + minetest.add_particlespawner({ + amount = 40, + time = 0.1, + minpos = pointed_thing.above, + maxpos = pointed_thing.above, + minvel = {x=2, y=0.2, z=2}, + maxvel = {x=-2, y=0.5, z=-2}, + minacc = {x=0, y=-6, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptime = 0.5, + maxexptime = 2, + minsize = 0.2, + maxsize = 5, + collisiondetection = true, + texture = 'more_fire_shatter.png'}) + --smoke particles + minetest.add_particlespawner({ + amount = 400, + time = 0.1, + minpos = pointed_thing.above, + maxpos = pointed_thing.above, + minvel = {x=2, y=0.2, z=2}, + maxvel = {x=-2, y=0.5, z=-2}, + minacc = {x=0, y=-6, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptime = 5, + maxexptime = 2, + minsize = 5, + maxsize = 20, + collisiondetection = true, + texture = 'more_fire_smoke.png'}) + --more smoke particles + minetest.add_particlespawner({ + amount = 600, + time = 1, + minpos = pointed_thing.above, + maxpos = pointed_thing.above, + minvel = {x=10, y= 3, z=10}, + maxvel = {x=-10, y= 3, z=-10}, + minacc = {x=2, y=2, z=2}, + maxacc = {x=-2, y=1, z=-2}, + minexptime = 2, + maxexptime = 3, + minsize = 2, + maxsize = 20, + collisiondetection = true, + texture = 'more_fire_smoke.png'}) + --even more smoke particles + minetest.add_particlespawner({ + amount = 400, + time = 1, + minpos = pointed_thing.above, + maxpos = pointed_thing.above, + minvel = {x=0.2, y=0.2, z=0.2}, + maxvel = {x=-0.2, y=0.5, z=-0.2}, + minacc = {x=10, y= 2, z=10}, + maxacc = {x=-10, y= 1, z=-10}, + minexptime = 2, + maxexptime = 3, + minsize = 20, + maxsize = 2, + collisiondetection = true, + texture = 'more_fire_smoke.png'}) + local dir = Vec3(user:get_look_dir()) *20 + minetest.add_particle( + {x=user:getpos().x, y=user:getpos().y+1.5, z=user:getpos().z}, {x=dir.x, y=dir.y, z=dir.z}, {x=0, y=-10, z=0}, 0.2, + 6, false, 'more_fire_smokebomb.png') + return itemstack + end, + }) + + local function throw_smokebomb(item, player) + local playerpos = player:getpos() + local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.625,z=playerpos.z}, 'more_fire:smokebomb_entity') + local dir = player:get_look_dir() + obj:setvelocity({x=dir.x*30, y=dir.y*30, z=dir.z*30}) + obj:setacceleration({x=dir.x*-3, y=-dir.y^8*80-10, z=dir.z*-3}) + if not minetest.setting_getbool('creative_mode') then + item:take_item() + end + return item +end + + local radius = 5 + +local function add_effects(pos, radius) + minetest.add_particlespawner({ + amount = 200, + time = 0.1, + minpos = vector.subtract(pos, radius / 3), + maxpos = vector.add(pos, radius / 3), + minvel = {x=2, y=0.2, z=2}, + maxvel = {x=-2, y=-0.5, z=-2}, + minacc = {x=1, y=-6, z=1}, + maxacc = {x=1, y=-10, z=1}, + minexptime = 1, + maxexptime = 5, + minsize = 10, + maxsize = 20, + texture = 'more_fire_smoke.png',}) + minetest.add_particlespawner({ + amount = 100, + time = 2, + minpos = vector.subtract(pos, radius / 2), + maxpos = vector.add(pos, radius / 2), + minvel = {x=0.2, y=0.2, z=0.2}, + maxvel = {x=-0.2, y=0.5, z=-0.2}, + minacc = {x=10, y= 2, z=10}, + maxacc = {x=-10, y= 1, z=-10}, + minexptime =1, + maxexptime = 3, + minsize = 5, + maxsize = 15, + texture = 'more_fire_smoke.png',}) +end + +local function plume(pos) + minetest.set_node(pos, {name='more_fire:plume'}) + minetest.get_node_timer(pos):start(3.0) + add_effects(pos, radius) +end + +local MORE_FIRE_SMOKEBOMB_ENTITY = { + timer=0, + collisionbox = {0,0,0,0,0,0}, + physical = false, + textures = {'more_fire_smokebomb.png'}, + lastpos={}, +} + +MORE_FIRE_SMOKEBOMB_ENTITY.on_step = function(self, dtime) + self.timer = self.timer + dtime + local pos = self.object:getpos() + local node = minetest.get_node(pos) +minetest.add_particlespawner({ + amount = 10, + time = 0.5, + minpos = pos, + maxpos = pos, + minvel = {x=-0, y=0, z=-0.5}, + maxvel = {x=0, y=0, z=-0.75}, + minacc = vector.new(), + maxacc = vector.new(), + minexptime = 0.5, + maxexptime = 1, + minsize = 0.25, + maxsize = 0.5, + texture = 'more_fire_smoke.png',}) + minetest.add_particlespawner({ + amount = 10, + time = 0.25, + minpos = pos, + maxpos = pos, + minvel = {x=-0, y=0, z=-0.5}, + maxvel = {x=0, y=0, z=-0.75}, + minacc = {x=0, y=0, z=-0.75}, + maxacc = {x=-0, y=0, z=-0.5}, + minexptime = 0.25, + maxexptime = 0.5, + minsize = 0.5, + maxsize = 0.75, + texture = 'more_fire_smoke.png',}) + if self.timer>0.2 then + local objs = minetest.env:get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1) + for k, obj in pairs(objs) do + if obj:get_luaentity() ~= nil then + if obj:get_luaentity().name ~= 'more_fire:smokebomb_entity' and obj:get_luaentity().name ~= '__builtin:item' then + if self.node ~= '' then + minetest.sound_play('more_fire_shatter', {gain = 1.0}) + local damage = 1 + obj:punch(self.object, 1.0, { + full_punch_interval=1.0, + damage_groups={fleshy=damage}, + }, nil) + self.object:remove() + end + end + end + end + if self.lastpos.x~=nil then + if node.name ~= 'air' then + self.object:remove() + plume(self.lastpos) + end + end + self.lastpos={x=pos.x, y=pos.y, z=pos.z} +end +end + +minetest.register_entity('more_fire:smokebomb_entity', MORE_FIRE_SMOKEBOMB_ENTITY) + +minetest.override_item('more_fire:smokebomb', {on_use = throw_smokebomb}) + +minetest.register_node('more_fire:plume', { +drawtype = 'plantlike', +description = 'Smoke Plume', + tiles = {{ + name='more_fire_smoke_animated.png', + animation={type='vertical_frames', aspect_w=16, aspect_h=16, length=1}, + }}, + inventory_image = 'more_fire_smoke.png', + light_source = 8, + groups = {dig_immediate=3, not_in_creative_inventory =1, not_in_craft_guide=1}, + drop = '', + walkable = false, + buildable_to = true, + on_timer = function(pos, elapsed) + minetest.remove_node(pos) + end, + damage_per_second = 1, +}) + +minetest.register_abm({ + nodenames={'more_fire:plume'}, + neighbors={'air'}, + interval = 1, + chance = 1, + action = function(pos, node) + if + minetest.get_node({x=pos.x, y=pos.y+1.0, z=pos.z}).name == 'air' and + minetest.get_node({x=pos.x, y=pos.y+2.0, z=pos.z}).name == 'air' + then + minetest.add_particlespawner({ + amount = 400, + time = 3, + minpos = pos, + maxpos = pos, + minvel = {x=2, y=-0.2, z=2}, + maxvel = {x=-2, y=-0.5, z=-2}, + minacc = {x=0, y=-6, z=0}, + maxacc = {x=0, y=-10, z=0}, + minexptime = 2, + maxexptime = 6, + minsize = 0.05, + maxsize = 0.5, + collisiondetection =false, + texture = 'more_fire_smoke.png'}) + minetest.add_particlespawner({ + amount = 50, + time = 2, + minpos = pos, + maxpos = pos, + minvel = {x=-2, y=0.5, z=-2}, + maxvel = {x=2, y=0.5, z=2}, + minacc = {x=0, y=0.04, z=0}, + maxacc = {x=0, y=0.01, z=0}, + minexptime = 1, + maxexptime = 3, + minsize = 3, + maxsize = 5, + collisiondetection = false, + texture = 'more_fire_smoke.png'}) + minetest.add_particlespawner({ + amount = 400, + time = 2, + minpos = vector.subtract(pos, radius / 2), + maxpos = vector.add(pos, radius / 2), + minvel = {x=0.2, y=2, z=0.2}, + maxvel = {x=-0.2, y=2, z=-0.2}, + minacc = {x=10, y= 2, z=10}, + maxacc = {x=-10, y= 1, z=-10}, + minexptime =1, + maxexptime = 3, + minsize = 5, + maxsize = 15, + texture = 'more_fire_smoke.png',}) + end + end +}) + + --crafting recipes + minetest.register_craft( { +output = 'more_fire:smoke_bomb', +recipe = { +{'more_fire:flintstone'}, +{'more_fire:charcoal'}, +{'vessels:glass_bottle'}, +} +}) diff --git a/mods/more_fire/sounds/more_fire_ignite.0.ogg b/mods/more_fire/sounds/more_fire_ignite.0.ogg new file mode 100644 index 0000000..73494f2 Binary files /dev/null and b/mods/more_fire/sounds/more_fire_ignite.0.ogg differ diff --git a/mods/more_fire/sounds/more_fire_shatter.0.ogg b/mods/more_fire/sounds/more_fire_shatter.0.ogg new file mode 100644 index 0000000..b6cc9e8 Binary files /dev/null and b/mods/more_fire/sounds/more_fire_shatter.0.ogg differ diff --git a/mods/more_fire/sounds/more_fire_shatter.1.ogg b/mods/more_fire/sounds/more_fire_shatter.1.ogg new file mode 100644 index 0000000..2577f40 Binary files /dev/null and b/mods/more_fire/sounds/more_fire_shatter.1.ogg differ diff --git a/mods/more_fire/sounds/spark.ogg b/mods/more_fire/sounds/spark.ogg new file mode 100644 index 0000000..cc35717 Binary files /dev/null and b/mods/more_fire/sounds/spark.ogg differ diff --git a/mods/more_fire/textures/more_fire_campfire.png b/mods/more_fire/textures/more_fire_campfire.png new file mode 100644 index 0000000..d402fb5 Binary files /dev/null and b/mods/more_fire/textures/more_fire_campfire.png differ diff --git a/mods/more_fire/textures/more_fire_campfire_active.png b/mods/more_fire/textures/more_fire_campfire_active.png new file mode 100644 index 0000000..5af9e76 Binary files /dev/null and b/mods/more_fire/textures/more_fire_campfire_active.png differ diff --git a/mods/more_fire/textures/more_fire_campfire_contained.png b/mods/more_fire/textures/more_fire_campfire_contained.png new file mode 100644 index 0000000..4a161ea Binary files /dev/null and b/mods/more_fire/textures/more_fire_campfire_contained.png differ diff --git a/mods/more_fire/textures/more_fire_campfire_inactive.png b/mods/more_fire/textures/more_fire_campfire_inactive.png new file mode 100644 index 0000000..74b2cbd Binary files /dev/null and b/mods/more_fire/textures/more_fire_campfire_inactive.png differ diff --git a/mods/more_fire/textures/more_fire_campfire_logs.png b/mods/more_fire/textures/more_fire_campfire_logs.png new file mode 100644 index 0000000..ceffba8 Binary files /dev/null and b/mods/more_fire/textures/more_fire_campfire_logs.png differ diff --git a/mods/more_fire/textures/more_fire_charcoal_block.png b/mods/more_fire/textures/more_fire_charcoal_block.png new file mode 100644 index 0000000..8f83bf6 Binary files /dev/null and b/mods/more_fire/textures/more_fire_charcoal_block.png differ diff --git a/mods/more_fire/textures/more_fire_charcoal_lump.png b/mods/more_fire/textures/more_fire_charcoal_lump.png new file mode 100644 index 0000000..7889ddb Binary files /dev/null and b/mods/more_fire/textures/more_fire_charcoal_lump.png differ diff --git a/mods/more_fire/textures/more_fire_chard_stick.png b/mods/more_fire/textures/more_fire_chard_stick.png new file mode 100644 index 0000000..427cda9 Binary files /dev/null and b/mods/more_fire/textures/more_fire_chard_stick.png differ diff --git a/mods/more_fire/textures/more_fire_embers.png b/mods/more_fire/textures/more_fire_embers.png new file mode 100644 index 0000000..b425aea Binary files /dev/null and b/mods/more_fire/textures/more_fire_embers.png differ diff --git a/mods/more_fire/textures/more_fire_flintstone.png b/mods/more_fire/textures/more_fire_flintstone.png new file mode 100644 index 0000000..da7fd05 Binary files /dev/null and b/mods/more_fire/textures/more_fire_flintstone.png differ diff --git a/mods/more_fire/textures/more_fire_grass_dried.png b/mods/more_fire/textures/more_fire_grass_dried.png new file mode 100644 index 0000000..df19c16 Binary files /dev/null and b/mods/more_fire/textures/more_fire_grass_dried.png differ diff --git a/mods/more_fire/textures/more_fire_kindle.png b/mods/more_fire/textures/more_fire_kindle.png new file mode 100644 index 0000000..44c4dcd Binary files /dev/null and b/mods/more_fire/textures/more_fire_kindle.png differ diff --git a/mods/more_fire/textures/more_fire_kindling.png b/mods/more_fire/textures/more_fire_kindling.png new file mode 100644 index 0000000..e8868fc Binary files /dev/null and b/mods/more_fire/textures/more_fire_kindling.png differ diff --git a/mods/more_fire/textures/more_fire_kindling_contained.png b/mods/more_fire/textures/more_fire_kindling_contained.png new file mode 100644 index 0000000..db6befe Binary files /dev/null and b/mods/more_fire/textures/more_fire_kindling_contained.png differ diff --git a/mods/more_fire/textures/more_fire_lamp.png b/mods/more_fire/textures/more_fire_lamp.png new file mode 100644 index 0000000..7856dda Binary files /dev/null and b/mods/more_fire/textures/more_fire_lamp.png differ diff --git a/mods/more_fire/textures/more_fire_lamp_inv.png b/mods/more_fire/textures/more_fire_lamp_inv.png new file mode 100644 index 0000000..e5d9c10 Binary files /dev/null and b/mods/more_fire/textures/more_fire_lamp_inv.png differ diff --git a/mods/more_fire/textures/more_fire_lamp_table_inv.png b/mods/more_fire/textures/more_fire_lamp_table_inv.png new file mode 100644 index 0000000..72ae83a Binary files /dev/null and b/mods/more_fire/textures/more_fire_lamp_table_inv.png differ diff --git a/mods/more_fire/textures/more_fire_lava_blob.png b/mods/more_fire/textures/more_fire_lava_blob.png new file mode 100644 index 0000000..15bc8ca Binary files /dev/null and b/mods/more_fire/textures/more_fire_lava_blob.png differ diff --git a/mods/more_fire/textures/more_fire_lighter.png b/mods/more_fire/textures/more_fire_lighter.png new file mode 100644 index 0000000..1926e34 Binary files /dev/null and b/mods/more_fire/textures/more_fire_lighter.png differ diff --git a/mods/more_fire/textures/more_fire_molotov_cocktail.png b/mods/more_fire/textures/more_fire_molotov_cocktail.png new file mode 100644 index 0000000..da14750 Binary files /dev/null and b/mods/more_fire/textures/more_fire_molotov_cocktail.png differ diff --git a/mods/more_fire/textures/more_fire_oil.png b/mods/more_fire/textures/more_fire_oil.png new file mode 100644 index 0000000..2d2ed58 Binary files /dev/null and b/mods/more_fire/textures/more_fire_oil.png differ diff --git a/mods/more_fire/textures/more_fire_shatter.png b/mods/more_fire/textures/more_fire_shatter.png new file mode 100644 index 0000000..41f6ec0 Binary files /dev/null and b/mods/more_fire/textures/more_fire_shatter.png differ diff --git a/mods/more_fire/textures/more_fire_smoke.png b/mods/more_fire/textures/more_fire_smoke.png new file mode 100644 index 0000000..b4b97ba Binary files /dev/null and b/mods/more_fire/textures/more_fire_smoke.png differ diff --git a/mods/more_fire/textures/more_fire_smoke_animated.png b/mods/more_fire/textures/more_fire_smoke_animated.png new file mode 100644 index 0000000..38af01f Binary files /dev/null and b/mods/more_fire/textures/more_fire_smoke_animated.png differ diff --git a/mods/more_fire/textures/more_fire_smokebomb.png b/mods/more_fire/textures/more_fire_smokebomb.png new file mode 100644 index 0000000..ff6db32 Binary files /dev/null and b/mods/more_fire/textures/more_fire_smokebomb.png differ diff --git a/mods/more_fire/textures/more_fire_spark.png b/mods/more_fire/textures/more_fire_spark.png new file mode 100644 index 0000000..a575518 Binary files /dev/null and b/mods/more_fire/textures/more_fire_spark.png differ diff --git a/mods/more_fire/textures/more_fire_torch_bottom.png b/mods/more_fire/textures/more_fire_torch_bottom.png new file mode 100644 index 0000000..a0d6a20 Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_bottom.png differ diff --git a/mods/more_fire/textures/more_fire_torch_inv.png b/mods/more_fire/textures/more_fire_torch_inv.png new file mode 100644 index 0000000..df2ea0f Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_inv.png differ diff --git a/mods/more_fire/textures/more_fire_torch_side.png b/mods/more_fire/textures/more_fire_torch_side.png new file mode 100644 index 0000000..a7ba0f5 Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_side.png differ diff --git a/mods/more_fire/textures/more_fire_torch_stub_bottom.png b/mods/more_fire/textures/more_fire_torch_stub_bottom.png new file mode 100644 index 0000000..39c4d30 Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_stub_bottom.png differ diff --git a/mods/more_fire/textures/more_fire_torch_stub_inv.png b/mods/more_fire/textures/more_fire_torch_stub_inv.png new file mode 100644 index 0000000..b2f9fdc Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_stub_inv.png differ diff --git a/mods/more_fire/textures/more_fire_torch_stub_side.png b/mods/more_fire/textures/more_fire_torch_stub_side.png new file mode 100644 index 0000000..9fc7541 Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_stub_side.png differ diff --git a/mods/more_fire/textures/more_fire_torch_stub_top.png b/mods/more_fire/textures/more_fire_torch_stub_top.png new file mode 100644 index 0000000..4103044 Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_stub_top.png differ diff --git a/mods/more_fire/textures/more_fire_torch_top.png b/mods/more_fire/textures/more_fire_torch_top.png new file mode 100644 index 0000000..af41037 Binary files /dev/null and b/mods/more_fire/textures/more_fire_torch_top.png differ diff --git a/mods/more_fire/tools.lua b/mods/more_fire/tools.lua new file mode 100644 index 0000000..d9292b9 --- /dev/null +++ b/mods/more_fire/tools.lua @@ -0,0 +1,36 @@ +minetest.register_tool('more_fire:lighter', { + description = 'Lighter', + inventory_image = 'more_fire_lighter.png', + stack_max = 1, + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level = 0, + groupcaps = { + flammable = {uses = 200, maxlevel = 1}, + } + }, + on_use = function(itemstack, user, pointed_thing) + minetest.sound_play("spark", {gain = 1.0, max_hear_distance = 32, loop = false }) + if pointed_thing.type == 'node' + and string.find(minetest.get_node(pointed_thing.under).name, 'more_fire:kindling') + then + burn(pointed_thing) + itemstack:add_wear(65535/200) + return itemstack + end + end, +}) + +local USES = 20 +minetest.register_tool('more_fire:marker', { + description = 'chard stick', + inventory_image = 'more_fire_chard_stick.png', + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type == 'node' then + minetest.set_node(pointed_thing.above, {name = "more_fire:marking", param2=minetest.dir_to_facedir(user:get_look_dir())}) + itemstack:add_wear(65535 / (USES - 1)) + return itemstack + end + end, +}) diff --git a/mods/mytreasure/cave.lua b/mods/mytreasure/cave.lua new file mode 100644 index 0000000..ef097d1 --- /dev/null +++ b/mods/mytreasure/cave.lua @@ -0,0 +1,287 @@ +local function coins(pos) + minetest.add_particlespawner(50, 0.4, + pos, pos, + {x=2, y=0.2, z=2}, {x=-2, y=2, z=-2}, + {x=0, y=-6, z=0}, {x=0, y=-10, z=0}, + 0.5, 2, + 0.2, 5, + true, "mytreasure_coin.png") +end + +minetest.register_node("mytreasure:cave1",{ + description = "Cave Treasure 1", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chest.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 2, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, + drop = { + max_items = 3, + items = { + { + items = {"default:diamond"}, + rarity = 30, + }, + { + items = {"default:mese_crystal"}, + rarity = 1, + }, + { + items = {"default:gold_lump"}, + rarity = 3, + }, + { + items = {"default:goldblock"}, + rarity = 30, + }, + { + items = {"default:wood 10"}, + rarity = 1, + }, + { + items = {"default:pick_diamond"}, + rarity = 25, + }, + { + items = {"default:pick_steel"}, + rarity = 10, + }, + { + items = {"default:chest_locked"}, + rarity = 15, + }, + { + items = {"default:coalblock"}, + rarity = 20, + }, + { + items = {"default:sword_diamond"}, + rarity = 25, + }, + { + items = {"wool:white 10"}, + rarity = 3, + }, + { + items = {"default:tree 10"}, + rarity = 3, + }, + { + items = {"default:papyrus 10"}, + rarity = 3, + }, + { + items = {"default:copper_lump 10"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:cave1", + wherein = "air", + clust_scarcity = 20*20*20, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + + +minetest.register_node("mytreasure:cave2",{ + description = "Cave Treasure 2", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chest.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 4, + visual_scale = 0.75, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.375, -0.375, -0.375, 0.375, 0.375, 0.375}, + } + }, + drop = { + max_items = 5, + items = { + { + items = {"default:diamond 2"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 2"}, + rarity = 1, + }, + { + items = {"default:gold_lump 2"}, + rarity = 3, + }, + { + items = {"default:goldblock 2"}, + rarity = 30, + }, + { + items = {"default:wood 10"}, + rarity = 1, + }, + { + items = {"default:pick_diamond 2"}, + rarity = 25, + }, + { + items = {"default:pick_steel 2"}, + rarity = 10, + }, + { + items = {"default:chest_locked 2"}, + rarity = 15, + }, + { + items = {"default:coalblock 5"}, + rarity = 20, + }, + { + items = {"default:sword_diamond 2"}, + rarity = 25, + }, + { + items = {"wool:white 10"}, + rarity = 3, + }, + { + items = {"default:tree 25"}, + rarity = 3, + }, + { + items = {"default:papyrus 20"}, + rarity = 3, + }, + { + items = {"default:copper_lump 25"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:cave2", + wherein = "air", + clust_scarcity = 40*40*40, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + +minetest.register_node("mytreasure:cave3",{ + description = "Cave Treasure 3", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chest.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 6, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + } + }, + drop = { + max_items = 10, + items = { + { + items = {"default:diamond 10"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 10"}, + rarity = 1, + }, + { + items = {"default:gold_lump 10"}, + rarity = 3, + }, + { + items = {"default:goldblock 10"}, + rarity = 30, + }, + { + items = {"default:wood 20"}, + rarity = 1, + }, + { + items = {"default:pick_diamond 2"}, + rarity = 25, + }, + { + items = {"default:pick_steel 2"}, + rarity = 10, + }, + { + items = {"default:chest_locked 3"}, + rarity = 15, + }, + { + items = {"default:coalblock 10"}, + rarity = 20, + }, + { + items = {"default:sword_diamond 2"}, + rarity = 25, + }, + { + items = {"wool:white 50"}, + rarity = 3, + }, + { + items = {"default:tree 99"}, + rarity = 3, + }, + { + items = {"default:papyrus 30"}, + rarity = 3, + }, + { + items = {"default:copper_lump 99"}, + rarity = 25, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:cave1", + wherein = "air", + clust_scarcity = 80*80*80, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + +--]] diff --git a/mods/mytreasure/depends.txt b/mods/mytreasure/depends.txt new file mode 100644 index 0000000..470ec30 --- /dev/null +++ b/mods/mytreasure/depends.txt @@ -0,0 +1,2 @@ +default +wool diff --git a/mods/mytreasure/ground.lua b/mods/mytreasure/ground.lua new file mode 100644 index 0000000..e8e5622 --- /dev/null +++ b/mods/mytreasure/ground.lua @@ -0,0 +1,286 @@ +local function coins(pos) + minetest.add_particlespawner(50, 0.4, + pos, pos, + {x=2, y=0.2, z=2}, {x=-2, y=2, z=-2}, + {x=0, y=-6, z=0}, {x=0, y=-10, z=0}, + 0.5, 2, + 0.2, 5, + true, "mytreasure_coin.png") +end + +minetest.register_node("mytreasure:buried1",{ + description = "Buried Treasure 1", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_cheststone.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 2, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, + drop = { + max_items = 3, + items = { + { + items = {"default:diamond"}, + rarity = 30, + }, + { + items = {"default:mese_crystal"}, + rarity = 1, + }, + { + items = {"default:gold_lump"}, + rarity = 3, + }, + { + items = {"default:goldblock"}, + rarity = 30, + }, + { + items = {"default:wood 10"}, + rarity = 1, + }, + { + items = {"default:pick_diamond"}, + rarity = 25, + }, + { + items = {"default:pick_steel"}, + rarity = 10, + }, + { + items = {"default:chest_locked"}, + rarity = 15, + }, + { + items = {"default:coalblock"}, + rarity = 20, + }, + { + items = {"default:sword_diamond"}, + rarity = 25, + }, + { + items = {"wool:white 10"}, + rarity = 3, + }, + { + items = {"default:tree 10"}, + rarity = 3, + }, + { + items = {"default:papyrus 10"}, + rarity = 3, + }, + { + items = {"default:copper_lump 10"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, + +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:buried1", + wherein = "default:stone", + clust_scarcity = 20*20*20, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + +minetest.register_node("mytreasure:buried2",{ + description = "Buried Treasure 2", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_cheststone.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 4, + visual_scale = 0.75, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.375, -0.375, -0.375, 0.375, 0.375, 0.375}, + } + }, + drop = { + max_items = 5, + items = { + { + items = {"default:diamond 2"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 2"}, + rarity = 1, + }, + { + items = {"default:gold_lump 2"}, + rarity = 3, + }, + { + items = {"default:goldblock 2"}, + rarity = 30, + }, + { + items = {"default:wood 10"}, + rarity = 1, + }, + { + items = {"default:pick_diamond 2"}, + rarity = 25, + }, + { + items = {"default:pick_steel 2"}, + rarity = 10, + }, + { + items = {"default:chest_locked 2"}, + rarity = 15, + }, + { + items = {"default:coalblock 5"}, + rarity = 20, + }, + { + items = {"default:sword_diamond 2"}, + rarity = 25, + }, + { + items = {"wool:white 10"}, + rarity = 3, + }, + { + items = {"default:tree 25"}, + rarity = 3, + }, + { + items = {"default:papyrus 20"}, + rarity = 3, + }, + { + items = {"default:copper_lump 25"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:buried2", + wherein = "default:stone", + clust_scarcity = 40*40*40, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + +minetest.register_node("mytreasure:buried3",{ + description = "Buried Treasure 3", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_cheststone.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 6, + visual_scale = 1, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + } + }, + drop = { + max_items = 10, + items = { + { + items = {"default:diamond 10"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 10"}, + rarity = 1, + }, + { + items = {"default:gold_lump 10"}, + rarity = 3, + }, + { + items = {"default:goldblock 10"}, + rarity = 30, + }, + { + items = {"default:wood 20"}, + rarity = 1, + }, + { + items = {"default:pick_diamond 2"}, + rarity = 25, + }, + { + items = {"default:pick_steel 2"}, + rarity = 10, + }, + { + items = {"default:chest_locked 3"}, + rarity = 15, + }, + { + items = {"default:coalblock 10"}, + rarity = 20, + }, + { + items = {"default:sword_diamond 2"}, + rarity = 25, + }, + { + items = {"wool:white 50"}, + rarity = 3, + }, + { + items = {"default:tree 99"}, + rarity = 3, + }, + { + items = {"default:papyrus 30"}, + rarity = 3, + }, + { + items = {"default:copper_lump 99"}, + rarity = 25, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:buried3", + wherein = "default:stone", + clust_scarcity = 80*80*80, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) diff --git a/mods/mytreasure/init.lua b/mods/mytreasure/init.lua new file mode 100644 index 0000000..498abee --- /dev/null +++ b/mods/mytreasure/init.lua @@ -0,0 +1,5 @@ + +dofile(minetest.get_modpath("mytreasure").."/cave.lua") +dofile(minetest.get_modpath("mytreasure").."/ground.lua") +dofile(minetest.get_modpath("mytreasure").."/sunken.lua") +dofile(minetest.get_modpath("mytreasure").."/special.lua") diff --git a/mods/mytreasure/models/chest.obj b/mods/mytreasure/models/chest.obj new file mode 100644 index 0000000..593d8f2 --- /dev/null +++ b/mods/mytreasure/models/chest.obj @@ -0,0 +1,336 @@ +# Blender v2.74 (sub 0) OBJ File: 'chest.blend' +# www.blender.org +mtllib chest.mtl +o Cube +v 0.312250 -0.437250 0.500250 +v 0.500250 -0.437250 0.500250 +v 0.312250 -0.375250 0.500250 +v 0.500250 -0.375250 0.500250 +v 0.312250 -0.437250 0.312250 +v 0.500250 -0.437250 0.312250 +v 0.312250 -0.375250 0.312250 +v 0.500250 -0.375250 0.312250 +v 0.375000 -0.499750 0.500000 +v 0.500000 -0.499750 0.500000 +v 0.375000 -0.437750 0.500000 +v 0.500000 -0.437750 0.500000 +v 0.375000 -0.499750 0.375000 +v 0.500000 -0.499750 0.375000 +v 0.375000 -0.437750 0.375000 +v 0.500000 -0.437750 0.375000 +v -0.500000 -0.499750 0.500000 +v -0.375000 -0.499750 0.500000 +v -0.500000 -0.437750 0.500000 +v -0.375000 -0.437750 0.500000 +v -0.500000 -0.499750 0.375000 +v -0.375000 -0.499750 0.375000 +v -0.500000 -0.437750 0.375000 +v -0.375000 -0.437750 0.375000 +v -0.500250 -0.437250 0.500250 +v -0.312250 -0.437250 0.500250 +v -0.500250 -0.375250 0.500250 +v -0.312250 -0.375250 0.500250 +v -0.500250 -0.437250 0.312250 +v -0.312250 -0.437250 0.312250 +v -0.500250 -0.375250 0.312250 +v -0.312250 -0.375250 0.312250 +v -0.500250 -0.437250 -0.312250 +v -0.312250 -0.437250 -0.312250 +v -0.500250 -0.375250 -0.312250 +v -0.312250 -0.375250 -0.312250 +v -0.500250 -0.437250 -0.500250 +v -0.312250 -0.437250 -0.500250 +v -0.500250 -0.375250 -0.500250 +v -0.312250 -0.375250 -0.500250 +v -0.500000 -0.499750 -0.375000 +v -0.375000 -0.499750 -0.375000 +v -0.500000 -0.437750 -0.375000 +v -0.375000 -0.437750 -0.375000 +v -0.500000 -0.499750 -0.500000 +v -0.375000 -0.499750 -0.500000 +v -0.500000 -0.437750 -0.500000 +v -0.375000 -0.437750 -0.500000 +v 0.312250 -0.437250 -0.312250 +v 0.500250 -0.437250 -0.312250 +v 0.312250 -0.375250 -0.312250 +v 0.500250 -0.375250 -0.312250 +v 0.312250 -0.437250 -0.500250 +v 0.500250 -0.437250 -0.500250 +v 0.312250 -0.375250 -0.500250 +v 0.500250 -0.375250 -0.500250 +v 0.375000 -0.499750 -0.375000 +v 0.500000 -0.499750 -0.375000 +v 0.375000 -0.437750 -0.375000 +v 0.500000 -0.437750 -0.375000 +v 0.375000 -0.499750 -0.500000 +v 0.500000 -0.499750 -0.500000 +v 0.375000 -0.437750 -0.500000 +v 0.500000 -0.437750 -0.500000 +v -0.500000 -0.375000 -0.500000 +v 0.500000 -0.375000 -0.500000 +v 0.500000 -0.375000 0.500000 +v -0.500000 -0.375000 0.500000 +v -0.500000 0.500000 -0.000000 +v -0.500000 -0.000000 -0.500000 +v -0.500000 0.475528 -0.154509 +v -0.500000 0.404508 -0.293893 +v -0.499999 0.293893 -0.404509 +v -0.500000 0.154508 -0.475528 +v 0.500000 -0.000000 -0.500000 +v 0.500000 0.500000 0.000000 +v 0.500000 0.154508 -0.475528 +v 0.500000 0.293893 -0.404508 +v 0.500000 0.404509 -0.293892 +v 0.500000 0.475528 -0.154508 +v 0.500000 0.500000 0.000000 +v 0.500000 -0.000000 0.500000 +v 0.500000 0.475528 0.154509 +v 0.500000 0.404508 0.293893 +v 0.500000 0.293893 0.404509 +v 0.500000 0.154508 0.475528 +v -0.500000 -0.000000 0.500000 +v -0.500000 0.500000 -0.000000 +v -0.500000 0.154508 0.475528 +v -0.500000 0.293893 0.404508 +v -0.500000 0.404509 0.293892 +v -0.500000 0.475528 0.154508 +vt 0.552726 0.888889 +vt 0.575956 0.888889 +vt 0.575956 0.972445 +vt 0.552726 0.972445 +vt 0.412489 0.695111 +vt 0.412489 0.611556 +vt 0.483038 0.611556 +vt 0.483038 0.695111 +vt 0.506267 0.888889 +vt 0.529497 0.888889 +vt 0.529497 0.972445 +vt 0.506267 0.972445 +vt 0.341941 0.695112 +vt 0.341941 0.611556 +vt 0.234161 0.972444 +vt 0.210895 0.972444 +vt 0.210895 0.888889 +vt 0.234161 0.888889 +vt 0.280693 0.972445 +vt 0.257427 0.972445 +vt 0.257427 0.888889 +vt 0.280693 0.888889 +vt 0.843132 0.944444 +vt 0.819903 0.944444 +vt 0.819903 0.888889 +vt 0.843132 0.888889 +vt 0.187629 0.888889 +vt 0.187629 0.944444 +vt 0.140722 0.944444 +vt 0.140722 0.888889 +vt 0.070137 1.000000 +vt 0.046907 1.000000 +vt 0.046907 0.944444 +vt 0.070137 0.944444 +vt 0.459397 0.834223 +vt 0.459397 0.889778 +vt 0.412489 0.889778 +vt 0.412489 0.834223 +vt 0.796673 0.944444 +vt 0.773407 0.944444 +vt 0.773407 0.888889 +vt 0.796673 0.888889 +vt 0.726875 0.944445 +vt 0.703609 0.944445 +vt 0.703609 0.888889 +vt 0.726875 0.888889 +vt 0.365207 0.889778 +vt 0.388436 0.889778 +vt 0.388436 0.945334 +vt 0.365207 0.945334 +vt 0.388848 0.834223 +vt 0.388848 0.889778 +vt 0.341941 0.889778 +vt 0.341941 0.834223 +vt 0.000000 0.944444 +vt 0.023229 0.944444 +vt 0.023229 1.000000 +vt 0.000000 1.000000 +vt 0.459397 0.778667 +vt 0.412489 0.778667 +vt 0.341941 0.945334 +vt 0.645681 0.944445 +vt 0.622415 0.944445 +vt 0.622415 0.888889 +vt 0.645681 0.888889 +vt 0.483038 0.972445 +vt 0.483038 0.888889 +vt 0.341941 0.528000 +vt 0.341941 0.444445 +vt 0.412489 0.444445 +vt 0.412489 0.528000 +vt 0.327152 0.972445 +vt 0.303923 0.972444 +vt 0.303923 0.888889 +vt 0.327152 0.888889 +vt 0.483038 0.444445 +vt 0.483038 0.528000 +vt 0.482663 0.945778 +vt 0.459397 0.945778 +vt 0.459397 0.862223 +vt 0.482663 0.862223 +vt 0.412114 0.945778 +vt 0.388848 0.945778 +vt 0.388848 0.862223 +vt 0.412114 0.862223 +vt 0.599185 0.888889 +vt 0.622415 0.972445 +vt 0.599185 0.972445 +vt 0.483038 0.778667 +vt 0.388848 0.778667 +vt 0.412114 0.778667 +vt 0.187629 0.972445 +vt 0.435719 0.889778 +vt 0.435719 0.945334 +vt 0.412489 0.945334 +vt 0.341941 0.778667 +vt 0.093815 0.944444 +vt 0.093815 0.888889 +vt 0.750141 0.944444 +vt 0.750141 0.888889 +vt 0.680343 0.944444 +vt 0.657077 0.944444 +vt 0.657077 0.888889 +vt 0.680343 0.888889 +vt 0.482663 0.778667 +vt 0.046459 0.944444 +vt 0.046459 1.000000 +vt 0.000000 0.888889 +vt 0.046907 0.888889 +vt 0.458948 0.889778 +vt 0.458948 0.945334 +vt 0.000000 0.000000 +vt 0.375258 0.000000 +vt 0.375258 0.444444 +vt 0.000000 0.444444 +vt 0.703609 0.444445 +vt 0.562887 0.444445 +vt 0.504907 0.433568 +vt 0.452602 0.402004 +vt 0.411092 0.352841 +vt 0.384442 0.290893 +vt 0.375258 0.222222 +vt 0.384442 0.153552 +vt 0.411092 0.091603 +vt 0.452602 0.042441 +vt 0.504907 0.010876 +vt 0.562887 0.000000 +vt 0.703609 0.000000 +vt 0.593324 0.888889 +vt 0.593324 0.444445 +vt 1.000000 0.444445 +vt 0.859499 0.444445 +vt 0.859499 0.000000 +vt 1.000000 0.000000 +vt 1.000000 0.888889 +vt 0.859499 0.888889 +vt 0.651304 0.444445 +vt 0.651304 0.888889 +vt 0.747379 0.444445 +vt 0.747379 0.888889 +vt 0.801095 0.444445 +vt 0.801095 0.888889 +vt 0.535343 0.888889 +vt 0.535343 0.444445 +vt 0.747379 0.000000 +vt 0.801095 0.000000 +vt 0.000000 0.666667 +vt 0.009183 0.597996 +vt 0.035834 0.536048 +vt 0.077343 0.486885 +vt 0.129649 0.455321 +vt 0.187629 0.444445 +vt 0.328351 0.444445 +vt 0.328351 0.888889 +vt 0.129649 0.878013 +vt 0.077344 0.846448 +vt 0.035834 0.797286 +vt 0.009183 0.735337 +vn -0.000000 0.000000 1.000000 +vn 0.000000 1.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 -1.000000 0.000000 +vn -1.000000 0.000000 0.000000 +vn 1.000000 0.000000 0.000000 +vn 0.000000 0.987700 -0.156400 +vn 0.000000 0.891000 -0.454000 +vn 0.000000 0.707100 -0.707100 +vn 0.000000 0.454000 -0.891000 +vn 0.000000 0.156400 -0.987700 +vn -0.000000 0.987700 0.156400 +vn -0.000000 0.891000 0.454000 +vn -0.000000 0.707100 0.707100 +vn -0.000000 0.454000 0.891000 +vn -0.000000 0.156400 0.987700 +usemtl Material +s off +f 2/1/1 4/2/1 3/3/1 1/4/1 +f 4/5/2 8/6/2 7/7/2 3/8/2 +f 8/9/3 6/10/3 5/11/3 7/12/3 +f 6/13/4 2/14/4 1/6/4 5/5/4 +f 1/15/5 3/16/5 7/17/5 5/18/5 +f 6/19/6 8/20/6 4/21/6 2/22/6 +f 10/23/1 12/24/1 11/25/1 9/26/1 +f 12/27/2 16/28/2 15/29/2 11/30/2 +f 16/31/3 14/32/3 13/33/3 15/34/3 +f 14/35/4 10/36/4 9/37/4 13/38/4 +f 9/39/5 11/40/5 15/41/5 13/42/5 +f 14/43/6 16/44/6 12/45/6 10/46/6 +f 18/47/1 20/48/1 19/49/1 17/50/1 +f 20/51/2 24/52/2 23/53/2 19/54/2 +f 24/55/3 22/56/3 21/57/3 23/58/3 +f 22/59/4 18/35/4 17/38/4 21/60/4 +f 17/50/5 19/61/5 23/53/5 21/47/5 +f 22/62/6 24/63/6 20/64/6 18/65/6 +f 26/12/1 28/66/1 27/67/1 25/9/1 +f 28/68/2 32/69/2 31/70/2 27/71/2 +f 32/72/3 30/73/3 29/74/3 31/75/3 +f 30/71/4 26/70/4 25/76/4 29/77/4 +f 25/78/5 27/79/5 31/80/5 29/81/5 +f 30/82/6 32/83/6 28/84/6 26/85/6 +f 34/73/1 36/19/1 35/22/1 33/74/1 +f 36/68/2 40/71/2 39/6/2 35/14/2 +f 40/86/3 38/64/3 37/87/3 39/88/3 +f 38/60/4 34/5/4 33/8/4 37/89/4 +f 33/85/5 35/84/5 39/90/5 37/91/5 +f 38/27/6 40/17/6 36/16/6 34/92/6 +f 42/37/1 44/93/1 43/94/1 41/95/1 +f 44/96/2 48/90/2 47/51/2 43/54/2 +f 48/24/3 46/39/3 45/42/3 47/25/3 +f 46/30/4 42/29/4 41/97/4 45/98/4 +f 41/40/5 43/99/5 47/100/5 45/41/5 +f 46/101/6 48/102/6 44/103/6 42/104/6 +f 50/4/1 52/11/1 51/10/1 49/1/1 +f 52/71/2 56/77/2 55/7/2 51/6/2 +f 56/2/3 54/86/3 53/88/3 55/3/3 +f 54/96/4 50/13/4 49/5/4 53/60/4 +f 49/81/5 51/80/5 55/59/5 53/105/5 +f 54/20/6 56/15/6 52/18/6 50/21/6 +f 58/56/1 60/106/1 59/107/1 57/57/1 +f 60/108/2 64/109/2 63/33/2 59/55/2 +f 64/93/3 62/110/3 61/111/3 63/94/3 +f 62/98/4 58/97/4 57/33/4 61/109/4 +f 57/44/5 59/101/5 63/104/5 61/45/5 +f 62/46/6 64/100/6 60/99/6 58/43/6 +f 65/112/4 66/113/4 67/114/4 68/115/4 +f 66/116/6 75/117/6 77/118/6 78/119/6 79/120/6 80/121/6 76/122/6 81/122/6 83/123/6 84/124/6 85/125/6 86/126/6 82/127/6 67/128/6 +f 69/129/2 88/129/2 81/130/2 76/130/2 +f 67/131/1 82/132/1 87/133/1 68/134/1 +f 65/135/3 70/136/3 75/132/3 66/131/3 +f 69/129/7 76/130/7 80/137/7 71/138/7 +f 71/138/8 80/137/8 79/116/8 72/45/8 +f 72/45/9 79/116/9 78/139/9 73/140/9 +f 73/140/10 78/139/10 77/141/10 74/142/10 +f 74/142/11 77/141/11 75/132/11 70/136/11 +f 81/130/12 88/129/12 92/143/12 83/144/12 +f 83/144/13 92/143/13 91/67/13 84/76/13 +f 84/116/14 91/128/14 90/145/14 85/139/14 +f 85/139/15 90/145/15 89/146/15 86/141/15 +f 86/141/16 89/146/16 87/133/16 82/132/16 +f 69/147/5 71/148/5 72/149/5 73/150/5 74/151/5 70/152/5 65/153/5 68/154/5 87/27/5 89/155/5 90/156/5 91/157/5 92/158/5 88/147/5 diff --git a/mods/mytreasure/models/mytreasure_chest.obj b/mods/mytreasure/models/mytreasure_chest.obj new file mode 100644 index 0000000..593d8f2 --- /dev/null +++ b/mods/mytreasure/models/mytreasure_chest.obj @@ -0,0 +1,336 @@ +# Blender v2.74 (sub 0) OBJ File: 'chest.blend' +# www.blender.org +mtllib chest.mtl +o Cube +v 0.312250 -0.437250 0.500250 +v 0.500250 -0.437250 0.500250 +v 0.312250 -0.375250 0.500250 +v 0.500250 -0.375250 0.500250 +v 0.312250 -0.437250 0.312250 +v 0.500250 -0.437250 0.312250 +v 0.312250 -0.375250 0.312250 +v 0.500250 -0.375250 0.312250 +v 0.375000 -0.499750 0.500000 +v 0.500000 -0.499750 0.500000 +v 0.375000 -0.437750 0.500000 +v 0.500000 -0.437750 0.500000 +v 0.375000 -0.499750 0.375000 +v 0.500000 -0.499750 0.375000 +v 0.375000 -0.437750 0.375000 +v 0.500000 -0.437750 0.375000 +v -0.500000 -0.499750 0.500000 +v -0.375000 -0.499750 0.500000 +v -0.500000 -0.437750 0.500000 +v -0.375000 -0.437750 0.500000 +v -0.500000 -0.499750 0.375000 +v -0.375000 -0.499750 0.375000 +v -0.500000 -0.437750 0.375000 +v -0.375000 -0.437750 0.375000 +v -0.500250 -0.437250 0.500250 +v -0.312250 -0.437250 0.500250 +v -0.500250 -0.375250 0.500250 +v -0.312250 -0.375250 0.500250 +v -0.500250 -0.437250 0.312250 +v -0.312250 -0.437250 0.312250 +v -0.500250 -0.375250 0.312250 +v -0.312250 -0.375250 0.312250 +v -0.500250 -0.437250 -0.312250 +v -0.312250 -0.437250 -0.312250 +v -0.500250 -0.375250 -0.312250 +v -0.312250 -0.375250 -0.312250 +v -0.500250 -0.437250 -0.500250 +v -0.312250 -0.437250 -0.500250 +v -0.500250 -0.375250 -0.500250 +v -0.312250 -0.375250 -0.500250 +v -0.500000 -0.499750 -0.375000 +v -0.375000 -0.499750 -0.375000 +v -0.500000 -0.437750 -0.375000 +v -0.375000 -0.437750 -0.375000 +v -0.500000 -0.499750 -0.500000 +v -0.375000 -0.499750 -0.500000 +v -0.500000 -0.437750 -0.500000 +v -0.375000 -0.437750 -0.500000 +v 0.312250 -0.437250 -0.312250 +v 0.500250 -0.437250 -0.312250 +v 0.312250 -0.375250 -0.312250 +v 0.500250 -0.375250 -0.312250 +v 0.312250 -0.437250 -0.500250 +v 0.500250 -0.437250 -0.500250 +v 0.312250 -0.375250 -0.500250 +v 0.500250 -0.375250 -0.500250 +v 0.375000 -0.499750 -0.375000 +v 0.500000 -0.499750 -0.375000 +v 0.375000 -0.437750 -0.375000 +v 0.500000 -0.437750 -0.375000 +v 0.375000 -0.499750 -0.500000 +v 0.500000 -0.499750 -0.500000 +v 0.375000 -0.437750 -0.500000 +v 0.500000 -0.437750 -0.500000 +v -0.500000 -0.375000 -0.500000 +v 0.500000 -0.375000 -0.500000 +v 0.500000 -0.375000 0.500000 +v -0.500000 -0.375000 0.500000 +v -0.500000 0.500000 -0.000000 +v -0.500000 -0.000000 -0.500000 +v -0.500000 0.475528 -0.154509 +v -0.500000 0.404508 -0.293893 +v -0.499999 0.293893 -0.404509 +v -0.500000 0.154508 -0.475528 +v 0.500000 -0.000000 -0.500000 +v 0.500000 0.500000 0.000000 +v 0.500000 0.154508 -0.475528 +v 0.500000 0.293893 -0.404508 +v 0.500000 0.404509 -0.293892 +v 0.500000 0.475528 -0.154508 +v 0.500000 0.500000 0.000000 +v 0.500000 -0.000000 0.500000 +v 0.500000 0.475528 0.154509 +v 0.500000 0.404508 0.293893 +v 0.500000 0.293893 0.404509 +v 0.500000 0.154508 0.475528 +v -0.500000 -0.000000 0.500000 +v -0.500000 0.500000 -0.000000 +v -0.500000 0.154508 0.475528 +v -0.500000 0.293893 0.404508 +v -0.500000 0.404509 0.293892 +v -0.500000 0.475528 0.154508 +vt 0.552726 0.888889 +vt 0.575956 0.888889 +vt 0.575956 0.972445 +vt 0.552726 0.972445 +vt 0.412489 0.695111 +vt 0.412489 0.611556 +vt 0.483038 0.611556 +vt 0.483038 0.695111 +vt 0.506267 0.888889 +vt 0.529497 0.888889 +vt 0.529497 0.972445 +vt 0.506267 0.972445 +vt 0.341941 0.695112 +vt 0.341941 0.611556 +vt 0.234161 0.972444 +vt 0.210895 0.972444 +vt 0.210895 0.888889 +vt 0.234161 0.888889 +vt 0.280693 0.972445 +vt 0.257427 0.972445 +vt 0.257427 0.888889 +vt 0.280693 0.888889 +vt 0.843132 0.944444 +vt 0.819903 0.944444 +vt 0.819903 0.888889 +vt 0.843132 0.888889 +vt 0.187629 0.888889 +vt 0.187629 0.944444 +vt 0.140722 0.944444 +vt 0.140722 0.888889 +vt 0.070137 1.000000 +vt 0.046907 1.000000 +vt 0.046907 0.944444 +vt 0.070137 0.944444 +vt 0.459397 0.834223 +vt 0.459397 0.889778 +vt 0.412489 0.889778 +vt 0.412489 0.834223 +vt 0.796673 0.944444 +vt 0.773407 0.944444 +vt 0.773407 0.888889 +vt 0.796673 0.888889 +vt 0.726875 0.944445 +vt 0.703609 0.944445 +vt 0.703609 0.888889 +vt 0.726875 0.888889 +vt 0.365207 0.889778 +vt 0.388436 0.889778 +vt 0.388436 0.945334 +vt 0.365207 0.945334 +vt 0.388848 0.834223 +vt 0.388848 0.889778 +vt 0.341941 0.889778 +vt 0.341941 0.834223 +vt 0.000000 0.944444 +vt 0.023229 0.944444 +vt 0.023229 1.000000 +vt 0.000000 1.000000 +vt 0.459397 0.778667 +vt 0.412489 0.778667 +vt 0.341941 0.945334 +vt 0.645681 0.944445 +vt 0.622415 0.944445 +vt 0.622415 0.888889 +vt 0.645681 0.888889 +vt 0.483038 0.972445 +vt 0.483038 0.888889 +vt 0.341941 0.528000 +vt 0.341941 0.444445 +vt 0.412489 0.444445 +vt 0.412489 0.528000 +vt 0.327152 0.972445 +vt 0.303923 0.972444 +vt 0.303923 0.888889 +vt 0.327152 0.888889 +vt 0.483038 0.444445 +vt 0.483038 0.528000 +vt 0.482663 0.945778 +vt 0.459397 0.945778 +vt 0.459397 0.862223 +vt 0.482663 0.862223 +vt 0.412114 0.945778 +vt 0.388848 0.945778 +vt 0.388848 0.862223 +vt 0.412114 0.862223 +vt 0.599185 0.888889 +vt 0.622415 0.972445 +vt 0.599185 0.972445 +vt 0.483038 0.778667 +vt 0.388848 0.778667 +vt 0.412114 0.778667 +vt 0.187629 0.972445 +vt 0.435719 0.889778 +vt 0.435719 0.945334 +vt 0.412489 0.945334 +vt 0.341941 0.778667 +vt 0.093815 0.944444 +vt 0.093815 0.888889 +vt 0.750141 0.944444 +vt 0.750141 0.888889 +vt 0.680343 0.944444 +vt 0.657077 0.944444 +vt 0.657077 0.888889 +vt 0.680343 0.888889 +vt 0.482663 0.778667 +vt 0.046459 0.944444 +vt 0.046459 1.000000 +vt 0.000000 0.888889 +vt 0.046907 0.888889 +vt 0.458948 0.889778 +vt 0.458948 0.945334 +vt 0.000000 0.000000 +vt 0.375258 0.000000 +vt 0.375258 0.444444 +vt 0.000000 0.444444 +vt 0.703609 0.444445 +vt 0.562887 0.444445 +vt 0.504907 0.433568 +vt 0.452602 0.402004 +vt 0.411092 0.352841 +vt 0.384442 0.290893 +vt 0.375258 0.222222 +vt 0.384442 0.153552 +vt 0.411092 0.091603 +vt 0.452602 0.042441 +vt 0.504907 0.010876 +vt 0.562887 0.000000 +vt 0.703609 0.000000 +vt 0.593324 0.888889 +vt 0.593324 0.444445 +vt 1.000000 0.444445 +vt 0.859499 0.444445 +vt 0.859499 0.000000 +vt 1.000000 0.000000 +vt 1.000000 0.888889 +vt 0.859499 0.888889 +vt 0.651304 0.444445 +vt 0.651304 0.888889 +vt 0.747379 0.444445 +vt 0.747379 0.888889 +vt 0.801095 0.444445 +vt 0.801095 0.888889 +vt 0.535343 0.888889 +vt 0.535343 0.444445 +vt 0.747379 0.000000 +vt 0.801095 0.000000 +vt 0.000000 0.666667 +vt 0.009183 0.597996 +vt 0.035834 0.536048 +vt 0.077343 0.486885 +vt 0.129649 0.455321 +vt 0.187629 0.444445 +vt 0.328351 0.444445 +vt 0.328351 0.888889 +vt 0.129649 0.878013 +vt 0.077344 0.846448 +vt 0.035834 0.797286 +vt 0.009183 0.735337 +vn -0.000000 0.000000 1.000000 +vn 0.000000 1.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 -1.000000 0.000000 +vn -1.000000 0.000000 0.000000 +vn 1.000000 0.000000 0.000000 +vn 0.000000 0.987700 -0.156400 +vn 0.000000 0.891000 -0.454000 +vn 0.000000 0.707100 -0.707100 +vn 0.000000 0.454000 -0.891000 +vn 0.000000 0.156400 -0.987700 +vn -0.000000 0.987700 0.156400 +vn -0.000000 0.891000 0.454000 +vn -0.000000 0.707100 0.707100 +vn -0.000000 0.454000 0.891000 +vn -0.000000 0.156400 0.987700 +usemtl Material +s off +f 2/1/1 4/2/1 3/3/1 1/4/1 +f 4/5/2 8/6/2 7/7/2 3/8/2 +f 8/9/3 6/10/3 5/11/3 7/12/3 +f 6/13/4 2/14/4 1/6/4 5/5/4 +f 1/15/5 3/16/5 7/17/5 5/18/5 +f 6/19/6 8/20/6 4/21/6 2/22/6 +f 10/23/1 12/24/1 11/25/1 9/26/1 +f 12/27/2 16/28/2 15/29/2 11/30/2 +f 16/31/3 14/32/3 13/33/3 15/34/3 +f 14/35/4 10/36/4 9/37/4 13/38/4 +f 9/39/5 11/40/5 15/41/5 13/42/5 +f 14/43/6 16/44/6 12/45/6 10/46/6 +f 18/47/1 20/48/1 19/49/1 17/50/1 +f 20/51/2 24/52/2 23/53/2 19/54/2 +f 24/55/3 22/56/3 21/57/3 23/58/3 +f 22/59/4 18/35/4 17/38/4 21/60/4 +f 17/50/5 19/61/5 23/53/5 21/47/5 +f 22/62/6 24/63/6 20/64/6 18/65/6 +f 26/12/1 28/66/1 27/67/1 25/9/1 +f 28/68/2 32/69/2 31/70/2 27/71/2 +f 32/72/3 30/73/3 29/74/3 31/75/3 +f 30/71/4 26/70/4 25/76/4 29/77/4 +f 25/78/5 27/79/5 31/80/5 29/81/5 +f 30/82/6 32/83/6 28/84/6 26/85/6 +f 34/73/1 36/19/1 35/22/1 33/74/1 +f 36/68/2 40/71/2 39/6/2 35/14/2 +f 40/86/3 38/64/3 37/87/3 39/88/3 +f 38/60/4 34/5/4 33/8/4 37/89/4 +f 33/85/5 35/84/5 39/90/5 37/91/5 +f 38/27/6 40/17/6 36/16/6 34/92/6 +f 42/37/1 44/93/1 43/94/1 41/95/1 +f 44/96/2 48/90/2 47/51/2 43/54/2 +f 48/24/3 46/39/3 45/42/3 47/25/3 +f 46/30/4 42/29/4 41/97/4 45/98/4 +f 41/40/5 43/99/5 47/100/5 45/41/5 +f 46/101/6 48/102/6 44/103/6 42/104/6 +f 50/4/1 52/11/1 51/10/1 49/1/1 +f 52/71/2 56/77/2 55/7/2 51/6/2 +f 56/2/3 54/86/3 53/88/3 55/3/3 +f 54/96/4 50/13/4 49/5/4 53/60/4 +f 49/81/5 51/80/5 55/59/5 53/105/5 +f 54/20/6 56/15/6 52/18/6 50/21/6 +f 58/56/1 60/106/1 59/107/1 57/57/1 +f 60/108/2 64/109/2 63/33/2 59/55/2 +f 64/93/3 62/110/3 61/111/3 63/94/3 +f 62/98/4 58/97/4 57/33/4 61/109/4 +f 57/44/5 59/101/5 63/104/5 61/45/5 +f 62/46/6 64/100/6 60/99/6 58/43/6 +f 65/112/4 66/113/4 67/114/4 68/115/4 +f 66/116/6 75/117/6 77/118/6 78/119/6 79/120/6 80/121/6 76/122/6 81/122/6 83/123/6 84/124/6 85/125/6 86/126/6 82/127/6 67/128/6 +f 69/129/2 88/129/2 81/130/2 76/130/2 +f 67/131/1 82/132/1 87/133/1 68/134/1 +f 65/135/3 70/136/3 75/132/3 66/131/3 +f 69/129/7 76/130/7 80/137/7 71/138/7 +f 71/138/8 80/137/8 79/116/8 72/45/8 +f 72/45/9 79/116/9 78/139/9 73/140/9 +f 73/140/10 78/139/10 77/141/10 74/142/10 +f 74/142/11 77/141/11 75/132/11 70/136/11 +f 81/130/12 88/129/12 92/143/12 83/144/12 +f 83/144/13 92/143/13 91/67/13 84/76/13 +f 84/116/14 91/128/14 90/145/14 85/139/14 +f 85/139/15 90/145/15 89/146/15 86/141/15 +f 86/141/16 89/146/16 87/133/16 82/132/16 +f 69/147/5 71/148/5 72/149/5 73/150/5 74/151/5 70/152/5 65/153/5 68/154/5 87/27/5 89/155/5 90/156/5 91/157/5 92/158/5 88/147/5 diff --git a/mods/mytreasure/models/mytreasure_chest2.obj b/mods/mytreasure/models/mytreasure_chest2.obj new file mode 100644 index 0000000..32260da --- /dev/null +++ b/mods/mytreasure/models/mytreasure_chest2.obj @@ -0,0 +1,451 @@ +# Blender v2.74 (sub 0) OBJ File: 'chest.blend' +# www.blender.org +mtllib chest.mtl +o Cube +v 0.312250 -0.437250 0.500250 +v 0.500250 -0.437250 0.500250 +v 0.312250 -0.375250 0.500250 +v 0.500250 -0.375250 0.500250 +v 0.312250 -0.437250 0.312250 +v 0.500250 -0.437250 0.312250 +v 0.312250 -0.375250 0.312250 +v 0.500250 -0.375250 0.312250 +v 0.375000 -0.499750 0.500000 +v 0.500000 -0.499750 0.500000 +v 0.375000 -0.437750 0.500000 +v 0.500000 -0.437750 0.500000 +v 0.375000 -0.499750 0.375000 +v 0.500000 -0.499750 0.375000 +v 0.375000 -0.437750 0.375000 +v 0.500000 -0.437750 0.375000 +v -0.500000 -0.499750 0.500000 +v -0.375000 -0.499750 0.500000 +v -0.500000 -0.437750 0.500000 +v -0.375000 -0.437750 0.500000 +v -0.500000 -0.499750 0.375000 +v -0.375000 -0.499750 0.375000 +v -0.500000 -0.437750 0.375000 +v -0.375000 -0.437750 0.375000 +v -0.500250 -0.437250 0.500250 +v -0.312250 -0.437250 0.500250 +v -0.500250 -0.375250 0.500250 +v -0.312250 -0.375250 0.500250 +v -0.500250 -0.437250 0.312250 +v -0.312250 -0.437250 0.312250 +v -0.500250 -0.375250 0.312250 +v -0.312250 -0.375250 0.312250 +v -0.500250 -0.437250 -0.312250 +v -0.312250 -0.437250 -0.312250 +v -0.500250 -0.375250 -0.312250 +v -0.312250 -0.375250 -0.312250 +v -0.500250 -0.437250 -0.500250 +v -0.312250 -0.437250 -0.500250 +v -0.500250 -0.375250 -0.500250 +v -0.312250 -0.375250 -0.500250 +v -0.500000 -0.499750 -0.375000 +v -0.375000 -0.499750 -0.375000 +v -0.500000 -0.437750 -0.375000 +v -0.375000 -0.437750 -0.375000 +v -0.500000 -0.499750 -0.500000 +v -0.375000 -0.499750 -0.500000 +v -0.500000 -0.437750 -0.500000 +v -0.375000 -0.437750 -0.500000 +v 0.312250 -0.437250 -0.312250 +v 0.500250 -0.437250 -0.312250 +v 0.312250 -0.375250 -0.312250 +v 0.500250 -0.375250 -0.312250 +v 0.312250 -0.437250 -0.500250 +v 0.500250 -0.437250 -0.500250 +v 0.312250 -0.375250 -0.500250 +v 0.500250 -0.375250 -0.500250 +v 0.375000 -0.499750 -0.375000 +v 0.500000 -0.499750 -0.375000 +v 0.375000 -0.437750 -0.375000 +v 0.500000 -0.437750 -0.375000 +v 0.375000 -0.499750 -0.500000 +v 0.500000 -0.499750 -0.500000 +v 0.375000 -0.437750 -0.500000 +v 0.500000 -0.437750 -0.500000 +v -0.500000 -0.375000 -0.500000 +v 0.500000 -0.375000 -0.500000 +v 0.500000 -0.375000 0.500000 +v -0.500000 -0.375000 0.500000 +v -0.500000 0.500000 -0.000000 +v -0.500000 0.000000 -0.500000 +v -0.500000 0.475528 -0.154509 +v -0.500000 0.404508 -0.293893 +v -0.499999 0.293893 -0.404509 +v -0.500000 0.154508 -0.475528 +v 0.500000 0.000000 -0.500000 +v 0.500000 0.500000 0.000000 +v 0.500000 0.154509 -0.475528 +v 0.500000 0.293893 -0.404508 +v 0.500000 0.404509 -0.293892 +v 0.500000 0.475528 -0.154508 +v 0.500000 0.500000 0.000000 +v 0.500000 0.000000 0.500000 +v 0.500000 0.475528 0.154509 +v 0.500000 0.404508 0.293893 +v 0.500000 0.293893 0.404509 +v 0.500000 0.154508 0.475528 +v -0.500000 0.000000 0.500000 +v -0.500000 0.500000 -0.000000 +v -0.500000 0.154509 0.475528 +v -0.500000 0.293893 0.404508 +v -0.500000 0.404509 0.293892 +v -0.500000 0.475528 0.154508 +vt 0.970223 0.789757 +vt 0.970223 0.813023 +vt 0.914668 0.813023 +vt 0.914668 0.789757 +vt 0.900688 0.812548 +vt 0.900688 0.789319 +vt 0.984244 0.789319 +vt 0.984244 0.812548 +vt 0.912490 0.984174 +vt 0.912490 0.900618 +vt 0.983038 0.900618 +vt 0.983038 0.984174 +vt 0.917205 0.901389 +vt 0.940435 0.901389 +vt 0.940435 0.984945 +vt 0.917205 0.984945 +vt 0.913816 0.979487 +vt 0.913816 0.895931 +vt 0.984365 0.895931 +vt 0.984365 0.979487 +vt 0.956037 0.980257 +vt 0.932770 0.980257 +vt 0.932770 0.896701 +vt 0.956037 0.896701 +vt 0.900806 0.812652 +vt 0.900806 0.789386 +vt 0.984361 0.789386 +vt 0.984361 0.812652 +vt 0.969913 0.789529 +vt 0.969913 0.812759 +vt 0.914357 0.812759 +vt 0.914357 0.789529 +vt 0.972004 0.913889 +vt 0.972004 0.969444 +vt 0.925097 0.969444 +vt 0.925097 0.913889 +vt 0.959199 0.967188 +vt 0.935970 0.967187 +vt 0.935970 0.911632 +vt 0.959199 0.911632 +vt 0.975022 0.917035 +vt 0.975022 0.972591 +vt 0.928115 0.972591 +vt 0.928115 0.917035 +vt 0.966986 0.975694 +vt 0.943720 0.975694 +vt 0.943720 0.920139 +vt 0.966986 0.920139 +vt 0.970063 0.790089 +vt 0.970063 0.813355 +vt 0.914507 0.813355 +vt 0.914507 0.790089 +vt 0.941769 0.927278 +vt 0.964999 0.927278 +vt 0.964999 0.982834 +vt 0.941769 0.982834 +vt 0.974786 0.912348 +vt 0.974786 0.967903 +vt 0.927878 0.967903 +vt 0.927878 0.912348 +vt 0.940625 0.913194 +vt 0.963855 0.913194 +vt 0.963855 0.968750 +vt 0.940625 0.968750 +vt 0.978147 0.917729 +vt 0.978147 0.973285 +vt 0.931239 0.973285 +vt 0.931240 0.917729 +vt 0.949582 0.975021 +vt 0.926316 0.975021 +vt 0.926316 0.919466 +vt 0.949582 0.919466 +vt 0.967556 0.978820 +vt 0.944290 0.978820 +vt 0.944290 0.923264 +vt 0.967556 0.923264 +vt 0.965643 0.991195 +vt 0.942413 0.991195 +vt 0.942413 0.907639 +vt 0.965643 0.907639 +vt 0.915378 0.984250 +vt 0.915378 0.900695 +vt 0.985927 0.900695 +vt 0.985927 0.984250 +vt 0.961527 0.986507 +vt 0.938298 0.986507 +vt 0.938298 0.902951 +vt 0.961527 0.902951 +vt 0.914052 0.985813 +vt 0.914052 0.902257 +vt 0.984601 0.902257 +vt 0.984601 0.985813 +vt 0.954538 0.987966 +vt 0.931272 0.987966 +vt 0.931272 0.904410 +vt 0.954538 0.904410 +vt 0.918536 0.899723 +vt 0.941802 0.899723 +vt 0.941802 0.983278 +vt 0.918536 0.983278 +vt 0.974235 0.991195 +vt 0.951006 0.991195 +vt 0.951006 0.907639 +vt 0.974235 0.907639 +vt 0.918503 0.899875 +vt 0.989052 0.899875 +vt 0.989052 0.983431 +vt 0.918503 0.983431 +vt 0.900665 0.812880 +vt 0.900665 0.789651 +vt 0.984220 0.789651 +vt 0.984220 0.812880 +vt 0.914052 0.986480 +vt 0.914052 0.902924 +vt 0.984601 0.902924 +vt 0.984601 0.986480 +vt 0.984150 0.789352 +vt 0.984150 0.812618 +vt 0.900595 0.812618 +vt 0.900595 0.789352 +vt 0.940754 0.895139 +vt 0.964020 0.895139 +vt 0.964020 0.978695 +vt 0.940754 0.978695 +vt 0.924990 0.921028 +vt 0.948219 0.921028 +vt 0.948219 0.976584 +vt 0.924989 0.976584 +vt 0.947019 0.882183 +vt 0.993926 0.882183 +vt 0.993926 0.937738 +vt 0.947019 0.937738 +vt 0.970157 0.789701 +vt 0.970157 0.812931 +vt 0.914601 0.812931 +vt 0.914601 0.789701 +vt 0.973535 0.913889 +vt 0.973535 0.969444 +vt 0.926627 0.969444 +vt 0.926627 0.913889 +vt 0.952218 0.964757 +vt 0.928952 0.964757 +vt 0.928952 0.909201 +vt 0.952218 0.909201 +vt 0.955852 0.981820 +vt 0.932622 0.981820 +vt 0.932622 0.898264 +vt 0.955852 0.898264 +vt 0.915615 0.901438 +vt 0.986163 0.901438 +vt 0.986163 0.984993 +vt 0.915614 0.984993 +vt 0.900751 0.812462 +vt 0.900751 0.789233 +vt 0.984306 0.789233 +vt 0.984306 0.812462 +vt 0.912253 0.983355 +vt 0.912253 0.899799 +vt 0.982802 0.899799 +vt 0.982802 0.983355 +vt 0.954538 0.980973 +vt 0.931272 0.980973 +vt 0.931272 0.897417 +vt 0.954538 0.897417 +vt 0.984080 0.789541 +vt 0.984080 0.812808 +vt 0.900525 0.812808 +vt 0.900525 0.789541 +vt 0.943542 0.917882 +vt 0.966772 0.917882 +vt 0.966772 0.973437 +vt 0.943542 0.973437 +vt 0.921875 0.915451 +vt 0.968783 0.915451 +vt 0.968783 0.971007 +vt 0.921875 0.971007 +vt 0.914450 0.813180 +vt 0.914450 0.789950 +vt 0.970006 0.789950 +vt 0.970006 0.813180 +vt 0.981315 0.912326 +vt 0.981315 0.967882 +vt 0.934408 0.967882 +vt 0.934407 0.912326 +vt 0.966109 0.969444 +vt 0.942843 0.969444 +vt 0.942843 0.913889 +vt 0.966109 0.913889 +vt 0.971845 0.972569 +vt 0.948579 0.972569 +vt 0.948579 0.917014 +vt 0.971845 0.917014 +vt 0.012500 0.021875 +vt 0.387758 0.021875 +vt 0.387758 0.466319 +vt 0.012500 0.466319 +vt 0.329186 0.489977 +vt 0.188464 0.489977 +vt 0.130483 0.479101 +vt 0.078178 0.447536 +vt 0.036669 0.398374 +vt 0.010018 0.336425 +vt 0.000835 0.267755 +vt 0.010018 0.199084 +vt 0.036669 0.137136 +vt 0.078178 0.087973 +vt 0.130483 0.056409 +vt 0.188464 0.045533 +vt 0.329186 0.045533 +vt 0.420874 0.983834 +vt 0.420874 0.539390 +vt 0.843427 0.251093 +vt 0.983927 0.251093 +vt 0.983927 0.748907 +vt 0.843427 0.748907 +vt 0.418956 0.726022 +vt 0.278455 0.726022 +vt 0.278455 0.281577 +vt 0.418956 0.281577 +vt 0.519156 0.749928 +vt 0.519156 0.250072 +vt 0.577137 0.250072 +vt 0.577137 0.749928 +vt 0.466912 0.750429 +vt 0.466912 0.249571 +vt 0.519217 0.249571 +vt 0.519217 0.750429 +vt 0.423266 0.720921 +vt 0.423265 0.276476 +vt 0.467035 0.276476 +vt 0.467035 0.720921 +vt 0.148315 0.973913 +vt 0.148315 0.529469 +vt 0.202031 0.529469 +vt 0.202031 0.973913 +vt 0.195830 0.973913 +vt 0.195830 0.529469 +vt 0.254234 0.529469 +vt 0.254234 0.973913 +vt 0.634866 0.250783 +vt 0.634865 0.749217 +vt 0.576885 0.749217 +vt 0.576885 0.250783 +vt 0.686963 0.250785 +vt 0.686963 0.748925 +vt 0.634658 0.748925 +vt 0.634658 0.250785 +vt 0.730543 0.251210 +vt 0.730543 0.748915 +vt 0.686773 0.748915 +vt 0.686773 0.251210 +vt 0.784304 0.251078 +vt 0.784304 0.748922 +vt 0.730588 0.748922 +vt 0.730588 0.251078 +vt 0.842913 0.251674 +vt 0.842913 0.748556 +vt 0.784509 0.748556 +vt 0.784509 0.251674 +vt 0.011637 0.249476 +vt 0.020820 0.180805 +vt 0.047471 0.118857 +vt 0.088980 0.069694 +vt 0.141285 0.038130 +vt 0.199266 0.027254 +vt 0.339988 0.027254 +vt 0.339988 0.471698 +vt 0.199266 0.471698 +vt 0.141285 0.460822 +vt 0.088980 0.429257 +vt 0.047471 0.380095 +vt 0.020820 0.318146 +vn -1.000000 0.000000 -0.000000 +vn -0.000000 0.000000 1.000000 +vn 0.000000 1.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn -0.000000 -1.000000 0.000000 +vn 1.000000 0.000000 0.000000 +vn 0.000000 0.987700 -0.156400 +vn 0.000000 0.891000 -0.454000 +vn 0.000000 0.707100 -0.707100 +vn 0.000000 0.454000 -0.891000 +vn 0.000000 0.156400 -0.987700 +vn -0.000000 0.987700 0.156400 +vn -0.000000 0.891000 0.454000 +vn -0.000000 0.707100 0.707100 +vn -0.000000 0.454000 0.891000 +vn -0.000000 0.156400 0.987700 +usemtl Material +s off +f 41/1/1 43/2/1 47/3/1 45/4/1 +usemtl Material_Untitled +f 2/5/2 4/6/2 3/7/2 1/8/2 +f 4/9/3 8/10/3 7/11/3 3/12/3 +f 8/13/4 6/14/4 5/15/4 7/16/4 +f 6/17/5 2/18/5 1/19/5 5/20/5 +f 1/21/1 3/22/1 7/23/1 5/24/1 +f 6/25/6 8/26/6 4/27/6 2/28/6 +f 10/29/2 12/30/2 11/31/2 9/32/2 +f 12/33/3 16/34/3 15/35/3 11/36/3 +f 16/37/4 14/38/4 13/39/4 15/40/4 +f 14/41/5 10/42/5 9/43/5 13/44/5 +f 9/45/1 11/46/1 15/47/1 13/48/1 +f 14/49/6 16/50/6 12/51/6 10/52/6 +f 18/53/2 20/54/2 19/55/2 17/56/2 +f 20/57/3 24/58/3 23/59/3 19/60/3 +f 24/61/4 22/62/4 21/63/4 23/64/4 +f 22/65/5 18/66/5 17/67/5 21/68/5 +f 17/69/1 19/70/1 23/71/1 21/72/1 +f 22/73/6 24/74/6 20/75/6 18/76/6 +f 26/77/2 28/78/2 27/79/2 25/80/2 +f 28/81/3 32/82/3 31/83/3 27/84/3 +f 32/85/4 30/86/4 29/87/4 31/88/4 +f 30/89/5 26/90/5 25/91/5 29/92/5 +f 25/93/1 27/94/1 31/95/1 29/96/1 +f 30/97/6 32/98/6 28/99/6 26/100/6 +f 34/101/2 36/102/2 35/103/2 33/104/2 +f 36/105/3 40/106/3 39/107/3 35/108/3 +f 40/109/4 38/110/4 37/111/4 39/112/4 +f 38/113/5 34/114/5 33/115/5 37/116/5 +f 33/117/1 35/118/1 39/119/1 37/120/1 +f 38/121/6 40/122/6 36/123/6 34/124/6 +f 42/125/2 44/126/2 43/127/2 41/128/2 +f 44/129/3 48/130/3 47/131/3 43/132/3 +f 48/133/4 46/134/4 45/135/4 47/136/4 +f 46/137/5 42/138/5 41/139/5 45/140/5 +f 46/141/6 48/142/6 44/143/6 42/144/6 +f 50/145/2 52/146/2 51/147/2 49/148/2 +f 52/149/3 56/150/3 55/151/3 51/152/3 +f 56/153/4 54/154/4 53/155/4 55/156/4 +f 54/157/5 50/158/5 49/159/5 53/160/5 +f 49/161/1 51/162/1 55/163/1 53/164/1 +f 54/165/6 56/166/6 52/167/6 50/168/6 +f 58/169/2 60/170/2 59/171/2 57/172/2 +f 60/173/3 64/174/3 63/175/3 59/176/3 +f 64/177/4 62/178/4 61/179/4 63/180/4 +f 62/181/5 58/182/5 57/183/5 61/184/5 +f 57/185/1 59/186/1 63/187/1 61/188/1 +f 62/189/6 64/190/6 60/191/6 58/192/6 +f 65/193/5 66/194/5 67/195/5 68/196/5 +f 66/197/6 75/198/6 77/199/6 78/200/6 79/201/6 80/202/6 76/203/6 81/203/6 83/204/6 84/205/6 85/206/6 86/207/6 82/208/6 67/209/6 +f 69/210/3 88/210/3 81/211/3 76/211/3 +f 67/212/2 82/213/2 87/214/2 68/215/2 +f 65/216/4 70/217/4 75/218/4 66/219/4 +f 69/220/7 76/221/7 80/222/7 71/223/7 +f 71/224/8 80/225/8 79/226/8 72/227/8 +f 72/228/9 79/229/9 78/230/9 73/231/9 +f 73/232/10 78/233/10 77/234/10 74/235/10 +f 74/236/11 77/237/11 75/238/11 70/239/11 +f 81/240/12 88/241/12 92/242/12 83/243/12 +f 83/244/13 92/245/13 91/246/13 84/247/13 +f 84/248/14 91/249/14 90/250/14 85/251/14 +f 85/252/15 90/253/15 89/254/15 86/255/15 +f 86/256/16 89/257/16 87/258/16 82/259/16 +f 69/260/1 71/261/1 72/262/1 73/263/1 74/264/1 70/265/1 65/266/1 68/267/1 87/268/1 89/269/1 90/270/1 91/271/1 92/272/1 88/260/1 diff --git a/mods/mytreasure/schems/chestx.mts b/mods/mytreasure/schems/chestx.mts new file mode 100644 index 0000000..12fe7da Binary files /dev/null and b/mods/mytreasure/schems/chestx.mts differ diff --git a/mods/mytreasure/schems/dungeon.mts b/mods/mytreasure/schems/dungeon.mts new file mode 100644 index 0000000..00822ff Binary files /dev/null and b/mods/mytreasure/schems/dungeon.mts differ diff --git a/mods/mytreasure/schems/wool.mts b/mods/mytreasure/schems/wool.mts new file mode 100644 index 0000000..ab6482d Binary files /dev/null and b/mods/mytreasure/schems/wool.mts differ diff --git a/mods/mytreasure/special.lua b/mods/mytreasure/special.lua new file mode 100644 index 0000000..1191c13 --- /dev/null +++ b/mods/mytreasure/special.lua @@ -0,0 +1,443 @@ +local function calc_velocity(pos1, pos2, old_vel, power) + local vel = vector.direction(pos1, pos2) + vel = vector.normalize(vel) + vel = vector.multiply(vel, power) + + -- Divide by distance + local dist = vector.distance(pos1, pos2) + dist = math.max(dist, 1) + vel = vector.divide(vel, dist) + + -- Add old velocity + vel = vector.add(vel, old_vel) + return vel +end + +local radius = tonumber(minetest.setting_get("chest_radius") or 3) + +local function entity_physics(pos, radius) + radius = radius * 2 + local objs = minetest.get_objects_inside_radius(pos, radius) + for _, obj in pairs(objs) do + local obj_pos = obj:getpos() + local obj_vel = obj:getvelocity() + local dist = math.max(1, vector.distance(pos, obj_pos)) + + if obj_vel ~= nil then + obj:setvelocity(calc_velocity(pos, obj_pos, + obj_vel, radius * 10)) + end + + local damage = (4 / dist) * radius + obj:set_hp(obj:get_hp() - damage) + end +end + +local function explode(pos, radius) + local pos = vector.round(pos) + local vm = VoxelManip() + local pr = PseudoRandom(os.time()) + local p1 = vector.subtract(pos, radius) + local p2 = vector.add(pos, radius) + local minp, maxp = vm:read_from_map(p1, p2) + local a = VoxelArea:new({MinEdge = minp, MaxEdge = maxp}) + local data = vm:get_data() + + local drops = {} + local p = {} + + local kaboom = minetest.get_content_id("mytreasure:kaboom") + + for z = -radius, radius do + for y = -radius, radius do + local vi = a:index(pos.x + (-radius), pos.y + y, pos.z + z) + for x = -radius, radius do + if (x * x) + (y * y) + (z * z) <= + (radius * radius) + pr:next(-radius, radius) then + local cid = data[vi] + p.x = pos.x + x + p.y = pos.y + y + p.z = pos.z + z + if + cid == kaboom then + minetest.remove_node(pos) + end + end + vi = vi + 1 + end + end + end + + return +end + +local function boom(pos) + minetest.sound_play("tnt_explode", {pos=pos, gain=1.5, max_hear_distance=2*64}) + minetest.get_node_timer(pos):start(0.5) + + minetest.add_particlespawner(50, 0.4, + pos, pos, + {x=4, y=1.2, z=4}, {x=-4, y=4, z=-4}, + {x=0, y=-6, z=0}, {x=0, y=-10, z=0}, + 0.5, 2, + 0.2, 5, + true, "mytreasure_boom.png") + + local drops = explode(pos, radius) + entity_physics(pos, radius) +end +local function coins(pos) + minetest.add_particlespawner(50, 0.4, + pos, pos, + {x=2, y=0.2, z=2}, {x=-2, y=2, z=-2}, + {x=0, y=-6, z=0}, {x=0, y=-10, z=0}, + 0.5, 2, + 0.2, 5, + true, "mytreasure_coin.png") +end + + + +minetest.register_node("mytreasure:dungeon",{ + description = "Dungeon Treasure", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestdungeon.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 2, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, + drop = { + max_items = 3, + items = { + { + items = {"default:diamond 10"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 10"}, + rarity = 1, + }, + { + items = {"default:gold_lump 25"}, + rarity = 3, + }, + { + items = {"default:goldblock 3"}, + rarity = 30, + }, + { + items = {"default:mossycobble 99"}, + rarity = 1, + }, + { + items = {"default:obsidian 25"}, + rarity = 25, + }, + { + items = {"default:iron_lump 99"}, + rarity = 10, + }, + { + items = {"default:chest_locked"}, + rarity = 15, + }, + { + items = {"default:coalblock 20"}, + rarity = 20, + }, + { + items = {"default:obsidian_glass 99"}, + rarity = 25, + }, + { + items = {"wool:white 99"}, + rarity = 3, + }, + { + items = {"default:tree 99"}, + rarity = 3, + }, + { + items = {"default:papyrus 10"}, + rarity = 3, + }, + { + items = {"default:copper_lump 10"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:dungeon", + wherein = "default:mossycobble", + clust_scarcity = 30*30*30, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + +--Dungeon2 - places scheme +minetest.register_node("mytreasure:dungeon2",{ + description = "Dungeon 2 Treasure", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestdungeon.png"}, + paramtype = "light", + paramtype2 = "facedir", + drop = "", + light_source = 2, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, +after_destruct = function(pos, oldnode) +local schem = minetest.get_modpath("mytreasure").."/schems/dungeon.mts" + minetest.place_schematic({x=pos.x-5,y=pos.y-2,z=pos.z-5},schem,0, 0, true) +end, +}) +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:dungeon2", + wherein = "stone", + clust_scarcity = 30*30*30, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -50, +}) + +--Wool - places scheme +minetest.register_node("mytreasure:wool",{ + description = "Wool Treasure", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestdungeon.png"}, + paramtype = "light", + paramtype2 = "facedir", + drop = "", + light_source = 2, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, +after_destruct = function(pos, oldnode) +local schem = minetest.get_modpath("mytreasure").."/schems/wool.mts" + minetest.place_schematic({x=pos.x-5,y=pos.y-2,z=pos.z-5},schem,0, 0, true) +end, +}) +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:wool", + wherein = "stone", + clust_scarcity = 30*30*30, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -50, +}) +--Cavex - places scheme +minetest.register_node("mytreasure:cavex",{ + description = "Cavex Treasure", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chest.png"}, + paramtype = "light", + paramtype2 = "facedir", + drop = "default:stick", + light_source = 2, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, +after_destruct = function(pos, oldnode) +local schem = minetest.get_modpath("mytreasure").."/schems/chestx.mts" + minetest.place_schematic(pos,schem,0, 0, true) +end, +}) +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:cavex", + wherein = "air", + clust_scarcity = 80*80*80, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -50, +}) +--Exploding Chest + +minetest.register_node("mytreasure:exploding",{ + description = "Exploding Chest", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestm.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 4, + visual_scale = 0.5, + groups = {not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, + on_punch = function(pos, node, puncher, pointed_thing) + minetest.set_node(pos, {name="mytreasure:kaboom"}) + minetest.get_node_timer(pos):start(2) + end +}) + +minetest.register_node("mytreasure:kaboom",{ + description = "Kaboom", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = { + {name="mytreasure_chestkaboom.png", animation={type="vertical_frames", + aspect_w=16, aspect_h=16, length=0.2}}, + }, + paramtype = "light", + paramtype2 = "facedir", + light_source = 13, + visual_scale = 0.75, + groups = {not_in_creative_inventory=1, explody = 1}, + selection_box = { + type = "fixed", + fixed = { + {-0.375, -0.375, -0.375, 0.375, 0.375, 0.375}, + } + }, + on_timer = boom, + +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:exploding", + wherein = "air", + clust_scarcity = 60*60*60, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:exploding", + wherein = "stone", + clust_scarcity = 60*60*60, + clust_num_ores = 1, + clust_size = 1, + height_min = -31000, + height_max = -150, +}) + +--Desert Treasure + +minetest.register_node("mytreasure:desert",{ + description = "Desert Treasure", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestdesert.png"}, + paramtype = "light", + paramtype2 = "facedir", + light_source = 6, + visual_scale = 0.5, + groups = {cracky = 2, choppy=2, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, + drop = { + max_items = 3, + items = { + { + items = {"default:diamond 3"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 3"}, + rarity = 1, + }, + { + items = {"default:gold_lump 3"}, + rarity = 3, + }, + { + items = {"default:desert_stone 25"}, + rarity = 30, + }, + { + items = {"default:wood 25"}, + rarity = 1, + }, + { + items = {"default:desert_sand 25"}, + rarity = 25, + }, + { + items = {"default:pick_steel 1"}, + rarity = 10, + }, + { + items = {"default:chest_locked 3"}, + rarity = 15, + }, + { + items = {"default:sand 25"}, + rarity = 20, + }, + { + items = {"default:papyrus 10"}, + rarity = 3, + }, + { + items = {"default:copper_lump 10"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:cave1", + wherein = "default:desert_stone", + clust_scarcity = 40*40*40, + clust_num_ores = 1, + clust_size = 1, + height_min = -150, + height_max = -15, +}) + + diff --git a/mods/mytreasure/sunken.lua b/mods/mytreasure/sunken.lua new file mode 100644 index 0000000..43aa9d6 --- /dev/null +++ b/mods/mytreasure/sunken.lua @@ -0,0 +1,330 @@ +local function coins(pos) + minetest.add_particlespawner(50, 0.4, + pos, pos, + {x=2, y=0.2, z=2}, {x=-2, y=2, z=-2}, + {x=0, y=-6, z=0}, {x=0, y=-10, z=0}, + 0.5, 2, + 0.2, 5, + true, "mytreasure_coin.png") +end + +minetest.register_node("mytreasure:sunken1",{ + description = "Sunken Treasure 1", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestaqua.png"}, + paramtype = "light", + paramtype2 = "facedir", + visual_scale = 0.5, + groups = {cracky = 2, choppy=2,falling_node = 1, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, + } + }, + drop = { + max_items = 3, + items = { + { + items = {"default:diamond"}, + rarity = 30, + }, + { + items = {"default:mese_crystal"}, + rarity = 1, + }, + { + items = {"default:gold_lump"}, + rarity = 3, + }, + { + items = {"default:goldblock"}, + rarity = 30, + }, + { + items = {"default:wood 10"}, + rarity = 1, + }, + { + items = {"default:pick_diamond"}, + rarity = 25, + }, + { + items = {"default:pick_steel"}, + rarity = 10, + }, + { + items = {"default:chest_locked"}, + rarity = 15, + }, + { + items = {"default:coalblock"}, + rarity = 20, + }, + { + items = {"default:sword_diamond"}, + rarity = 25, + }, + { + items = {"wool:white 10"}, + rarity = 3, + }, + { + items = {"default:tree 10"}, + rarity = 3, + }, + { + items = {"default:papyrus 10"}, + rarity = 3, + }, + { + items = {"default:copper_lump 10"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:sunken1", + wherein = "default:water_source", + clust_scarcity = 80*80*80, + clust_num_ores = 1, + clust_size = 1, + height_min = -1000, + height_max = -5, +}) + +minetest.register_node("mytreasure:sunken2",{ + description = "Sunken Treasure 2", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestaqua.png"}, + paramtype = "light", + paramtype2 = "facedir", + visual_scale = 0.75, + groups = {cracky = 2, choppy=2,falling_node = 1, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.375, -0.375, -0.375, 0.375, 0.375, 0.375}, + } + }, + drop = { + max_items = 5, + items = { + { + items = {"default:diamond 2"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 2"}, + rarity = 1, + }, + { + items = {"default:gold_lump 2"}, + rarity = 3, + }, + { + items = {"default:goldblock 2"}, + rarity = 30, + }, + { + items = {"default:wood 10"}, + rarity = 1, + }, + { + items = {"default:pick_diamond 2"}, + rarity = 25, + }, + { + items = {"default:pick_steel 2"}, + rarity = 10, + }, + { + items = {"default:chest_locked 2"}, + rarity = 15, + }, + { + items = {"default:coalblock 5"}, + rarity = 20, + }, + { + items = {"default:sword_diamond 2"}, + rarity = 25, + }, + { + items = {"wool:white 10"}, + rarity = 3, + }, + { + items = {"default:tree 25"}, + rarity = 3, + }, + { + items = {"default:papyrus 20"}, + rarity = 3, + }, + { + items = {"default:copper_lump 25"}, + rarity = 8, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:sunken2", + wherein = "default:water_source", + clust_scarcity = 120*120*120, + clust_num_ores = 1, + clust_size = 1, + height_min = -1000, + height_max = -5, +}) + +minetest.register_node("mytreasure:sunken3",{ + description = "Sunken Treasure 3", + drawtype = "mesh", + mesh = "mytreasure_chest.obj", + tiles = {"mytreasure_chestaqua.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky = 2, choppy=2,falling_node = 1, not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5}, + } + }, + drop = { + max_items = 10, + items = { + { + items = {"default:diamond 10"}, + rarity = 30, + }, + { + items = {"default:mese_crystal 10"}, + rarity = 1, + }, + { + items = {"default:gold_lump 10"}, + rarity = 3, + }, + { + items = {"default:goldblock 10"}, + rarity = 30, + }, + { + items = {"default:wood 20"}, + rarity = 1, + }, + { + items = {"default:pick_diamond 2"}, + rarity = 25, + }, + { + items = {"default:pick_steel 2"}, + rarity = 10, + }, + { + items = {"default:chest_locked 3"}, + rarity = 15, + }, + { + items = {"default:coalblock 10"}, + rarity = 20, + }, + { + items = {"default:sword_diamond 2"}, + rarity = 25, + }, + { + items = {"wool:white 50"}, + rarity = 3, + }, + { + items = {"default:tree 99"}, + rarity = 3, + }, + { + items = {"default:papyrus 30"}, + rarity = 3, + }, + { + items = {"default:copper_lump 99"}, + rarity = 12, + }, + + }, + }, +on_destruct = coins, +}) + +minetest.register_ore({ + ore_type = "scatter", + ore = "mytreasure:sunken3", + wherein = "default:water_source", + clust_scarcity = 180*180*180, + clust_num_ores = 1, + clust_size = 1, + height_min = -1000, + height_max = -5, +}) + +minetest.register_abm({ + nodenames = {"mytreasure:sunken1"}, + interval = 1, + chance = 1, + action = function(pos, node) + local nodeu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + + + if nodeu == "default:water_source" then + minetest.set_node(pos,{name = "default:water_source", param2 = node.param2}) + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z},{name = "mytreasure:sunken1", param2 = node.param2}) + end + end, +}) + +minetest.register_abm({ + nodenames = {"mytreasure:sunken2"}, + interval = 1, + chance = 1, + action = function(pos, node) + local nodeu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + + + if nodeu == "default:water_source" then + minetest.set_node(pos,{name = "default:water_source", param2 = node.param2}) + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z},{name = "mytreasure:sunken2", param2 = node.param2}) + end + end, +}) + +minetest.register_abm({ + nodenames = {"mytreasure:sunken3"}, + interval = 1, + chance = 1, + action = function(pos, node) + local nodeu = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name + + + if nodeu == "default:water_source" then + minetest.set_node(pos,{name = "default:water_source", param2 = node.param2}) + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z},{name = "mytreasure:sunken3", param2 = node.param2}) + end + end, +}) + + + + diff --git a/mods/mytreasure/textures/chestmap5.png b/mods/mytreasure/textures/chestmap5.png new file mode 100644 index 0000000..9417618 Binary files /dev/null and b/mods/mytreasure/textures/chestmap5.png differ diff --git a/mods/mytreasure/textures/mytreasure_alpha20.png b/mods/mytreasure/textures/mytreasure_alpha20.png new file mode 100644 index 0000000..ec908ca Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alpha20.png differ diff --git a/mods/mytreasure/textures/mytreasure_alpha30.png b/mods/mytreasure/textures/mytreasure_alpha30.png new file mode 100644 index 0000000..51038cb Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alpha30.png differ diff --git a/mods/mytreasure/textures/mytreasure_alpha40.png b/mods/mytreasure/textures/mytreasure_alpha40.png new file mode 100644 index 0000000..c3c902c Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alpha40.png differ diff --git a/mods/mytreasure/textures/mytreasure_alpha50.png b/mods/mytreasure/textures/mytreasure_alpha50.png new file mode 100644 index 0000000..844b3bf Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alpha50.png differ diff --git a/mods/mytreasure/textures/mytreasure_alpha60.png b/mods/mytreasure/textures/mytreasure_alpha60.png new file mode 100644 index 0000000..72e70b5 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alpha60.png differ diff --git a/mods/mytreasure/textures/mytreasure_alpha70.png b/mods/mytreasure/textures/mytreasure_alpha70.png new file mode 100644 index 0000000..0bbc1aa Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alpha70.png differ diff --git a/mods/mytreasure/textures/mytreasure_alphared.png b/mods/mytreasure/textures/mytreasure_alphared.png new file mode 100644 index 0000000..d34a7a3 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_alphared.png differ diff --git a/mods/mytreasure/textures/mytreasure_boom.png b/mods/mytreasure/textures/mytreasure_boom.png new file mode 100644 index 0000000..5f83a04 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_boom.png differ diff --git a/mods/mytreasure/textures/mytreasure_chest.png b/mods/mytreasure/textures/mytreasure_chest.png new file mode 100644 index 0000000..2011f59 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chest.png differ diff --git a/mods/mytreasure/textures/mytreasure_chest1_back.png b/mods/mytreasure/textures/mytreasure_chest1_back.png new file mode 100644 index 0000000..2dd71f4 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chest1_back.png differ diff --git a/mods/mytreasure/textures/mytreasure_chest1_bottom.png b/mods/mytreasure/textures/mytreasure_chest1_bottom.png new file mode 100644 index 0000000..435c6cd Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chest1_bottom.png differ diff --git a/mods/mytreasure/textures/mytreasure_chest1_front.png b/mods/mytreasure/textures/mytreasure_chest1_front.png new file mode 100644 index 0000000..4c2a845 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chest1_front.png differ diff --git a/mods/mytreasure/textures/mytreasure_chest1_side.png b/mods/mytreasure/textures/mytreasure_chest1_side.png new file mode 100644 index 0000000..9c0f7d8 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chest1_side.png differ diff --git a/mods/mytreasure/textures/mytreasure_chest1_top.png b/mods/mytreasure/textures/mytreasure_chest1_top.png new file mode 100644 index 0000000..8b1148a Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chest1_top.png differ diff --git a/mods/mytreasure/textures/mytreasure_chestaqua.png b/mods/mytreasure/textures/mytreasure_chestaqua.png new file mode 100644 index 0000000..fbf98c5 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chestaqua.png differ diff --git a/mods/mytreasure/textures/mytreasure_chestdesert.png b/mods/mytreasure/textures/mytreasure_chestdesert.png new file mode 100644 index 0000000..823c0c7 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chestdesert.png differ diff --git a/mods/mytreasure/textures/mytreasure_chestdungeon.png b/mods/mytreasure/textures/mytreasure_chestdungeon.png new file mode 100644 index 0000000..edb7371 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chestdungeon.png differ diff --git a/mods/mytreasure/textures/mytreasure_chestkaboom.png b/mods/mytreasure/textures/mytreasure_chestkaboom.png new file mode 100644 index 0000000..f966362 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chestkaboom.png differ diff --git a/mods/mytreasure/textures/mytreasure_chestm.png b/mods/mytreasure/textures/mytreasure_chestm.png new file mode 100644 index 0000000..9417618 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_chestm.png differ diff --git a/mods/mytreasure/textures/mytreasure_cheststone.png b/mods/mytreasure/textures/mytreasure_cheststone.png new file mode 100644 index 0000000..11be8ac Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_cheststone.png differ diff --git a/mods/mytreasure/textures/mytreasure_coin.png b/mods/mytreasure/textures/mytreasure_coin.png new file mode 100644 index 0000000..541b3c4 Binary files /dev/null and b/mods/mytreasure/textures/mytreasure_coin.png differ diff --git a/mods/mytreasure/textures/old/chestmap5.png b/mods/mytreasure/textures/old/chestmap5.png new file mode 100644 index 0000000..9417618 Binary files /dev/null and b/mods/mytreasure/textures/old/chestmap5.png differ diff --git a/mods/mytreasure/textures/old/mytreasure_chest1_back.png b/mods/mytreasure/textures/old/mytreasure_chest1_back.png new file mode 100644 index 0000000..2dd71f4 Binary files /dev/null and b/mods/mytreasure/textures/old/mytreasure_chest1_back.png differ diff --git a/mods/mytreasure/textures/old/mytreasure_chest1_bottom.png b/mods/mytreasure/textures/old/mytreasure_chest1_bottom.png new file mode 100644 index 0000000..435c6cd Binary files /dev/null and b/mods/mytreasure/textures/old/mytreasure_chest1_bottom.png differ diff --git a/mods/mytreasure/textures/old/mytreasure_chest1_front.png b/mods/mytreasure/textures/old/mytreasure_chest1_front.png new file mode 100644 index 0000000..4c2a845 Binary files /dev/null and b/mods/mytreasure/textures/old/mytreasure_chest1_front.png differ diff --git a/mods/mytreasure/textures/old/mytreasure_chest1_side.png b/mods/mytreasure/textures/old/mytreasure_chest1_side.png new file mode 100644 index 0000000..9c0f7d8 Binary files /dev/null and b/mods/mytreasure/textures/old/mytreasure_chest1_side.png differ diff --git a/mods/mytreasure/textures/old/mytreasure_chest1_top.png b/mods/mytreasure/textures/old/mytreasure_chest1_top.png new file mode 100644 index 0000000..8b1148a Binary files /dev/null and b/mods/mytreasure/textures/old/mytreasure_chest1_top.png differ diff --git a/mods/mytreasure/textures/old/mytreasure_chestm.png b/mods/mytreasure/textures/old/mytreasure_chestm.png new file mode 100644 index 0000000..19cf642 Binary files /dev/null and b/mods/mytreasure/textures/old/mytreasure_chestm.png differ diff --git a/mods/pathogen/API.md b/mods/pathogen/API.md new file mode 100644 index 0000000..a81cf89 --- /dev/null +++ b/mods/pathogen/API.md @@ -0,0 +1,196 @@ +# API + +## Register pathogens +```lua +pathogen.register_pathogen("pathogenia", { + description = "An example disease", + symptoms = 12, + latent_period = 240, + infection_period = 740, + on_infect = function( infection ) + minetest.sound_play( "pathogen_cough", { pos = pos, gain = 0.3 } ) + end, + on_symptom = function( infection ) + minetest.sound_play( "pathogen_cough", { pos = pos, gain = 0.3 } ) + end + on_death = function( infection ) + end +}) +``` + +## Pathogen definition +|key|type|description| +|---|----|-----------| +|symptom|number|the amount of times symptoms are shown| +|latent_period|number|seconds before the symptoms start showing| +|infection_period|number|seconds from infection till last symptom| +|on_infect( infection )|function|actions to perform when infected ( this happens as soon as the infection takes place )| +|on_symptom( infection )|function|happens as many times as the defined symptom amount| +|on_death( infection )|function|called when the player dies while having the pathogen| + +### infection +All function in the pathogen definition give an infection table as callback. +The infection table includes. + +|key|type|description| +|---|----|-----------| +|symptom|number|an integer that represents the index of current symptom| +|player|string|the name of the player| +|immune|bool|when true the infection has stopped. For now it does not mean that the player cant be reinfected| +|pathogen|string|the name of the pathogen| + +# API Functions + +```lua +----------- +--PATHOGENS +----------- + +pathogen.register_pathogen = function( pathogen_name, definition ) + --checks if pathogen is registererd and registers if not + ---- + +pathogen.get_pathogen = function( pathogen_name ) + --get the table of a particular pathogen + ---- + +pathogen.get_pathogens = function() + --gives all the pathogens that are registered + ---- + +-------------- +--CONTAMINENTS +-------------- + +pathogen.spawn_fluid = function( name, pos, pathogen_name ) + --spawn the infectious juices + ---- + +pathogen.register_fluid = function( name ) + --registering a fluid(juice). This assumes that all fluids are flat on the + --floor + ------ + +pathogen.contaminate = function( pos, pathogen_name ) + --contaminates a node which when dug infects the player that dug the node + ---- + +pathogen.decontaminate = function( pos ) + --remove the contamination from the node + ---- + +pathogen.get_contaminant = function( pos ) + --used to check if the node is infected and to get the name of the pathogen + --with which it is infected + ------ +------------ +--INFECTIONS +------------ +pathogen.infect = function( _pathogen, player_name ) + --infects the player with a pathogen. If not able returns false + ---- + --return false if pathogen does not exist or player is immune + --consider making an is_immune function + ---- + --The table containing all the data that a infection cinsists out of. See + --the README.md for a more extensive explanation + ----- + + --store the infection in a table for later use. This table is also saved and + --loaded if the persistent option is set + ------ + --check if on_infect has been registered in pathogen + ---- + --perform the on_infect command that is defined in the regsiter function + --this is not the same as the on_symptoms. It is called only once at the + --beginning of the infection + -------- + --latent perios is the time till the first symptom shows + ---- + --show the first symptom + ---- + +pathogen.perform_symptom = function( infection, symptom ) + --An infection can also be initiated without having to perform the on_infect. + --you can can cut straight to a particular symptom by using this function + --notice the symptom_n argument. This is a number that determines the state of + --the infection. + -- + --only keep showing symptoms if there is no immunity against the pathogen + ---- + --only show symptoms if not all symptoms have occured. + ---- + --set the time till the next symptom and then perfrom it again + ---- + --survives and is now immunized, immunization lasts till the server is + --restarted + +pathogen.immunize = function( infection ) + --immunize a player so the next symptom won't show. It also disables the + --abilty to reinfect the player. Use pathogen.disinfect to also remove + --the immunization It will also trigger the on_cured when the next symptom + --would have triggered. + ---- + --do not immunize if alread y immunized, return false + --else immunize the player and return true + +pathogen.disinfect = function( infection ) + --removes the immunization and the infection all together + ---- + --only is the is infected does it do this, return true + -- else it will only return false + +pathogen.get_infection = function( player_name, pathogen_name ) + --get an infection of a certain player + ---- + --only if the infection is registered + --otherwise return nil + +pathogen.get_infections = function( ) + --gives all the infections of all the players. If not infections are defined + --it returns an empty table. That's it. + +pathogen.get_player_infections = function( player_name ) + --helper function for getting the infections of a certain player + ---- + --gets and loops through the infections + ---- + --and adds the infection to the output of matches the player_name + +------------- +--PERSISTENCE +------------- + +pathogen.save = function( ) + --TODO save the infections so it won"t get lost between server reloads + +pathogen.load = function( ) + --TODO reinfect the players when they rejoin the server. it remembers the + --infection fase thus the infection continues and does not get reset. + +--------- +--HELPERS +--------- + +pathogen.get_players_in_radius = function( pos, radius ) + --helper to get players within the radius. + ---- + --loops threw all objects in within a radius + ---- + --and check if the object is a player + +pathogen.on_dieplayer = function( player ) + --when dying while having a pathogen it will trigger the on_death of the + --pathogen and it will remove all player infections + ---- + --loops through the player infections + ---- + --checks if it is a valid and still registered pathogen + ---- + --it then triggers the on_death if the on_death is defined + +pathogen.on_dignode = function( pos, digger ) + --infects players that dig a node that is infected with a pathogen + ---- +``` + diff --git a/mods/pathogen/README.md b/mods/pathogen/README.md new file mode 100644 index 0000000..78069ca --- /dev/null +++ b/mods/pathogen/README.md @@ -0,0 +1,87 @@ +# PATHOGEN + +A minetest mod that enables users to get a pathogen. + +# Features + +- Easily define a new pathogen using the pathogen API +- Demo pathogens that are infectious and sometimes deadly. + +# Diseases + +## Gravititus +Occurs when ascending too quickly. Symptons include hiccups and random sense of +gravity. There is no known cure yet. ( any suggestions? stone soup anyone? ) + +## Influencia +Highly contagious as it is airborne. Being around someone that has the diseases +increases the chances of getting the virus drastically. It is advised to eat well +and keep your distance from players that are coughing. Death is very unlikely. + +## Panola +Contagious through body fluids. It is ok to be near someone that has the disease. +Make sure that when cleaning up after someone that has expelled fluids, to +decontaminate the fluids first. This can be done with the Decontaminator +![Decontaminator](pathogen/textures/pathogen_decontaminator.png). + +## Gosirea +Symptons include gas and burps. Occasionaly a shard. +Carrier contaminates nearby surfaces when symptoms show. These can intern infect +players that dig the infected nodes. Not deadly for those that have good health. + +# Items +- Comes with nodes like vomit, blood and feces that are infectious when dug. +- A bio hazard warning fence, in case a quarantine is required. +- A decontaminater for removing infectious fluids. + +# Crafts + +```lua +pathogen.recipes['xpanes:fence_warning'] = { + {'group:stick', 'wool:red', 'group:stick'}, + {'group:stick', 'wool:red', 'group:stick'}, + {'group:stick', 'wool:red', 'group:stick'} +} + +pathogen.recipes['pathogen:decontaminator'] = { + {'xpanes:bar','',''}, + {'','default:steelblock',''}, + {'','',''} +} +``` + +# Commands + +Infections can be initiated by using commands. It requires the "pathogen" +privilege. /grant pathogen. + +```lua + +/pathogens +--list all pathogens and their descriptions + +/infect +--infect the player + +/immunize +--make player immune to particular pathogen + +``` + +# Roadmap + +- saving infections for persistence between server restarts +- more pathogens and cures +- make the API more flexible, consistent and forgiving +- register immunization with pathogen in seconds + +# Reference + +- https://en.wikipedia.org/wiki/Incubation_period#mediaviewer/File:Concept_of_incubation_period.svg +- https://www.freesound.org + +# License + +- Code WTFPL +- Images WTFPL +- Sounds CC diff --git a/mods/pathogen/gosirea/depends.txt b/mods/pathogen/gosirea/depends.txt new file mode 100644 index 0000000..5adc6a5 --- /dev/null +++ b/mods/pathogen/gosirea/depends.txt @@ -0,0 +1 @@ +pathogen diff --git a/mods/pathogen/gosirea/init.lua b/mods/pathogen/gosirea/init.lua new file mode 100644 index 0000000..a484433 --- /dev/null +++ b/mods/pathogen/gosirea/init.lua @@ -0,0 +1,43 @@ +pathogen.register_pathogen("gosirea", { + description = "Symptons include gas. Carrier contaminates surfaces nearby. Not deadly for those that have good health", + symptoms = 10, + latent_period = 120, + infection_period = 420, + on_infect = function( infection ) + local _player = minetest.get_player_by_name( infection.player ) + local _pos = _player:getpos() + minetest.sound_play( "pathogen_cough", { pos = _pos, gain = 0.3 } ) + end, + on_symptom = function( infection ) + local player = minetest.get_player_by_name( infection.player ) + local pos = player:getpos() + local burp = function() + if math.random(2) == 1 then + return 'pathogen_burp_1' + else + return 'pathogen_burp_2' + end + end + local contaminate = function( pos ) + local contaminate_pos = { + x = pos.x + math.random( -5,5 ), + y = pos.y + math.random( -5,5 ), + z = pos.z + math.random( -5,5 ) + } + pathogen.contaminate( contaminate_pos ) + end + local hp = player:get_hp() + if hp <= 5 then + player:set_hp( hp - 1 ) + end + if math.random(25) == 1 then + pathogen.spawn_fluid( "feces", pos, infection.pathogen ) + minetest.sound_play( "pathogen_poop", { pos = pos, gain = 0.3} ) + else + minetest.sound_play( burp(), { pos = pos, gain = 0.3 } ) + end + for i=0,3 do + contaminate( pos ) + end + end +}) diff --git a/mods/pathogen/gravititus/depends.txt b/mods/pathogen/gravititus/depends.txt new file mode 100644 index 0000000..5adc6a5 --- /dev/null +++ b/mods/pathogen/gravititus/depends.txt @@ -0,0 +1 @@ +pathogen diff --git a/mods/pathogen/gravititus/init.lua b/mods/pathogen/gravititus/init.lua new file mode 100644 index 0000000..19ea441 --- /dev/null +++ b/mods/pathogen/gravititus/init.lua @@ -0,0 +1,51 @@ +local gravititus = {} + +local set_player_gravity = function( player_name, gravity ) + local player = minetest.get_player_by_name( player_name ) + local pos = player:getpos() + minetest.sound_play( "gravititus_hiccup", { pos = pos, gain = 0.3 } ) + player:set_physics_override({ + gravity = gravity + }) +end + +pathogen.register_pathogen("gravititus", { + description = "Occurs when ascending too quickly. Symptons are hiccups and random sense of gravity.", + symptoms = 10, + latent_period = 120, + infection_period = 420, + on_infect = function( infection ) + set_player_gravity( infection.player, 2 / math.random( 1, 5 ) ) + minetest.sound_play( "gravititus_hiccup", { pos = pos, gain = 0.3 } ) + end, + on_symptom = function( infection ) + set_player_gravity( infection.player, 2/ math.random( 1, 5 ) ) + minetest.sound_play( "gravititus_hiccup", { pos = pos, gain = 0.3 } ) + end, + on_death = function( infection ) + set_player_gravity( infection.player, 1 ) + end, + on_cured = function( infection ) + set_player_gravity( infection.player, 1 ) + end +}) + +minetest.register_on_dignode( function( pos, node, digger ) + --determines when infection occurs. + ---- + local pln = digger:get_player_name() + local pos = pos + local pre = gravititus[pln] + gravititus[pln] = pos + if ( pre == nil ) then + minetest.after( 15, function() + local pre = gravititus[pln] + local dis = math.abs( pre.y - pos.y ) + if ( dis > 20 ) then + local pat = pathogen.get_pathogen( 'gravititus' ) + pathogen.infect( pat, pln ) + end + gravititus[pln] = nil + end) + end +end ) diff --git a/mods/pathogen/gravititus/sounds/gravititus_hiccup.ogg b/mods/pathogen/gravititus/sounds/gravititus_hiccup.ogg new file mode 100644 index 0000000..914d4eb Binary files /dev/null and b/mods/pathogen/gravititus/sounds/gravititus_hiccup.ogg differ diff --git a/mods/pathogen/influencia/depends.txt b/mods/pathogen/influencia/depends.txt new file mode 100644 index 0000000..5adc6a5 --- /dev/null +++ b/mods/pathogen/influencia/depends.txt @@ -0,0 +1 @@ +pathogen diff --git a/mods/pathogen/influencia/init.lua b/mods/pathogen/influencia/init.lua new file mode 100644 index 0000000..e48412d --- /dev/null +++ b/mods/pathogen/influencia/init.lua @@ -0,0 +1,36 @@ +pathogen.register_pathogen("influencia", { + description = "Highly contagious and possibly deadly for those with low health.", + symptoms = 12, + latent_period = 240, + infection_period = 740, + on_infect = function( infection ) + local _player = minetest.get_player_by_name( infection.player ) + local _pos = _player:getpos() + minetest.sound_play( "pathogen_cough", { pos = _pos, gain = 0.3 } ) + end, + on_symptom = function( infection ) + local player = minetest.get_player_by_name( infection.player ) + local pos = player:getpos() + local players_nearby = pathogen.get_players_in_radius(pos, 5) + local hp = player:get_hp() + if hp <= 14 then + player:set_hp( hp - 1 ) + if math.random(10) == 1 then + player:set_hp( 6 ) + end + end + if math.random(2) == 1 then + minetest.sound_play( "pathogen_sneeze", { pos = pos, gain = 0.3 } ) + else + minetest.sound_play( "pathogen_cough", { pos = pos, gain = 0.3 } ) + end + for index, player_nearby in ipairs(players_nearby) do + local player_nearby_name = player_nearby:get_player_name() + if player_nearby_name ~= infection.player then + if math.random(3) == 1 then + pathogen.infect( infection.pathogen, player_nearby_name ) + end + end + end + end +}) diff --git a/mods/pathogen/lunit/init.lua b/mods/pathogen/lunit/init.lua new file mode 100644 index 0000000..b196157 --- /dev/null +++ b/mods/pathogen/lunit/init.lua @@ -0,0 +1,52 @@ +lunit = {} + +lunit.tests = function( name, tests ) + print("TEST: "..name) + local succes = function( description ) + print( 'succes: '..description ) + return true + end + local failed = function( description, expected, value ) + print( 'failed: '..description..'\texpected '..tostring(expected)..' got '..tostring(value) ) + return false + end + local unit = { + ok = function( value, description ) + if value then + succes( description ) + else + failed( description, 'true-ish', value ) + end + return value + end, + equal = function( value, expected, description) + if value == expected then + succes( description ) + else + failed( description, expected, value ) + end + return value + end, + } + return tests( unit ) +end + +if false then + --used to test the framewrk itself + lunit.tests( 'lunit succes', function( unit ) + unit.ok( true, 'true is ok') + unit.ok( {}, 'table is ok') + unit.equal( true, true, 'equals true') + unit.equal( false, false, 'equals false') + unit.equal( 'hello', 'hello', 'equals string') + unit.equal( type(''), 'string', 'is type') + end) + --fail + lunit.tests( 'lunit fails', function( unit ) + unit.ok( false, 'true is ok') + unit.equal( false, true, 'equals true') + unit.equal( false , {}, 'false equals table') + unit.equal( true, false, 'equals false') + unit.equal( 'hello', 'world', 'does not equal string') + end) +end diff --git a/mods/pathogen/modpack.txt b/mods/pathogen/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/pathogen/panola/depends.txt b/mods/pathogen/panola/depends.txt new file mode 100644 index 0000000..5adc6a5 --- /dev/null +++ b/mods/pathogen/panola/depends.txt @@ -0,0 +1 @@ +pathogen diff --git a/mods/pathogen/panola/init.lua b/mods/pathogen/panola/init.lua new file mode 100644 index 0000000..ae8ce06 --- /dev/null +++ b/mods/pathogen/panola/init.lua @@ -0,0 +1,29 @@ +pathogen.register_pathogen("panola", { + description = "Panola virus is highly contagious. It spreads threw bodily fluids.", + symptoms = 20, + latent_period = 840, + infection_period = 1200, + on_death = function( infection ) + local _player = minetest.get_player_by_name( infection.player ) + local _pos = _player:getpos() + pathogen.spawn_fluid( "blood", _pos, infection.pathogen ) + minetest.sound_play( "pathogen_bleed", { pos = _pos, gain = 0.3} ) + end, + on_symptom = function( infection ) + local player = minetest.get_player_by_name( infection.player ) + local pos = player:getpos() + local hp = player:get_hp() + if hp > 12 then + player:set_hp( math.floor(hp /2 ) ) + else + player:set_hp( hp - 1 ) + end + if math.random(0, 1) == 1 then + pathogen.spawn_fluid( "vomit", pos, infection.pathogen ) + minetest.sound_play( "pathogen_vomit", { pos = pos, gain = 0.3} ) + else + pathogen.spawn_fluid( "feces", pos, infection.pathogen ) + minetest.sound_play( "pathogen_poop", { pos = pos, gain = 0.3} ) + end + end +}) diff --git a/mods/pathogen/pathogen/api.lua b/mods/pathogen/pathogen/api.lua new file mode 100644 index 0000000..875d858 --- /dev/null +++ b/mods/pathogen/pathogen/api.lua @@ -0,0 +1,374 @@ +----------- +--PATHOGENS +----------- +pathogen.register_pathogen = function( pathogen_name, definition ) + --checks if pathogen is registererd and registers if not + ---- + if not pathogen.get_pathogen( pathogen_name ) then + definition.name = pathogen_name; + pathogen.pathogens[pathogen_name] = definition + return pathogen.pathogens[pathogen_name] + else + return false + end +end + +pathogen.get_pathogen = function( pathogen_name ) + --get the table of a particular pathogen + ---- + return pathogen.pathogens[pathogen_name] +end + +pathogen.get_pathogens = function() + --gives all the pathogens that are registered + ---- + return pathogen.pathogens +end +-------------- +--CONTAMINENTS +-------------- +pathogen.spawn_fluid = function( name, pos, pathogen_name ) + --spawn the infectious juices + ---- + if minetest.get_node( pos ).name == "air" then + local node_name = "pathogen:fluid_"..name + minetest.set_node( pos, { name = node_name, param2=1 } ) + pathogen.contaminate( pos, pathogen_name ) + end +end + +pathogen.register_fluid = function( name ) + --registering a fluid(juice). This assumes that all fluids are flat on the + --floor + ------ + local texture = "pathogen_fluid_"..name..".png" + local node_name = "pathogen:fluid_"..name + pathogen.fluids[ name ] = node_name + minetest.register_node( node_name, { + description= name, + drawtype = "signlike", + inventory_image = texture, + tiles = { texture }, + paramtype = "light", + paramtype2 = "wallmounted", + walkable = false, + sunlight_propagates = true, + drop = "", + groups = { oddly_breakable_by_hand = 2, crumbly = 2 }, + on_punch = function(pos, node, puncher, pointed_thing) + local meta = minetest.get_meta( pos ) + local pathogen_name = meta:get_string( "pathogen" ) + local player_name = puncher:get_player_name() + local _pathogen = pathogen.get_pathogen( pathogen_name ) + if _pathogen then + pathogen.infect( _pathogen, player_name ) + end + end, + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -7.9/16, 0.5}, + }, + }) +end + +pathogen.contaminate = function( pos, pathogen_name ) + --contaminates a node which when dug infects the player that dug the node + ---- + local meta = minetest.get_meta( pos ) + if meta then + meta:set_string( 'pathogen', pathogen_name ) + return true + else + return false + end +end + +pathogen.decontaminate = function( pos ) + --remove the contamination from the node + ---- + local meta = minetest.get_meta( pos ) + if meta then + local str = meta:get_string('pathogen') + if str ~= '' then + meta:set_string( 'pathogen', '' ) + return true + else + return false + end + else + return false + end +end + +pathogen.get_contaminant = function( pos ) + --used to check if the node is infected and to get the name of the pathogen + --with which it is infected + ------ + local meta = minetest.get_meta( pos ) + if not meta then return false end + local pathogen_name = meta:get_string( 'pathogen' ) + if pathogen_name then + if pathogen_name ~= '' then + return pathogen_name + else + return false + end + else + return false + end +end +------------ +--INFECTIONS +------------ +pathogen.infect = function( _pathogen, player_name ) + --infects the player with a pathogen. If not able returns false + ---- + local infection = pathogen.get_infection( player_name, _pathogen.name ) + if ( infection ~= nil ) then + --return false if pathogen does not exist or player is immune + if ( infection.immune ) then return false end + end + --consider making an is_immune function + ---- + local infection = { + --The table containing all the data that a infection cinsists out of. See + --the README.md for a more extensive explanation + ----- + id = player_name.._pathogen.name, + symptom = 0, + pathogen = _pathogen, + immune = false, + player = player_name + } + + pathogen.infections[ player_name.._pathogen.name ] = infection + --store the infection in a table for later use. This table is also saved and + --loaded if the persistent option is set + ------ + local on_infect = _pathogen.on_infect + if on_infect then + --check if on_infect has been registered in pathogen + ---- + if minetest.get_player_by_name( player_name ) then + on_infect( infection ) + end + end + --perform the on_infect command that is defined in the regsiter function + --this is not the same as the on_symptoms. It is called only once at the + --beginning of the infection + -------- + minetest.after( _pathogen.latent_period, function() + --latent perios is the time till the first symptom shows + ---- + pathogen.perform_symptom( infection, 0 ) + --show the first symptom + ---- + end) + return infection +end + +pathogen.perform_symptom = function( infection, symptom ) + --An infection can also be initiated without having to perform the on_infect. + --you can can cut straight to a particular symptom by using this function + --notice the symptom_n argument. This is a number that determines the state of + --the infection. + ---------- + if infection.immune then return false end + --only keep showing symptoms if there is no immunity against the pathogen + ---- + local symptom = symptom + 1 + if ( infection.pathogen.symptoms >= symptom ) then --check if all symptoms have occured + --only show symptoms if not all symptoms have occured. + ---- + infection.symptom = symptom + + local on_symptom = infection.pathogen.on_symptom + if on_symptom then + if minetest.get_player_by_name( infection.player ) then + on_symptom( infection ) + end + end + + local interval = ( ( infection.pathogen.infection_period - infection.pathogen.latent_period ) / infection.pathogen.symptoms ) + minetest.after( interval , function() + --set the time till the next symptom and then perfrom it again + -- + pathogen.perform_symptom( infection, symptom ) + end) + infection.symptom = symptom + return true + elseif ( infection.pathogen.symptoms < symptom ) then + ---- + --survives and is now immunized, immunization lasts till the server is + --restarted + ------ + local on_recover = infection.pathogen.on_recover + if on_recover and ( infection.pathogen.symptoms+1 == symptom ) then + pathogen.immunize( infection ) + local result = on_recover( infection ) + if minetest.get_player_by_name( infection.player ) then + on_recover( infection ) + end + return true + else + return false + end + else + return false + end +end + +pathogen.immunize = function( infection ) + --immunize a player so the next symptom won't show. It also disables the + --abilty to reinfect the player. Use pathogen.disinfect to also remove + --the immunization It will also trigger the on_cured when the next symptom + --would have triggered. + ---- + if infection.immune == true then + --do not immunize if alread y immunized, return false + -- + return false + else + --else immunize the player and return true + infection.immune = true + return true + end +end + +pathogen.disinfect = function( infection ) + --removes the immunization and the infection all together + ---- + if pathogen.infections[ infection.player..infection.pathogen.name ] then + --only is the is infected does it do this, return true + pathogen.infections[ infection.player..infection.pathogen.name ]= nil + return true + else + -- else it will only return false + return false + end +end + +pathogen.get_infection = function( player_name, pathogen_name ) + --get an infection of a certain player + ---- + if player_name and pathogen_name then + --only if the infection is registered + return pathogen.infections[ player_name..pathogen_name ] + else + --otherwise return nil + return nil + end +end + +pathogen.get_infections = function( ) + --gives all the infections of all the players. If not infections are defined + --it returns an empty table. That's it. + return pathogen.infections +end + +pathogen.get_player_infections = function( player_name ) + --helper function for getting the infections of a certain player + ---- + local infections = pathogen.get_infections() + local output = {} + for index, infection in pairs(infections) do + --gets and loops through the infections + ---- + if infection.player == player_name then + --and adds the infection to the output of matches the player_name + output[#output+1] = infection + end + end + return output +end + +------------- +--PERSISTENCE +------------- + +------------- +--PERSISTENCE +------------- + +pathogen.save = function( ) + --TODO save the infections so it won"t get lost between server reloads + local serialized = minetest.serialize( infections ) + return serialized +end + +pathogen.load = function( ) + --TODO reinfect the players when they rejoin the server. it remembers the + --infection fase thus the infection continues and does not get reset. + local deserialized = minetest.deserialize(string) + return deserialized +end + +--------- +--HELPERS +--------- + +--------- +--HELPERS +--------- + +pathogen.get_players_in_radius = function( pos, radius ) + --helper to get players within the radius. + ---- + local objects = minetest.get_objects_inside_radius(pos, 5) + local players = {} + for index, object in ipairs(objects) do + --loops threw all objects in within a radius + ---- + if object:is_player() then + --and check if the object is a player + players[#players+1] = object + end + end + return players +end + +pathogen.on_dieplayer = function( player ) + --when dying while having a pathogen it will trigger the on_death of the + --pathogen and it will remove all player infections + ---- + local player_name = player:get_player_name() + local _infections = pathogen.get_player_infections( player_name ) + for index, infection in pairs(_infections) do + --loops through the player infections + ---- + local _pathogen = pathogen.get_pathogen( infection.pathogen ) + if _pathogen then + --checks if it is a valid and still registered pathogen + ---- + local on_death = _pathogen.on_death + if on_death then + --it then triggers the on_death if the on_death is defined + pathogen.disinfect( infection ) + on_death( infection ) + return true + end + end + end + return false +end + +pathogen.on_dignode = function( pos, digger ) + --infects players that dig a node that is infected with a pathogen + ---- + local pathogen_name = pathogen.get_contaminant( pos ) + if pathogen_name then + local _pathogen = pathogen.get_pathogen( pathogen_name ) + local player_name = digger:get_player_name( ) + return pathogen.infect( _pathogen, player_name ) + end + return false +end + +minetest.register_on_dignode( function( pos, oldnode, digger) + pathogen.on_dignode( pos, digger ) +end) + +minetest.register_on_dieplayer( function( player ) + pathogen.on_dieplayer( player ) +end) + diff --git a/mods/pathogen/pathogen/commands.lua b/mods/pathogen/pathogen/commands.lua new file mode 100644 index 0000000..4cff79f --- /dev/null +++ b/mods/pathogen/pathogen/commands.lua @@ -0,0 +1,60 @@ +minetest.register_privilege('pathogen', "infect and cure players of pathogens") + +minetest.register_chatcommand("infect", { + params = " ", + description = "infect a player with a pathogen", + privs = { pathogen=true }, + func = function(name, params) + local params = params:split(' ') + local player_name = params[1] + local pathogen_name = params[2] + if not minetest.get_player_by_name( player_name ) then + minetest.chat_send_player(name, 'could not infect: player '..player_name..' does not exist') + end + local _pathogen = pathogen.get_pathogen( pathogen_name ) + if _pathogen then + local infection = pathogen.infect( _pathogen, player_name ) + if infection then + minetest.chat_send_player(name, 'infected: '..player_name..' with '..pathogen_name ) + else + minetest.chat_send_player(name, 'could not infect: '..pathogen_name..' is immune') + end + else + minetest.chat_send_player(name, 'could not infect: pathogen '..pathogen_name..' does not exist') + end + end +}) + +minetest.register_chatcommand("pathogens", { + params = "", + description = "list all available pathogens", + privs = {}, + func = function(name, params) + local pathogens = pathogen.get_pathogens() + for key, _pathogen in pairs( pathogens ) do + if _pathogen.description then + minetest.chat_send_player( name, _pathogen.name..' - '.._pathogen.description ) + else + minetest.chat_send_player( name, _pathogen.name ) + end + end + end +}) + +minetest.register_chatcommand("immunize", { + params = " ", + description = "immunize a player from an infection", + privs = { pathogen=true }, + func = function(name, params) + local params = params:split(' ') + local player_name = params[1] + local pathogen_name = params[2] + local infection = pathogen.get_infection( player_name, pathogen_name ) + if infection then + pathogen.immunize( infection ) + minetest.chat_send_player(name, 'immunized: player '..player_name..' from '..pathogen_name) + else + minetest.chat_send_player(name, 'could not immunize: infection does not exist' ) + end + end +}) diff --git a/mods/pathogen/pathogen/crafts.lua b/mods/pathogen/pathogen/crafts.lua new file mode 100644 index 0000000..9a1e9d8 --- /dev/null +++ b/mods/pathogen/pathogen/crafts.lua @@ -0,0 +1,4 @@ +minetest.register_craft({ + output = 'pathogen:decontaminator', + recipe = pathogen.recipes['pathogen:decontaminator'] +}) diff --git a/mods/pathogen/pathogen/depends.txt b/mods/pathogen/pathogen/depends.txt new file mode 100644 index 0000000..0052466 --- /dev/null +++ b/mods/pathogen/pathogen/depends.txt @@ -0,0 +1,3 @@ +default +wool +xpanes? diff --git a/mods/pathogen/pathogen/init.lua b/mods/pathogen/pathogen/init.lua new file mode 100644 index 0000000..2a76e12 --- /dev/null +++ b/mods/pathogen/pathogen/init.lua @@ -0,0 +1,13 @@ +pathogen = { + pathogens = {}, + infections = {}, + fluids = {}, +} + +dofile( minetest.get_modpath( "pathogen" ) .. "/options.lua" ) --WIP +dofile( minetest.get_modpath( "pathogen" ) .. "/recipes.lua") +dofile( minetest.get_modpath( "pathogen" ) .. "/api.lua" ) +dofile( minetest.get_modpath( "pathogen" ) .. "/tools.lua" ) +dofile( minetest.get_modpath( "pathogen" ) .. "/crafts.lua" ) +dofile( minetest.get_modpath( "pathogen" ) .. "/nodes.lua" ) +dofile( minetest.get_modpath( "pathogen" ) .. "/commands.lua" ) diff --git a/mods/pathogen/pathogen/nodes.lua b/mods/pathogen/pathogen/nodes.lua new file mode 100644 index 0000000..683dd27 --- /dev/null +++ b/mods/pathogen/pathogen/nodes.lua @@ -0,0 +1,47 @@ +pathogen.register_fluid( 'vomit' ) +pathogen.register_fluid( 'blood' ) +pathogen.register_fluid( 'feces' ) + +if not minetest.get_modpath( "xpanes" ) then + + minetest.register_node("pathogen:fence", { + description = "Infection Hazard Fence", + drawtype = 'nodebox', + tiles = {"pathogen_fence.png"}, + inventory_image = 'pathogen_fence.png', + paramtype = "light", + sunlight_propagates = true, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + node_box = { + type = 'fixed', + fixed = { + {-0.5, -0.5, 63/128, + 0.5, 0.5 , 63/128}, + } + }, + }) + +else + + xpanes.register_pane("fence_warning", { + description = "Infection Hazard Fence", + tiles = {"pathogen_fence.png"}, + drawtype = "airlike", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + air_equivalent = true, + textures = {"pathogen_fence.png", "pathogen_fence.png", 'xpanes_space.png'}, + inventory_image = "pathogen_fence.png", + wield_image = "pathogen_fence.png", + groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1}, + recipe = pathogen.recipes['xpanes:fence_warning'] + }) + +end diff --git a/mods/pathogen/pathogen/options.lua b/mods/pathogen/pathogen/options.lua new file mode 100644 index 0000000..f44c560 --- /dev/null +++ b/mods/pathogen/pathogen/options.lua @@ -0,0 +1,5 @@ +--DOES NOT WORK YET WIP +pathogen.options = { + persistence = false, + immunization = false, +} diff --git a/mods/pathogen/pathogen/recipes.lua b/mods/pathogen/pathogen/recipes.lua new file mode 100644 index 0000000..093067d --- /dev/null +++ b/mods/pathogen/pathogen/recipes.lua @@ -0,0 +1,13 @@ +pathogen.recipes = {} + +pathogen.recipes['xpanes:fence_warning'] = { + {'group:stick', 'wool:red', 'group:stick'}, + {'group:stick', 'wool:red', 'group:stick'}, + {'group:stick', 'wool:red', 'group:stick'} +} + +pathogen.recipes['pathogen:decontaminator'] = { + {'xpanes:bar','',''}, + {'','default:steelblock',''}, + {'','',''} +} diff --git a/mods/pathogen/pathogen/sounds/pathogen_bleed.ogg b/mods/pathogen/pathogen/sounds/pathogen_bleed.ogg new file mode 100644 index 0000000..83722c0 Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_bleed.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_burp_1.ogg b/mods/pathogen/pathogen/sounds/pathogen_burp_1.ogg new file mode 100644 index 0000000..07500c4 Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_burp_1.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_burp_2.ogg b/mods/pathogen/pathogen/sounds/pathogen_burp_2.ogg new file mode 100644 index 0000000..0d9086d Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_burp_2.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_cough.ogg b/mods/pathogen/pathogen/sounds/pathogen_cough.ogg new file mode 100644 index 0000000..63d6bf4 Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_cough.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_poop.ogg b/mods/pathogen/pathogen/sounds/pathogen_poop.ogg new file mode 100644 index 0000000..2d1f47e Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_poop.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_sneeze.ogg b/mods/pathogen/pathogen/sounds/pathogen_sneeze.ogg new file mode 100644 index 0000000..3f22965 Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_sneeze.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_spray.ogg b/mods/pathogen/pathogen/sounds/pathogen_spray.ogg new file mode 100644 index 0000000..bace721 Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_spray.ogg differ diff --git a/mods/pathogen/pathogen/sounds/pathogen_vomit.ogg b/mods/pathogen/pathogen/sounds/pathogen_vomit.ogg new file mode 100644 index 0000000..15fe351 Binary files /dev/null and b/mods/pathogen/pathogen/sounds/pathogen_vomit.ogg differ diff --git a/mods/pathogen/pathogen/textures/pathogen_decontaminator.png b/mods/pathogen/pathogen/textures/pathogen_decontaminator.png new file mode 100644 index 0000000..5380fd1 Binary files /dev/null and b/mods/pathogen/pathogen/textures/pathogen_decontaminator.png differ diff --git a/mods/pathogen/pathogen/textures/pathogen_fence.png b/mods/pathogen/pathogen/textures/pathogen_fence.png new file mode 100644 index 0000000..87e96bf Binary files /dev/null and b/mods/pathogen/pathogen/textures/pathogen_fence.png differ diff --git a/mods/pathogen/pathogen/textures/pathogen_fluid_blood.png b/mods/pathogen/pathogen/textures/pathogen_fluid_blood.png new file mode 100644 index 0000000..21746b1 Binary files /dev/null and b/mods/pathogen/pathogen/textures/pathogen_fluid_blood.png differ diff --git a/mods/pathogen/pathogen/textures/pathogen_fluid_feces.png b/mods/pathogen/pathogen/textures/pathogen_fluid_feces.png new file mode 100644 index 0000000..7c4b53a Binary files /dev/null and b/mods/pathogen/pathogen/textures/pathogen_fluid_feces.png differ diff --git a/mods/pathogen/pathogen/textures/pathogen_fluid_vomit.png b/mods/pathogen/pathogen/textures/pathogen_fluid_vomit.png new file mode 100644 index 0000000..ba2b95d Binary files /dev/null and b/mods/pathogen/pathogen/textures/pathogen_fluid_vomit.png differ diff --git a/mods/pathogen/pathogen/tools.lua b/mods/pathogen/pathogen/tools.lua new file mode 100644 index 0000000..d131b82 --- /dev/null +++ b/mods/pathogen/pathogen/tools.lua @@ -0,0 +1,10 @@ +minetest.register_tool( 'pathogen:decontaminator', { + description = 'Decontaminator', + inventory_image = "pathogen_decontaminator.png", + on_use = function(itemstack, user, pt) + minetest.sound_play( 'pathogen_spray', { pos = user:getpos(), gain = 0.2, max_hear_distance = 5 }) + if not pt then return itemstack end + if math.random(5) == 1 then return itemstack end + pathogen.decontaminate( pt.under ) + end +}) diff --git a/mods/plantlife_modpack/.gitignore b/mods/plantlife_modpack/.gitignore new file mode 100644 index 0000000..b25c15b --- /dev/null +++ b/mods/plantlife_modpack/.gitignore @@ -0,0 +1 @@ +*~ diff --git a/mods/plantlife_modpack/API.txt b/mods/plantlife_modpack/API.txt new file mode 100644 index 0000000..8075865 --- /dev/null +++ b/mods/plantlife_modpack/API.txt @@ -0,0 +1,612 @@ +This document describes the Plantlife mod API. + +Last revision: 2014-05-24 + + +========= +Functions +========= + +There are three main functions defined by the main "plants_lib" mod: + +spawn_on_surfaces() +register_generate_plant() +grow_plants() + +There are also several internal, helper functions that can be called if so +desired, but they are not really intended for use by other mods and may change +at any time. They are briefly described below these main functions, but see +init.lua for details. + +Most functions in plants lib are declared locally to avoid namespace +collisions with other mods. They are accessible via the "plantslib" method, +e.g. plantslib:spawn_on_surfaces() and so forth. + +===== +spawn_on_surfaces(biome) +spawn_on_surfaces(sdelay, splant, sradius, schance, ssurface, savoid) + +This first function is an ABM-based spawner function originally created as +part of Ironzorg's flowers mod. It has since been largely extended and +expanded. There are two ways to call this function: You can either pass it +several individual string and number parameters to use the legacy interface, +or you can pass a single biome definition as a table, with all of your options +spelled out nicely. This is the preferred method. + +When used with the legacy interface, you must specify the parameters exactly +in order, with the first five being mandatory (even if some are set to nil), +and the last one being optional: + +sdelay: The value passed to the ABM's interval parameter, in seconds. +splant: The node name of the item to spawn (e.g. + "flowers:flower_rose"). A plant will of course only be + spawned if the node about to be replaced is air. +sradius: Don't spawn within this many nodes of the avoid items + mentioned below. If set to nil, this check is skipped. +schance: The value passed to the ABM's chance parameter, normally in + the 10-100 range (1-in-X chance of operating on a given node) +ssurface: String with the name of the node on which to spawn the plant + in question, such as "default:sand" or + "default:dirt_with_grass". It is not recommended to put air, + stone, or plain dirt here if you can use some other node, as + doing so will cause the engine to process potentially large + numbers of such nodes when deciding when to execute the ABM + and where it should operate. +savoid: Table with a list of groups and/or node names to avoid when + spawning the plant, such as {"group:flowers", "default:tree"}. + +When passed a table as the argument, and thus using the modern calling method, +you must pass a number of arguments in the form of an ordinary keyed-value +table. Below is a list of everything supported by this function: + +biome = { + spawn_plants = something, -- [*] String or table; see below. + spawn_delay = number, -- same as sdelay, above. + spawn_chance = number, -- same as schance, above. + spawn_surfaces = {table}, -- List of node names on which the plants + -- should be spawned. As with the single- + -- node "ssurface" option in the legacy API, + -- you should not put stone, air, etc. here. + + ---- From here down are a number of optional parameters. You will + ---- most likely want to use at least some of these to limit how and + ---- where your objects are spawned. + + avoid_nodes = {table}, -- same meaning as savoid, above + avoid_radius = num, -- same as sradius + seed_diff = num, -- The Perlin seed difference value passed to + -- the minetest.get_perlin() function. + -- Used along with the global Perlin controls + -- below to create the "biome" in which the + -- plants will spawn. Defaults to 0 if not + -- provided. + light_min = num, -- Minimum amount of light necessary to make a + -- plant spawn. Defaults to 0. + light_max = num, -- Maximum amount of light needed to spawn. + -- Defaults to the engine's MAX_LIGHT value of + -- 14. + neighbors = {table}, -- List of neighboring nodes that need to be + -- immediately next to the node the plant is + -- about to spawn on. Can also be a string + -- with a single node name. It is both passed + -- to the ABM as the "neighbors" parameter, + -- and is used to manually check the + -- adjacent nodes. It only takes one of these + -- for the spawn routine to mark the target as + -- spawnable. Defaults to nil (ignored). + ncount = num, -- There must be at least this many of the + -- above neighbors in the eight spaces + -- immediately surrounding the node the plant + -- is about to spawn on for it to happen. If + -- not provided, this check is disabled. + facedir = num, -- The value passed to the param2 variable + -- when adding the node to the map. Defaults + -- to 0. Be sure that the value you use here + -- (and the range thereof) is appropriate for + -- the type of node you're spawning. + random_facedir = {table}, -- If set, the table should contain two + -- values. If they're both provided, the + -- spawned plant will be given a random + -- facedir value in the range specified by + -- these two numbers. Overrides the facedir + -- parameter above, if it exists. Use {0,3} + -- if you want the full range for wallmounted + -- nodes, or {2,5} for most everything else, + -- or any other pair of numbers in the 0 to 5 + -- range, as appropriate for the node you want + -- to spawn. + verticals_list = {table}, -- List of nodes that should be considered + -- to be natural walls. + alt_wallnode = "string", -- If specified, this node will be + -- substituted in place of the plant(s) + -- defined by spawn_plants above, if the spawn + -- target has one or more adjacent walls. In + -- such a case, the two above facedir + -- parameters will be ignored. + depth_max = num, -- If the object spawns on top of a water + -- source, the water must be at most this + -- deep. Defaults to 1 node. + min_elevation = num, -- Surface must be at this altitude or higher + -- to spawn at all. Defaults to -31000... + max_elevation = num, -- ...but must be no higher than this + -- altitude. Defaults to +31000. + near_nodes = {table}, -- List of nodes that must be somewhere in the + -- vicinity in order for the plant to spawn. + -- Can also be a string with a single node + -- name. If not provided, this check is + -- disabled. + near_nodes_size = num, -- How large of an area to check for the above + -- node. Specifically, this checks a flat + -- horizontal area centered on the node to be + -- spawned on. Defaults to 0, but is ignored + -- if the above near_nodes value is not set. + near_nodes_vertical = num, -- Used with the size value above, this + -- extends the vertical range of the near + -- nodes search. Basically, this turns the + -- flat region described above into a cuboid + -- region. The area to be checked will extend + -- this high AND this low above/below the + -- target node, centered thereon. Defaults to + -- 1 (check only the layer above, the layer + -- at, and the layer below the target node), + -- but is ignored if near_nodes is not set. + near_nodes_count = num, -- How many of the above nodes must be within + -- that radius. Defaults to 1 but is ignored + -- if near_nodes isn't set. Bear in mind that + -- the total area to be checked is equal to + -- (near_nodes_size^2)*near_nodes_vertical*2. + -- so for example, if size is 10 and vertical + -- is 4 then the area is (10^2)*8 = 800 nodes + -- in size, so you'll want to make sure you + -- specify a value appropriate for the amount + -- in question. + air_size = num, -- How large of an area to check for air + -- above and around the target. If omitted, + -- only the space above the target is checked. + -- This does not check for air at the sides or + -- below the target. + air_count = num, -- How many of the surrounding nodes need to + -- be air for the above check to return true. + -- If omitted, only the space above the target + -- is checked. + plantlife_limit = num, -- The value compared against the generic + -- "plants can grow here" Perlin noise layer. + -- Smaller numbers result in more abundant + -- plants. Range of -1 to +1, with values in + -- the range of about 0 to 0.5 being most + -- useful. Defaults to 0.1. + temp_min = num, -- Minimum temperature needed for the desired + -- object to spawn. This is a 2d Perlin + -- value, which has an inverted range of +1 to + -- -1. Larger values represent *colder* + -- temperatures, so this value is actually the + -- upper end of the desired Perlin range. See + -- the temperature map section at the bottom + -- of this document for details on how these + -- values work. Defaults to +1 (unlimited + -- coldness). + temp_max = num, -- Maximum temperature/lower end of the Perlin + -- range. Defaults to -1 (unlimited heat). + humidity_min = num, -- Minimum humidity for the plant to spawn in. + -- Like the temperature map, this is a Perlin + -- value where lower numbers mean more + -- humidity in the area. Defaults to +1 (0% + -- relative humidity). + humidity_max = num, -- Maximum humidity for the plant to spawn at. + -- Defaults to -1 (100% humidity). + spawn_on_side = bool, -- Set this to true to spawn the node on one + -- side of the target node rather than the + -- top. The code will search for an airspace + -- to the side of the target, then spawn the + -- plant at the first one found. The above + -- facedir and random_facedir parameters are + -- ignored in this case. If the above + -- parameters for selecting generic wall nodes + -- are provided, this option is ignored. + -- Important note: the facedir values assigned + -- by this option only make sense with + -- wallmounted nodes (nodes which don't use + -- facedir won't be affected). + spawn_on_bottom = bool, -- If set to true, spawn the object below the + -- target node instead of above it. The above + -- spawn_on_side variable takes precedence + -- over this one if both happen to be true. + -- When using this option with the random + -- facedir function above, the values given to + -- the facedir parameter are for regular + -- nodes, not wallmounted. + spawn_replace_node = bool, -- If set to true, the target node itself + -- is replaced by the spawned object. + -- Overrides the spawn_on_bottom and + -- spawn_on_side settings. +} + +[*] spawn_plants must be either a table or a string. If it's a table, the +values therein are treated as a list of nodenames to pick from randomly on +each application of the ABM code. The more nodes you can pack into this +parameter to avoid making too many calls to this function, the lower the CPU +load will likely be. + +You can also specify a string containing the name of a function to execute. +In this case, the function will be passed a single position parameter +indicating where the function should place the desired object, and the checks +for spawning on top vs. sides vs. bottom vs. replacing the target node will be +skipped. + +By default, if a biome node, size, and count are not defined, the biome +checking is disabled. Same holds true for the nneighbors bit above that. + + +===== +plantslib:register_generate_plant(biome, nodes_or_function_or_treedef) + +To register an object to be spawned at mapgen time rather than via an ABM, +call this function with two parameters: a table with your object's biome +information, and a string, function, or table describing what to do if the +engine finds a suitable surface node (see below). + +The biome table contains quite a number of options, though there are fewer +here than are available in the ABM-based spawner, as some stuff doesn't make +sense at map-generation time. + +biome = { + surface = something, -- What node(s). May be a string such as + -- "default:dirt_with_grass" or a table with + -- multiple such entries. + + ---- Everything else is optional, but you'll definitely want to use + ---- some of these other fields to limit where and under what + ---- conditions the objects are spawned. + + below_nodes = {table}, -- List of nodes that must be below the target + -- node. Useful in snow biomes to keep + -- objects from spawning in snow that's on the + -- wrong surface for that object. + avoid_nodes = {table}, -- List of nodes to avoid when spawning. + -- Groups are not supported here. + avoid_radius = num, -- how much distance to leave between the + -- object to be added and the objects to be + -- avoided. If this or the avoid_nodes value + -- is nil or omitted, this check is skipped. + -- Avoid using excessively large radii or you + -- will slow down the map generator. + rarity = num, -- how rare should this object be in its + -- biome? Larger values make objects more + -- rare, via: math.random(1,100) > this + max_count = num, -- The absolute maximum number of your object + -- that should be allowed to spawn in a 5x5x5 + -- mapblock area (80x80x80 nodes). Defaults + -- to 5, but be sure you set this to some + -- reasonable value depending on your object + -- and its size if 5 is insufficient. + seed_diff = num, -- perlin seed-diff value. Defaults to 0, + -- which causes the function to inherit the + -- global value of 329. + neighbors = {table}, -- What ground nodes must be right next to and + -- at the same elevation as the node to be + -- spawned on. + ncount = num, -- at least this many of the above nodes must + -- be next to the node to spawn on. Any value + -- greater than 8 will probably cause the code + -- to never spawn anything. Defaults to 0. + depth = num, -- how deep/thick of a layer the spawned-on + -- node must be. Typically used for water. + min_elevation = num, -- minimum elevation in meters/nodes. + -- Defaults to -31000 (unlimited). + max_elevation = num, -- maximum elevation. Defaults to +31000 + -- (unlimited). + near_nodes = {table}, -- what nodes must be in the general vicinity + -- of the object being spawned. + near_nodes_size = num, -- how wide of a search area to look for + -- the nodes in that list. + near_nodes_vertical = num, -- How high/low of an area to search from + -- the target node. + near_nodes_count = num, -- at least this many of those nodes must be + -- in the area. + plantlife_limit = num, -- The value compared against the generic + -- "plants can grow here" Perlin noise layer. + -- Smaller numbers result in more abundant + -- plants. Range of -1 to +1, with values in + -- the range of about 0 to 0.5 being most + -- useful. Defaults to 0.1. + temp_min = num, -- coldest allowable temperature for a plant + -- to spawn (that is, the highest Perlin + -- temperature map value). + temp_max = num, -- warmest allowable temperature to spawn a + -- plant (lowest Perlin temperature value). + verticals_list = {table}, -- Same as with the spawn_on_surfaces + -- function. + check_air = bool, -- Flag to tell the mapgen code to check for + -- air above the spawn target. Defaults to + -- true if not explicitly set to false. + delete_above = bool, -- Flag to tell the mapgen code to delete the + -- two nodes directly above the spawn target + -- just before adding the plant or tree. + -- Useful when generating in snow biomes. + -- Defaults to false. + delete_above_surround = bool, -- Flag to tell the mapgen code to also + -- delete the four nodes surrounding the above + -- space, and the four nodes above those, + -- resulting in a two-node-deep cross-shaped + -- empty region above the spawn target. + -- Useful when adding trees to snow biomes. + -- Defaults to false. + spawn_replace_node = bool, -- same as with the ABM spawner. + random_facedir = {table}, -- same as with the ABM spawner. +} + +Regarding nodes_or_function_or_treedef, this must either be a string naming +a node to spawn, a table with a list of nodes to choose from, a table with an +L-Systems tree definition, or a function. + +If you specified a string, the code will attempt to determine whether that +string specifies a valid node name. If it does, that node will be placed on +top of the target position directly (unless one of the other mapgen options +directs the code to do otherwise). + +If you specified a table and there is no "axiom" field, the code assumes that +it is a list of nodes. Simply name one node per entry in the list, e.g. +{"default:junglegrass", "default:dry_shrub"} and so on, for as many nodes as +you want to list. A random node from the list will be chosen each time the +code goes to place a node. + +If you specified a table, and there *is* an "axiom" field, the code assumes +that this table contains an L-Systems tree definition, which will be passed +directly to the engine's spawn_tree() function along with the position on +which to spawn the tree. + +You can also supply a function to be directly executed, which is given the +current node position (the usual "pos" table format) as its sole argument. It +will be called in the form: + + somefunction(pos) + + +===== +plantslib:grow_plants(options) + +The third function, grow_plants() is used to turn the spawned nodes above +into something else over time. This function has no return value, and accepts +a biome definition table as the only parameter. These are defined like so: + +options = { + grow_plant = "string", -- Name of the node to be grown into something + -- else. This value is passed to the ABM as + -- the "nodenames" parameter, so it is the + -- plants themselves that are the ABM trigger, + -- rather than the ground they spawned on. A + -- plant will only grow if the node above it + -- is air. Can also be a table, but note that + -- all nodes referenced therein will be grown + -- into the same object. + grow_delay = num, -- Passed as the ABM "interval" parameter, as + -- with spawning. + grow_chance = num, -- Passed as the ABM "chance" parameter. + grow_result = "string", -- Name of the node into which the grow_plant + -- node(s) should transform when the ABM + -- executes. + + ---- Everything from here down is optional. + + dry_early_node = "string", -- This value is ignored except for jungle + -- grass (a corner case needed by that mod), + -- where it indicates which node the grass + -- must be on in order for it to turn from + -- the short size to "default:dry_shrub" + -- instead of the medium size. + grow_nodes = {table}, -- One of these nodes must be under the plant + -- in order for it to grow at all. Normally + -- this should be the same as the list of + -- surfaces passed to the spawning ABM as the + -- "nodenames" parameter. This is so that the + -- plant can be manually placed on something + -- like a flower pot or something without it + -- growing and eventually dieing. Defaults to + -- "default:dirt_with_grass". + facedir = num, -- Same as with spawning a plant. + need_wall = bool, -- Set this to true if you the plant needs to + -- grow against a wall. Defaults to false. + verticals_list = {table}, -- List of nodes that should be considered + -- to be wall surfaces when growing the plant + -- vertically. If not provided, the walls + -- check is skipped. + grow_vertically = bool, -- Set this to true if the plant needs to grow + -- vertically, as in climbing poison ivy. + -- Defaults to false. + height_limit = num, -- Set this to limit how tall the desired node + -- can grow. The mod will search straight + -- down from the position being spawned at to + -- find a ground node, set via the parameter + -- below. Defaults to 5 nodes. + ground_nodes = {table}, -- What nodes should be treated as "the + -- ground" below a vertically-growing plant. + -- Usually this should be the same as the + -- grow_nodes table, but might also include, + -- for example, water or some other + -- surrounding material. Defaults to + -- "default:dirt_with_grass". + grow_function = something, -- [*] see below. + seed_diff = num, -- [*] see below. +} + +[*] grow_function can take one of three possible settings: it can be nil (or + not provided), a string, or a table. + +If it is not provided or it's set to nil, all of the regular growing code is +executed normally, the value of seed_diff, if any, is ignored, and the node to +be placed is assumed to be specified in the grow_result variable. + +If this value is set to a simple string, this is treated as the name of the +function to use to grow the plant. In this case, all of the usual growing +code is executeed, but then instead of a plant being simply added to the +world, grow_result is ignored and the named function is executed and passed a +few parmeters in the following general form: + + somefunction(pos, perlin1, perlin2) + +These values represent the current position (the usual table), the Perlin +noise value for that spot in the generic "plants can grow here" map for the +seed_diff value above, the Perlin value for that same spot from the +temperature map, and the detected neighboring wall face, if there was one (or +nil if not). If seed_diff is not provided, it defaults to 0. + +If this variable is instead set to a table, it is treated an an L-Systems tree +definition. All of the growing code is executed in the usual manner, then the +tree described by that definition is spawned at the current position instead, +and grow_result is ignored. + + +===== +find_adjacent_wall(pos, verticals) + +Of the few helper functions, this one expects a position parameter and a table +with the list of nodes that should be considered as walls. The code will +search around the given position for a neighboring wall, returning the first +one it finds as a facedir value, or nil if there are no adjacent walls. + + +===== +is_node_loaded(pos) + +This acts as a wrapper for the minetest.get_node_or_nil(node_pos) +function and accepts a single position parameter. Returns true if the node in +question is already loaded, or false if not. + + +===== +dbg(string) + +This is a simple debug output function which takes one string parameter. It +just checks if DEBUG is true and outputs the phrase "[Plantlife] " followed by +the supplied string, via the print() function, if so. + +===== +plantslib:generate_tree(pos, treemodel) +plantslib:grow_tree(pos, treemodel) + +In the case of the growing code and the mapgen-based tree generator code, +generating a tree is done via the above two calls, which in turn immediately +call the usual spawn_tree() functions. This rerouting exists as a way for +other mods to hook into plants_lib's tree-growing functions in general, +perhaps to execute something extra whenever a tree is spawned. + +plantslib:generate_tree(pos, treemodel) is called any time a +tree is spawned at map generation time. 'pos' is the position of the block on +which the tree is to be placed. 'treemodel' is the standard L-Systems tree +definition table expected by the spawn_tree() function. Refer to the 'trunk' +field in that table to derive the name of the tree being spawned. + +plantslib:grow_tree(pos, treemodel) does the same sort of thing whenever a +tree is spawned within the abm-based growing code, for example when growing a +sapling into a tree. + + +===== +There are other, internal helper functions that are not meant for use by other +mods. Don't rely on them, as they are subject to change without notice. + + +=============== +Global Settings +=============== + +Set this to true if you want the mod to spam your console with debug info :-) + + plantlife_debug = false + + +====================== +Fertile Ground Mapping +====================== + +The mod uses Perlin noise to create "biomes" of the various plants, via the +minetest.get_perlin() function. At present, there are three layers of +Perlin noise used. + +The first one is for a "fertile ground" layer, which I tend to refer to as the +generic "stuff can potentially grow here" layer. Its values are hard-coded: + + plantslib.plantlife_seed_diff = 329 + perlin_octaves = 3 + perlin_persistence = 0.6 + perlin_scale = 100 + +For more information on how Perlin noise is generated, you will need to search +the web, as these default values were from that which is used by minetest_game +to spawn jungle grass at mapgen time, and I'm still learning how Perlin noise +works. ;-) + + +=================== +Temperature Mapping +=================== + +The second Perlin layer is a temperature map, with values taken from +SPlizard's Snow Biomes mod so that the two will be compatible, since that mod +appears to be the standard now. Those values are: + + temperature_seeddiff = 112 + temperature_octaves = 3 + temperature_persistence = 0.5 + temperature_scale = 150 + +The way Perlin values are used by this mod, in keeping with the snow mod's +apparent methods, larger values returned by the Perlin function represent +*colder* temperatures. In this mod, the following table gives a rough +approximation of how temperature maps to these values, normalized to +0.53 = 0 °C and +1.0 = -25 °C. + +Perlin Approx. Temperature +-1.0 81 °C ( 178 °F) +-0.75 68 °C ( 155 °F) +-0.56 58 °C ( 136 °F) +-0.5 55 °C ( 131 °F) +-0.25 41 °C ( 107 °F) +-0.18 38 °C ( 100 °F) + 0 28 °C ( 83 °F) + 0.13 21 °C ( 70 °F) + 0.25 15 °C ( 59 °F) + 0.5 2 °C ( 35 °F) + 0.53 0 °C ( 32 °F) + 0.75 -12 °C ( 11 °F) + 0.86 -18 °C ( 0 °F) + 1.0 -25 °C (- 13 °F) + +Included in this table are even 0.25 steps in Perlin values along with some +common temperatures on both the Centigrade and Fahrenheit scales. Note that +unless you're trying to model the Moon or perhaps Mercury in your mods/maps, +you probably won't need to bother with Perlin values of less than -0.56 or so. + + +================ +Humidity Mapping +================ + +Last but not least is a moisture/humidity map. Like the temperature map +above, Perlin values can be tested to determine the approximate humidity of +the *air* in the area. This humidity map is basically the perlin layer used +for deserts. + +A value of +1.0 is very moist (basically a thick fog, if it could be seen), a +value of roughly +0.25 represents the edge of a desert as usually seen in the +game, and a value of -1.0 is as dry as a bone. + +This does not check for nearby water, just general air humidity, and that +being the case, nearby ground does not affect the reported humidity of a +region (because this isn't yet possible to calculate yet). Use the near_nodes +and avoid_nodes parameters and their related options to check for water and +such. + +The Perlin values use for this layer are: + + humidity_seeddiff = 9130 + humidity_octaves = 3 + humidity_persistence = 0.5 + humidity_scale = 250 + +And this particular one is mapped slightly differently from the others: + + noise3 = perlin3:get2d({x=p_top.x+150, y=p_top.z+50}) + +(Note the +150 and +50 offsets) + diff --git a/mods/plantlife_modpack/LICENSE b/mods/plantlife_modpack/LICENSE new file mode 100644 index 0000000..594ea2a --- /dev/null +++ b/mods/plantlife_modpack/LICENSE @@ -0,0 +1,336 @@ +Sunflower model and textures by kaeza (CC-BY-SA 3.0). + +For the code, Ironzorg's textures, and everything else: WTFPL + +For Mossmanikin's mods (Ferns, Dryplans, and the components +from the Undergrowth modpack), and all of my own textures: +CC-By-SA 3.0 + +---------- + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2004 Sam Hocevar + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. You just DO WHAT THE FUCK YOU WANT TO. + + This license is also known as "WTFPL" + +----------- + +THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS +CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). THE WORK IS +PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW. ANY USE OF THE +WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR COPYRIGHT LAW +IS PROHIBITED. + +BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND +AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS +LICENSE MAY BE CONSIDERED TO BE A CONTRACT, THE LICENSOR GRANTS +YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE +OF SUCH TERMS AND CONDITIONS. + +1. Definitions + + "Collective Work" means a work, such as a periodical issue, +anthology or encyclopedia, in which the Work in its entirety in +unmodified form, along with one or more other contributions, +constituting separate and independent works in themselves, are +assembled into a collective whole. A work that constitutes a +Collective Work will not be considered a Derivative Work (as +defined below) for the purposes of this License. + "Creative Commons Compatible License" means a license that is +listed at http://creativecommons.org/compatiblelicenses that has +been approved by Creative Commons as being essentially equivalent +to this License, including, at a minimum, because that license: +(i) contains terms that have the same purpose, meaning and effect +as the License Elements of this License; and, (ii) explicitly +permits the relicensing of derivatives of works made available +under that license under this License or either a Creative Commons +unported license or a Creative Commons jurisdiction license with +the same License Elements as this License. + "Derivative Work" means a work based upon the Work or upon the +Work and other pre-existing works, such as a translation, musical +arrangement, dramatization, fictionalization, motion picture +version, sound recording, art reproduction, abridgment, +condensation, or any other form in which the Work may be recast, +transformed, or adapted, except that a work that constitutes a +Collective Work will not be considered a Derivative Work for the +purpose of this License. For the avoidance of doubt, where the +Work is a musical composition or sound recording, the +synchronization of the Work in timed-relation with a moving image +("synching") will be considered a Derivative Work for the purpose +of this License. + "License Elements" means the following high-level license +attributes as selected by Licensor and indicated in the title of +this License: Attribution, ShareAlike. + "Licensor" means the individual, individuals, entity or +entities that offers the Work under the terms of this License. + "Original Author" means the individual, individuals, entity or +entities who created the Work. + "Work" means the copyrightable work of authorship offered +under the terms of this License. + "You" means an individual or entity exercising rights under +this License who has not previously violated the terms of this +License with respect to the Work, or who has received express +permission from the Licensor to exercise rights under this License +despite a previous violation. + +2. Fair Use Rights. Nothing in this license is intended to reduce, +limit, or restrict any rights arising from fair use, first sale or +other limitations on the exclusive rights of the copyright owner +under copyright law or other applicable laws. + +3. License Grant. Subject to the terms and conditions of this +License, Licensor hereby grants You a worldwide, royalty-free, +non-exclusive, perpetual (for the duration of the applicable +copyright) license to exercise the rights in the Work as stated +below: + + to reproduce the Work, to incorporate the Work into one or +more Collective Works, and to reproduce the Work as incorporated +in the Collective Works; + to create and reproduce Derivative Works provided that any +such Derivative Work, including any translation in any medium, +takes reasonable steps to clearly label, demarcate or otherwise +identify that changes were made to the original Work. For example, +a translation could be marked "The original work was translated +from English to Spanish," or a modification could indicate "The +original work has been modified."; + to distribute copies or phonorecords of, display publicly, +perform publicly, and perform publicly by means of a digital audio +transmission the Work including as incorporated in Collective +Works; + to distribute copies or phonorecords of, display publicly, +perform publicly, and perform publicly by means of a digital audio +transmission Derivative Works. + + For the avoidance of doubt, where the Work is a musical +composition: + Performance Royalties Under Blanket Licenses. Licensor +waives the exclusive right to collect, whether individually or, in +the event that Licensor is a member of a performance rights +society (e.g. ASCAP, BMI, SESAC), via that society, royalties for +the public performance or public digital performance (e.g. +webcast) of the Work. + Mechanical Rights and Statutory Royalties. Licensor waives +the exclusive right to collect, whether individually or via a +music rights agency or designated agent (e.g. Harry Fox Agency), +royalties for any phonorecord You create from the Work ("cover +version") and distribute, subject to the compulsory license +created by 17 USC Section 115 of the US Copyright Act (or the +equivalent in other jurisdictions). + Webcasting Rights and Statutory Royalties. For the avoidance +of doubt, where the Work is a sound recording, Licensor waives the +exclusive right to collect, whether individually or via a +performance-rights society (e.g. SoundExchange), royalties for the +public digital performance (e.g. webcast) of the Work, subject to +the compulsory license created by 17 USC Section 114 of the US +Copyright Act (or the equivalent in other jurisdictions). + +The above rights may be exercised in all media and formats whether +now known or hereafter devised. The above rights include the right +to make such modifications as are technically necessary to +exercise the rights in other media and formats. All rights not +expressly granted by Licensor are hereby reserved. + +4. Restrictions. The license granted in Section 3 above is +expressly made subject to and limited by the following +restrictions: + + You may distribute, publicly display, publicly perform, or +publicly digitally perform the Work only under the terms of this +License, and You must include a copy of, or the Uniform Resource +Identifier for, this License with every copy or phonorecord of the +Work You distribute, publicly display, publicly perform, or +publicly digitally perform. You may not offer or impose any terms +on the Work that restrict the terms of this License or the ability +of a recipient of the Work to exercise of the rights granted to +that recipient under the terms of the License. You may not +sublicense the Work. You must keep intact all notices that refer +to this License and to the disclaimer of warranties. When You +distribute, publicly display, publicly perform, or publicly +digitally perform the Work, You may not impose any technological +measures on the Work that restrict the ability of a recipient of +the Work from You to exercise of the rights granted to that +recipient under the terms of the License. This Section 4(a) +applies to the Work as incorporated in a Collective Work, but this +does not require the Collective Work apart from the Work itself to +be made subject to the terms of this License. If You create a +Collective Work, upon notice from any Licensor You must, to the +extent practicable, remove from the Collective Work any credit as +required by Section 4(c), as requested. If You create a Derivative +Work, upon notice from any Licensor You must, to the extent +practicable, remove from the Derivative Work any credit as +required by Section 4(c), as requested. + You may distribute, publicly display, publicly perform, or +publicly digitally perform a Derivative Work only under: (i) the +terms of this License; (ii) a later version of this License with +the same License Elements as this License; (iii) either the +Creative Commons (Unported) license or a Creative Commons +jurisdiction license (either this or a later license version) that +contains the same License Elements as this License (e.g. +Attribution-ShareAlike 3.0 (Unported)); (iv) a Creative Commons +Compatible License. If you license the Derivative Work under one +of the licenses mentioned in (iv), you must comply with the terms +of that license. If you license the Derivative Work under the +terms of any of the licenses mentioned in (i), (ii) or (iii) (the +"Applicable License"), you must comply with the terms of the +Applicable License generally and with the following provisions: +(I) You must include a copy of, or the Uniform Resource Identifier +for, the Applicable License with every copy or phonorecord of each +Derivative Work You distribute, publicly display, publicly +perform, or publicly digitally perform; (II) You may not offer or +impose any terms on the Derivative Works that restrict the terms +of the Applicable License or the ability of a recipient of the +Work to exercise the rights granted to that recipient under the +terms of the Applicable License; (III) You must keep intact all +notices that refer to the Applicable License and to the disclaimer +of warranties; and, (IV) when You distribute, publicly display, +publicly perform, or publicly digitally perform the Work, You may +not impose any technological measures on the Derivative Work that +restrict the ability of a recipient of the Derivative Work from +You to exercise the rights granted to that recipient under the +terms of the Applicable License. This Section 4(b) applies to the +Derivative Work as incorporated in a Collective Work, but this +does not require the Collective Work apart from the Derivative +Work itself to be made subject to the terms of the Applicable +License. + If You distribute, publicly display, publicly perform, or +publicly digitally perform the Work (as defined in Section 1 +above) or any Derivative Works (as defined in Section 1 above) or +Collective Works (as defined in Section 1 above), You must, unless +a request has been made pursuant to Section 4(a), keep intact all +copyright notices for the Work and provide, reasonable to the +medium or means You are utilizing: (i) the name of the Original +Author (or pseudonym, if applicable) if supplied, and/or (ii) if +the Original Author and/or Licensor designate another party or +parties (e.g. a sponsor institute, publishing entity, journal) for +attribution ("Attribution Parties") in Licensor's copyright +notice, terms of service or by other reasonable means, the name of +such party or parties; the title of the Work if supplied; to the +extent reasonably practicable, the Uniform Resource Identifier, if +any, that Licensor specifies to be associated with the Work, +unless such URI does not refer to the copyright notice or +licensing information for the Work; and, consistent with Section +3(b) in the case of a Derivative Work, a credit identifying the +use of the Work in the Derivative Work (e.g., "French translation +of the Work by Original Author," or "Screenplay based on original +Work by Original Author"). The credit required by this Section +4(c) may be implemented in any reasonable manner; provided, +however, that in the case of a Derivative Work or Collective Work, +at a minimum such credit will appear, if a credit for all +contributing authors of the Derivative Work or Collective Work +appears, then as part of these credits and in a manner at least as +prominent as the credits for the other contributing authors. For +the avoidance of doubt, You may only use the credit required by +this Section for the purpose of attribution in the manner set out +above and, by exercising Your rights under this License, You may +not implicitly or explicitly assert or imply any connection with, +sponsorship or endorsement by the Original Author, Licensor and/or +Attribution Parties, as appropriate, of You or Your use of the +Work, without the separate, express prior written permission of +the Original Author, Licensor and/or Attribution Parties. + +5. Representations, Warranties and Disclaimer + +UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN WRITING, +LICENSOR OFFERS THE WORK AS-IS AND ONLY TO THE EXTENT OF ANY +RIGHTS HELD IN THE LICENSED WORK BY THE LICENSOR. THE LICENSOR +MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE +WORK, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING, WITHOUT +LIMITATION, WARRANTIES OF TITLE, MARKETABILITY, MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR THE ABSENCE +OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF ABSENCE +OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO NOT +ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY +NOT APPLY TO YOU. + +6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY +APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY +LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE +OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE +WORK, EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + +7. Termination + + This License and the rights granted hereunder will terminate +automatically upon any breach by You of the terms of this License. +Individuals or entities who have received Derivative Works or +Collective Works from You under this License, however, will not +have their licenses terminated provided such individuals or +entities remain in full compliance with those licenses. Sections +1, 2, 5, 6, 7, and 8 will survive any termination of this License. + Subject to the above terms and conditions, the license granted +here is perpetual (for the duration of the applicable copyright in +the Work). Notwithstanding the above, Licensor reserves the right +to release the Work under different license terms or to stop +distributing the Work at any time; provided, however that any such +election will not serve to withdraw this License (or any other +license that has been, or is required to be, granted under the +terms of this License), and this License will continue in full +force and effect unless terminated as stated above. + +8. Miscellaneous + + Each time You distribute or publicly digitally perform the +Work (as defined in Section 1 above) or a Collective Work (as +defined in Section 1 above), the Licensor offers to the recipient +a license to the Work on the same terms and conditions as the +license granted to You under this License. + Each time You distribute or publicly digitally perform a +Derivative Work, Licensor offers to the recipient a license to the +original Work on the same terms and conditions as the license +granted to You under this License. + If any provision of this License is invalid or unenforceable +under applicable law, it shall not affect the validity or +enforceability of the remainder of the terms of this License, and +without further action by the parties to this agreement, such +provision shall be reformed to the minimum extent necessary to +make such provision valid and enforceable. + No term or provision of this License shall be deemed waived +and no breach consented to unless such waiver or consent shall be +in writing and signed by the party to be charged with such waiver +or consent. + This License constitutes the entire agreement between the +parties with respect to the Work licensed here. There are no +understandings, agreements or representations with respect to the +Work not specified here. Licensor shall not be bound by any +additional provisions that may appear in any communication from +You. This License may not be modified without the mutual written +agreement of the Licensor and You. + + Creative Commons Notice + + Creative Commons is not a party to this License, and makes no +warranty whatsoever in connection with the Work. Creative Commons +will not be liable to You or any party on any legal theory for any +damages whatsoever, including without limitation any general, +special, incidental or consequential damages arising in connection +to this license. Notwithstanding the foregoing two (2) sentences, +if Creative Commons has expressly identified itself as the +Licensor hereunder, it shall have all rights and obligations of +Licensor. + + Except for the limited purpose of indicating to the public +that the Work is licensed under the CCPL, Creative Commons does +not authorize the use by either party of the trademark "Creative +Commons" or any related trademark or logo of Creative Commons +without the prior written consent of Creative Commons. Any +permitted use will be in compliance with Creative Commons' +then-current trademark usage guidelines, as may be published on +its website or otherwise made available upon request from time to +time. For the avoidance of doubt, this trademark restriction does +not form part of this License. + + Creative Commons may be contacted at +http://creativecommons.org/. + diff --git a/mods/plantlife_modpack/README b/mods/plantlife_modpack/README new file mode 100644 index 0000000..8e13f15 --- /dev/null +++ b/mods/plantlife_modpack/README @@ -0,0 +1,72 @@ +README file for Plantlife mod, by Vanessa Ezekowitz +--------------------------------------------------- + +Plantlife is a combined form of my Flowers and Poison Ivy mods and an expanded +version of the old Bushes mod, now called bushes_classic. The entire package +has been significantly rewritten and re-organized. This mod supplies all +three of these components and should be 100% compatible with mods that used +the old versions. + +Its purpose is to add various kinds of flowers, cotton plants, water foliage, +poison ivy, and fruit bushes, obviously. :-) All of these are spawned as +normal nodes and can be collected and used in any recipes that depend on the +old mods. + +Spawning of plants is sensitive to the amount of available light. Flowers, +cotton, and waterlilies only spawn when there at least a signficant amount of +light. Seaweed will grow only in dimly-lit areas. Poison ivy also grows only +in the daytime, but require less light than flowers. + +Growing of poison ivy will only occur for plants that are on the same surface +that is necessary for them to spawn on, so they won't grow if placed on e.g. +cobble or homedecor flower pot, etc. This doesn't affect wall-climbing poison +ivy, since it uses a different growth pattern. + +All plants use multiple controls provided by plants_lib, to keep where they +grow under control - no more random spread of plants! In addition, the density +of the plants in any region they appear in has been fixed and brought under +control. + +Poison ivy is found sparsely among junglegrass, but will not grow near flowers. + +------------------------------------------------------------------------------ + +Important details: + +Configuration: Any of the three components of this mod can be disabled +by just removing their respective directories. + +Dependencies: Just the game's default stuff. + +Recommends: Nothing in particular. + +Conflicts: This mod should not be installed alongside the original, separate +Poison Ivy, or old Bushes mods. If those exist, delete them, as this mod +supplies their functionality. If you still use the old Jungle Grass mod +either as previously supplied with this modpack, or in its standalone form, +you'll want to delete the "junglegrass" directory from this modpack to get rid +of the aliases-to-air that it supplies. + +Software Requirements: This mod requires Minetest 0.4.11 or later. It is +unlikely to work with old versions. + +------------------------------------------------------------------------------ + +Crafting: + +For crafting recipes, please see the forum thread for this modpack: + +https://forum.minetest.net/viewtopic.php?f=11&t=3898 + +------------------------------------------------------------------------------ + +Notes: + +Poison Ivy will spawn on grass and in some cases, on vertical surfaces +including trees and jungle trees where they meet the dirt or grass. Ivy +previously spawned on the ground taller/thicker or start climbing up said +vertical surfaces and trees. + +At present, the poison ivy presents little more than an annoyance - they can +only be cut down and either re-planted or thrown away. No damage is done by +harvesting them, yet. ;-) diff --git a/mods/plantlife_modpack/along_shore/depends.txt b/mods/plantlife_modpack/along_shore/depends.txt new file mode 100644 index 0000000..e27a0d0 --- /dev/null +++ b/mods/plantlife_modpack/along_shore/depends.txt @@ -0,0 +1,3 @@ +default +plants_lib +flowers_plus? \ No newline at end of file diff --git a/mods/plantlife_modpack/along_shore/init.lua b/mods/plantlife_modpack/along_shore/init.lua new file mode 100644 index 0000000..719d324 --- /dev/null +++ b/mods/plantlife_modpack/along_shore/init.lua @@ -0,0 +1,9 @@ +----------------------------------------------------------------------------------------------- +local title = "Along the Shore" +local version = "0.0.4" +local mname = "along_shore" +----------------------------------------------------------------------------------------------- + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/mods/plantlife_modpack/along_shore/textures/along_shore_seaweed_1Darker.png b/mods/plantlife_modpack/along_shore/textures/along_shore_seaweed_1Darker.png new file mode 100644 index 0000000..b5bd99c Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/along_shore_seaweed_1Darker.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/credit_textures.txt b/mods/plantlife_modpack/along_shore/textures/credit_textures.txt new file mode 100644 index 0000000..89b4ce7 --- /dev/null +++ b/mods/plantlife_modpack/along_shore/textures/credit_textures.txt @@ -0,0 +1,30 @@ +------------------------------------------------------------- +Credit for textures of "along_shore" +------------------------------------------------------------- +(If more than one author is listed the names are in alphabetical order) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +FOLDER TEXTURE AUTHORS +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../along_shore/textures along_shore_seaweed_1Darker.png Neuromancer, VanessaE +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../along_shore/textures/old (along_shore_empty.png) (Mossmanikin) + along_shore_lilypads_1.png Mossmanikin, Neuromancer + along_shore_lilypads_2.png Mossmanikin, Neuromancer + along_shore_lilypads_3.png Mossmanikin, Neuromancer + along_shore_lilypads_4.png Mossmanikin, Neuromancer + along_shore_pondscum_1.png Neuromancer + along_shore_seaweed_1.png Neuromancer, VanessaE + along_shore_seaweed_2.png Mossmanikin, Neuromancer, VanessaE + along_shore_seaweed_3.png Mossmanikin, Neuromancer, VanessaE + along_shore_seaweed_4.png Mossmanikin, Neuromancer, VanessaE + flowers_seaweed.png Neuromancer, VanessaE + flowers_waterlily.png Mossmanikin, VanessaE + flowers_waterlily_22.5.png Mossmanikin, VanessaE + flowers_waterlily_45.png Mossmanikin, VanessaE + flowers_waterlily_67.5.png Mossmanikin, VanessaE + lillypad3Flower16x.png Neuromancer + LillyPad3x16.png Neuromancer + lillyPad5x16.png Neuromancer + MultiLilly16x.png Neuromancer + pondscum16xc.png Neuromancer +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/mods/plantlife_modpack/along_shore/textures/old/LillyPad3x16.png b/mods/plantlife_modpack/along_shore/textures/old/LillyPad3x16.png new file mode 100644 index 0000000..7d840bd Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/LillyPad3x16.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/MultiLilly16x.png b/mods/plantlife_modpack/along_shore/textures/old/MultiLilly16x.png new file mode 100644 index 0000000..474ad05 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/MultiLilly16x.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_empty.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_empty.png new file mode 100644 index 0000000..2f6464b Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_empty.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_1.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_1.png new file mode 100644 index 0000000..a075ba9 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_1.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_2.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_2.png new file mode 100644 index 0000000..90f5364 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_2.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_3.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_3.png new file mode 100644 index 0000000..94d00d2 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_3.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_4.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_4.png new file mode 100644 index 0000000..9b6387f Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_lilypads_4.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_pondscum_1.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_pondscum_1.png new file mode 100644 index 0000000..3502354 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_pondscum_1.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_1.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_1.png new file mode 100644 index 0000000..7595ebc Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_1.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_2.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_2.png new file mode 100644 index 0000000..0b24730 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_2.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_3.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_3.png new file mode 100644 index 0000000..d9b7f43 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_3.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_4.png b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_4.png new file mode 100644 index 0000000..887c183 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/along_shore_seaweed_4.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/flowers_seaweed.png b/mods/plantlife_modpack/along_shore/textures/old/flowers_seaweed.png new file mode 100644 index 0000000..7595ebc Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/flowers_seaweed.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily.png b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily.png new file mode 100644 index 0000000..040a397 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_22.5.png b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_22.5.png new file mode 100644 index 0000000..c409bcb Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_22.5.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_45.png b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_45.png new file mode 100644 index 0000000..c870df4 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_45.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_67.5.png b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_67.5.png new file mode 100644 index 0000000..5b9291b Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/flowers_waterlily_67.5.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/lillyPad5x16.png b/mods/plantlife_modpack/along_shore/textures/old/lillyPad5x16.png new file mode 100644 index 0000000..761beb9 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/lillyPad5x16.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/lillypad3Flower16x.png b/mods/plantlife_modpack/along_shore/textures/old/lillypad3Flower16x.png new file mode 100644 index 0000000..541200f Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/lillypad3Flower16x.png differ diff --git a/mods/plantlife_modpack/along_shore/textures/old/pondscum16xc.png b/mods/plantlife_modpack/along_shore/textures/old/pondscum16xc.png new file mode 100644 index 0000000..3502354 Binary files /dev/null and b/mods/plantlife_modpack/along_shore/textures/old/pondscum16xc.png differ diff --git a/mods/plantlife_modpack/bushes/depends.txt b/mods/plantlife_modpack/bushes/depends.txt new file mode 100644 index 0000000..bde0bdf --- /dev/null +++ b/mods/plantlife_modpack/bushes/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/mods/plantlife_modpack/bushes/init.lua b/mods/plantlife_modpack/bushes/init.lua new file mode 100644 index 0000000..99fa116 --- /dev/null +++ b/mods/plantlife_modpack/bushes/init.lua @@ -0,0 +1,257 @@ +-- Bushes Mod by Mossmanikin, Evergreen, & Neuromancer +-- The initial code for this was taken from Mossmanikin's Grasses Mod, then heavilly modified by Neuromancer for this mod. +-- Mossmanikin also greatly helped with providing samples for coding. +-- bush leaf textures are cc-by-sa 3.0. from VannessaE's moretrees mod. (Leaf texture created by RealBadAngel or VanessaE) +-- Branch textures created by Neuromancer. +-- Licence for Code and Non-Bush leaf code is WTFPL. + + abstract_bushes = {} + + minetest.register_node("bushes:youngtree2_bottom", { + description = "Young Tree 2 (bottom)", + drawtype="nodebox", + tiles = {"bushes_youngtree2trunk.png"}, + inventory_image = "bushes_youngtree2trunk_inv.png", + wield_image = "bushes_youngtree2trunk_inv.png", +paramtype = "light", + walkable = false, + is_ground_content = true, +node_box = { + type = "fixed", + fixed = { + --{0.375000,-0.500000,-0.500000,0.500000,0.500000,-0.375000}, --NodeBox 1 + {-0.0612,-0.500000,-0.500000,0.0612,0.500000,-0.375000}, --NodeBox 1 + } +}, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = 'default:stick' +}) + + local BushBranchCenter = { {1,1}, {3,2} } +for i in pairs(BushBranchCenter) do + local Num = BushBranchCenter[i][1] + local TexNum = BushBranchCenter[i][2] + minetest.register_node("bushes:bushbranches"..Num, { + description = "Bush Branches "..Num, + drawtype = "nodebox", + tiles = { + "bushes_leaves_"..TexNum..".png", + "bushes_branches_center_"..TexNum..".png" + }, + node_box = { + type = "fixed", + fixed = { + {0, -1/2, -1/2, -1/4, 1/2, 1/2}, + {0, -1/2, -1/2, 1/4, 1/2, 1/2} + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "bushes_branches_center_"..TexNum..".png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = { + -- tree=1, -- MM: disabled because some recipes use group:tree for trunks + snappy=3, + flammable=2, + leaves=1 + }, + sounds = default.node_sound_leaves_defaults(), + drop = 'default:stick 4' + }) +end + +local BushBranchSide = { {2,1}, {4,2} } +for i in pairs(BushBranchSide) do + local Num = BushBranchSide[i][1] + local TexNum = BushBranchSide[i][2] + minetest.register_node("bushes:bushbranches"..Num, { + description = "Bush Branches "..Num, + drawtype = "nodebox", + tiles = { +--[[top]] "bushes_leaves_"..TexNum..".png", +--[[bottom]]"bushes_branches_center_"..TexNum..".png", +--[[right]] "bushes_branches_left_"..TexNum..".png", +--[[left]] "bushes_branches_right_"..TexNum..".png", -- MM: We could also mirror the previous here, +--[[back]] "bushes_branches_center_"..TexNum..".png",-- unless U really want 'em 2 B different +--[[front]] "bushes_branches_right_"..TexNum..".png" + }, + node_box = { + type = "fixed", + fixed = { +-- { left , bottom , front, right , top , back } + {0.137748,-0.491944, 0.5 ,-0.125000,-0.179444,-0.007790}, --NodeBox 1 + {0.262748,-0.185995, 0.5 ,-0.237252, 0.126505,-0.260269}, --NodeBox 2 + {0.500000, 0.125000, 0.5 ,-0.500000, 0.500000,-0.500000}, --NodeBox 3 + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 1/2, 1/2}, + }, + inventory_image = "bushes_branches_right_"..TexNum..".png", + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + groups = { + -- tree=1, -- MM: disabled because some recipes use group:tree for trunks + snappy=3, + flammable=2, + leaves=1 + }, + sounds = default.node_sound_leaves_defaults(), + drop = 'default:stick 3' + }) +end + +local BushLeafNode = { {1}, {2}} +for i in pairs(BushLeafNode) do + local Num = BushLeafNode[i][1] + minetest.register_node("bushes:BushLeaves"..Num, { + description = "Bush Leaves "..Num, + drawtype = "allfaces_optional", + tiles = {"bushes_leaves_"..Num..".png"}, + paramtype = "light", + groups = { -- MM: Should we add leafdecay? + snappy=3, + flammable=2, + attached_node=1 + }, + sounds = default.node_sound_leaves_defaults(), + }) +end + +abstract_bushes.grow_bush = function(pos) + local leaf_type = math.random(1,2) + local bush_side_height = math.random(0,1) + local chance_of_bush_node_right = math.random(1,10) + if chance_of_bush_node_right> 5 then + local right_pos = {x=pos.x+1, y=pos.y+bush_side_height, z=pos.z} + abstract_bushes.grow_bush_node(right_pos,3,leaf_type) + end + local chance_of_bush_node_left = math.random(1,10) + if chance_of_bush_node_left> 5 then + bush_side_height = math.random(0,1) + local left_pos = {x=pos.x-1, y=pos.y+bush_side_height, z=pos.z} + abstract_bushes.grow_bush_node(left_pos,1,leaf_type) + end + local chance_of_bush_node_front = math.random(1,10) + if chance_of_bush_node_front> 5 then + bush_side_height = math.random(0,1) + local front_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z+1} + abstract_bushes.grow_bush_node(front_pos,2,leaf_type) + end + local chance_of_bush_node_back = math.random(1,10) + if chance_of_bush_node_back> 5 then + bush_side_height = math.random(0,1) + local back_pos = {x=pos.x, y=pos.y+bush_side_height, z=pos.z-1} + abstract_bushes.grow_bush_node(back_pos,0,leaf_type) + end + +abstract_bushes.grow_bush_node(pos,5,leaf_type) +end + +abstract_bushes.grow_bush_node = function(pos,dir, leaf_type) + + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} + + local bush_branch_type = 2 + + -- MM: I'm not sure if it's slower now than before... + if dir ~= 5 and leaf_type == 1 then + bush_branch_type = 2 + end + if dir ~= 5 and leaf_type == 2 then + bush_branch_type = 4 + end + if dir == 5 and leaf_type == 1 then + bush_branch_type = 1 + dir = 1 + end + if dir == 5 and leaf_type == 2 then + bush_branch_type = 3 + dir = 1 + end + + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + minetest.set_node(right_here, {name="bushes:bushbranches"..bush_branch_type , param2=dir}) + --minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")") + minetest.set_node(above_right_here, {name="bushes:BushLeaves"..leaf_type}) + local chance_of_high_leaves = math.random(1,10) + if chance_of_high_leaves> 5 then + local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} + --minetest.chat_send_all("leaf_type: (" .. leaf_type .. ")") + minetest.set_node(two_above_right_here, {name="bushes:BushLeaves"..leaf_type}) + end + end +end + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 15, --10,15 + rarity = 101 - 4, --3,4 + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + }, + abstract_bushes.grow_bush +) + + abstract_bushes.grow_youngtree2 = function(pos) + local height = math.random(4,5) + abstract_bushes.grow_youngtree_node2(pos,height) +end + +abstract_bushes.grow_youngtree_node2 = function(pos, height) + + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} + local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} + local three_above_right_here = {x=pos.x, y=pos.y+4, z=pos.z} + + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + if height == 4 then + local two_above_right_here_south = {x=pos.x, y=pos.y+3, z=pos.z-1} + local three_above_right_here_south = {x=pos.x, y=pos.y+4, z=pos.z-1} + minetest.set_node(right_here, {name="bushes:youngtree2_bottom"}) + minetest.set_node(above_right_here, {name="bushes:youngtree2_bottom"}) + minetest.set_node(two_above_right_here, {name="bushes:bushbranches2" , param2=2}) + minetest.set_node(two_above_right_here_south, {name="bushes:bushbranches2" , param2=0}) + minetest.set_node(three_above_right_here, {name="bushes:BushLeaves1" }) + minetest.set_node(three_above_right_here_south, {name="bushes:BushLeaves1" }) + end + + end +end + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 55, --10,15 + rarity = 101 - 4, --3,4 + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + }, + abstract_bushes.grow_youngtree2 +) + + --http://dev.minetest.net/Node_Drawtypes diff --git a/mods/plantlife_modpack/bushes/textures/bushes_branches_center_1.png b/mods/plantlife_modpack/bushes/textures/bushes_branches_center_1.png new file mode 100644 index 0000000..bac3ee4 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_branches_center_1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_branches_center_2.png b/mods/plantlife_modpack/bushes/textures/bushes_branches_center_2.png new file mode 100644 index 0000000..c21edf6 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_branches_center_2.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_branches_left_1.png b/mods/plantlife_modpack/bushes/textures/bushes_branches_left_1.png new file mode 100644 index 0000000..120f100 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_branches_left_1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_branches_left_2.png b/mods/plantlife_modpack/bushes/textures/bushes_branches_left_2.png new file mode 100644 index 0000000..1c17bac Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_branches_left_2.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_branches_right_1.png b/mods/plantlife_modpack/bushes/textures/bushes_branches_right_1.png new file mode 100644 index 0000000..af5de67 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_branches_right_1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_branches_right_2.png b/mods/plantlife_modpack/bushes/textures/bushes_branches_right_2.png new file mode 100644 index 0000000..8fb8332 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_branches_right_2.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_leaves_1.png b/mods/plantlife_modpack/bushes/textures/bushes_leaves_1.png new file mode 100644 index 0000000..594c958 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_leaves_1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_leaves_2.png b/mods/plantlife_modpack/bushes/textures/bushes_leaves_2.png new file mode 100644 index 0000000..e6de482 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_leaves_2.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_youngtree2trunk.png b/mods/plantlife_modpack/bushes/textures/bushes_youngtree2trunk.png new file mode 100644 index 0000000..ea685e3 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_youngtree2trunk.png differ diff --git a/mods/plantlife_modpack/bushes/textures/bushes_youngtree2trunk_inv.png b/mods/plantlife_modpack/bushes/textures/bushes_youngtree2trunk_inv.png new file mode 100644 index 0000000..7d6728f Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/bushes_youngtree2trunk_inv.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1.png b/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1.png new file mode 100644 index 0000000..28fe91f Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1L.png b/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1L.png new file mode 100644 index 0000000..1d8a8e2 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1L.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1R.png b/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1R.png new file mode 100644 index 0000000..514b888 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BlockBranch1R.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1.png new file mode 100644 index 0000000..5bb2b46 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm.png new file mode 100644 index 0000000..5574f38 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm2.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm2.png new file mode 100644 index 0000000..6ffd2f3 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm2.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm3.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm3.png new file mode 100644 index 0000000..5bb9bf5 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm3.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm4.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm4.png new file mode 100644 index 0000000..b204fef Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranches1sm4.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesCenter.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesCenter.png new file mode 100644 index 0000000..0c9b5af Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesCenter.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesSide1.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesSide1.png new file mode 100644 index 0000000..ca95dd3 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesSide1.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesSide2.png b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesSide2.png new file mode 100644 index 0000000..d62499e Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/BushBranchesSide2.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/blank.png b/mods/plantlife_modpack/bushes/textures/old & unused/blank.png new file mode 100644 index 0000000..ed495a8 Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/blank.png differ diff --git a/mods/plantlife_modpack/bushes/textures/old & unused/moretrees_pine_leaves3.png b/mods/plantlife_modpack/bushes/textures/old & unused/moretrees_pine_leaves3.png new file mode 100644 index 0000000..57d077d Binary files /dev/null and b/mods/plantlife_modpack/bushes/textures/old & unused/moretrees_pine_leaves3.png differ diff --git a/mods/plantlife_modpack/bushes_classic/cooking.lua b/mods/plantlife_modpack/bushes_classic/cooking.lua new file mode 100644 index 0000000..677cb44 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/cooking.lua @@ -0,0 +1,118 @@ +local S = plantslib.intllib + +-- Basket + +minetest.register_craft({ + output = "bushes:basket_empty", + recipe = { + { "default:stick", "default:stick", "default:stick" }, + { "", "default:stick", "" }, + }, +}) + +-- Sugar + +minetest.register_craftitem(":bushes:sugar", { + description = S("Sugar"), + inventory_image = "bushes_sugar.png", + on_use = minetest.item_eat(1), + groups = {food_sugar=1} +}) + +minetest.register_craft({ + output = "bushes:sugar 1", + recipe = { + { "default:papyrus", "default:papyrus" }, + }, +}) + +for i, berry in ipairs(bushes_classic.bushes) do + local desc = bushes_classic.bushes_descriptions[i] + + minetest.register_craftitem(":bushes:"..berry.."_pie_raw", { + description = S("Raw "..desc.." pie"), + inventory_image = "bushes_"..berry.."_pie_raw.png", + on_use = minetest.item_eat(4), + }) + + if berry ~= "mixed_berry" then + + if berry == "strawberry" and minetest.registered_nodes["farming_plus:strawberry"] then + -- Special case for strawberries, when farming_plus is in use. Use + -- the item from that mod, but redefine it so it has the right + -- groups and does't look so ugly! + minetest.register_craftitem(":farming_plus:strawberry_item", { + description = S("Strawberry"), + inventory_image = "bushes_"..berry..".png", + on_use = minetest.item_eat(2), + groups = {berry=1, strawberry=1} + }) + minetest.register_alias("bushes:strawberry", "farming_plus:strawberry_item") + else + minetest.register_craftitem(":bushes:"..berry, { + description = desc, + inventory_image = "bushes_"..berry..".png", + groups = {berry = 1, [berry] = 1}, + on_use = minetest.item_eat(1), + }) + end + minetest.register_craft({ + output = "bushes:"..berry.."_pie_raw 1", + recipe = { + { "group:food_sugar", "farming:flour", "group:food_sugar" }, + { "group:"..berry, "group:"..berry, "group:"..berry }, + }, + }) + end + + -- Cooked pie + + minetest.register_craftitem(":bushes:"..berry.."_pie_cooked", { + description = S("Cooked "..desc.." pie"), + inventory_image = "bushes_"..berry.."_pie_cooked.png", + on_use = minetest.item_eat(6), + }) + + minetest.register_craft({ + type = "cooking", + output = "bushes:"..berry.."_pie_cooked", + recipe = "bushes:"..berry.."_pie_raw", + cooktime = 30, + }) + + -- slice of pie + + minetest.register_craftitem(":bushes:"..berry.."_pie_slice", { + description = S("Slice of "..desc.." pie"), + inventory_image = "bushes_"..berry.."_pie_slice.png", + on_use = minetest.item_eat(1), + }) + + minetest.register_craft({ + output = "bushes:"..berry.."_pie_slice 6", + recipe = { + { "bushes:"..berry.."_pie_cooked" }, + }, + }) + + -- Basket with pies + + minetest.register_craft({ + output = "bushes:basket_"..berry.." 1", + recipe = { + { "bushes:"..berry.."_pie_cooked", "bushes:"..berry.."_pie_cooked", "bushes:"..berry.."_pie_cooked" }, + { "", "bushes:basket_empty", "" }, + }, + }) +end + +minetest.register_craft({ + output = "bushes:mixed_berry_pie_raw 2", + recipe = { + { "group:food_sugar", "farming:flour", "group:food_sugar" }, + { "group:berry", "group:berry", "group:berry" }, + { "group:berry", "group:berry", "group:berry" }, + }, +}) + + diff --git a/mods/plantlife_modpack/bushes_classic/depends.txt b/mods/plantlife_modpack/bushes_classic/depends.txt new file mode 100644 index 0000000..632373e --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/depends.txt @@ -0,0 +1,3 @@ +plants_lib +farming? +farming_plus? diff --git a/mods/plantlife_modpack/bushes_classic/image_credits.txt b/mods/plantlife_modpack/bushes_classic/image_credits.txt new file mode 100644 index 0000000..a4ddc51 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/image_credits.txt @@ -0,0 +1,5 @@ +strawberry: http://www.clker.com/clipart-4060.html +blueberry: http://www.clker.com/clipart-cerezafiro12.html +blackberry: http://www.clker.com/clipart-blackberry-2.html +raspberry: http://www.clker.com/clipart-simple-raspberry.html +gooseberry: http://www.clker.com/clipart-26281.html diff --git a/mods/plantlife_modpack/bushes_classic/init.lua b/mods/plantlife_modpack/bushes_classic/init.lua new file mode 100644 index 0000000..f06c50c --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/init.lua @@ -0,0 +1,58 @@ +-- Bushes classic mod originally by unknown +-- now maintained by VanessaE +-- +-- License: WTFPL + +local S = plantslib.intllib + +bushes_classic = {} + +bushes_classic.bushes = { + "strawberry", + "blackberry", + "blueberry", + "raspberry", + "gooseberry", + "mixed_berry" +} + +bushes_classic.bushes_descriptions = { + "Strawberry", + "Blackberry", + "Blueberry", + "Raspberry", + "Gooseberry", + "Mixed Berry" +} + +bushes_classic.spawn_list = {} + +dofile(minetest.get_modpath('bushes_classic') .. '/cooking.lua') +dofile(minetest.get_modpath('bushes_classic') .. '/nodes.lua') + +plantslib:spawn_on_surfaces({ + spawn_delay = 3600, + spawn_plants = bushes_classic.spawn_list, + avoid_radius = 10, + spawn_chance = 100, + spawn_surfaces = { + "default:dirt_with_grass", + "woodsoils:dirt_with_leaves_1", + "woodsoils:grass_with_leaves_1", + "woodsoils:grass_with_leaves_2", + "farming:soil", + "farming:soil_wet" + }, + avoid_nodes = {"group:bush"}, + seed_diff = 545342534, -- chosen by a fair mashing of the keyboard - guaranteed to be random :P + plantlife_limit = -0.1, + light_min = 10, + temp_min = 0.15, -- approx 20C + temp_max = -0.15, -- approx 35C + humidity_min = 0, -- 50% RH + humidity_max = -1, -- 100% RH +}) + +minetest.register_alias("bushes:basket_pies", "bushes:basket_strawberry") + +print(S("[Bushes] Loaded.")) diff --git a/mods/plantlife_modpack/bushes_classic/locale/de.txt b/mods/plantlife_modpack/bushes_classic/locale/de.txt new file mode 100644 index 0000000..3724274 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/locale/de.txt @@ -0,0 +1,43 @@ +# Translation by Xanthin + +Strawberry = Erdbeere +Blackberry = Brombeere +Blueberry = Blaubeere +Raspberry = Himbeere +Gooseberry = Stachelbeere +Mixed Berry = Beerenmix +Basket with Strawberry Pies = Korb mit Erdbeertorten +Basket with Blackberry Pies = Korb mit Brombeertorten +Basket with Blueberry Pies = Korb mit Blaubeertorten +Basket with Raspberry Pies = Korb mit Himbeertorten +Basket with Gooseberry Pies = Korb mit Stachelbeertorten +Basket with Mixed Berry Pies = Korb mit Beerenmixtorten +currently fruitless = zur Zeit fruechteloser +Strawberry Bush = Erdbeerbusch +Blackberry Bush = Brombeerbusch +Blueberry Bush = Blaubeerbusch +Raspberry Bush = Himbeerbusch +Gooseberry Bush = Stachelbeerbusch +Mixed Berry Bush = Beerenmixbusch +Basket = Korb +Sugar = Zucker +Raw Strawberry pie = Rohe Erdbeertorte +Raw Blackberry pie = Rohe Brombeertorte +Raw Blueberry pie = Rohe Blaubeertorte +Raw Raspberry pie = Rohe Himbeertorte +Raw Gooseberry pie = Rohe Stachelbeertorte +Raw Mixed Berry pie = Rohe Beerenmixtorte +Cooked Strawberry pie = Erdbeertorte +Cooked Blackberry pie = Brombeertorte +Cooked Blueberry pie = Blaubeertorte +Cooked Raspberry pie = Himbeertorte +Cooked Gooseberry pie = Stachelbeertorte +Cooked Mixed Berry pie = Beerenmixtorte +Slice of Strawberry pie = Erdbeertortenstueck +Slice of Blackberry pie = Brombeertortenstueck +Slice of Blueberry pie = Blaubeertortenstueck +Slice of Raspberry pie = Himbeertortenstueck +Slice of Gooseberry pie = Stachelbeertortenstueck +Slice of Mixed Berry pie = Beerenmixtortenstueck + +[Bushes] Loaded. = [Bushes] Geladen. diff --git a/mods/plantlife_modpack/bushes_classic/locale/fr.txt b/mods/plantlife_modpack/bushes_classic/locale/fr.txt new file mode 100644 index 0000000..ce80613 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/locale/fr.txt @@ -0,0 +1,43 @@ +# Template + +Strawberry = Fraise +Blackberry = Mûre +Blueberry = Myrtille +Raspberry = Framboise +Gooseberry = Groseille +Mixed Berry = Mélange de baies +Basket with Strawberry Pies = Panier de tartes aux fraises +Basket with Blackberry Pies = Panier de tartes aux mûres +Basket with Blueberry Pies = Panier de tartes aux myrtilles +Basket with Raspberry Pies = Panier de tartes aux framboises +Basket with Gooseberry Pies = Panier de tartes aux groseilles +Basket with Mixed Berry Pies = Panier de tartes au mélange de baies +currently fruitless = actuellement sans fruit +Strawberry Bush = Buisson à fraise +Blackberry Bush = Buisson à mûre +Blueberry Bush = Buisson à myrtille +Raspberry Bush = Buisson à framboise +Gooseberry Bush = Buisson à groseille +Mixed Berry Bush = Buisson de baies mélangées +Basket = Panier +Sugar = Sucre +Raw Strawberry pie = Tarte crue aux fraises +Raw Blackberry pie = Tarte crue aux mûres +Raw Blueberry pie = Tarte crue aux myrtilles +Raw Raspberry pie = Tarte crue aux framboises +Raw Gooseberry pie = Tarte crue aux groseilles +Raw Mixed Berry pie = Tarte crue au mélange de baies +Cooked Strawberry pie = Tarte cuite aux fraises +Cooked Blackberry pie = Tarte cuite aux mûres +Cooked Blueberry pie = Tarte cuite aux myrtilles +Cooked Raspberry pie = Tarte cuite aux framboises +Cooked Gooseberry pie = Tarte cuite aux groseilles +Cooked Mixed Berry pie = Tarte cuite au mélange de baies +Slice of Strawberry pie = Part de tarte aux fraises +Slice of Blackberry pie = Part de tarte aux mûres +Slice of Blueberry pie = Part de tarte aux myrtilles +Slice of Raspberry pie = Part de tarts aux framboises +Slice of Gooseberry pie = Part de tarte aux groseilles +Slice of Mixed Berry pie = Part de tarte au mélange de baies + +[Bushes] Loaded. = [Buissons] Chargés. diff --git a/mods/plantlife_modpack/bushes_classic/locale/template.txt b/mods/plantlife_modpack/bushes_classic/locale/template.txt new file mode 100644 index 0000000..6c35312 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/locale/template.txt @@ -0,0 +1,43 @@ +# Template + +Strawberry = +Blackberry = +Blueberry = +Raspberry = +Gooseberry = +Mixed Berry = +Basket with Strawberry Pies = +Basket with Blackberry Pies = +Basket with Blueberry Pies = +Basket with Raspberry Pies = +Basket with Gooseberry Pies = +Basket with Mixed Berry Pies = +currently fruitless = +Strawberry Bush = +Blackberry Bush = +Blueberry Bush = +Raspberry Bush = +Gooseberry Bush = +Mixed Berry Bush = +Basket = +Sugar = +Raw Strawberry pie = +Raw Blackberry pie = +Raw Blueberry pie = +Raw Raspberry pie = +Raw Gooseberry pie = +Raw Mixed Berry pie = +Cooked Strawberry pie = +Cooked Blackberry pie = +Cooked Blueberry pie = +Cooked Raspberry pie = +Cooked Gooseberry pie = +Cooked Mixed Berry pie = +Slice of Strawberry pie = +Slice of Blackberry pie = +Slice of Blueberry pie = +Slice of Raspberry pie = +Slice of Gooseberry pie = +Slice of Mixed Berry pie = + +[Bushes] Loaded. = diff --git a/mods/plantlife_modpack/bushes_classic/locale/tr.txt b/mods/plantlife_modpack/bushes_classic/locale/tr.txt new file mode 100644 index 0000000..0472921 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/locale/tr.txt @@ -0,0 +1,44 @@ +# Turkish translation +# mahmutelmas06@hotmail.com + +Strawberry = Çilek +Blackberry = Böğürtlen +Blueberry = Yaban mersini +Raspberry = Ahududu +Gooseberry = Bektaşi üzümü +Mixed Berry = Dut +Basket with Strawberry Pies = Çilekli pasta sepeti +Basket with Blackberry Pies = Böğürtlenli pasta sepeti +Basket with Blueberry Pies = Yaban mersini pastalı sepet +Basket with Raspberry Pies = Ahududulu pasta sepeti +Basket with Gooseberry Pies = Bektaşi üzümlü pasta sepeti +Basket with Mixed Berry Pies = Dutlu pasta sepeti +currently fruitless = şu anda meyvesiz +Strawberry Bush = Çilek fidanı +Blackberry Bush = Böğürtlen fidanı +Blueberry Bush = Yaban mersini fidanı +Raspberry Bush = Ahududu fidanı +Gooseberry Bush = Bektaşi üzümü fidanı +Mixed Berry Bush = Dut fidanı +Basket = Sepet +Sugar = Şeker +Raw Strawberry pie = Çilekli çiğ pasta +Raw Blackberry pie = Böğürtlenli çiğ pasta +Raw Blueberry pie = Yaban mersinli çiğ pasta +Raw Raspberry pie = Ahududulu çiğ pasta +Raw Gooseberry pie = Bektaşi üzümlü çiğ pasta +Raw Mixed Berry pie = Dutlu çiğ pasta +Cooked Strawberry pie = Pişmiş çilekli pasta +Cooked Blackberry pie = Pişmiş böğürtlenli pasta +Cooked Blueberry pie = Pişmiş yaban mersinli pasta +Cooked Raspberry pie = Pişmiş ahududulu pasta +Cooked Gooseberry pie = Pişmiş bektaşi üzümlü pasta +Cooked Mixed Berry pie = Pişmiş dutlu pasta +Slice of Strawberry pie = Çilekli pasta dilimi +Slice of Blackberry pie = Böğürtlenli pasta dilimi +Slice of Blueberry pie = Yaban mersinli pasta dilimi +Slice of Raspberry pie = Ahududulu pasta dilimi +Slice of Gooseberry pie = Bektaşi üzümlü pasta dilimi +Slice of Mixed Berry pie = Dutlu pasta dilimi + +[Bushes] Loaded. = [Bushes] yüklendi. diff --git a/mods/plantlife_modpack/bushes_classic/models/bushes_basket_empty.obj b/mods/plantlife_modpack/bushes_classic/models/bushes_basket_empty.obj new file mode 100644 index 0000000..0179c31 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/models/bushes_basket_empty.obj @@ -0,0 +1,46 @@ +# Blender v2.73 (sub 0) OBJ File: 'basket-of-pies.blend' +# www.blender.org +o basket_Cube.001 +v -0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v -0.500000 0.500000 -0.500000 +v 0.500000 0.500000 -0.500000 +v 0.500000 0.500000 0.500000 +v -0.437500 0.500000 0.437500 +v -0.437500 0.500000 -0.437500 +v 0.437500 0.500000 -0.437500 +v 0.437500 0.500000 0.437500 +v -0.437500 -0.437500 0.437500 +v -0.437500 -0.437500 -0.437500 +v 0.437500 -0.437500 -0.437500 +v 0.437500 -0.437500 0.437500 +vt 0.484848 0.984848 +vt 0.015152 0.984848 +vt 0.015152 0.515152 +vt 0.484848 0.515152 +vt 0.515152 0.984848 +vt 0.515152 0.515152 +vt 0.984848 0.515152 +vt 0.984848 0.984848 +vt 0.954545 0.545455 +vt 0.545455 0.545455 +vt 0.954545 0.954545 +vt 0.545455 0.954545 +s off +f 5/1 6/2 2/3 1/4 +f 6/1 7/2 3/3 2/4 +f 7/1 8/2 4/3 3/4 +f 8/1 5/2 1/3 4/4 +f 1/5 2/6 3/7 4/8 +f 5/6 8/7 12/9 9/10 +f 8/7 7/8 11/11 12/9 +f 7/8 6/5 10/12 11/11 +f 6/5 5/6 9/10 10/12 +f 9/1 12/2 16/3 13/4 +f 12/1 11/2 15/3 16/4 +f 11/1 10/2 14/3 15/4 +f 10/1 9/2 13/3 14/4 +f 13/10 16/9 15/11 14/12 diff --git a/mods/plantlife_modpack/bushes_classic/models/bushes_basket_full.obj b/mods/plantlife_modpack/bushes_classic/models/bushes_basket_full.obj new file mode 100644 index 0000000..5a3e1a8 --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/models/bushes_basket_full.obj @@ -0,0 +1,330 @@ +# Blender v2.73 (sub 0) OBJ File: 'basket-of-pies.blend' +# www.blender.org +o pies_Cylinder +v -0.089468 -0.116804 -0.438000 +v -0.116691 -0.091480 -0.438000 +v 0.024696 0.005921 -0.404659 +v -0.002527 0.031245 -0.404659 +v 0.121480 0.109962 -0.309713 +v 0.094258 0.135286 -0.309713 +v 0.186149 0.179480 -0.167615 +v 0.158927 0.204804 -0.167615 +v 0.208858 0.203891 0.000000 +v 0.181635 0.229215 0.000000 +v 0.186149 0.179480 0.167615 +v 0.158927 0.204804 0.167615 +v 0.121480 0.109962 0.309713 +v 0.094258 0.135286 0.309713 +v 0.024696 0.005921 0.404659 +v -0.002527 0.031245 0.404659 +v -0.089468 -0.116804 0.438000 +v -0.116691 -0.091480 0.438000 +v -0.230856 -0.214204 0.404659 +v -0.327640 -0.318245 0.309713 +v -0.392309 -0.387763 0.167615 +v -0.415018 -0.412175 -0.000000 +v -0.392309 -0.387763 -0.167615 +v -0.327640 -0.318245 -0.309713 +v -0.230856 -0.214204 -0.404659 +v -0.135230 -0.074234 -0.383250 +v -0.035336 0.033150 -0.354077 +v 0.049350 0.124186 -0.270999 +v 0.105936 0.185014 -0.146663 +v 0.125806 0.206374 0.000000 +v 0.105936 0.185014 0.146663 +v 0.049350 0.124186 0.270999 +v -0.035336 0.033150 0.354077 +v -0.135230 -0.074234 0.383250 +v -0.235124 -0.181618 0.354077 +v -0.319810 -0.272654 0.270999 +v -0.376395 -0.333482 0.146663 +v -0.396266 -0.354842 -0.000000 +v -0.376395 -0.333482 -0.146664 +v -0.319810 -0.272654 -0.270999 +v -0.235124 -0.181618 -0.354077 +v 0.071215 -0.085999 -0.438000 +v 0.041377 -0.063816 -0.438000 +v 0.171221 0.048513 -0.404659 +v 0.141384 0.070697 -0.404659 +v 0.256002 0.162547 -0.309713 +v 0.226165 0.184731 -0.309713 +v 0.312652 0.238743 -0.167615 +v 0.282814 0.260926 -0.167615 +v 0.332544 0.265499 0.000000 +v 0.302707 0.287682 0.000000 +v 0.312652 0.238743 0.167615 +v 0.282814 0.260926 0.167615 +v 0.256002 0.162547 0.309713 +v 0.226165 0.184731 0.309713 +v 0.171221 0.048513 0.404659 +v 0.141383 0.070697 0.404659 +v 0.071215 -0.085999 0.438000 +v 0.041377 -0.063816 0.438000 +v -0.058629 -0.198328 0.404659 +v -0.058629 -0.198328 -0.404659 +v 0.021058 -0.048709 -0.383250 +v 0.108564 0.068989 -0.354077 +v 0.182747 0.168769 -0.270999 +v 0.232315 0.235440 -0.146663 +v 0.249721 0.258852 0.000000 +v 0.232315 0.235440 0.146663 +v 0.182747 0.168769 0.270999 +v 0.108564 0.068989 0.354077 +v 0.021058 -0.048709 0.383250 +v -0.066448 -0.166408 0.354077 +v -0.140632 -0.266188 0.270999 +v -0.190200 -0.332858 0.146663 +v -0.207605 -0.356270 -0.000000 +v -0.190199 -0.332858 -0.146664 +v -0.140631 -0.266188 -0.270999 +v -0.066448 -0.166408 -0.354077 +v 0.220377 -0.057101 -0.438000 +v 0.188086 -0.038671 -0.438000 +v 0.303465 0.088470 -0.404659 +v 0.271175 0.106901 -0.404659 +v 0.373905 0.211880 -0.309713 +v 0.341614 0.230311 -0.309713 +v 0.420971 0.294340 -0.167615 +v 0.388680 0.312771 -0.167615 +v 0.437498 0.323296 0.000000 +v 0.405208 0.341727 0.000000 +v 0.420971 0.294340 0.167615 +v 0.388680 0.312771 0.167615 +v 0.373905 0.211880 0.309713 +v 0.341614 0.230311 0.309713 +v 0.303465 0.088470 0.404659 +v 0.271175 0.106901 0.404659 +v 0.220377 -0.057101 0.438000 +v 0.188086 -0.038671 0.438000 +v 0.104997 -0.184242 0.404659 +v 0.104997 -0.184242 -0.404659 +v 0.166096 -0.026119 -0.383250 +v 0.238799 0.101256 -0.354077 +v 0.300433 0.209240 -0.270999 +v 0.341616 0.281392 -0.146663 +v 0.356078 0.306728 0.000000 +v 0.341616 0.281392 0.146664 +v 0.300433 0.209240 0.270999 +v 0.238799 0.101256 0.354077 +v 0.166096 -0.026119 0.383250 +v 0.093393 -0.153495 0.354077 +v 0.031759 -0.261478 0.270999 +v -0.009424 -0.333631 0.146663 +v -0.023885 -0.358967 -0.000000 +v -0.009424 -0.333631 -0.146664 +v 0.031759 -0.261478 -0.270999 +v 0.093394 -0.153495 -0.354077 +vt 0.000000 0.054054 +vt 0.000000 0.000000 +vt 0.062500 0.000000 +vt 0.062500 0.054054 +vt 0.125000 0.000000 +vt 0.125000 0.054054 +vt 0.187500 0.000000 +vt 0.187500 0.054054 +vt 0.250000 0.000000 +vt 0.250000 0.054054 +vt 0.312500 0.000000 +vt 0.312500 0.054054 +vt 0.375000 0.000000 +vt 0.375000 0.054054 +vt 0.437500 0.000000 +vt 0.437500 0.054054 +vt 0.500000 0.000000 +vt 0.500000 0.054054 +vt 0.055610 0.293778 +vt 0.110171 0.184656 +vt 0.123905 0.225763 +vt 0.076165 0.321244 +vt 0.316174 0.801264 +vt 0.253798 0.852938 +vt 0.186282 0.852938 +vt 0.123905 0.801264 +vt 0.076165 0.705782 +vt 0.050327 0.581029 +vt 0.050327 0.445997 +vt 0.186282 0.174088 +vt 0.253798 0.174089 +vt 0.316174 0.225763 +vt 0.363915 0.321245 +vt 0.389752 0.445997 +vt 0.389752 0.581029 +vt 0.363915 0.705782 +vt 0.384468 0.733249 +vt 0.329907 0.842371 +vt 0.055610 0.733249 +vt 0.026082 0.590674 +vt 0.384468 0.293778 +vt 0.413996 0.436353 +vt 0.258619 0.901428 +vt 0.181458 0.901428 +vt 0.181458 0.125599 +vt 0.258619 0.125599 +vt 0.026082 0.436353 +vt 0.413996 0.590674 +vt 0.110171 0.842371 +vt 0.329907 0.184656 +vt 0.076566 0.705251 +vt 0.050729 0.580498 +vt 0.050729 0.445466 +vt 0.076566 0.320713 +vt 0.124307 0.225232 +vt 0.186684 0.173557 +vt 0.254199 0.173557 +vt 0.316576 0.225232 +vt 0.364317 0.320713 +vt 0.390154 0.445466 +vt 0.390154 0.580498 +vt 0.364317 0.705251 +vt 0.316576 0.800732 +vt 0.254199 0.852407 +vt 0.186684 0.852407 +vt 0.124307 0.800732 +vt 0.110573 0.841838 +vt 0.056012 0.732716 +vt 0.330309 0.841838 +vt 0.259022 0.900894 +vt 0.026484 0.590141 +vt 0.026484 0.435819 +vt 0.414398 0.435819 +vt 0.414398 0.590141 +vt 0.181861 0.900894 +vt 0.384870 0.732716 +vt 0.384870 0.293245 +vt 0.389637 0.582094 +vt 0.363799 0.706847 +vt 0.316059 0.802329 +vt 0.253682 0.854003 +vt 0.186166 0.854003 +vt 0.123790 0.802329 +vt 0.076049 0.706847 +vt 0.050212 0.582094 +vt 0.050212 0.447062 +vt 0.076049 0.322309 +vt 0.123790 0.226828 +vt 0.186166 0.175153 +vt 0.253682 0.175153 +vt 0.316058 0.226828 +vt 0.363799 0.322310 +vt 0.389637 0.447062 +vt 0.413881 0.437419 +vt 0.413881 0.591741 +vt 0.258504 0.126666 +vt 0.329792 0.185722 +vt 0.384353 0.734315 +vt 0.329792 0.843437 +vt 0.055495 0.294844 +vt 0.110056 0.185722 +vt 0.384353 0.294844 +vt 0.181343 0.126666 +vt 0.025967 0.437419 +g pies_Cylinder_pie +s off +f 1/1 2/2 4/3 3/4 +f 3/4 4/3 6/5 5/6 +f 5/6 6/5 8/7 7/8 +f 7/8 8/7 10/9 9/10 +f 9/10 10/9 12/11 11/12 +f 11/12 12/11 14/13 13/14 +f 13/14 14/13 16/15 15/16 +f 15/16 16/15 18/17 17/18 +f 20/19 19/20 35/21 36/22 +f 27/23 26/24 41/25 40/26 39/27 38/28 37/29 36/22 35/21 34/30 33/31 32/32 31/33 30/34 29/35 28/36 +f 6/37 4/38 27/23 28/36 +f 23/39 22/40 38/28 39/27 +f 12/41 10/42 30/34 31/33 +f 2/43 25/44 41/25 26/24 +f 4/38 2/43 26/24 27/23 +f 18/45 16/46 33/31 34/30 +f 21/47 20/19 36/22 37/29 +f 8/48 6/37 28/36 29/35 +f 24/49 23/39 39/27 40/26 +f 14/50 12/41 31/33 32/32 +f 19/20 18/45 34/30 35/21 +f 22/40 21/47 37/29 38/28 +f 10/42 8/48 29/35 30/34 +f 25/44 24/49 40/26 41/25 +f 16/46 14/50 32/32 33/31 +f 42/1 43/2 45/3 44/4 +f 44/4 45/3 47/5 46/6 +f 46/6 47/5 49/7 48/8 +f 48/8 49/7 51/9 50/10 +f 50/10 51/9 53/11 52/12 +f 52/12 53/11 55/13 54/14 +f 54/14 55/13 57/15 56/16 +f 56/16 57/15 59/17 58/18 +f 63/51 62/52 77/53 76/54 75/55 74/56 73/57 72/58 71/59 70/60 69/61 68/62 67/63 66/64 65/65 64/66 +f 47/67 45/68 63/51 64/66 +f 53/69 51/70 66/64 67/63 +f 43/71 61/72 77/53 62/52 +f 45/68 43/71 62/52 63/51 +f 59/73 57/74 69/61 70/60 +f 49/75 47/67 64/66 65/65 +f 55/76 53/69 67/63 68/62 +f 60/77 59/73 70/60 71/59 +f 51/70 49/75 65/65 66/64 +f 57/74 55/76 68/62 69/61 +f 78/1 79/2 81/3 80/4 +f 80/4 81/3 83/5 82/6 +f 82/6 83/5 85/7 84/8 +f 84/8 85/7 87/9 86/10 +f 86/10 87/9 89/11 88/12 +f 88/12 89/11 91/13 90/14 +f 90/14 91/13 93/15 92/16 +f 92/16 93/15 95/17 94/18 +f 99/78 98/79 113/80 112/81 111/82 110/83 109/84 108/85 107/86 106/87 105/88 104/89 103/90 102/91 101/92 100/93 +f 83/94 81/95 99/78 100/93 +f 89/96 87/97 102/91 103/90 +f 79/98 97/99 113/80 98/79 +f 81/95 79/98 98/79 99/78 +f 95/100 93/101 105/88 106/87 +f 85/102 83/94 100/93 101/92 +f 91/103 89/96 103/90 104/89 +f 96/104 95/100 106/87 107/86 +f 87/97 85/102 101/92 102/91 +f 93/101 91/103 104/89 105/88 +o basket_Cube.001 +v -0.500000 -0.500000 0.500000 +v -0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 -0.500000 +v 0.500000 -0.500000 0.500000 +v -0.500000 0.500000 0.500000 +v -0.500000 0.500000 -0.500000 +v 0.500000 0.500000 -0.500000 +v 0.500000 0.500000 0.500000 +v -0.437500 0.500000 0.437500 +v -0.437500 0.500000 -0.437500 +v 0.437500 0.500000 -0.437500 +v 0.437500 0.500000 0.437500 +v -0.437500 -0.437500 0.437500 +v -0.437500 -0.437500 -0.437500 +v 0.437500 -0.437500 -0.437500 +v 0.437500 -0.437500 0.437500 +vt 0.484848 0.984848 +vt 0.015152 0.984848 +vt 0.015152 0.515152 +vt 0.484848 0.515152 +vt 0.515152 0.984848 +vt 0.515152 0.515152 +vt 0.984848 0.515152 +vt 0.984848 0.984848 +vt 0.954545 0.545455 +vt 0.545455 0.545455 +vt 0.954545 0.954545 +vt 0.545455 0.954545 +g basket_Cube.001_basket +s off +f 118/105 119/106 115/107 114/108 +f 119/105 120/106 116/107 115/108 +f 120/105 121/106 117/107 116/108 +f 121/105 118/106 114/107 117/108 +f 114/109 115/110 116/111 117/112 +f 118/110 121/111 125/113 122/114 +f 121/111 120/112 124/115 125/113 +f 120/112 119/109 123/116 124/115 +f 119/109 118/110 122/114 123/116 +f 122/105 125/106 129/107 126/108 +f 125/105 124/106 128/107 129/108 +f 124/105 123/106 127/107 128/108 +f 123/105 122/106 126/107 127/108 +f 126/114 129/113 128/115 127/116 diff --git a/mods/plantlife_modpack/bushes_classic/models/bushes_bush.obj b/mods/plantlife_modpack/bushes_classic/models/bushes_bush.obj new file mode 100644 index 0000000..a69bfce --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/models/bushes_bush.obj @@ -0,0 +1,329 @@ +# Blender v2.73 (sub 0) OBJ File: 'bush.blend' +# www.blender.org +o nodebox-4 +v 0.467076 -0.122686 -0.190481 +v -0.453590 -0.119789 -0.192145 +v 0.420865 -0.181680 -0.171396 +v -0.429008 -0.188000 -0.182314 +v -0.450977 0.041977 -0.191409 +v -0.271687 -0.294075 -0.114977 +v -0.096925 -0.495759 -0.044091 +v -0.070286 -0.344209 -0.030750 +v -0.163971 -0.173437 -0.403793 +v -0.188139 -0.116431 0.446425 +v 0.069865 0.462329 0.170043 +v -0.175980 -0.180649 0.417932 +v -0.184276 0.039248 0.437271 +v -0.121692 -0.319322 0.290049 +v -0.039557 -0.495759 0.097032 +v -0.029307 -0.346230 0.070496 +v -0.440307 0.205163 -0.203598 +v -0.440281 0.206327 0.191785 +v -0.339366 0.327086 -0.144329 +v -0.267923 0.418413 0.108270 +v -0.264994 0.405691 -0.113216 +v 0.173823 0.186657 0.424935 +v -0.172109 0.470396 -0.073638 +v -0.090743 0.491063 -0.039539 +v -0.173625 0.180559 0.412022 +v 0.108534 0.404586 0.263698 +v -0.137870 0.317286 0.327397 +v 0.149454 0.342906 0.361857 +v -0.115069 0.426252 0.274637 +v 0.116858 -0.311812 0.284557 +v -0.074459 0.465500 0.178311 +v -0.036397 0.486640 0.094150 +v 0.044199 -0.495759 -0.101459 +v 0.034559 -0.377127 -0.079219 +v 0.116886 -0.299764 -0.276145 +v -0.172864 0.462259 0.069984 +v 0.173974 -0.178414 -0.411782 +v 0.191827 0.042411 -0.453422 +v 0.190055 -0.117435 -0.449613 +v -0.136929 0.321997 -0.339476 +v 0.101567 -0.495759 0.039664 +v 0.076778 -0.365788 0.030191 +v 0.292232 -0.320027 0.121743 +v -0.067752 0.451498 -0.167691 +v 0.433751 -0.189348 0.181586 +v 0.457624 0.044950 0.184732 +v 0.473778 -0.128221 0.198329 +v -0.113891 -0.307852 -0.282552 +v 0.081961 0.458662 -0.191580 +v 0.042947 0.491063 -0.093885 +v 0.109202 0.397842 -0.257691 +v 0.145450 0.328672 -0.343352 +v 0.191241 0.038411 0.444768 +v -0.184306 0.045052 -0.456452 +v -0.289997 -0.318897 0.117161 +v 0.182461 0.185982 -0.431178 +v 0.180190 0.469152 0.074510 +v 0.097292 0.491063 0.039804 +v 0.264954 0.412421 0.110505 +v 0.355939 0.336100 0.148277 +v -0.474575 0.042725 0.191924 +v -0.169486 0.185035 -0.418844 +v -0.445009 -0.118527 0.180804 +v 0.427054 0.187979 0.172057 +v 0.350926 0.339079 -0.143384 +v 0.189060 -0.125023 0.462241 +v 0.269270 -0.290650 -0.109472 +v 0.175816 -0.186803 0.429367 +v 0.259570 0.406980 -0.105942 +v -0.103158 0.398344 -0.255462 +v -0.339105 0.330270 0.137302 +v -0.186029 -0.123369 -0.460126 +v -0.418539 -0.180131 0.169838 +v 0.041492 0.491063 0.094145 +v 0.487251 0.041118 -0.191308 +v 0.173059 0.459504 -0.070716 +v 0.460259 0.206607 -0.196213 +v 0.108065 0.487446 -0.045199 +v -0.103423 0.491173 0.040772 +v -0.040665 0.496765 -0.107957 +v -0.070153 -0.343292 0.028053 +v -0.028215 -0.347521 -0.072596 +v 0.028031 -0.329368 0.067986 +v 0.075170 -0.358957 -0.031186 +v -0.037332 -0.495759 -0.099759 +v 0.099867 -0.495759 -0.041867 +v -0.095225 -0.495759 0.037440 +v 0.041974 -0.495759 0.095332 +v 0.001777 0.503796 -0.003546 +v 0.002321 -0.495758 -0.002214 +vt 0.875000 0.281250 +vt 1.000000 0.281250 +vt 1.000000 0.421875 +vt 0.875000 0.421875 +vt 0.375000 0.125000 +vt 0.500000 0.125000 +vt 0.500000 0.234375 +vt 0.375000 0.234375 +vt 0.625000 0.234375 +vt 0.625000 0.281250 +vt 0.500000 0.281250 +vt 0.500000 0.609375 +vt 0.500000 0.656250 +vt 0.375000 0.656250 +vt 0.375000 0.609375 +vt 0.625000 0.421875 +vt 0.500000 0.421875 +vt 0.375000 0.281250 +vt 0.375000 0.421875 +vt 0.125000 0.609375 +vt 0.125000 0.656250 +vt 0.000000 0.656250 +vt 0.000000 0.609375 +vt 0.846670 0.983596 +vt 0.823789 0.862038 +vt 0.861831 0.862038 +vt 0.500000 0.531250 +vt 0.375000 0.531250 +vt 0.234375 0.609375 +vt 0.234375 0.531250 +vt 0.875000 0.234375 +vt 0.750000 0.234375 +vt 0.750000 0.125000 +vt 0.875000 0.125000 +vt 0.125000 0.234375 +vt 0.125000 0.125000 +vt 0.234375 0.125000 +vt 0.234375 0.234375 +vt 0.125000 0.281250 +vt 0.234375 0.281250 +vt 0.234375 0.421875 +vt 0.125000 0.421875 +vt 0.125000 0.703125 +vt 0.000000 0.703125 +vt 0.875000 0.656250 +vt 0.750000 0.656250 +vt 0.750000 0.609375 +vt 0.875000 0.609375 +vt 0.625000 0.656250 +vt 0.625000 0.609375 +vt 0.234375 0.656250 +vt 0.375000 0.703125 +vt 0.234375 0.703125 +vt 0.125000 0.531250 +vt 0.875000 0.531250 +vt 1.000000 0.531250 +vt 1.000000 0.609375 +vt 0.500000 0.703125 +vt 0.000000 0.421875 +vt 0.000000 0.531250 +vt 0.875000 0.703125 +vt 0.750000 0.703125 +vt 0.328125 0.812500 +vt 0.328125 0.875000 +vt 0.265625 0.890625 +vt 0.265625 0.781250 +vt 0.750000 0.531250 +vt 1.000000 0.234375 +vt -0.000000 0.281250 +vt 0.000000 0.234375 +vt 0.375000 0.921875 +vt 0.328125 0.984375 +vt 0.562500 0.812500 +vt 0.500000 0.828125 +vt 0.625000 0.125000 +vt 0.625000 0.531250 +vt 0.970570 0.983596 +vt 0.918853 0.862038 +vt 0.983390 0.862038 +vt 1.000000 0.703125 +vt 1.000000 0.656250 +vt 0.694849 0.983596 +vt 0.653099 0.862038 +vt 0.703461 0.862038 +vt 0.453125 1.000000 +vt 0.437500 0.937500 +vt 0.546875 0.937500 +vt 0.375000 0.765625 +vt 0.625000 0.703125 +vt 0.750000 0.281250 +vt 0.000000 0.125000 +vt 0.781059 0.974219 +vt 0.740272 0.862038 +vt 0.773590 0.862038 +vt 0.823762 0.862067 +vt 0.773656 0.862066 +vt 0.800723 0.801332 +vt 0.750000 0.421875 +vt 1.000000 0.125000 +vt 0.881508 0.980225 +vt 0.923791 0.982865 +vt 0.819499 0.959318 +vt 0.634200 0.973424 +vt 0.659430 0.971277 +vt 0.724959 0.956989 +vt 0.755822 0.968617 +vt 0.125000 0.000000 +vt 0.234375 0.000000 +vt 0.375000 0.000000 +vt 0.500000 0.000000 +vt 0.750000 0.000000 +vt 0.875000 0.000000 +vt 1.000000 0.000000 +vt 0.625000 0.000000 +vt 0.000000 0.000000 +vt 0.618713 0.862038 +vt 0.453125 0.781250 +vt 0.484375 0.890625 +vt 0.406250 0.859375 +vt 0.738525 0.828462 +vt 0.741806 0.778103 +vt 0.777683 0.740596 +vt 0.827789 0.740597 +vt 0.862920 0.774201 +vt 0.859639 0.824560 +s off +f 63/1 10/2 13/3 61/4 +f 67/5 35/6 37/7 3/8 +f 9/9 72/10 39/11 37/7 +f 52/12 51/13 69/14 65/15 +f 72/10 54/16 38/17 39/11 +f 1/18 39/11 38/17 75/19 +f 28/20 26/21 29/22 27/23 +f 82/24 33/25 85/26 +f 75/19 38/17 56/27 77/28 +f 77/28 65/15 60/29 64/30 +f 73/31 4/32 6/33 55/34 +f 68/35 30/36 43/37 45/38 +f 66/39 47/40 46/41 53/42 +f 11/43 31/44 29/22 26/21 +f 20/45 21/46 19/47 71/48 +f 70/49 40/50 19/47 21/46 +f 59/51 69/14 76/52 57/53 +f 3/8 37/7 39/11 1/18 +f 28/20 22/54 64/30 60/29 +f 71/48 18/55 25/56 27/57 +f 69/14 51/13 49/58 76/52 +f 13/59 53/42 22/54 25/60 +f 36/61 23/62 21/46 20/45 +f 58/63 74/64 11/65 57/66 +f 57/53 11/43 26/21 59/51 +f 19/47 17/67 18/55 71/48 +f 73/31 12/68 10/2 63/1 +f 68/35 66/39 10/69 12/70 +f 74/64 32/71 31/72 11/65 +f 53/42 46/41 64/30 22/54 +f 25/56 18/55 61/4 13/3 +f 49/58 44/73 80/74 +f 45/38 3/8 1/18 47/40 +f 9/9 48/75 6/33 4/32 +f 62/76 40/50 52/12 56/27 +f 81/77 7/78 87/79 +f 31/80 36/61 20/45 29/81 +f 83/82 15/83 88/84 +f 36/85 79/86 23/87 +f 78/88 58/63 57/66 +f 17/67 19/47 40/50 62/76 +f 45/38 47/40 66/39 68/35 +f 51/13 70/49 44/89 49/58 +f 4/32 73/31 63/1 2/90 +f 12/70 14/91 30/36 68/35 +f 84/92 41/93 86/94 +f 33/95 86/96 90/97 +f 70/49 21/46 23/62 44/89 +f 54/16 62/76 56/27 38/17 +f 29/81 20/45 71/48 27/57 +f 37/7 35/6 48/75 9/9 +f 5/98 17/67 62/76 54/16 +f 18/55 17/67 5/98 61/4 +f 10/69 66/39 53/42 13/59 +f 12/68 73/31 55/34 14/99 +f 51/13 52/12 40/50 70/49 +f 27/23 25/60 22/54 28/20 +f 65/15 69/14 59/51 60/29 +f 56/27 52/12 65/15 77/28 +f 46/41 75/19 77/28 64/30 +f 60/29 59/51 26/21 28/20 +f 47/40 1/18 75/19 46/41 +f 2/90 5/98 54/16 72/10 +f 4/32 2/90 72/10 9/9 +f 43/37 67/5 3/8 45/38 +f 2/90 63/1 61/4 5/98 +f 82/100 7/78 8/101 +f 82/24 34/102 33/25 +f 81/103 15/83 16/104 +f 81/77 8/101 7/78 +f 83/82 41/93 42/105 +f 83/82 16/104 15/83 +f 84/92 33/25 34/102 +f 84/92 42/106 41/93 +f 30/36 83/107 42/108 43/37 +f 42/108 84/109 67/5 43/37 +f 67/5 84/109 34/110 35/6 +f 55/34 6/33 8/111 81/112 +f 55/34 81/112 16/113 14/99 +f 34/110 82/114 48/75 35/6 +f 48/75 82/114 8/111 6/33 +f 30/36 14/91 16/115 83/107 +f 7/78 82/100 85/26 +f 15/83 81/103 87/116 +f 41/93 83/82 88/84 +f 33/25 84/92 86/94 +f 80/74 50/117 49/58 +f 23/87 24/118 80/74 +f 80/74 44/73 23/87 +f 79/86 36/85 31/72 +f 79/86 24/118 23/87 +f 31/72 32/71 79/86 +f 78/88 49/58 50/117 +f 78/88 57/66 76/52 +f 76/52 49/58 78/88 +f 24/118 79/86 89/119 +f 79/86 32/71 89/119 +f 32/71 74/64 89/119 +f 74/64 58/63 89/119 +f 58/63 78/88 89/119 +f 78/88 50/117 89/119 +f 50/117 80/74 89/119 +f 80/74 24/118 89/119 +f 86/96 41/120 90/97 +f 41/120 88/121 90/97 +f 88/121 15/122 90/97 +f 15/122 87/123 90/97 +f 87/123 7/124 90/97 +f 7/124 85/125 90/97 +f 85/125 33/95 90/97 diff --git a/mods/plantlife_modpack/bushes_classic/nodes.lua b/mods/plantlife_modpack/bushes_classic/nodes.lua new file mode 100644 index 0000000..0a0446f --- /dev/null +++ b/mods/plantlife_modpack/bushes_classic/nodes.lua @@ -0,0 +1,214 @@ +local S = plantslib.intllib + +plantlife_bushes = {} + +-- TODO: add support for nodebreakers? those dig like mese picks +plantlife_bushes.after_dig_node = function(pos, oldnode, oldmetadata, digger) + if not (digger and pos and oldnode) then + return + end + + -- find out which bush type we are dealing with + local bush_name = "" + local can_harvest = false + + if oldnode.name == "bushes:fruitless_bush" then + -- this bush has not grown fruits yet (but will eventually) + bush_name = oldmetadata.fields.bush_type + -- no fruits to be found, so can_harvest stays false + else + local name_parts = oldnode.name:split(":") + if #name_parts >= 2 and name_parts[2] ~= nil then + + name_parts = name_parts[2]:split("_") + + if #name_parts >= 2 and name_parts[1] ~= nil then + bush_name = name_parts[1] + -- this bush really carries fruits + can_harvest = true + end + end + end + + -- find out which tool the digger was wielding (if any) + local toolstack = digger:get_wielded_item() + local capabilities = toolstack:get_tool_capabilities() + + -- what the player will get + local harvested + + -- failure to find out what the tool can do: destroy the bush and return nothing + local groupcaps = capabilities.groupcaps + if not groupcaps then + return + + -- digging with the hand or something like that + elseif groupcaps.snappy then + + -- plant a new bush without fruits + minetest.set_node(pos, {type = "node", name = "bushes:fruitless_bush"}) + local meta = minetest.get_meta(pos) + meta:set_string('bush_type', bush_name) + + -- construct the stack of fruits the player will get + -- only bushes that have grown fruits can actually give fruits + if can_harvest then + local amount = "4" + harvested = "bushes:" .. bush_name .. " " .. amount + end + + -- something like a shovel + elseif groupcaps.crumbly then + + -- with a chance of 1/3, return 2 bushes + local amount + if math.random(1,3) == 1 then + amount = "2" + else + amount = "1" + end + -- return the bush itself + harvested = "bushes:" .. bush_name .. "_bush "..amount + + -- something like an axe + elseif groupcaps.choppy then + + -- the amount of sticks may vary + local amount = math.random(4, 20) + -- return some sticks + harvested = "default:stick " .. amount + + -- nothing known - destroy the plant + else + return + end + + -- give the harvested result to the player + if harvested then + --minetest.chat_send_player("singleplayer","you would now get "..tostring( harvested ) ); + local itemstack = ItemStack(harvested) + local inventory = digger:get_inventory() + if inventory:room_for_item("main", itemstack) then + inventory:add_item("main", itemstack) + else + minetest.item_drop(itemstack, digger, pos) + end + end +end + +plantlife_bushes.after_place_node = function(pos, placer, itemstack) + + if not (itemstack and pos) then + return + end + + local name_parts = itemstack:get_name():split(":") + if #name_parts < 2 or name_parts[2] == nil then + return + end + + name_parts = name_parts[2]:split("_") + + if #name_parts < 2 or name_parts[1] == nil then + return + end + + minetest.set_node(pos, {name = "bushes:fruitless_bush"}) + local meta = minetest.get_meta(pos) + meta:set_string("bush_type", name_parts[1]) +end + +-- regrow berries (uses a base abm instead of plants_lib because of the use of metadata). + +minetest.register_abm({ + nodenames = {"bushes:fruitless_bush"}, + neighbors = {"group:soil", "group:potting_soil"}, + interval = 500, + chance = 5, + action = function(pos, node, active_object_count, active_object_count_wider) + + local meta = minetest.get_meta(pos) + local bush_name = meta:get_string("bush_type") + + if bush_name and bush_name ~= "" then + local dirtpos = {x = pos.x, y = pos.y-1, z = pos.z} + local dirt = minetest.get_node(dirtpos) + local is_soil = minetest.get_item_group(dirt.name, "soil") or minetest.get_item_group(dirt.name, "potting_soil") + + if is_soil and (dirt.name == "farming:soil_wet" or math.random(1,3) == 1) then + minetest.set_node( pos, {name = "bushes:" .. bush_name .. "_bush"}) + end + end + end +}) + +-- Define the basket and bush nodes + +for i, bush_name in ipairs(bushes_classic.bushes) do + + local desc = bushes_classic.bushes_descriptions[i] + + minetest.register_node(":bushes:basket_"..bush_name, { + description = S("Basket with "..desc.." Pies"), + drawtype = "mesh", + mesh = "bushes_basket_full.obj", + tiles = { + "bushes_basket_pie_"..bush_name..".png", + "bushes_basket.png" + }, + paramtype = "light", + paramtype2 = "facedir", + on_use = minetest.item_eat(18), + groups = { dig_immediate = 3 }, + }) + + local texture_top, texture_bottom + + local groups = {snappy = 3, bush = 1, flammable = 2, attached_node=1} + if bush_name == "mixed_berry" then + bush_name = "fruitless"; + desc = S("currently fruitless"); + texture_top = "bushes_fruitless_bush_top.png" + texture_bottom = "bushes_fruitless_bush_bottom.png" + groups.not_in_creative_inventory = 1 + else + texture_top = "bushes_bush_top.png" + texture_bottom = "bushes_bush_bottom.png" + end + + minetest.register_node(":bushes:" .. bush_name .. "_bush", { + description = S(desc.." Bush"), + drawtype = "mesh", + mesh = "bushes_bush.obj", + tiles = {"bushes_bush_"..bush_name..".png"}, + paramtype = "light", + sunlight_propagates = true, + walkable = false, + groups = groups, + sounds = default.node_sound_leaves_defaults(), + drop = "", + after_dig_node = function( pos, oldnode, oldmetadata, digger ) + return plantlife_bushes.after_dig_node(pos, oldnode, oldmetadata, digger); + end, + after_place_node = function( pos, placer, itemstack ) + return plantlife_bushes.after_place_node(pos, placer, itemstack); + end, + }) + + -- do not spawn fruitless bushes + if bush_name ~= "fruitless" then + table.insert(bushes_classic.spawn_list, "bushes:"..bush_name.."_bush") + end +end + +minetest.register_node(":bushes:basket_empty", { + description = S("Basket"), + drawtype = "mesh", + mesh = "bushes_basket_empty.obj", + tiles = { "bushes_basket.png" }, + paramtype = "light", + paramtype2 = "facedir", + groups = { dig_immediate = 3 }, +}) + + diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket.png new file mode 100644 index 0000000..4384fba Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_blackberry_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_blackberry_top.png new file mode 100644 index 0000000..655b3e8 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_blackberry_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_blueberry_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_blueberry_top.png new file mode 100644 index 0000000..555b902 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_blueberry_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_bottom.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_bottom.png new file mode 100644 index 0000000..3eeba8e Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_bottom.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_empty_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_empty_top.png new file mode 100644 index 0000000..e972264 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_empty_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_gooseberry_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_gooseberry_top.png new file mode 100644 index 0000000..b66c5f5 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_gooseberry_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_mixed_berry_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_mixed_berry_top.png new file mode 100644 index 0000000..a2be7da Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_mixed_berry_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_blackberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_blackberry.png new file mode 100644 index 0000000..83ee63c Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_blackberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_blueberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_blueberry.png new file mode 100644 index 0000000..9f9b2c6 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_blueberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_gooseberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_gooseberry.png new file mode 100644 index 0000000..d6bdff4 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_gooseberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_mixed_berry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_mixed_berry.png new file mode 100644 index 0000000..ff271ff Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_mixed_berry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_raspberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_raspberry.png new file mode 100644 index 0000000..3bfd42f Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_raspberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_strawberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_strawberry.png new file mode 100644 index 0000000..c27b0b3 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_pie_strawberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_raspberry_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_raspberry_top.png new file mode 100644 index 0000000..8a0ab1a Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_raspberry_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_side.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_side.png new file mode 100644 index 0000000..668104f Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_side.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_strawberry_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_strawberry_top.png new file mode 100644 index 0000000..2a6c1ba Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_basket_strawberry_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry.png new file mode 100644 index 0000000..76b742b Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_bush.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_bush.png new file mode 100644 index 0000000..594dec4 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_bush.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_cooked.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_cooked.png new file mode 100644 index 0000000..a6af5ca Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_cooked.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_raw.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_raw.png new file mode 100644 index 0000000..c37f987 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_raw.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_slice.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_slice.png new file mode 100644 index 0000000..90be80e Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blackberry_pie_slice.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry.png new file mode 100644 index 0000000..e15047f Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_bush.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_bush.png new file mode 100644 index 0000000..7d1bf47 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_bush.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_cooked.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_cooked.png new file mode 100644 index 0000000..11ce60f Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_cooked.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_raw.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_raw.png new file mode 100644 index 0000000..6e8dd9e Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_raw.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_slice.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_slice.png new file mode 100644 index 0000000..eb6bf5a Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_blueberry_pie_slice.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_blackberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_blackberry.png new file mode 100644 index 0000000..fa76c61 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_blackberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_blueberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_blueberry.png new file mode 100644 index 0000000..3a305ca Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_blueberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_bottom.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_bottom.png new file mode 100644 index 0000000..a1c5af5 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_bottom.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_fruitless.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_fruitless.png new file mode 100644 index 0000000..ffa2e0a Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_fruitless.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_gooseberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_gooseberry.png new file mode 100644 index 0000000..52eca60 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_gooseberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_raspberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_raspberry.png new file mode 100644 index 0000000..01809de Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_raspberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_strawberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_strawberry.png new file mode 100644 index 0000000..a5060e2 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_strawberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_top.png new file mode 100644 index 0000000..ef35c71 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_bush_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush.png new file mode 100644 index 0000000..3475e58 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush_bottom.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush_bottom.png new file mode 100644 index 0000000..7632894 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush_bottom.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush_top.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush_top.png new file mode 100644 index 0000000..ec6d1d8 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_fruitless_bush_top.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry.png new file mode 100644 index 0000000..e712cad Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_bush.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_bush.png new file mode 100644 index 0000000..b7d9c60 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_bush.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_cooked.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_cooked.png new file mode 100644 index 0000000..caa4e92 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_cooked.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_raw.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_raw.png new file mode 100644 index 0000000..baf5af7 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_raw.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_slice.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_slice.png new file mode 100644 index 0000000..5cf2844 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_gooseberry_pie_slice.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_cooked.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_cooked.png new file mode 100644 index 0000000..351a269 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_cooked.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_raw.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_raw.png new file mode 100644 index 0000000..6486989 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_raw.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_slice.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_slice.png new file mode 100644 index 0000000..8844c3d Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_mixed_berry_pie_slice.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry.png new file mode 100644 index 0000000..034fd48 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_bush.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_bush.png new file mode 100644 index 0000000..182ce8f Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_bush.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_cooked.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_cooked.png new file mode 100644 index 0000000..afeb7d8 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_cooked.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_raw.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_raw.png new file mode 100644 index 0000000..bb76a1d Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_raw.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_slice.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_slice.png new file mode 100644 index 0000000..a094488 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_raspberry_pie_slice.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry.png new file mode 100644 index 0000000..b6a74b6 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_bush.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_bush.png new file mode 100644 index 0000000..8ddd16e Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_bush.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_cooked.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_cooked.png new file mode 100644 index 0000000..3d034ea Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_cooked.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_raw.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_raw.png new file mode 100644 index 0000000..932c073 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_raw.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_slice.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_slice.png new file mode 100644 index 0000000..f8d1d36 Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_strawberry_pie_slice.png differ diff --git a/mods/plantlife_modpack/bushes_classic/textures/bushes_sugar.png b/mods/plantlife_modpack/bushes_classic/textures/bushes_sugar.png new file mode 100644 index 0000000..726196b Binary files /dev/null and b/mods/plantlife_modpack/bushes_classic/textures/bushes_sugar.png differ diff --git a/mods/plantlife_modpack/cavestuff/depends.txt b/mods/plantlife_modpack/cavestuff/depends.txt new file mode 100644 index 0000000..3a7daa1 --- /dev/null +++ b/mods/plantlife_modpack/cavestuff/depends.txt @@ -0,0 +1,2 @@ +default + diff --git a/mods/plantlife_modpack/cavestuff/init.lua b/mods/plantlife_modpack/cavestuff/init.lua new file mode 100644 index 0000000..f2bed1a --- /dev/null +++ b/mods/plantlife_modpack/cavestuff/init.lua @@ -0,0 +1,12 @@ +----------------------------------------------------------------------------------------------- +local title = "Cave Stuff" +local version = "0.0.3" +local mname = "cavestuff" +----------------------------------------------------------------------------------------------- + +dofile(minetest.get_modpath("cavestuff").."/nodes.lua") +dofile(minetest.get_modpath("cavestuff").."/mapgen.lua") + +----------------------------------------------------------------------------------------------- + +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") diff --git a/mods/plantlife_modpack/cavestuff/mapgen.lua b/mods/plantlife_modpack/cavestuff/mapgen.lua new file mode 100644 index 0000000..a91a2f0 --- /dev/null +++ b/mods/plantlife_modpack/cavestuff/mapgen.lua @@ -0,0 +1,52 @@ +--Map Generation Stuff + +minetest.register_on_generated(function(minp, maxp, seed) + if maxp.y >= 2 and minp.y <= 0 then + -- Generate pebbles + local perlin1 = minetest.get_perlin(329, 3, 0.6, 100) + -- Assume X and Z lengths are equal + local divlen = 16 + local divs = (maxp.x-minp.x)/divlen+1; + for divx=0,divs-1 do + for divz=0,divs-1 do + local x0 = minp.x + math.floor((divx+0)*divlen) + local z0 = minp.z + math.floor((divz+0)*divlen) + local x1 = minp.x + math.floor((divx+1)*divlen) + local z1 = minp.z + math.floor((divz+1)*divlen) + -- Determine pebble amount from perlin noise + local pebble_amount = math.floor(perlin1:get2d({x=x0, y=z0}) ^ 2 * 2) + -- Find random positions for pebbles based on this random + local pr = PseudoRandom(seed+1) + for i=0,pebble_amount do + local x = pr:next(x0, x1) + local z = pr:next(z0, z1) + -- Find ground level (0...15) + local ground_y = nil + for y=30,0,-1 do + if minetest.get_node({x=x,y=y,z=z}).name ~= "air" then + ground_y = y + break + end + end + + if ground_y then + local p = {x=x,y=ground_y+1,z=z} + local nn = minetest.get_node(p).name + -- Check if the node can be replaced + if minetest.registered_nodes[nn] and + minetest.registered_nodes[nn].buildable_to then + nn = minetest.get_node({x=x,y=ground_y,z=z}).name + -- If desert sand, add dry shrub + if nn == "default:dirt_with_grass" then + minetest.set_node(p,{name="cavestuff:pebble_"..pr:next(1,2), param2=math.random(0,3)}) + elseif nn == "default:desert_sand" then + minetest.set_node(p,{name="cavestuff:desert_pebble_"..pr:next(1,2), param2=math.random(0,3)}) + end + end + end + + end + end + end + end +end) diff --git a/mods/plantlife_modpack/cavestuff/models/cavestuff_pebble.obj b/mods/plantlife_modpack/cavestuff/models/cavestuff_pebble.obj new file mode 100644 index 0000000..243d1ce --- /dev/null +++ b/mods/plantlife_modpack/cavestuff/models/cavestuff_pebble.obj @@ -0,0 +1,279 @@ +# Blender v2.69 (sub 0) OBJ File: '' +# www.blender.org +mtllib cavestuff_pebble.mtl +o Icosphere.001_Icosphere.002 +v -0.000327 -0.410467 0.180121 +v -0.235610 -0.410468 0.155391 +v -0.284796 -0.410468 -0.076018 +v -0.121985 -0.209219 0.205980 +v -0.284738 -0.218753 0.040139 +v -0.201573 -0.219323 -0.168447 +v -0.100950 -0.116906 0.005837 +v -0.088586 -0.496875 -0.111804 +v -0.196648 -0.428134 -0.159917 +v -0.209011 -0.497294 -0.042276 +v -0.041805 -0.497429 0.108278 +v -0.180101 -0.487871 0.093742 +v -0.120956 -0.428134 0.196184 +v -0.288163 -0.428135 0.045629 +v -0.147553 -0.309844 -0.213938 +v -0.268157 -0.309844 -0.144718 +v -0.192465 -0.309844 0.211384 +v -0.054169 -0.309844 0.225920 +v -0.324717 -0.309844 -0.017682 +v -0.288965 -0.319377 0.114387 +v -0.023183 -0.210866 0.195570 +v -0.221888 -0.201086 0.143956 +v -0.275798 -0.233149 -0.072011 +v -0.160094 -0.150509 -0.096605 +v -0.113314 -0.150508 0.123477 +v -0.216653 -0.160042 0.030431 +v 0.073364 -0.397538 -0.267606 +v 0.268711 -0.397538 -0.091716 +v 0.161795 -0.397537 0.148424 +v 0.199614 -0.173928 -0.211396 +v 0.254265 -0.173928 0.045725 +v 0.026620 -0.195887 0.177156 +v -0.061812 -0.173929 -0.238874 +v 0.049992 -0.055394 -0.045225 +v 0.178551 -0.485125 -0.072552 +v 0.063729 -0.498396 -0.175936 +v 0.192289 -0.417167 -0.203264 +v -0.056339 -0.417167 -0.229396 +v -0.070077 -0.496109 -0.098684 +v 0.115708 -0.497252 0.068599 +v 0.244268 -0.417167 0.041273 +v 0.027763 -0.417167 0.166272 +v -0.001987 -0.285733 -0.289762 +v -0.109557 -0.285733 -0.245455 +v 0.258217 -0.285733 -0.165444 +v 0.151676 -0.285733 -0.273611 +v 0.235777 -0.285733 0.122059 +v 0.298622 -0.285733 -0.019093 +v 0.101971 -0.285733 0.199312 +v 0.072221 -0.154299 -0.256722 +v 0.258006 -0.154298 -0.089439 +v 0.156323 -0.154299 0.138946 +v 0.137937 -0.086893 -0.142897 +v -0.015725 -0.073070 -0.159049 +v 0.170060 -0.073069 0.008234 +v 0.036254 -0.095028 0.085487 +v -0.059660 -0.090744 -0.028814 +v -0.016904 -0.495185 -0.020480 +v -0.038530 -0.134593 0.104482 +v 0.018559 -0.297788 0.203363 +vt 0.999784 0.777888 +vt 0.781916 0.751069 +vt 0.930695 0.535842 +vt 0.718554 0.493678 +vt 0.498343 0.500066 +vt 0.612704 0.301958 +vt 0.278288 0.491767 +vt 0.136170 0.301428 +vt 0.385039 0.315647 +vt 0.861174 0.302958 +vt 0.817615 0.924676 +vt 0.662334 0.996212 +vt 0.719667 0.785775 +vt 0.955856 0.540882 +vt 0.919844 0.749017 +vt 0.810792 0.580191 +vt 0.698724 0.249779 +vt 0.882029 0.358101 +vt 0.648319 0.423681 +vt 0.738504 0.311189 +vt 0.859769 0.100574 +vt 0.955856 0.301223 +vt 0.603011 0.109855 +vt 0.889116 0.979094 +vt 0.625593 0.954685 +vt 0.572947 0.723101 +vt 0.629662 0.708272 +vt 0.361849 0.694965 +vt 0.626863 0.523494 +vt 0.877334 0.514944 +vt 0.753445 0.687054 +vt 0.678897 0.522004 +vt 0.804007 0.322784 +vt 0.508145 0.125975 +vt 0.614686 0.322544 +vt 0.274631 0.088482 +vt 0.046907 0.080882 +vt 0.724191 0.150589 +vt 0.955856 0.101994 +vt 0.459738 0.810380 +vt 0.524431 0.596612 +vt 0.614955 0.619521 +vt 0.385224 0.455707 +vt 0.518113 0.743431 +vt 0.397247 0.481913 +vt 0.473092 0.333636 +vt 0.593136 0.806842 +vt 0.542133 0.566645 +vt 0.245991 0.361941 +vt 0.291514 0.126530 +vt 0.515385 0.289890 +vt 0.348981 0.560141 +vt 0.480373 0.537386 +vt 0.705144 0.472239 +vt 0.601667 0.722403 +vt 0.283471 0.700220 +vt 0.061144 0.812481 +vt 0.120014 0.502516 +vt 0.080353 0.535703 +vt 0.356859 0.719702 +vt 0.417004 0.243099 +vt 0.001005 0.468262 +vt 0.186797 0.314823 +vt 0.187216 0.555587 +vt 0.094383 0.931756 +vt 0.003057 0.709324 +vt 0.238065 0.772821 +vt 0.569632 0.999536 +vt 0.323797 1.000000 +vt 0.482075 0.313011 +vt 0.735871 0.182001 +vt 0.032983 0.251846 +vt 0.574313 0.080491 +vt 0.318361 0.961238 +vt 0.229901 0.178033 +vt 0.256609 0.467686 +vt 0.464307 0.768933 +vt 0.865183 0.712997 +vt 0.725052 0.926500 +vt 0.093408 0.705147 +vt 0.230523 0.921209 +vt 0.968797 0.984796 +vt 0.210756 0.792236 +vt 0.477482 0.962103 +vt 0.256493 0.223509 +vt 0.000000 0.255402 +vt 0.543998 0.500902 +vt 0.362414 0.637562 +vt 0.469769 0.648982 +vt 0.379376 0.894841 +vt 0.246514 0.544201 +vt 0.117965 0.884444 +vt 0.047032 0.632888 +vt 0.079441 0.605161 +vt 0.000000 0.325670 +vt 0.241712 0.163133 +vt 0.470206 0.343559 +usemtl None +s off +f 2/1 13/2 17/3 +f 3/4 14/5 19/6 +f 2/7 17/8 20/9 +f 3/4 19/6 16/10 +f 4/11 21/12 25/13 +f 5/14 22/15 26/16 +f 6/17 23/18 24/19 +f 9/20 10/21 3/22 +f 9/20 8/23 10/21 +f 12/24 13/2 2/1 +f 12/24 11/25 13/2 +f 11/25 1/26 13/2 +f 10/27 14/5 3/4 +f 10/27 12/28 14/5 +f 12/28 2/7 14/5 +f 15/29 16/30 6/31 +f 15/29 9/20 16/30 +f 9/20 3/22 16/30 +f 17/3 18/32 4/33 +f 17/3 13/2 18/32 +f 13/2 1/26 18/32 +f 19/6 20/9 5/34 +f 19/6 14/5 20/9 +f 14/5 2/7 20/9 +f 18/32 21/35 4/33 +f 20/9 22/36 5/34 +f 20/9 17/8 22/36 +f 17/8 4/37 22/36 +f 16/10 23/38 6/39 +f 16/10 19/6 23/38 +f 19/6 5/34 23/38 +f 56/40 57/41 7/42 +f 57/41 54/43 24/19 +f 1/26 42/44 49/45 +f 38/46 9/20 15/29 +f 25/13 21/12 59/47 +f 15/29 6/31 44/48 +f 26/16 25/13 7/42 +f 26/16 22/15 25/13 +f 22/15 4/11 25/13 +f 24/19 26/16 7/42 +f 24/19 23/18 26/16 +f 23/18 5/14 26/16 +f 27/49 36/50 38/46 +f 32/51 21/35 49/45 +f 27/49 38/46 43/52 +f 28/53 37/54 45/55 +f 29/56 41/57 47/58 +f 1/26 11/25 42/44 +f 27/49 43/52 46/59 +f 28/53 45/55 48/60 +f 29/56 47/58 49/45 +f 6/17 24/19 33/61 +f 30/62 50/63 53/64 +f 31/65 51/66 55/67 +f 32/68 52/69 56/40 +f 35/70 37/54 28/53 +f 35/70 36/71 37/54 +f 36/50 27/49 37/72 +f 9/20 38/46 8/23 +f 38/46 36/50 39/73 +f 40/74 41/57 29/56 +f 40/75 35/70 41/76 +f 35/70 28/53 41/76 +f 44/48 38/46 15/29 +f 38/46 39/73 8/23 +f 40/74 29/56 42/44 +f 43/52 44/48 33/77 +f 43/52 38/46 44/48 +f 45/55 46/78 30/79 +f 45/55 37/54 46/78 +f 37/72 27/49 46/59 +f 47/80 48/60 31/81 +f 47/80 41/76 48/60 +f 41/76 28/53 48/60 +f 11/25 40/74 42/44 +f 42/44 29/56 49/45 +f 46/78 50/82 30/79 +f 46/59 43/52 50/83 +f 43/52 33/77 50/83 +f 48/60 51/84 31/81 +f 48/60 45/55 51/84 +f 45/55 30/79 51/84 +f 49/45 52/85 32/51 +f 49/45 47/58 52/85 +f 47/58 31/86 52/85 +f 18/32 1/26 60/87 +f 21/35 18/32 60/87 +f 6/31 33/77 44/48 +f 53/64 54/43 34/88 +f 53/64 50/63 54/43 +f 50/63 33/61 54/43 +f 55/67 53/64 34/88 +f 55/67 51/66 53/64 +f 51/66 30/62 53/64 +f 56/40 55/67 34/88 +f 56/40 52/69 55/67 +f 52/69 31/65 55/67 +f 57/41 56/40 34/88 +f 21/12 32/68 56/40 +f 25/13 59/47 7/42 +f 54/43 57/41 34/88 +f 7/42 57/41 24/19 +f 33/61 24/19 54/43 +f 11/89 12/90 58/91 +f 12/90 10/92 58/91 +f 10/92 8/93 58/91 +f 8/93 39/94 58/91 +f 39/94 36/95 58/91 +f 36/95 35/96 58/91 +f 35/96 40/97 58/91 +f 40/97 11/89 58/91 +f 21/12 56/40 59/47 +f 59/47 56/40 7/42 +f 1/26 49/45 60/87 +f 49/45 21/35 60/87 diff --git a/mods/plantlife_modpack/cavestuff/nodes.lua b/mods/plantlife_modpack/cavestuff/nodes.lua new file mode 100644 index 0000000..dc537cf --- /dev/null +++ b/mods/plantlife_modpack/cavestuff/nodes.lua @@ -0,0 +1,145 @@ +--Rocks + +local cbox = { + type = "fixed", + fixed = {-5/16, -8/16, -6/16, 5/16, -1/32, 5/16}, +} + +minetest.register_node("cavestuff:pebble_1",{ + description = "Pebble", + drawtype = "mesh", + mesh = "cavestuff_pebble.obj", + tiles = {"undergrowth_pebble.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1}, + selection_box = cbox, + collision_box = cbox, + on_place = function(itemstack, placer, pointed_thing) + -- place a random pebble node + local stack = ItemStack("cavestuff:pebble_"..math.random(1,2)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("cavestuff:pebble_1 "..itemstack:get_count()-(1-ret:get_count())) + end, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("cavestuff:pebble_2",{ + drawtype = "mesh", + mesh = "cavestuff_pebble.obj", + tiles = {"undergrowth_pebble.png"}, + drop = "cavestuff:pebble_1", + tiles = {"undergrowth_pebble.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1, not_in_creative_inventory=1}, + selection_box = cbox, + collision_box = cbox, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("cavestuff:desert_pebble_1",{ + description = "Desert Pebble", + drawtype = "mesh", + mesh = "cavestuff_pebble.obj", + tiles = {"default_desert_stone.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1}, + selection_box = cbox, + collision_box = cbox, + on_place = function(itemstack, placer, pointed_thing) + -- place a random pebble node + local stack = ItemStack("cavestuff:desert_pebble_"..math.random(1,2)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("cavestuff:desert_pebble_1 "..itemstack:get_count()-(1-ret:get_count())) + end, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node("cavestuff:desert_pebble_2",{ + drawtype = "mesh", + mesh = "cavestuff_pebble.obj", + drop = "cavestuff:desert_pebble_1", + tiles = {"default_desert_stone.png"}, + paramtype = "light", + paramtype2 = "facedir", + groups = {cracky=3, stone=1, not_in_creative__inventory=1}, + selection_box = cbox, + collision_box = cbox, + sounds = default.node_sound_stone_defaults(), +}) + +--Staclactites + +minetest.register_node("cavestuff:stalactite_1",{ + drawtype="nodebox", + tiles = {"undergrowth_pebble.png"}, + groups = {cracky=3,attached_node=1}, + description = "Stalactite", + paramtype = "light", + paramtype2 = "wallmounted", + node_box = { + type = "fixed", + fixed = { + {-0.187500,0.425000,-0.150003,0.162500,0.500000,0.162500}, + {-0.112500,0.162500,-0.100000,0.087500,0.475000,0.087500}, + {-0.062500,-0.275000,-0.062500,0.062500,0.500000,0.062500}, + {-0.037500,-0.837500,0.037500,0.037500,0.500000,-0.025000}, + } + }, + + on_place = function(itemstack, placer, pointed_thing) + local pt = pointed_thing + if minetest.get_node(pt.under).name=="default:stone" + and minetest.get_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}).name=="air" + and minetest.get_node({x=pt.under.x, y=pt.under.y-2, z=pt.under.z}).name=="air" then + minetest.set_node({x=pt.under.x, y=pt.under.y-1, z=pt.under.z}, {name="cavestuff:stalactite_"..math.random(1,3)}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + end + return itemstack + end, +}) + +minetest.register_node("cavestuff:stalactite_2",{ + drawtype="nodebox", + tiles = {"undergrowth_pebble.png"}, + groups = {cracky=3,attached_node=1,not_in_creative_inventory=1}, + drop = "cavestuff:stalactite_1", + paramtype = "light", + paramtype2 = "wallmounted", + node_box = { + type = "fixed", + fixed = { + {-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500}, + {-0.112500,0.112500,-0.100000,0.087500,0.475000,0.087500}, + {-0.062500,-0.675000,-0.062500,0.062500,0.500000,0.062500}, + {-0.037500,-0.975000,0.037500,0.037500,0.500000,-0.025000}, + } + }, +}) + +minetest.register_node("cavestuff:stalactite_3",{ + drawtype="nodebox", + tiles = {"undergrowth_pebble.png"}, + groups = {cracky=3,attached_node=1,not_in_creative_inventory=1}, + drop = "cavestuff:stalactite_1", + paramtype = "light", + paramtype2 = "wallmounted", + node_box = { + type = "fixed", + fixed = { + {-0.187500,0.387500,-0.150003,0.162500,0.500000,0.162500}, + {-0.112500,0.037500,-0.100000,0.087500,0.475000,0.087500}, + {-0.062500,-0.437500,-0.062500,0.062500,0.500000,0.062500}, + {-0.037500,-1.237500,0.037500,0.037500,0.500000,-0.025000}, + } + }, +}) + +--Stalagmites + + + diff --git a/mods/plantlife_modpack/cavestuff/textures/undergrowth_desert_pebble.png b/mods/plantlife_modpack/cavestuff/textures/undergrowth_desert_pebble.png new file mode 100644 index 0000000..966e937 Binary files /dev/null and b/mods/plantlife_modpack/cavestuff/textures/undergrowth_desert_pebble.png differ diff --git a/mods/plantlife_modpack/cavestuff/textures/undergrowth_pebble.png b/mods/plantlife_modpack/cavestuff/textures/undergrowth_pebble.png new file mode 100644 index 0000000..306ca6a Binary files /dev/null and b/mods/plantlife_modpack/cavestuff/textures/undergrowth_pebble.png differ diff --git a/mods/plantlife_modpack/copyright.txt b/mods/plantlife_modpack/copyright.txt new file mode 100644 index 0000000..63d2431 --- /dev/null +++ b/mods/plantlife_modpack/copyright.txt @@ -0,0 +1,10 @@ +Ironzorg's Flowers mod served as the basis for the three mods that eventually +went into creating this file. Any code still remaining from that mod is +entirely his work (though I'm pretty sure it's all been phased out). + +Flowers textures by Ironzorg. + +Junglegrass textures are modified copies of the original one from the game's +default set. + +All remaining code, textures, etc. by Vanessa Ezekowitz. diff --git a/mods/plantlife_modpack/dryplants/crafting.lua b/mods/plantlife_modpack/dryplants/crafting.lua new file mode 100644 index 0000000..69154b5 --- /dev/null +++ b/mods/plantlife_modpack/dryplants/crafting.lua @@ -0,0 +1,360 @@ +----------------------------------------------------------------------------------------------- +-- Dry Plants - Recipes 0.1.0 -- Short Grass -> Dirt +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Looked at code from: darkage, default, farming, sickle, stairs +-- Dependencies: default, farming +-- Supports: flint, stoneage, sumpf +----------------------------------------------------------------------------------------------- + +----------------------------------------------------------------------------------------------- +-- Short Grass +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + output = "default:dirt", + recipe = { + {"dryplants:grass_short"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- Cut Grass +----------------------------------------------------------------------------------------------- +-- grass recipes (remove roots) +minetest.register_craft({ + output = "dryplants:grass", + recipe = { + {"default:grass_1"}, + } +}) +minetest.register_craft({ + output = "dryplants:grass", + recipe = { + {"default:junglegrass"}, + } +}) +if minetest.get_modpath("sumpf") ~= nil then + minetest.register_craft({ + output = "dryplants:grass", + recipe = { + {"sumpf:gras"}, + } + }) +end + +----------------------------------------------------------------------------------------------- +-- Sickle +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + output = "dryplants:sickle", + recipe = { + {"group:stone",""}, + {"", "default:stick"}, + {"default:stick",""} + } +}) +if minetest.get_modpath("flint") ~= nil then + minetest.register_craft({ + output = "dryplants:sickle", + recipe = { + {"flint:flintstone",""}, + {"", "default:stick"}, + {"default:stick",""} + } + }) +end +if minetest.get_modpath("stoneage") ~= nil then + minetest.register_craft({ + output = "dryplants:sickle", + recipe = { + {"stoneage:silex",""}, + {"", "default:stick"}, + {"default:stick",""} + } + }) +end + +----------------------------------------------------------------------------------------------- +-- Hay +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ + type = "cooking", + output = "dryplants:hay", + recipe = "dryplants:grass", + cooktime = 2, +}) + +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:hay", + burntime = 1, +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- papyrus -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"default:papyrus","default:papyrus"}, + {"default:papyrus","default:papyrus"}, + } +}) +minetest.register_craft({ -- reedmace_sapling -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace_sapling","dryplants:reedmace_sapling"}, + {"dryplants:reedmace_sapling","dryplants:reedmace_sapling"}, + } +}) +minetest.register_craft({ -- reedmace_top -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace_top","dryplants:reedmace_top"}, + {"dryplants:reedmace_top","dryplants:reedmace_top"}, + } +}) +minetest.register_craft({ -- reedmace -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace","dryplants:reedmace"}, + {"dryplants:reedmace","dryplants:reedmace"}, + } +}) +minetest.register_craft({ -- reedmace_bottom -> wetreed + output = "dryplants:wetreed 2", + recipe = { + {"dryplants:reedmace_bottom","dryplants:reedmace_bottom"}, + {"dryplants:reedmace_bottom","dryplants:reedmace_bottom"}, + } +}) + + +local ReeD = { + {"wetreed"}, + {"reed"} +} +for i in pairs(ReeD) do + local reed = "dryplants:"..ReeD[i][1] + local slab = reed.."_slab" + local roof = reed.."_roof" + local corner = roof.."_corner" + local corner_2 = corner.."_2" +----------------------------------------------------------------------------------------------- +-- Block +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- slab -> block + output = reed, + recipe = { + {slab}, + {slab}, + } + }) + minetest.register_craft({ -- roof -> block + output = reed, + recipe = { + {roof}, + {roof}, + } + }) + minetest.register_craft({ -- corner -> block + type = "shapeless", + output = reed.." 3", + recipe = {corner,corner,corner,corner,corner,corner,corner,corner}, -- 8x + }) + minetest.register_craft({ -- corner_2 -> block + type = "shapeless", + output = reed.." 3", + recipe = {corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2,corner_2}, -- 8x + }) +----------------------------------------------------------------------------------------------- +-- Slab +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> slab + output = slab.." 6", + recipe = { + {reed,reed,reed}, + } + }) + minetest.register_craft({ -- roof -> slab + output = slab, + recipe = { + {roof}, + } + }) + minetest.register_craft({ -- corner -> slab + output = slab.." 3", + recipe = { + {corner,corner}, + {corner,corner}, + } + }) + minetest.register_craft({ -- corner_2 -> slab + output = slab.." 3", + recipe = { + {corner_2,corner_2}, + {corner_2,corner_2}, + } + }) +----------------------------------------------------------------------------------------------- +-- Roof +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> roof + output = roof.." 4", + recipe = { + {reed,""}, + {"",reed}, + } + }) + minetest.register_craft({ -- block -> roof + output = roof.." 4", + recipe = { + {"",reed}, + {reed,""}, + } + }) + minetest.register_craft({ -- slab -> roof + output = roof, + recipe = { + {slab}, + } + }) +----------------------------------------------------------------------------------------------- +-- Roof Corner +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> corner + output = corner.." 8", + recipe = { + {"",reed,""}, + {reed,"",reed}, + } + }) + minetest.register_craft({ -- corner_2 -> corner + output = corner, + recipe = { + {corner_2}, + } + }) +----------------------------------------------------------------------------------------------- +-- Roof Corner 2 +----------------------------------------------------------------------------------------------- + minetest.register_craft({ -- block -> corner_2 + output = corner_2.." 8", + recipe = { + {reed,"",reed}, + {"",reed,""}, + } + }) + minetest.register_craft({ -- corner -> corner_2 + output = corner_2, + recipe = { + {corner}, + } + }) +end + +----------------------------------------------------------------------------------------------- +-- Reed +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- hay -> reed + output = "dryplants:reed 2", + recipe = { + {"dryplants:hay","dryplants:hay"}, + {"dryplants:hay","dryplants:hay"}, + } +}) +--cooking +minetest.register_craft({ -- wetreed -> reed + type = "cooking", + output = "dryplants:reed", + recipe = "dryplants:wetreed", + cooktime = 2, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed", + burntime = 4, +}) +----------------------------------------------------------------------------------------------- +-- Reed Slab +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_slab -> reed_slab + type = "cooking", + output = "dryplants:reed_slab", + recipe = "dryplants:wetreed_slab", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_slab", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Reed Roof +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_roof -> reed_roof + type = "cooking", + output = "dryplants:reed_roof", + recipe = "dryplants:wetreed_roof", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_roof", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Reed Roof Corner +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner + type = "cooking", + output = "dryplants:reed_roof_corner", + recipe = "dryplants:wetreed_roof_corner", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_roof_corner", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof Corner 2 +----------------------------------------------------------------------------------------------- +--cooking +minetest.register_craft({ -- wetreed_roof_corner -> reed_roof_corner + type = "cooking", + output = "dryplants:reed_roof_corner_2", + recipe = "dryplants:wetreed_roof_corner_2", + cooktime = 1, +}) +--fuel +minetest.register_craft({ + type = "fuel", + recipe = "dryplants:reed_roof_corner_2", + burntime = 2, +}) +----------------------------------------------------------------------------------------------- +-- Dandelion Leave +----------------------------------------------------------------------------------------------- +--[[minetest.register_craftitem("dryplants:dandelion_leave", { + description = "Dandelion Leave", + inventory_image = "dryplants_dandelion_leave.png", + on_use = minetest.item_eat(1), +}) +minetest.register_craft({ + type = "shapeless", + output = "dryplants:dandelion_leave 4", + recipe = {"flowers:dandelion_yellow"}, + replacements = { + {"flowers:dandelion_yellow", "dye:yellow"} + }, +})]] \ No newline at end of file diff --git a/mods/plantlife_modpack/dryplants/depends.txt b/mods/plantlife_modpack/dryplants/depends.txt new file mode 100644 index 0000000..5be6833 --- /dev/null +++ b/mods/plantlife_modpack/dryplants/depends.txt @@ -0,0 +1,3 @@ +default +plants_lib +farming? diff --git a/mods/plantlife_modpack/dryplants/init.lua b/mods/plantlife_modpack/dryplants/init.lua new file mode 100644 index 0000000..28bc2fa --- /dev/null +++ b/mods/plantlife_modpack/dryplants/init.lua @@ -0,0 +1,203 @@ +----------------------------------------------------------------------------------------------- +local title = "Grasses" -- former "Dry plants" +local version = "0.1.5" +local mname = "dryplants" +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- textures & ideas partly by Neuromancer + +-- License (everything): WTFPL +-- Contains code from: default, farming +-- Looked at code from: darkage, sickle, stairs +-- Dependencies: default, farming, plants_lib +-- Supports: +----------------------------------------------------------------------------------------------- +abstract_dryplants = {} + +dofile(minetest.get_modpath("dryplants").."/crafting.lua") +dofile(minetest.get_modpath("dryplants").."/settings.txt") +dofile(minetest.get_modpath("dryplants").."/reed.lua") +if REEDMACE_GENERATES == true then +dofile(minetest.get_modpath("dryplants").."/reedmace.lua") +end +if SMALL_JUNCUS_GENERATES == true then +dofile(minetest.get_modpath("dryplants").."/juncus.lua") +end +if EXTRA_TALL_GRASS_GENERATES == true then +dofile(minetest.get_modpath("dryplants").."/moregrass.lua") +end +--dofile(minetest.get_modpath("dryplants").."/meadowvariation.lua") + +----------------------------------------------------------------------------------------------- +-- Sickle +----------------------------------------------------------------------------------------------- +local function sickle_can_break(pos, deff, player) + local def = ItemStack({name=deff.name}):get_definition() + + if not def.diggable or (def.can_dig and not def.can_dig(pos,player)) then + minetest.log("info", player:get_player_name() .. " tried to sickle " + .. def.name .. " which is not diggable " + .. minetest.pos_to_string(pos)) + return + end + + if minetest.is_protected(pos, player:get_player_name()) then + minetest.log("action", player:get_player_name() + .. " tried to sickle " .. def.name + .. " at protected position " + .. minetest.pos_to_string(pos)) + minetest.record_protection_violation(pos, player:get_player_name()) + return + end + + return true +end +-- turns nodes with group flora=1 & flower=0 into cut grass +local function sickle_on_use(itemstack, user, pointed_thing, uses) + local pt = pointed_thing + -- check if pointing at a node + if not pt then + return + end + if pt.type ~= "node" then + return + end + + local under = minetest.get_node(pt.under) + local above_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} + local above = minetest.get_node(above_pos) + + -- return if any of the nodes is not registered + if not minetest.registered_nodes[under.name] then + return + end + if not minetest.registered_nodes[above.name] then + return + end + + if not sickle_can_break(pt.under, under, user) then + return + end + -- check if something that can be cut using fine tools + if minetest.get_item_group(under.name, "snappy") > 0 then + -- check if flora but no flower + if minetest.get_item_group(under.name, "flora") == 1 and minetest.get_item_group(under.name, "flower") == 0 then + -- turn the node into cut grass, wear out item and play sound + minetest.set_node(pt.under, {name="dryplants:grass"}) + else -- otherwise dig the node + if not minetest.node_dig(pt.under, under, user) then + return + end + end + minetest.sound_play("default_dig_crumbly", { + pos = pt.under, + gain = 0.5, + }) + itemstack:add_wear(65535/(uses-1)) + return itemstack + elseif string.find(under.name, "default:dirt_with_grass") then + if minetest.is_protected(above_pos, user:get_player_name()) or above.name ~= "air" then + return + end + minetest.set_node(pt.under, {name="dryplants:grass_short"}) + minetest.set_node(above_pos, {name="dryplants:grass"}) + minetest.sound_play("default_dig_crumbly", { + pos = pt.under, + gain = 0.5, + }) + itemstack:add_wear(65535/(uses-1)) + return itemstack + end +end +-- the tool +minetest.register_tool("dryplants:sickle", { + description = "Sickle", + inventory_image = "dryplants_sickle.png", + on_use = function(itemstack, user, pointed_thing) + return sickle_on_use(itemstack, user, pointed_thing, 220) + end, +}) + +----------------------------------------------------------------------------------------------- +-- Cut Grass +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:grass", { + description = "Cut Grass", + inventory_image = "dryplants_grass.png", + wield_image = "dryplants_grass.png", + paramtype = "light", + sunlight_propagates = true, + tiles = {"dryplants_grass.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 }, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Cut Grass becomes Hay over time +----------------------------------------------------------------------------------------------- +minetest.register_abm({ + nodenames = {"dryplants:grass"}, + interval = HAY_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle + chance = 1, + action = function(pos) + minetest.set_node(pos, {name="dryplants:hay"}) + end, +}) + +----------------------------------------------------------------------------------------------- +-- Hay +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:hay", { + description = "Hay", + inventory_image = "dryplants_hay.png", + wield_image = "dryplants_hay.png", + paramtype = "light", + sunlight_propagates = true, + tiles = {"dryplants_hay.png"}, + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {-0.5 , -0.5 , -0.5 , 0.5 , -0.4375, 0.5 }, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Short Grass +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:grass_short", { + description = "Short Grass", + tiles = {"default_grass.png^dryplants_grass_short.png", "default_dirt.png", "default_dirt.png^default_grass_side.png^dryplants_grass_short_side.png"}, + is_ground_content = true, + groups = {crumbly=3,soil=1,not_in_creative_inventory=1}, + --drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +----------------------------------------------------------------------------------------------- +-- Short Grass becomes Dirt with Grass over time +----------------------------------------------------------------------------------------------- +minetest.register_abm({ + nodenames = {"dryplants:grass_short"}, + interval = GRASS_REGROWING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle + chance = 100/GRASS_REGROWING_CHANCE, + action = function(pos) + -- Only become dirt with grass if no cut grass or hay lies on top + local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z}) + if above.name ~= "dryplants:grass" and above.name ~= "dryplants:hay" then + minetest.set_node(pos, {name="default:dirt_with_grass"}) + end + end, +}) + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- diff --git a/mods/plantlife_modpack/dryplants/juncus.lua b/mods/plantlife_modpack/dryplants/juncus.lua new file mode 100644 index 0000000..43ae97a --- /dev/null +++ b/mods/plantlife_modpack/dryplants/juncus.lua @@ -0,0 +1,127 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - Juncus 0.0.5 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- textures & ideas partly by Neuromancer + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_juncus = function(pos) + local juncus_type = math.random(2,3) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + if juncus_type == 2 then + minetest.set_node(right_here, {name="dryplants:juncus_02"}) + else + minetest.set_node(right_here, {name="dryplants:juncus"}) + end + end +end + +minetest.register_node("dryplants:juncus", { + description = "Juncus", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_juncus_03.png"}, + inventory_image = "dryplants_juncus_inv.png", + walkable = false, + buildable_to = true, + groups = { + snappy=3, + flammable=2, + attached_node=1, + flora=1 + --not_in_creative_inventory=1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + on_place = function(itemstack, placer, pointed_thing) + local pos = pointed_thing.under + local juncus_type = math.random(2,3) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + if juncus_type == 2 then + minetest.set_node(right_here, {name="dryplants:juncus_02"}) + else + minetest.set_node(right_here, {name="dryplants:juncus"}) + end + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end, +}) +minetest.register_node("dryplants:juncus_02", { + description = "Juncus", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_juncus_02.png"}, + walkable = false, + buildable_to = true, + groups = { + snappy=3, + flammable=2, + attached_node=1, + flora=1, + not_in_creative_inventory=1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + drop = "dryplants:juncus", +}) +----------------------------------------------------------------------------------------------- +-- GENERATE SMALL JUNCUS +----------------------------------------------------------------------------------------------- +-- near water or swamp +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + --"default:desert_sand", + --"default:sand", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = JUNCUS_NEAR_WATER_PER_MAPBLOCK, + rarity = 101 - JUNCUS_NEAR_WATER_RARITY, + min_elevation = 1, -- above sea level + near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_juncus +) +-- at dunes/beach +plantslib:register_generate_plant({ + surface = { + --"default:dirt_with_grass", + --"default:desert_sand", + "default:sand", + --"stoneage:grass_with_silex", + --"sumpf:peat", + --"sumpf:sumpf" + }, + max_count = JUNCUS_AT_BEACH_PER_MAPBLOCK, + rarity = 101 - JUNCUS_AT_BEACH_RARITY, + min_elevation = 1, -- above sea level + near_nodes = {"default:dirt_with_grass"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_juncus +) diff --git a/mods/plantlife_modpack/dryplants/meadowvariation.lua b/mods/plantlife_modpack/dryplants/meadowvariation.lua new file mode 100644 index 0000000..31484ff --- /dev/null +++ b/mods/plantlife_modpack/dryplants/meadowvariation.lua @@ -0,0 +1,26 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - Meadow Variation 0.0.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_grass_variation = function(pos) + local right_here = {x=pos.x, y=pos.y, z=pos.z} + minetest.set_node(right_here, {name="dryplants:grass_short"}) +end + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + }, + max_count = 4800, + rarity = 25, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_grass_variation +) diff --git a/mods/plantlife_modpack/dryplants/models/plantlike.obj b/mods/plantlife_modpack/dryplants/models/plantlike.obj new file mode 100644 index 0000000..4b38d39 --- /dev/null +++ b/mods/plantlife_modpack/dryplants/models/plantlike.obj @@ -0,0 +1,28 @@ +# Blender v2.73 (sub 0) OBJ File: '' +# www.blender.org +o Cylinder +v 0.359670 -0.500000 0.347329 +v 0.359670 0.500000 0.347329 +v -0.359670 -0.500000 -0.347329 +v -0.359670 0.500000 -0.347329 +v 0.347329 0.500000 -0.359670 +v 0.347329 -0.500000 -0.359670 +v -0.347329 0.500000 0.359670 +v -0.347329 -0.500000 0.359670 +v 0.359670 -0.500000 0.347329 +v 0.359670 0.500000 0.347329 +v -0.359670 -0.500000 -0.347329 +v -0.359670 0.500000 -0.347329 +v 0.347329 0.500000 -0.359670 +v 0.347329 -0.500000 -0.359670 +v -0.347329 0.500000 0.359670 +v -0.347329 -0.500000 0.359670 +vt 1.000000 -0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt -0.000000 0.000000 +s off +f 1/1 2/2 4/3 3/4 +f 8/1 7/2 5/3 6/4 +f 9/1 11/4 12/3 10/2 +f 16/1 14/4 13/3 15/2 diff --git a/mods/plantlife_modpack/dryplants/moregrass.lua b/mods/plantlife_modpack/dryplants/moregrass.lua new file mode 100644 index 0000000..aec09b9 --- /dev/null +++ b/mods/plantlife_modpack/dryplants/moregrass.lua @@ -0,0 +1,33 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - More Tall Grass 0.0.2 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_grass = function(pos) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local grass_size = math.random(1,5) + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + minetest.set_node(right_here, {name="default:grass_"..grass_size}) + end +end + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = TALL_GRASS_PER_MAPBLOCK, + rarity = 101 - TALL_GRASS_RARITY, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_grass +) diff --git a/mods/plantlife_modpack/dryplants/reed.lua b/mods/plantlife_modpack/dryplants/reed.lua new file mode 100644 index 0000000..6f29028 --- /dev/null +++ b/mods/plantlife_modpack/dryplants/reed.lua @@ -0,0 +1,380 @@ +----------------------------------------------------------------------------------------------- +-- Dry Plants - Reed 0.0.5 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Looked at code from: darkage, default, stairs +-- Dependencies: default +----------------------------------------------------------------------------------------------- +minetest.register_alias("stairs:stair_wetreed", "dryplants:wetreed_roof") +minetest.register_alias("stairs:slab_wetreed", "dryplants:wetreed_slab") +minetest.register_alias("stairs:stair_reed", "dryplants:reed_roof") +minetest.register_alias("stairs:slab_reed", "dryplants:reed_slab") + + +----------------------------------------------------------------------------------------------- +-- Wet Reed +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed", { + description = "Wet Reed", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed Slab +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_slab", { + description = "Wet Reed Slab", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + node_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_roof", { + description = "Wet Reed Roof", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + node_box = { + type = "fixed", +-- { left , bottom , front , right , top , back } + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +if AUTO_ROOF_CORNER == true then + + local CoRNeR = { +-- MaTeRiaL + {"wetreed"}, + {"reed"} + } + + for i in pairs(CoRNeR) do + + local MaTeRiaL = CoRNeR[i][1] + local roof = "dryplants:"..MaTeRiaL.."_roof" + local corner = "dryplants:"..MaTeRiaL.."_roof_corner" + local corner_2 = "dryplants:"..MaTeRiaL.."_roof_corner_2" + + minetest.register_abm({ + nodenames = {roof}, + interval = 1, + chance = 1, + action = function(pos) + + local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }) + local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }) + local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + -- corner 1 + if ((node_west.name == roof and node_west.param2 == 0) + or (node_west.name == corner and node_west.param2 == 1)) + and ((node_north.name == roof and node_north.param2 == 3) + or (node_north.name == corner and node_north.param2 == 3)) + then + minetest.set_node(pos, {name=corner, param2=0}) + end + + if ((node_north.name == roof and node_north.param2 == 1) + or (node_north.name == corner and node_north.param2 == 2)) + and ((node_east.name == roof and node_east.param2 == 0) + or (node_east.name == corner and node_east.param2 == 0)) + then + minetest.set_node(pos, {name=corner, param2=1}) + end + + if ((node_east.name == roof and node_east.param2 == 2) + or (node_east.name == corner and node_east.param2 == 3)) + and ((node_south.name == roof and node_south.param2 == 1) + or (node_south.name == corner and node_south.param2 == 1)) + then + minetest.set_node(pos, {name=corner, param2=2}) + end + + if ((node_south.name == roof and node_south.param2 == 3) + or (node_south.name == corner and node_south.param2 == 0)) + and ((node_west.name == roof and node_west.param2 == 2) + or (node_west.name == corner and node_west.param2 == 2)) + then + minetest.set_node(pos, {name=corner, param2=3}) + end + -- corner 2 + if ((node_west.name == roof and node_west.param2 == 2) + or (node_west.name == corner_2 and node_west.param2 == 1)) + and ((node_north.name == roof and node_north.param2 == 1) + or (node_north.name == corner_2 and node_north.param2 == 3)) + then + minetest.set_node(pos, {name=corner_2, param2=0}) + end + + if ((node_north.name == roof and node_north.param2 == 3) + or (node_north.name == corner_2 and node_north.param2 == 2)) + and ((node_east.name == roof and node_east.param2 == 2) + or (node_east.name == corner_2 and node_east.param2 == 0)) + then + minetest.set_node(pos, {name=corner_2, param2=1}) + end + + if ((node_east.name == roof and node_east.param2 == 0) + or (node_east.name == corner_2 and node_east.param2 == 3)) + and ((node_south.name == roof and node_south.param2 == 3) + or (node_south.name == corner_2 and node_south.param2 == 1)) + then + minetest.set_node(pos, {name=corner_2, param2=2}) + end + + if ((node_south.name == roof and node_south.param2 == 1) + or (node_south.name == corner_2 and node_south.param2 == 0)) + and ((node_west.name == roof and node_west.param2 == 0) + or (node_west.name == corner_2 and node_west.param2 == 2)) + then + minetest.set_node(pos, {name=corner_2, param2=3}) + end + + end, + }) + end +end + +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof Corner +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_roof_corner", { + description = "Wet Reed Roof Corner", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + node_box = { + type = "fixed", +-- { left , bottom , front , right , top , back } + fixed = { + {-1/2, 0, 0, 0, 1/2, 1/2}, + {0, -1/2, 0, 1/2, 0, 1/2}, + {-1/2, -1/2, -1/2, 0, 0, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, 0, 0, 0, 1/2, 1/2}, + {0, -1/2, 0, 1/2, 0, 1/2}, + {-1/2, -1/2, -1/2, 0, 0, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed Roof Corner 2 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:wetreed_roof_corner_2", { + description = "Wet Reed Roof Corner 2", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed_wet.png"}, + node_box = { + type = "fixed", +-- { left , bottom , front , right , top , back } + fixed = { + {-1/2, -1/2, 0, 0, 0, 1/2}, + {0, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, 0, -1/2, 0, 1/2, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, -1/2, 0, 0, 0, 1/2}, + {0, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, 0, -1/2, 0, 1/2, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Wet Reed becomes (dry) Reed over time +----------------------------------------------------------------------------------------------- +if REED_WILL_DRY == true then + + local DRyiNG = { +-- WeT DRy + {"dryplants:wetreed", "dryplants:reed"}, + {"dryplants:wetreed_slab", "dryplants:reed_slab"}, + {"dryplants:wetreed_roof", "dryplants:reed_roof"}, + {"dryplants:wetreed_roof_corner", "dryplants:reed_roof_corner"}, + {"dryplants:wetreed_roof_corner_2", "dryplants:reed_roof_corner_2"} + } + for i in pairs(DRyiNG) do + + local WeT = DRyiNG[i][1] + local DRy = DRyiNG[i][2] + + minetest.register_abm({ + nodenames = {WeT}, + interval = REED_DRYING_TIME, --1200, -- 20 minutes: a minetest-day/night-cycle + chance = 1, + action = function(pos) + local direction = minetest.get_node(pos).param2 + minetest.set_node(pos, {name=DRy, param2=direction}) + end, + }) + end +end + +----------------------------------------------------------------------------------------------- +-- Reed +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed", { + description = "Reed", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Slab +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_slab", { + description = "Reed Slab", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + node_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Roof +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_roof", { + description = "Reed Roof", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + node_box = { + type = "fixed", +-- { left , bottom , front , right , top , back } + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Roof Corner +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_roof_corner", { + description = "Reed Roof Corner", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + node_box = { + type = "fixed", +-- { left , bottom , front , right , top , back } + fixed = { + {-1/2, 0, 0, 0, 1/2, 1/2}, + {0, -1/2, 0, 1/2, 0, 1/2}, + {-1/2, -1/2, -1/2, 0, 0, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, 0, 0, 0, 1/2, 1/2}, + {0, -1/2, 0, 1/2, 0, 1/2}, + {-1/2, -1/2, -1/2, 0, 0, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- Reed Roof Corner 2 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reed_roof_corner_2", { + description = "Reed Roof Corner 2", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"dryplants_reed.png"}, + node_box = { + type = "fixed", +-- { left , bottom , front , right , top , back } + fixed = { + {-1/2, -1/2, 0, 0, 0, 1/2}, + {0, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, 0, -1/2, 0, 1/2, 0}, + } + }, + selection_box = { + type = "fixed", + fixed = { + {-1/2, -1/2, 0, 0, 0, 1/2}, + {0, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, 0, -1/2, 0, 1/2, 0}, + } + }, + groups = {snappy=3, flammable=2}, + sounds = default.node_sound_leaves_defaults(), +}) diff --git a/mods/plantlife_modpack/dryplants/reedmace.lua b/mods/plantlife_modpack/dryplants/reedmace.lua new file mode 100644 index 0000000..1043d2c --- /dev/null +++ b/mods/plantlife_modpack/dryplants/reedmace.lua @@ -0,0 +1,411 @@ +----------------------------------------------------------------------------------------------- +-- Grasses - Reedmace 0.1.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- textures & ideas partly by Neuromancer + +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default, trees +----------------------------------------------------------------------------------------------- + +-- NOTES (from wikipedia, some of this might get implemented) +-- rhizomes are edible +-- outer portion of young plants can be peeled and the heart can be eaten raw or boiled and eaten like asparagus +-- leaf bases can be eaten raw or cooked +-- sheath can be removed from the developing green flower spike, which can then be boiled and eaten like corn on the cob +-- pollen can be collected and used as a flour supplement or thickener +-- Typha stems and leaves can be used to make paper +-- The seed hairs were used by some Native American groups as tinder for starting fires + +----------------------------------------------------------------------------------------------- +-- REEDMACE SHAPES +----------------------------------------------------------------------------------------------- + +abstract_dryplants.grow_reedmace = function(pos) + local size = math.random(1,3) + local spikes = math.random(1,3) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z} + local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z} + if minetest.get_node(pos_01).name == "air" -- bug fix + or minetest.get_node(pos_01).name == "dryplants:reedmace_sapling" then + if minetest.get_node(pos_02).name ~= "air" then + minetest.set_node(pos_01, {name="dryplants:reedmace_top"}) + elseif minetest.get_node(pos_03).name ~= "air" then + minetest.set_node(pos_01, {name="dryplants:reedmace_height_2"}) + elseif size == 1 then + minetest.set_node(pos_01, {name="dryplants:reedmace_top"}) + elseif size == 2 then + minetest.set_node(pos_01, {name="dryplants:reedmace_height_2"}) + elseif size == 3 then + if spikes == 1 then + minetest.set_node(pos_01, {name="dryplants:reedmace_height_3_spikes"}) + else + minetest.set_node(pos_01, {name="dryplants:reedmace_height_3"}) + end + end + end +end + +abstract_dryplants.grow_reedmace_water = function(pos) + local size = math.random(1,3) + local spikes = math.random(1,3) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + local pos_02 = {x = pos.x, y = pos.y + 2, z = pos.z} + local pos_03 = {x = pos.x, y = pos.y + 3, z = pos.z} + local pos_04 = {x = pos.x, y = pos.y + 4, z = pos.z} + minetest.add_entity(pos_01, "dryplants:reedmace_water_entity") + if minetest.get_node(pos_02).name == "air" then -- bug fix + if minetest.get_node(pos_03).name ~= "air" then + minetest.set_node(pos_02, {name="dryplants:reedmace_top"}) + elseif minetest.get_node(pos_04).name ~= "air" then + minetest.set_node(pos_02, {name="dryplants:reedmace_height_2"}) + elseif size == 1 then + minetest.set_node(pos_02, {name="dryplants:reedmace_top"}) + elseif size == 2 then + minetest.set_node(pos_02, {name="dryplants:reedmace_height_2"}) + elseif size == 3 then + if spikes == 1 then + minetest.set_node(pos_02, {name="dryplants:reedmace_height_3_spikes"}) + else + minetest.set_node(pos_02, {name="dryplants:reedmace_height_3"}) + end + end + end +end + +----------------------------------------------------------------------------------------------- +-- REEDMACE SPIKES +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_spikes", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_spikes.png"}, + inventory_image = "dryplants_reedmace_spikes.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 1 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_top", { + description = "Reedmace, height: 1", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_top.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 2 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_height_2", { + description = "Reedmace, height: 2", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_reedmace_height_2.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2--, + --not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 3 +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_height_3", { + description = "Reedmace, height: 3", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_reedmace_height_3.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2--, + --not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE height: 3 & Spikes +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_height_3_spikes", { + description = "Reedmace, height: 3 & Spikes", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"dryplants_reedmace_height_3_spikes.png"}, + inventory_image = "dryplants_reedmace_top.png", + walkable = false, + groups = { + snappy=3, + flammable=2--, + --not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE STEMS +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace.png"}, + inventory_image = "dryplants_reedmace.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "dryplants:reedmace_top" + or node.name == "dryplants:reedmace_spikes" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"dryplants:reedmace_sapling") + end + end, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE BOTTOM +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_bottom", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_bottom.png"}, + inventory_image = "dryplants_reedmace_bottom.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + not_in_creative_inventory=1 + }, + drop = 'dryplants:reedmace_sapling', + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "dryplants:reedmace" + or node.name == "dryplants:reedmace_top" + or node.name == "dryplants:reedmace_spikes" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"dryplants:reedmace_sapling") + end + end, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE "SAPLING" (the drop from the above) +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_sapling", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_sapling.png"}, + inventory_image = "dryplants_reedmace_sapling.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1 + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +-- abm +minetest.register_abm({ + nodenames = "dryplants:reedmace_sapling", + interval = REEDMACE_GROWING_TIME, + chance = 100/REEDMACE_GROWING_CHANCE, + action = function(pos, node, _, _) + if string.find(minetest.get_node({x = pos.x + 1, y = pos.y, z = pos.z }).name, "default:water") + or string.find(minetest.get_node({x = pos.x, y = pos.y, z = pos.z + 1}).name, "default:water") + or string.find(minetest.get_node({x = pos.x - 1, y = pos.y, z = pos.z }).name, "default:water") + or string.find(minetest.get_node({x = pos.x, y = pos.y, z = pos.z - 1}).name, "default:water") then + if minetest.get_node({x = pos.x, y = pos.y + 1, z = pos.z}).name == "air" then + abstract_dryplants.grow_reedmace_water({x = pos.x, y = pos.y - 1, z = pos.z}) + end + minetest.set_node({x=pos.x, y=pos.y, z=pos.z}, {name="default:water_source"}) + else + abstract_dryplants.grow_reedmace({x = pos.x, y = pos.y - 1, z = pos.z}) + end + end +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE WATER (for entity) +----------------------------------------------------------------------------------------------- +minetest.register_node("dryplants:reedmace_water", { + description = "Reedmace", + drawtype = "plantlike", + paramtype = "light", + tiles = {"dryplants_reedmace_water.png"}, + inventory_image = "dryplants_reedmace_water.png", + groups = {not_in_creative_inventory=1}, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, +}) +----------------------------------------------------------------------------------------------- +-- REEDMACE WATER ENTITY +----------------------------------------------------------------------------------------------- +minetest.register_entity("dryplants:reedmace_water_entity",{ + visual = "mesh", + mesh = "plantlike.obj", + visual_size = {x=10, y=10}, + textures = {"dryplants_reedmace_water.png"}, + collisionbox = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + on_punch = function(self, puncher) + if puncher:is_player() and puncher:get_inventory() then + if not minetest.setting_getbool("creative_mode") then + puncher:get_inventory():add_item("main", "dryplants:reedmace_sapling") + end + self.object:remove() + end + end, +}) +----------------------------------------------------------------------------------------------- +-- SPAWN REEDMACE +----------------------------------------------------------------------------------------------- +--[[plantslib:spawn_on_surfaces({ + spawn_delay = 1200, + spawn_plants = {"dryplants:reedmace_sapling"}, + spawn_chance = 400, + spawn_surfaces = { + "default:dirt_with_grass", + "default:desert_sand", + "default:sand", + "dryplants:grass_short", + "stoneage:grass_with_silex" + }, + seed_diff = 329, + near_nodes = {"default:water_source"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, +})]] +----------------------------------------------------------------------------------------------- +-- GENERATE REEDMACE +----------------------------------------------------------------------------------------------- +-- near water or swamp +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:desert_sand", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = REEDMACE_NEAR_WATER_PER_MAPBLOCK, + rarity = 101 - REEDMACE_NEAR_WATER_RARITY, + --rarity = 60, + min_elevation = 1, -- above sea level + near_nodes = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_reedmace +) +-- in water +plantslib:register_generate_plant({ + surface = { + "default:dirt", + "default:dirt_with_grass", + --"default:desert_sand", + --"stoneage:grass_with_silex", + "stoneage:sand_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = REEDMACE_IN_WATER_PER_MAPBLOCK, + rarity = 101 - REEDMACE_IN_WATER_RARITY, + --rarity = 35, + min_elevation = 0, -- a bit below sea level + max_elevation = 0, -- "" + near_nodes = {"default:water_source","sumpf:dirtywater_source"}, + near_nodes_size = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_reedmace_water +) +-- for oases & tropical beaches & tropical swamps +plantslib:register_generate_plant({ + surface = { + "default:sand", + "sumpf:sumpf" + }, + max_count = REEDMACE_FOR_OASES_PER_MAPBLOCK, + rarity = 101 - REEDMACE_FOR_OASES_RARITY, + --rarity = 10, + neighbors = {"default:water_source","sumpf:dirtywater_source","sumpf:sumpf"}, + ncount = 1, + min_elevation = 1, -- above sea level + near_nodes = {"default:desert_sand","sumpf:sumpf"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_dryplants.grow_reedmace +) diff --git a/mods/plantlife_modpack/dryplants/settings.txt b/mods/plantlife_modpack/dryplants/settings.txt new file mode 100644 index 0000000..cc12a9c --- /dev/null +++ b/mods/plantlife_modpack/dryplants/settings.txt @@ -0,0 +1,52 @@ +-- Here you can enable/disable the different plants +REEDMACE_GENERATES = true +SMALL_JUNCUS_GENERATES = true +EXTRA_TALL_GRASS_GENERATES = true + + + +-- Amount of Reedmace near water or swamp +REEDMACE_NEAR_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number) +REEDMACE_NEAR_WATER_RARITY = 40 -- percent + +-- Amount of Reedmace in water +REEDMACE_IN_WATER_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number) +REEDMACE_IN_WATER_RARITY = 65 -- percent + +-- Amount of Reedmace for oases, tropical beaches and tropical swamps +REEDMACE_FOR_OASES_PER_MAPBLOCK = 35 -- plants per 80x80x80 nodes (absolute maximum number) +REEDMACE_FOR_OASES_RARITY = 90 -- percent + +-- growing of reedmace sapling +REEDMACE_GROWING_TIME = 600 -- seconds +REEDMACE_GROWING_CHANCE = 5 -- percent + + + +-- Amount of small Juncus near water or swamp +JUNCUS_NEAR_WATER_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number) +JUNCUS_NEAR_WATER_RARITY = 75 -- percent + +-- Amount of small Juncus at dunes/beach +JUNCUS_AT_BEACH_PER_MAPBLOCK = 70 -- plants per 80x80x80 nodes (absolute maximum number) +JUNCUS_AT_BEACH_RARITY = 75 -- percent + + + +-- Tall Grass on dirt with grass +TALL_GRASS_PER_MAPBLOCK = 4800 -- plants per 80x80x80 nodes (absolute maximum number) +TALL_GRASS_RARITY = 75 -- percent + + + +-- short grass becomes dirt with grass again +GRASS_REGROWING_TIME = 1200 -- seconds +GRASS_REGROWING_CHANCE = 5 -- percent + +HAY_DRYING_TIME = 3600 -- seconds + +REED_WILL_DRY = false -- wet reed nodes will become dry reed nodes +REED_DRYING_TIME = 3600 -- seconds + +AUTO_ROOF_CORNER = true + diff --git a/mods/plantlife_modpack/dryplants/textures/default_grass_1.png b/mods/plantlife_modpack/dryplants/textures/default_grass_1.png new file mode 100644 index 0000000..8820e7e Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/default_grass_1.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/default_grass_2.png b/mods/plantlife_modpack/dryplants/textures/default_grass_2.png new file mode 100644 index 0000000..9929548 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/default_grass_2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/default_grass_3.png b/mods/plantlife_modpack/dryplants/textures/default_grass_3.png new file mode 100644 index 0000000..4d62f69 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/default_grass_3.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/default_grass_4.png b/mods/plantlife_modpack/dryplants/textures/default_grass_4.png new file mode 100644 index 0000000..8ad76c5 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/default_grass_4.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/default_grass_5.png b/mods/plantlife_modpack/dryplants/textures/default_grass_5.png new file mode 100644 index 0000000..799b0fd Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/default_grass_5.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_grass.png b/mods/plantlife_modpack/dryplants/textures/dryplants_grass.png new file mode 100644 index 0000000..cbd276e Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_grass.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_grass_short.png b/mods/plantlife_modpack/dryplants/textures/dryplants_grass_short.png new file mode 100644 index 0000000..30553aa Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_grass_short.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_grass_short_side.png b/mods/plantlife_modpack/dryplants/textures/dryplants_grass_short_side.png new file mode 100644 index 0000000..bc27507 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_grass_short_side.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_hay.png b/mods/plantlife_modpack/dryplants/textures/dryplants_hay.png new file mode 100644 index 0000000..600c508 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_hay.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_02.png b/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_02.png new file mode 100644 index 0000000..2e4f840 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_02.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_03.png b/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_03.png new file mode 100644 index 0000000..ff3d9c5 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_03.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_inv.png b/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_inv.png new file mode 100644 index 0000000..d5b9dca Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_juncus_inv.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reed.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reed.png new file mode 100644 index 0000000..b350a78 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reed.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reed_wet.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reed_wet.png new file mode 100644 index 0000000..cd4488a Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reed_wet.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace.png new file mode 100644 index 0000000..d14686f Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_bottom.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_bottom.png new file mode 100644 index 0000000..d83c36d Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_bottom.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_2.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_2.png new file mode 100644 index 0000000..4ac816a Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_3.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_3.png new file mode 100644 index 0000000..5cbd8d8 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_3.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_3_spikes.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_3_spikes.png new file mode 100644 index 0000000..16a29b3 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_height_3_spikes.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_sapling.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_sapling.png new file mode 100644 index 0000000..04b8c1f Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_sapling.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_spikes.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_spikes.png new file mode 100644 index 0000000..4a23745 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_spikes.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_top.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_top.png new file mode 100644 index 0000000..8532ece Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_top.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_water.png b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_water.png new file mode 100644 index 0000000..3ebf93c Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_reedmace_water.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/dryplants_sickle.png b/mods/plantlife_modpack/dryplants/textures/dryplants_sickle.png new file mode 100644 index 0000000..e496062 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/dryplants_sickle.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/big_pic_8.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/big_pic_8.png new file mode 100644 index 0000000..aac9520 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/big_pic_8.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/big_pic_9.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/big_pic_9.png new file mode 100644 index 0000000..1ebe95c Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/big_pic_9.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_cattailsG_m2.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_cattailsG_m2.png new file mode 100644 index 0000000..0a2cae1 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_cattailsG_m2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_left.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_left.png new file mode 100644 index 0000000..b771a55 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_left.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_right.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_right.png new file mode 100644 index 0000000..a9f4b7e Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_right.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png new file mode 100644 index 0000000..67c3cb8 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_02_whole2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_left.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_left.png new file mode 100644 index 0000000..dc8a33e Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_left.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_right.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_right.png new file mode 100644 index 0000000..23b5cf3 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_right.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png new file mode 100644 index 0000000..d494ae4 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_juncus_03_whole2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_01.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_01.png new file mode 100644 index 0000000..aaab5fe Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_01.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_02.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_02.png new file mode 100644 index 0000000..5c8751a Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_02.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_03.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_03.png new file mode 100644 index 0000000..342b8b8 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_03.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_04.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_04.png new file mode 100644 index 0000000..a1d708d Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_04.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_bottom_left.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_bottom_left.png new file mode 100644 index 0000000..643bbea Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_bottom_left.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_bottom_right.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_bottom_right.png new file mode 100644 index 0000000..d415003 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_bottom_right.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_left.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_left.png new file mode 100644 index 0000000..1a3bd92 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_left.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_right.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_right.png new file mode 100644 index 0000000..b178d4a Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_right.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_top_left.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_top_left.png new file mode 100644 index 0000000..18ae716 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_top_left.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_top_right.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_top_right.png new file mode 100644 index 0000000..e511b24 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/dryplants_reedmace_top_right.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace2.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace2.png new file mode 100644 index 0000000..ca505bd Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace3.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace3.png new file mode 100644 index 0000000..d2ec729 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace3.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace4.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace4.png new file mode 100644 index 0000000..9ba759b Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedmace4.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/reedtest.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedtest.png new file mode 100644 index 0000000..33822ef Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/reedtest.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/not_in_use/texturing.png b/mods/plantlife_modpack/dryplants/textures/not_in_use/texturing.png new file mode 100644 index 0000000..6a18fda Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/not_in_use/texturing.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_grass_short_old3.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_grass_short_old3.png new file mode 100644 index 0000000..f6f6c5b Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_grass_short_old3.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_grass_short_old4.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_grass_short_old4.png new file mode 100644 index 0000000..6e7611c Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_grass_short_old4.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_02_left_old.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_02_left_old.png new file mode 100644 index 0000000..ce49ec2 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_02_left_old.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_02_right_old.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_02_right_old.png new file mode 100644 index 0000000..e512a77 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_02_right_old.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_03_left_old.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_03_left_old.png new file mode 100644 index 0000000..7644a0d Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_03_left_old.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_03_right_old.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_03_right_old.png new file mode 100644 index 0000000..801cf23 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_juncus_03_right_old.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_left_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_left_old2.png new file mode 100644 index 0000000..7d25e49 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_left_old2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_old4.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_old4.png new file mode 100644 index 0000000..a02b19b Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_old4.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_right_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_right_old2.png new file mode 100644 index 0000000..0b13beb Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_bottom_right_old2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_left_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_left_old2.png new file mode 100644 index 0000000..784d45d Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_left_old2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_old8.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_old8.png new file mode 100644 index 0000000..1498b5f Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_old8.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_right_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_right_old2.png new file mode 100644 index 0000000..db758c4 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_right_old2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_spikes_old3.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_spikes_old3.png new file mode 100644 index 0000000..207a747 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_spikes_old3.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_left_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_left_old2.png new file mode 100644 index 0000000..6d9afce Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_left_old2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_old3.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_old3.png new file mode 100644 index 0000000..6eedad4 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_old3.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_right_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_right_old2.png new file mode 100644 index 0000000..333f587 Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_top_right_old2.png differ diff --git a/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_water_old2.png b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_water_old2.png new file mode 100644 index 0000000..6b10bff Binary files /dev/null and b/mods/plantlife_modpack/dryplants/textures/old/dryplants_reedmace_water_old2.png differ diff --git a/mods/plantlife_modpack/ferns/crafting.lua b/mods/plantlife_modpack/ferns/crafting.lua new file mode 100644 index 0000000..8d8b3ed --- /dev/null +++ b/mods/plantlife_modpack/ferns/crafting.lua @@ -0,0 +1,104 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Crafting 0.0.5 +----------------------------------------------------------------------------------------------- +-- (by Mossmanikin) +-- License (everything): WTFPL +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + type = "shapeless", + output = "ferns:fiddlehead 3", + recipe = {"ferns:fern_01"}, + replacements = { + {"ferns:fern_01", "ferns:ferntuber"} + }, +}) + +minetest.register_craft({ + type = "shapeless", + output = "ferns:fiddlehead 3", + recipe = {"ferns:tree_fern_leaves"}, + replacements = { + {"ferns:tree_fern_leaves", "ferns:sapling_tree_fern"} + }, +}) +----------------------------------------------------------------------------------------------- +-- FIDDLEHEAD +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:fiddlehead", "ferns:fiddlehead") + +minetest.register_craftitem("ferns:fiddlehead", { + description = "Fiddlehead", + inventory_image = "ferns_fiddlehead.png", + on_use = minetest.item_eat(-1), -- slightly poisonous when raw +}) +minetest.register_craft({ + type = "cooking", + output = "ferns:fiddlehead_roasted", + recipe = "ferns:fiddlehead", + cooktime = 1, +}) +minetest.register_craftitem("ferns:fiddlehead_roasted", { + description = "Roasted Fiddlehead", + inventory_image = "ferns_fiddlehead_roasted.png", + on_use = minetest.item_eat(1), -- edible when cooked +}) +----------------------------------------------------------------------------------------------- +-- FERN TUBER +----------------------------------------------------------------------------------------------- +minetest.register_alias("archaeplantae:ferntuber", "ferns:ferntuber") + +minetest.register_craftitem("ferns:ferntuber", { + description = "Fern Tuber", + inventory_image = "ferns_ferntuber.png", +}) +minetest.register_craft({ + type = "cooking", + output = "ferns:ferntuber_roasted", + recipe = "ferns:ferntuber", + cooktime = 3, +}) + +minetest.register_alias("archaeplantae:ferntuber_roasted", "ferns:ferntuber_roasted") + +minetest.register_craftitem("ferns:ferntuber_roasted", { + description = "Roasted Fern Tuber", + inventory_image = "ferns_ferntuber_roasted.png", + on_use = minetest.item_eat(3), +}) +----------------------------------------------------------------------------------------------- +-- HORSETAIL (EQUISETUM) --> GREEN DYE https://en.wikipedia.org/wiki/Equisetum +----------------------------------------------------------------------------------------------- +minetest.register_craft({ + type = "shapeless", + output = "dye:green", + recipe = {"group:horsetail"}, +}) +----------------------------------------------------------------------------------------------- +-- GLUE WOODEN TOOLS with RESIN & POLISH them with HORSETAIL (planned) +----------------------------------------------------------------------------------------------- +--[[minetest.register_craft({ + type = "shapeless", + output = "default:pick_wood", + recipe = {"default:pick_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "default:shovel_wood", + recipe = {"default:shovel_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "default:axe_wood", + recipe = {"default:axe_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "default:sword_wood", + recipe = {"default:sword_wood","group:horsetail","farming:string","default:stick"}, +}) +minetest.register_craft({ + type = "shapeless", + output = "farming:hoe_wood", + recipe = {"farming:hoe_wood","group:horsetail","farming:string","default:stick"}, +})]] + diff --git a/mods/plantlife_modpack/ferns/depends.txt b/mods/plantlife_modpack/ferns/depends.txt new file mode 100644 index 0000000..0077f8a --- /dev/null +++ b/mods/plantlife_modpack/ferns/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/mods/plantlife_modpack/ferns/fern.lua b/mods/plantlife_modpack/ferns/fern.lua new file mode 100644 index 0000000..f4bbe6f --- /dev/null +++ b/mods/plantlife_modpack/ferns/fern.lua @@ -0,0 +1,196 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Fern 0.1.0 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default, flowers, painting, trees +-- Dependencies: plants_lib +-- Supports: dryplants, stoneage, sumpf +----------------------------------------------------------------------------------------------- +-- some inspiration from here +-- https://en.wikipedia.org/wiki/Athyrium_yokoscense +-- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1 +----------------------------------------------------------------------------------------------- + +assert(abstract_ferns.config.enable_lady_fern == true) + +-- Maintain backward compatibilty +minetest.register_alias("archaeplantae:fern", "ferns:fern_03") +minetest.register_alias("archaeplantae:fern_mid", "ferns:fern_02") +minetest.register_alias("archaeplantae:fern_small", "ferns:fern_01") +minetest.register_alias("ferns:fern_04", "ferns:fern_02") -- for placing + +local nodenames = {} + +local function create_nodes() + local images = { "ferns_fern.png", "ferns_fern_mid.png", "ferns_fern_big.png" } + local vscales = { 1, 2, 2.2 } + local descs = { "Lady-fern (Athyrium)", nil, nil } + + for i = 1, 3 do + local node_on_place = nil + if i == 1 then + node_on_place = function(itemstack, placer, pointed_thing) + -- place a random fern + local stack = ItemStack("ferns:fern_0"..math.random(1,4)) + local ret = minetest.item_place(stack, placer, pointed_thing) + return ItemStack("ferns:fern_01 "..itemstack:get_count()-(1-ret:get_count())) -- TODO FIXME? + end + end + nodenames[i] = "ferns:fern_"..string.format("%02d", i) + minetest.register_node(nodenames[i], { + description = descs[i] or ("Lady-fern (Athyrium) " .. string.format("%02d", i)), + inventory_image = "ferns_fern.png", + drawtype = "plantlike", + visual_scale = vscales[i], + paramtype = "light", + tiles = { images[i] }, + walkable = false, + buildable_to = true, + groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, + drop = "ferns:fern_01", + on_place = node_on_place + }) + end +end + +----------------------------------------------------------------------------------------------- +-- Init +----------------------------------------------------------------------------------------------- + +create_nodes() + +----------------------------------------------------------------------------------------------- +-- Spawning +----------------------------------------------------------------------------------------------- + +if abstract_ferns.config.lady_ferns_near_tree == true then + plantslib:register_generate_plant({ -- near trees (woodlands) + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "default:desert_sand", + "default:sand", + "default:jungletree", + "stoneage:grass_with_silex", + "sumpf:sumpf" + }, + max_count = 30, + rarity = 62,--63, + min_elevation = 1, -- above sea level + near_nodes = {"group:tree"}, + near_nodes_size = 3,--4, + near_nodes_vertical = 2,--3, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 C (too hot?) + temp_min = 0.75, -- -12 C + random_facedir = { 0, 179 }, + }, + nodenames + ) +end + +if abstract_ferns.config.lady_ferns_near_rock == true then + plantslib:register_generate_plant({ -- near stone (mountains) + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "group:falling_node", + --"default:jungletree", + "stoneage:grass_with_silex", + "sumpf:sumpf" + }, + max_count = 35, + rarity = 40, + min_elevation = 1, -- above sea level + near_nodes = {"group:stone"}, + near_nodes_size = 1, + near_nodes_count = 16, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 C (too hot?) + temp_min = 0.75, -- -12 C + random_facedir = { 0, 179 }, + }, + nodenames + ) +end + +if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop + plantslib:register_generate_plant({ -- near ores (potential mining sites) + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "default:stone_with_coal", + "default:stone_with_iron", + "moreores:mineral_tin", + "moreores:mineral_silver", + "sumpf:sumpf" + }, + max_count = 1200,--1600, -- maybe too much? :D + rarity = 25,--15, + min_elevation = 1, -- above sea level + near_nodes = { + "default:stone_with_iron", + --"default:stone_with_copper", + --"default:stone_with_mese", + --"default:stone_with_gold", + --"default:stone_with_diamond", + "moreores:mineral_tin", + "moreores:mineral_silver" + --"moreores:mineral_mithril" + }, + near_nodes_size = 2, + near_nodes_vertical = 4,--5,--6, + near_nodes_count = 2,--3, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 C (too hot?) + temp_min = 0.75, -- -12 C + random_facedir = { 0, 179 }, + }, + nodenames + ) +end + +if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores + plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:mossycobble", + "default:stone_with_coal", + "default:stone_with_iron", + "moreores:mineral_tin", + "moreores:mineral_silver", + "sumpf:sumpf" + }, + max_count = 70, + rarity = 25,--15, + min_elevation = 1, -- above sea level + near_nodes = { + "default:stone" + }, + near_nodes_size = 2, + near_nodes_vertical = 2,--6, + near_nodes_count = 3, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, -- 55 C (too hot?) + temp_min = 0.75, -- -12 C + random_facedir = { 0, 179 }, + }, + nodenames + ) +end diff --git a/mods/plantlife_modpack/ferns/gianttreefern.lua b/mods/plantlife_modpack/ferns/gianttreefern.lua new file mode 100644 index 0000000..27c9552 --- /dev/null +++ b/mods/plantlife_modpack/ferns/gianttreefern.lua @@ -0,0 +1,336 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Giant Tree Fern 0.1.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: 4seasons, default +-- Supports: vines +----------------------------------------------------------------------------------------------- + +assert(abstract_ferns.config.enable_giant_treefern == true) + +-- lot of code, lot to load + +abstract_ferns.grow_giant_tree_fern = function(pos) + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(pos_01).name ~= "air" + and minetest.get_node(pos_01).name ~= "ferns:sapling_giant_tree_fern" + and minetest.get_node(pos_01).name ~= "default:junglegrass" then + return + end + + local size = math.random(12,16) -- min of range must be >= 4 + + local leafchecks = { + { + direction = 3, + positions = { + {x = pos.x + 1, y = pos.y + size - 1, z = pos.z }, + {x = pos.x + 2, y = pos.y + size , z = pos.z }, + {x = pos.x + 3, y = pos.y + size - 1, z = pos.z }, + {x = pos.x + 4, y = pos.y + size - 2, z = pos.z } + } + }, + { + direction = 1, + positions = { + {x = pos.x - 1, y = pos.y + size - 1, z = pos.z }, + {x = pos.x - 2, y = pos.y + size, z = pos.z }, + {x = pos.x - 3, y = pos.y + size - 1, z = pos.z }, + {x = pos.x - 4, y = pos.y + size - 2, z = pos.z } + } + }, + { + direction = 2, + positions = { + {x = pos.x , y = pos.y + size - 1, z = pos.z + 1}, + {x = pos.x , y = pos.y + size , z = pos.z + 2}, + {x = pos.x , y = pos.y + size - 1, z = pos.z + 3}, + {x = pos.x , y = pos.y + size - 2, z = pos.z + 4} + } + }, + { + direction = 0, + positions = { + {x = pos.x , y = pos.y + size - 1, z = pos.z - 1}, + {x = pos.x , y = pos.y + size , z = pos.z - 2}, + {x = pos.x , y = pos.y + size - 1, z = pos.z - 3}, + {x = pos.x , y = pos.y + size - 2, z = pos.z - 4} + } + } + } + + for i = 1, size-3 do + minetest.set_node({x = pos.x, y = pos.y + i, z = pos.z}, {name="ferns:fern_trunk_big"}) + end + minetest.set_node({x = pos.x, y = pos.y + size-2, z = pos.z}, {name="ferns:fern_trunk_big_top"}) + minetest.set_node({x = pos.x, y = pos.y + size-1, z = pos.z}, {name="ferns:tree_fern_leaves_giant"}) + + -- all the checking for air below is to prevent some ugly bugs (incomplete trunks of neighbouring trees), it's a bit slower, but worth the result + + -- assert(#leafchecks == 4) + for i = 1, 4 do + local positions = leafchecks[i].positions + local rot = leafchecks[i].direction + local endpos = 4 -- If the loop below adds all intermediate leaves then the "terminating" leaf will be at positions[4] + -- assert(#positions == 4) + -- add leaves so long as the destination nodes are air + for j = 1, 3 do + if minetest.get_node(positions[j]).name == "air" then + minetest.set_node(positions[j], {name="ferns:tree_fern_leave_big"}) + else + endpos = j + break + end + end + -- add the terminating leaf if required and possible + if endpos == 4 and minetest.get_node(positions[endpos]).name == "air" then + minetest.set_node(positions[endpos], {name="ferns:tree_fern_leave_big_end", param2=rot}) + end + end +end + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN LEAVES +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leaves_giant", { + description = "Tree Fern Crown (Dicksonia)", + drawtype = "plantlike", + visual_scale = math.sqrt(8), + wield_scale = {x=0.175, y=0.175, z=0.175}, + paramtype = "light", + tiles = {"ferns_fern_tree_giant.png"}, + inventory_image = "ferns_fern_tree.png", + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1, + not_in_creative_inventory=1 + }, + drop = { + max_items = 2, + items = { + { + -- occasionally, drop a second sapling instead of leaves + -- (extra saplings can also be obtained by replanting and + -- reharvesting leaves) + items = {"ferns:sapling_giant_tree_fern"}, + rarity = 10, + }, + { + items = {"ferns:sapling_giant_tree_fern"}, + }, + { + items = {"ferns:tree_fern_leaves_giant"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN LEAVE PART +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leave_big", { + description = "Giant Tree Fern Leaves", + drawtype = "raillike", + paramtype = "light", + tiles = { + "ferns_tree_fern_leave_big.png", + }, + walkable = false, + groups = { + snappy=3, + flammable=2, + attached_node=1, + not_in_creative_inventory=1 + }, + drop = "", + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN LEAVE END +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:tree_fern_leave_big_end", { + description = "Giant Tree Fern Leave End", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = { "ferns_tree_fern_leave_big_end.png" }, + walkable = false, + node_box = { + type = "fixed", +-- {left, bottom, front, right, top, back } + fixed = {-1/2, -1/2, 1/2, 1/2, 33/64, 1/2}, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, 1/2, 1/2, 33/64, 1/2}, + }, + groups = { + snappy=3, + flammable=2, + attached_node=1, + not_in_creative_inventory=1 + }, + drop = "", + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN TRUNK TOP +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:fern_trunk_big_top", { + description = "Giant Fern Trunk", + drawtype = "nodebox", + paramtype = "light", + tiles = { + "ferns_fern_trunk_big_top.png^ferns_tree_fern_leave_big_cross.png", + "ferns_fern_trunk_big_top.png^ferns_tree_fern_leave_big_cross.png", + "ferns_fern_trunk_big.png" + }, + node_box = { + type = "fixed", +-- {left, bottom, front, right, top, back } + fixed = { + {-1/2, 33/64, -1/2, 1/2, 33/64, 1/2}, + {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + } + }, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + }, + groups = { + tree=1, + choppy=2, + oddly_breakable_by_hand=2, + flammable=3, + wood=1, + not_in_creative_inventory=1, + leafdecay=3 -- to support vines + }, + drop = "ferns:fern_trunk_big", + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN TRUNK +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:fern_trunk_big", { + description = "Giant Fern Trunk", + drawtype = "nodebox", + paramtype = "light", + tiles = { + "ferns_fern_trunk_big_top.png", + "ferns_fern_trunk_big_top.png", + "ferns_fern_trunk_big.png" + }, + node_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + }, + selection_box = { + type = "fixed", + fixed = {-1/4, -1/2, -1/4, 1/4, 1/2, 1/4}, + }, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "ferns:fern_trunk_big" or node.name == "ferns:fern_trunk_big_top" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"ferns:fern_trunk_big") + end + end, +}) + +----------------------------------------------------------------------------------------------- +-- GIANT TREE FERN SAPLING +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:sapling_giant_tree_fern", { + description = "Giant Tree Fern Sapling", + drawtype = "plantlike", + paramtype = "light", + tiles = {"ferns_sapling_tree_fern_giant.png"}, + inventory_image = "ferns_sapling_tree_fern_giant.png", + walkable = false, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) + +-- abm +minetest.register_abm({ + nodenames = "ferns:sapling_giant_tree_fern", + interval = 1000, + chance = 4, + action = function(pos, node, _, _) + abstract_ferns.grow_giant_tree_fern({x = pos.x, y = pos.y-1, z = pos.z}) + end +}) + +----------------------------------------------------------------------------------------------- +-- GENERATE GIANT TREE FERN +----------------------------------------------------------------------------------------------- + +-- in jungles +if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then + plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:sand", + "default:desert_sand"--, + --"dryplants:grass_short" + }, + max_count = 12,--27, + avoid_nodes = {"group:tree"}, + avoid_radius = 3,--4, + rarity = 85, + seed_diff = 329, + min_elevation = 1, + near_nodes = {"default:jungletree"}, + near_nodes_size = 6, + near_nodes_vertical = 2,--4, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_ferns.grow_giant_tree_fern + ) +end + +-- for oases & tropical beaches +if abstract_ferns.config.enable_giant_treeferns_in_oases == true then + plantslib:register_generate_plant({ + surface = { + "default:sand"--, + --"default:desert_sand" + }, + max_count = 10,--27, + rarity = 90, + seed_diff = 329, + neighbors = {"default:desert_sand"}, + ncount = 1, + min_elevation = 1, + near_nodes = {"default:water_source"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 1.0, + temp_max = -1.0, + temp_min = 1.0, + }, + abstract_ferns.grow_giant_tree_fern + ) +end diff --git a/mods/plantlife_modpack/ferns/horsetail.lua b/mods/plantlife_modpack/ferns/horsetail.lua new file mode 100644 index 0000000..7668981 --- /dev/null +++ b/mods/plantlife_modpack/ferns/horsetail.lua @@ -0,0 +1,156 @@ +----------------------------------------------------------------------------------------------- +-- Archae Plantae - Horsetail 0.0.5 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default, flowers, trees +-- Dependencies: plants_lib +-- Supports: dryplants, stoneage, sumpf +----------------------------------------------------------------------------------------------- + +assert(abstract_ferns.config.enable_horsetails == true) + +----------------------------------------------------------------------------------------------- +-- HORSETAIL (EQUISETUM) +----------------------------------------------------------------------------------------------- + +local node_names = {} + +local function create_nodes() + local selection_boxes = { + { -0.15, -1/2, -0.15, 0.15, -1/16, 0.15 }, + { -0.15, -1/2, -0.15, 0.15, 1/16, 0.15 }, + { -0.15, -1/2, -0.15, 0.15, 4/16, 0.15 }, + { -0.15, -1/2, -0.15, 0.15, 7/16, 0.15 }, + } + + for i = 1, 4 do + local node_name = "ferns:horsetail_" .. string.format("%02d", i) + local node_img = "ferns_horsetail_" .. string.format("%02d", i) .. ".png" + local node_desc + local node_on_use = nil + local node_drop = "ferns:horsetail_04" + + if i == 1 then + node_desc = "Young Horsetail (Equisetum)" + node_on_use = minetest.item_eat(1) -- young ones edible https://en.wikipedia.org/wiki/Equisetum + node_drop = node_name + elseif i == 4 then + node_desc = "Horsetail (Equisetum)" + else + node_desc = "Horsetail (Equisetum) ".. string.format("%02d", i) + end + + node_names[i] = node_name + + minetest.register_node(node_name, { + description = node_desc, + drawtype = "plantlike", + paramtype = "light", + tiles = { node_img }, + inventory_image = node_img, + walkable = false, + buildable_to = true, + groups = {snappy=3,flammable=2,attached_node=1,horsetail=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = selection_boxes[i], + }, + on_use = node_on_use, + drop = node_drop, + }) + end +end + +----------------------------------------------------------------------------------------------- +-- Init +----------------------------------------------------------------------------------------------- + +create_nodes() + +----------------------------------------------------------------------------------------------- +-- Spawning +----------------------------------------------------------------------------------------------- +if abstract_ferns.config.enable_horsetails_spawning == true then + plantslib:spawn_on_surfaces({ + spawn_delay = 1200, + spawn_plants = node_names, + spawn_chance = 400, + spawn_surfaces = { + "default:dirt_with_grass", + "default:desert_sand", + "default:sand", + "dryplants:grass_short", + "stoneage:grass_with_silex", + "default:mossycobble", + "default:gravel" + }, + seed_diff = 329, + min_elevation = 1, -- above sea level + near_nodes = {"default:water_source","default:gravel"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + --random_facedir = { 0, 179 }, + }) +end + +----------------------------------------------------------------------------------------------- +-- Generating +----------------------------------------------------------------------------------------------- + +if abstract_ferns.config.enable_horsetails_on_grass == true then + plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "sumpf:sumpf" + }, + max_count = 35, + rarity = 40, + min_elevation = 1, -- above sea level + near_nodes = { + "group:water", -- likes water (of course) + "default:gravel", -- near those on gravel + "default:sand", -- some like sand + "default:clay", -- some like clay + "stoneage:grass_with_silex", + "default:mossycobble", + "default:cobble", + "sumpf:sumpf" + }, + near_nodes_size = 3, + near_nodes_vertical = 2,--3, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_min = 0.4, + temp_max = -0.5, -- 55 C + temp_min = 0.53, -- 0 C, dies back in winter + --random_facedir = { 0, 179 }, + }, + node_names + ) +end + +if abstract_ferns.config.enable_horsetails_on_stones == true then + plantslib:register_generate_plant({ + surface = { + "default:gravel", -- roots go deep + "default:mossycobble", + "stoneage:dirt_with_silex", + "stoneage:grass_with_silex", + "stoneage:sand_with_silex", -- roots go deep + }, + max_count = 35, + rarity = 20, + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + humidity_min = 0.4, + temp_max = -0.5, -- 55 C + temp_min = 0.53, -- 0 C, dies back in winter + --random_facedir = { 0, 179 }, + }, + node_names + ) +end diff --git a/mods/plantlife_modpack/ferns/init.lua b/mods/plantlife_modpack/ferns/init.lua new file mode 100644 index 0000000..b629d5d --- /dev/null +++ b/mods/plantlife_modpack/ferns/init.lua @@ -0,0 +1,69 @@ +----------------------------------------------------------------------------------------------- +local title = "Ferns" -- former "Archae Plantae" +local version = "0.2.0" +local mname = "ferns" -- former "archaeplantae" +----------------------------------------------------------------------------------------------- +-- (by Mossmanikin) +-- License (everything): WTFPL +----------------------------------------------------------------------------------------------- + +abstract_ferns = {} + +dofile(minetest.get_modpath("ferns").."/settings.lua") + +if abstract_ferns.config.enable_lady_fern == true then + dofile(minetest.get_modpath("ferns").."/fern.lua") +end + +if abstract_ferns.config.enable_horsetails == true then + dofile(minetest.get_modpath("ferns").."/horsetail.lua") +end + +if abstract_ferns.config.enable_treefern == true then + dofile(minetest.get_modpath("ferns").."/treefern.lua") +end + +if abstract_ferns.config.enable_giant_treefern == true then + dofile(minetest.get_modpath("ferns").."/gianttreefern.lua") +end + +dofile(minetest.get_modpath("ferns").."/crafting.lua") + + +----------------------------------------------------------------------------- +-- TESTS +----------------------------------------------------------------------------- +local run_tests = true -- set to false to skip + +if run_tests then + + -- These are, essentially, unit tests to make sure that all required item + -- strings are registered. The init sequence is not time critical so leaving + -- them here won't affect performance. + + -- Check node names + if abstract_ferns.config.enable_horsetails then + print("[Mod] " ..title.. " Checking horsetail item strings") + assert(minetest.registered_items["ferns:horsetail_01"] ~= nil) + assert(minetest.registered_items["ferns:horsetail_02"] ~= nil) + assert(minetest.registered_items["ferns:horsetail_03"] ~= nil) + assert(minetest.registered_items["ferns:horsetail_04"] ~= nil) + end + if abstract_ferns.config.enable_lady_fern then + print("[Mod] ".. title .." Checking lady fern item strings") + assert(minetest.registered_items["ferns:fern_01"] ~= nil) + assert(minetest.registered_items["ferns:fern_02"] ~= nil) + assert(minetest.registered_items["ferns:fern_03"] ~= nil) + end + if abstract_ferns.config.enable_treefern then + print("[Mod] ".. title .." Checking tree fern item strings") + assert(minetest.registered_items["ferns:tree_fern_leaves"] ~= nil) + assert(minetest.registered_items["ferns:tree_fern_leaves_02"] ~= nil) + assert(minetest.registered_items["ferns:fern_trunk"] ~= nil) + assert(minetest.registered_items["ferns:sapling_tree_fern"] ~= nil) + end +end + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- diff --git a/mods/plantlife_modpack/ferns/settings.lua b/mods/plantlife_modpack/ferns/settings.lua new file mode 100644 index 0000000..8254fcf --- /dev/null +++ b/mods/plantlife_modpack/ferns/settings.lua @@ -0,0 +1,43 @@ +-- In case you don't wanna have errors: + +-- Only change what's behind a "=" (or "--"). +-- Don't use caps (behind a "="). + +-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around). +-- Spelling is important. +-- If "true" or "false" is necessary as setting, everything(!) which is not spelled "true" will be read as if it were "false" (even "1", "True"...) + +-- If you wanna comment something (for example to remember the default value), you can do this by putting "--" in front of the comment. +-- You can put "--" at the end of a line with "=" in it, or at the beginning of an empty/new line (minetest will ignore what's behind it then). +-- But don't put "--" in front of a line with "=" in it (or else minetest will ignore the setting and you might get an error). + +-- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921 + +abstract_ferns.config = {} + +-- Which plants should generate/spawn? +abstract_ferns.config.enable_lady_fern = true +abstract_ferns.config.enable_horsetails = true +abstract_ferns.config.enable_treefern = true +abstract_ferns.config.enable_giant_treefern = true + +-- Where should they generate/spawn? (if they generate/spawn) +-- +-- Lady-Fern +abstract_ferns.config.lady_ferns_near_tree = true +abstract_ferns.config.lady_ferns_near_rock = true +abstract_ferns.config.lady_ferns_near_ores = true -- if there's a bunch of ferns there's ores nearby, this one causes a huge fps drop +abstract_ferns.config.lady_ferns_in_groups = false -- this one is meant as a replacement of Ferns_near_Ores: ferns tend to generate in groups, less fps drop, no hint for nearby ores +-- +-- Horsetails +abstract_ferns.config.enable_horsetails_spawning = false -- horsetails will grow in already explored areas, over time, near water or gravel +abstract_ferns.config.enable_horsetails_on_grass = true -- on dirt with grass and swamp (sumpf mod) +abstract_ferns.config.enable_horsetails_on_stones = true -- on gravel, mossy cobble and silex (stoneage mod) +-- +-- Tree_Fern +abstract_ferns.config.enable_treeferns_in_jungle = true +abstract_ferns.config.enable_treeferns_in_oases = true -- for oases and tropical beaches +-- +-- Giant_Tree_Fern +abstract_ferns.config.enable_giant_treeferns_in_jungle = true +abstract_ferns.config.enable_giant_treeferns_in_oases = true -- for oases and tropical beaches diff --git a/mods/plantlife_modpack/ferns/textures/ferns_5.png b/mods/plantlife_modpack/ferns/textures/ferns_5.png new file mode 100644 index 0000000..7e40665 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_5.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_6.png b/mods/plantlife_modpack/ferns/textures/ferns_6.png new file mode 100644 index 0000000..107bbf6 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_6.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_7.png b/mods/plantlife_modpack/ferns/textures/ferns_7.png new file mode 100644 index 0000000..b1ac1f5 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_7.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_8.png b/mods/plantlife_modpack/ferns/textures/ferns_8.png new file mode 100644 index 0000000..db5510b Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_8.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern.png b/mods/plantlife_modpack/ferns/textures/ferns_fern.png new file mode 100644 index 0000000..7884e5a Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_big.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_big.png new file mode 100644 index 0000000..42deb95 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_big.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_mid.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_mid.png new file mode 100644 index 0000000..3213308 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_mid.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_tree.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree.png new file mode 100644 index 0000000..8daeafd Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_giant.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_giant.png new file mode 100644 index 0000000..2e3adb7 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_giant.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_inv.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_inv.png new file mode 100644 index 0000000..5417669 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_inv.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_tl.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_tl.png new file mode 100644 index 0000000..16b6e3a Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_tl.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_tr.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_tr.png new file mode 100644 index 0000000..768430f Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_tree_tr.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk.png new file mode 100644 index 0000000..a8e1bf6 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_big.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_big.png new file mode 100644 index 0000000..24ede0a Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_big.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_big_top.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_big_top.png new file mode 100644 index 0000000..3e3c829 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_big_top.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_top.png b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_top.png new file mode 100644 index 0000000..8b259cc Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fern_trunk_top.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_ferntuber.png b/mods/plantlife_modpack/ferns/textures/ferns_ferntuber.png new file mode 100644 index 0000000..2d6785d Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_ferntuber.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_ferntuber_roasted.png b/mods/plantlife_modpack/ferns/textures/ferns_ferntuber_roasted.png new file mode 100644 index 0000000..f62a88d Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_ferntuber_roasted.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fiddlehead.png b/mods/plantlife_modpack/ferns/textures/ferns_fiddlehead.png new file mode 100644 index 0000000..0925c78 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fiddlehead.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_fiddlehead_roasted.png b/mods/plantlife_modpack/ferns/textures/ferns_fiddlehead_roasted.png new file mode 100644 index 0000000..9f4943c Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_fiddlehead_roasted.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_horsetail_01.png b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_01.png new file mode 100644 index 0000000..60d3ca6 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_01.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_horsetail_02.png b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_02.png new file mode 100644 index 0000000..3c7edf7 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_02.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_horsetail_03.png b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_03.png new file mode 100644 index 0000000..5d28a46 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_03.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_horsetail_04.png b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_04.png new file mode 100644 index 0000000..a8254ed Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_horsetail_04.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_sapling_tree_fern.png b/mods/plantlife_modpack/ferns/textures/ferns_sapling_tree_fern.png new file mode 100644 index 0000000..b459d48 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_sapling_tree_fern.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_sapling_tree_fern_giant.png b/mods/plantlife_modpack/ferns/textures/ferns_sapling_tree_fern_giant.png new file mode 100644 index 0000000..e556016 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_sapling_tree_fern_giant.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big.png b/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big.png new file mode 100644 index 0000000..09cc001 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big_cross.png b/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big_cross.png new file mode 100644 index 0000000..48f7e2c Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big_cross.png differ diff --git a/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big_end.png b/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big_end.png new file mode 100644 index 0000000..d0064fe Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/ferns_tree_fern_leave_big_end.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/archaeplantae_horsetails.png b/mods/plantlife_modpack/ferns/textures/not_in_use/archaeplantae_horsetails.png new file mode 100644 index 0000000..6ba89c1 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/archaeplantae_horsetails.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/big picture 3.png b/mods/plantlife_modpack/ferns/textures/not_in_use/big picture 3.png new file mode 100644 index 0000000..de344e6 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/big picture 3.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_big_left.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_big_left.png new file mode 100644 index 0000000..0fdf515 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_big_left.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_big_right.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_big_right.png new file mode 100644 index 0000000..d30def0 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_big_right.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_mid_left.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_mid_left.png new file mode 100644 index 0000000..d146df3 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_mid_left.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_mid_right.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_mid_right.png new file mode 100644 index 0000000..e10460a Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_mid_right.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_tree_bl.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_tree_bl.png new file mode 100644 index 0000000..e2fdb67 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_tree_bl.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_tree_br.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_tree_br.png new file mode 100644 index 0000000..eb547e8 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_tree_br.png differ diff --git a/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_trunk_big_crown.png b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_trunk_big_crown.png new file mode 100644 index 0000000..7a12671 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/not_in_use/ferns_fern_trunk_big_crown.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/archaeplantae_fern_old4.png b/mods/plantlife_modpack/ferns/textures/old/archaeplantae_fern_old4.png new file mode 100644 index 0000000..a3d403c Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/archaeplantae_fern_old4.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/comb.png b/mods/plantlife_modpack/ferns/textures/old/comb.png new file mode 100644 index 0000000..ea1e19f Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/comb.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_5_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_5_old.png new file mode 100644 index 0000000..5676278 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_5_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_6_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_6_old.png new file mode 100644 index 0000000..36d6040 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_6_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_7_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_7_old.png new file mode 100644 index 0000000..8aabe61 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_7_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_big_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_big_old.png new file mode 100644 index 0000000..d17ed11 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_big_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_mid_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_mid_old.png new file mode 100644 index 0000000..08513c2 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_mid_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_tree_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_tree_old.png new file mode 100644 index 0000000..4599672 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_tree_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_old2.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_old2.png new file mode 100644 index 0000000..a048ee0 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_old2.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_top_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_top_old.png new file mode 100644 index 0000000..d83151f Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_top_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_top_old2.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_top_old2.png new file mode 100644 index 0000000..244ddfe Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_big_top_old2.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_top_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_top_old.png new file mode 100644 index 0000000..872fdab Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_fern_trunk_top_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_01_old2.png b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_01_old2.png new file mode 100644 index 0000000..7d55718 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_01_old2.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_02_old2.png b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_02_old2.png new file mode 100644 index 0000000..d0b5563 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_02_old2.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_03_old2.png b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_03_old2.png new file mode 100644 index 0000000..42cf76e Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_03_old2.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_04_old2.png b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_04_old2.png new file mode 100644 index 0000000..600ebe7 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_horsetail_04_old2.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_cross_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_cross_old.png new file mode 100644 index 0000000..00ec9d8 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_cross_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_end_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_end_old.png new file mode 100644 index 0000000..ce1a87d Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_end_old.png differ diff --git a/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_old.png b/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_old.png new file mode 100644 index 0000000..b568383 Binary files /dev/null and b/mods/plantlife_modpack/ferns/textures/old/ferns_tree_fern_leave_big_old.png differ diff --git a/mods/plantlife_modpack/ferns/treefern.lua b/mods/plantlife_modpack/ferns/treefern.lua new file mode 100644 index 0000000..fe64885 --- /dev/null +++ b/mods/plantlife_modpack/ferns/treefern.lua @@ -0,0 +1,228 @@ +----------------------------------------------------------------------------------------------- +-- Ferns - Tree Fern 0.1.1 +----------------------------------------------------------------------------------------------- +-- by Mossmanikin +-- License (everything): WTFPL +-- Contains code from: plants_lib +-- Looked at code from: default , trees +----------------------------------------------------------------------------------------------- + +assert(abstract_ferns.config.enable_treefern == true) + +abstract_ferns.grow_tree_fern = function(pos) + + local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} + if minetest.get_node(pos_01).name ~= "air" + and minetest.get_node(pos_01).name ~= "ferns:sapling_tree_fern" + and minetest.get_node(pos_01).name ~= "default:junglegrass" then + return + end + + local size = math.random(1, 4) + math.random(1, 4) + if (size > 5) then + size = 10 - size + end + size = size + 1 + local crown = ({ "ferns:tree_fern_leaves", "ferns:tree_fern_leaves_02" })[math.random(1, 2)] + + local i = 1 + while (i < size-1) do + if minetest.get_node({x = pos.x, y = pos.y + i + 1, z = pos.z}).name ~= "air" then + break + end + minetest.set_node({x = pos.x, y = pos.y + i, z = pos.z}, { name = "ferns:fern_trunk" }) + i = i + 1 + end + + minetest.set_node({x = pos.x, y = pos.y + i, z = pos.z}, { name = crown }) +end + +----------------------------------------------------------------------------------------------- +-- TREE FERN LEAVES +----------------------------------------------------------------------------------------------- + +-- TODO: Both of these nodes look the same? + +minetest.register_node("ferns:tree_fern_leaves", { + description = "Tree Fern Crown (Dicksonia)", + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + paramtype2 = "facedir", + --tiles = {"[combine:32x32:0,0=top_left.png:0,16=bottom_left.png:16,0=top_right.png:16,16=bottom_right.png"}, + tiles = {"ferns_fern_tree.png"}, + inventory_image = "ferns_fern_tree_inv.png", + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1}, + drop = { + max_items = 2, + items = { + { + -- occasionally, drop a second sapling instead of leaves + -- (extra saplings can also be obtained by replanting and + -- reharvesting leaves) + items = {"ferns:sapling_tree_fern"}, + rarity = 10, + }, + { + items = {"ferns:sapling_tree_fern"}, + }, + { + items = {"ferns:tree_fern_leaves"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +minetest.register_node("ferns:tree_fern_leaves_02", { + drawtype = "plantlike", + visual_scale = 2, + paramtype = "light", + tiles = {"ferns_fern_big.png"}, + walkable = false, + groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1}, + drop = { + max_items = 2, + items = { + { + -- occasionally, drop a second sapling instead of leaves + -- (extra saplings can also be obtained by replanting and + -- reharvesting leaves) + items = {"ferns:sapling_tree_fern"}, + rarity = 10, + }, + { + items = {"ferns:sapling_tree_fern"}, + }, + { + items = {"ferns:tree_fern_leaves"}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +----------------------------------------------------------------------------------------------- +-- FERN TRUNK +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:fern_trunk", { + description = "Fern Trunk (Dicksonia)", + drawtype = "nodebox", + paramtype = "light", + tiles = { + "ferns_fern_trunk_top.png", + "ferns_fern_trunk_top.png", + "ferns_fern_trunk.png" + }, + node_box = { + type = "fixed", + fixed = {-1/8, -1/2, -1/8, 1/8, 1/2, 1/8}, + }, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), + after_destruct = function(pos,oldnode) + local node = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}) + if node.name == "ferns:fern_trunk" then + minetest.dig_node({x=pos.x,y=pos.y+1,z=pos.z}) + minetest.add_item(pos,"ferns:fern_trunk") + end + end, +}) + +----------------------------------------------------------------------------------------------- +-- TREE FERN SAPLING +----------------------------------------------------------------------------------------------- +minetest.register_node("ferns:sapling_tree_fern", { + description = "Tree Fern Sapling (Dicksonia)", + drawtype = "plantlike", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"ferns_sapling_tree_fern.png"}, + inventory_image = "ferns_sapling_tree_fern.png", + walkable = false, + groups = {snappy=3,flammable=2,flora=1,attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16}, + }, +}) +-- abm +minetest.register_abm({ + nodenames = "ferns:sapling_tree_fern", + interval = 1000, + chance = 4, + action = function(pos, node, _, _) + abstract_ferns.grow_tree_fern({x = pos.x, y = pos.y-1, z = pos.z}) + end +}) + +----------------------------------------------------------------------------------------------- +-- GENERATE TREE FERN +----------------------------------------------------------------------------------------------- + +-- in jungles +if abstract_ferns.config.enable_treeferns_in_jungle == true then + plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "default:sand", + "default:desert_sand", + }, + max_count = 35,--27, + avoid_nodes = {"default:tree"}, + avoid_radius = 4, + rarity = 50, + seed_diff = 329, + min_elevation = -10, + near_nodes = {"default:jungletree"}, + near_nodes_size = 6, + near_nodes_vertical = 2,--4, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 0.4, + temp_max = -0.5, + temp_min = 0.13, + }, + abstract_ferns.grow_tree_fern + ) +end + +-- for oases & tropical beaches +if abstract_ferns.config.enable_treeferns_in_oases == true then + plantslib:register_generate_plant({ + surface = { + "default:sand"--, + --"default:desert_sand" + }, + max_count = 35, + rarity = 50, + seed_diff = 329, + neighbors = {"default:desert_sand"}, + ncount = 1, + min_elevation = 1, + near_nodes = {"default:water_source"}, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + humidity_max = -1.0, + humidity_min = 1.0, + temp_max = -1.0, + temp_min = 1.0, + }, + abstract_ferns.grow_tree_fern +) +end diff --git a/mods/plantlife_modpack/flowers_plus/depends.txt b/mods/plantlife_modpack/flowers_plus/depends.txt new file mode 100644 index 0000000..6a66906 --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/depends.txt @@ -0,0 +1,2 @@ +plants_lib + diff --git a/mods/plantlife_modpack/flowers_plus/flowers-changelog.txt b/mods/plantlife_modpack/flowers_plus/flowers-changelog.txt new file mode 100644 index 0000000..fbe7518 --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/flowers-changelog.txt @@ -0,0 +1,24 @@ +Changelog +--------- + +2012-08-06: Tweaked selection boxes on all nodes. Tweaked seaweed to use +signlike instead of raillike drawtype, (still forced to only spawn flat as +usual). Adjusted light level limits to give it more time to grow. Created +this changelog file using github commit messages as the basis. Shrunk the +geranium flower down a bit to better match the others. + +2012-08-03: Tuned out the random-numbers-inside-ABM stuff. Uses the ABM's +chance setting instead. Should be approximately the same as before, but +hopefully using a tad less CPU. Minor tweak to ABM interval/growing delay. + +2012-08-01: Added blue geranium to the collection of flowers. + +2012-07-31: Disable debug by default. + +2012-07-30: many updates over the course of the day - first commit, removed +some redundant files, added wield/inventory image entries for each item, to +force the game to draw them properly (these shouldn't be needed, must be a +bug). Tweaked spawn code so that the radius check also includes the name of +the item being spawned as well as items in group:flower, that way all items can +have a radius test, and not just those in group:flower. Fiddled with the spawn +rates a bit. diff --git a/mods/plantlife_modpack/flowers_plus/init.lua b/mods/plantlife_modpack/flowers_plus/init.lua new file mode 100644 index 0000000..bd74b79 --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/init.lua @@ -0,0 +1,475 @@ +local S = plantslib.intllib + +-- This file supplies a few additional plants and some related crafts +-- for the plantlife modpack. Last revision: 2013-04-24 + +flowers_plus = {} + +local SPAWN_DELAY = 1000 +local SPAWN_CHANCE = 200 +local flowers_seed_diff = 329 +local lilies_max_count = 320 +local lilies_rarity = 33 +local seaweed_max_count = 320 +local seaweed_rarity = 33 +local sunflowers_max_count = 10 +local sunflowers_rarity = 25 + +-- register the various rotations of waterlilies + +local lilies_list = { + { nil , nil , 1 }, + { "225", "22.5" , 2 }, + { "45" , "45" , 3 }, + { "675", "67.5" , 4 }, + { "s1" , "small_1" , 5 }, + { "s2" , "small_2" , 6 }, + { "s3" , "small_3" , 7 }, + { "s4" , "small_4" , 8 }, +} + +for i in ipairs(lilies_list) do + local deg1 = "" + local deg2 = "" + local lily_groups = {snappy = 3,flammable=2,flower=1} + + if lilies_list[i][1] ~= nil then + deg1 = "_"..lilies_list[i][1] + deg2 = "_"..lilies_list[i][2] + lily_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 } + end + + minetest.register_node(":flowers:waterlily"..deg1, { + description = S("Waterlily"), + drawtype = "nodebox", + tiles = { + "flowers_waterlily"..deg2..".png", + "flowers_waterlily"..deg2..".png^[transformFY" + }, + inventory_image = "flowers_waterlily.png", + wield_image = "flowers_waterlily.png", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + groups = lily_groups, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.4, -0.5, -0.4, 0.4, -0.45, 0.4 }, + }, + node_box = { + type = "fixed", + fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 }, + }, + buildable_to = true, + + liquids_pointable = true, + drop = "flowers:waterlily", + on_place = function(itemstack, placer, pointed_thing) + local keys=placer:get_player_control() + local pt = pointed_thing + + local place_pos = nil + local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} + local under_node = minetest.get_node(pt.under) + local above_node = minetest.get_node(pt.above) + local top_node = minetest.get_node(top_pos) + + if plantslib:get_nodedef_field(under_node.name, "buildable_to") then + if under_node.name ~= "default:water_source" then + place_pos = pt.under + elseif top_node.name ~= "default:water_source" + and plantslib:get_nodedef_field(top_node.name, "buildable_to") then + place_pos = top_pos + else + return + end + elseif plantslib:get_nodedef_field(above_node.name, "buildable_to") then + place_pos = pt.above + end + + if place_pos and not minetest.is_protected(place_pos, placer:get_player_name()) then + + local nodename = "default:cobble" -- if this block appears, something went....wrong :-) + + if not keys["sneak"] then + local node = minetest.get_node(pt.under) + local waterlily = math.random(1,8) + if waterlily == 1 then + nodename = "flowers:waterlily" + elseif waterlily == 2 then + nodename = "flowers:waterlily_225" + elseif waterlily == 3 then + nodename = "flowers:waterlily_45" + elseif waterlily == 4 then + nodename = "flowers:waterlily_675" + elseif waterlily == 5 then + nodename = "flowers:waterlily_s1" + elseif waterlily == 6 then + nodename = "flowers:waterlily_s2" + elseif waterlily == 7 then + nodename = "flowers:waterlily_s3" + elseif waterlily == 8 then + nodename = "flowers:waterlily_s4" + end + minetest.set_node(place_pos, {name = nodename, param2 = math.random(0,3) }) + else + local fdir = minetest.dir_to_facedir(placer:get_look_dir()) + minetest.set_node(place_pos, {name = "flowers:waterlily", param2 = fdir}) + end + + if not plantslib.expect_infinite_stacks then + itemstack:take_item() + end + return itemstack + end + end, + }) +end + +local algae_list = { {nil}, {2}, {3}, {4} } + +for i in ipairs(algae_list) do + local num = "" + local algae_groups = {snappy = 3,flammable=2,flower=1} + + if algae_list[i][1] ~= nil then + num = "_"..algae_list[i][1] + algae_groups = { snappy = 3,flammable=2,flower=1, not_in_creative_inventory=1 } + end + + minetest.register_node(":flowers:seaweed"..num, { + description = S("Seaweed"), + drawtype = "nodebox", + tiles = { + "flowers_seaweed"..num..".png", + "flowers_seaweed"..num..".png^[transformFY" + }, + inventory_image = "flowers_seaweed_2.png", + wield_image = "flowers_seaweed_2.png", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + groups = algae_groups, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.4, -0.5, -0.4, 0.4, -0.45, 0.4 }, + }, + node_box = { + type = "fixed", + fixed = { -0.5, -0.49, -0.5, 0.5, -0.49, 0.5 }, + }, + buildable_to = true, + + liquids_pointable = true, + drop = "flowers:seaweed", + on_place = function(itemstack, placer, pointed_thing) + local keys=placer:get_player_control() + local pt = pointed_thing + + local place_pos = nil + local top_pos = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z} + local under_node = minetest.get_node(pt.under) + local above_node = minetest.get_node(pt.above) + local top_node = minetest.get_node(top_pos) + + if plantslib:get_nodedef_field(under_node.name, "buildable_to") then + if under_node.name ~= "default:water_source" then + place_pos = pt.under + elseif top_node.name ~= "default:water_source" + and plantslib:get_nodedef_field(top_node.name, "buildable_to") then + place_pos = top_pos + else + return + end + elseif plantslib:get_nodedef_field(above_node.name, "buildable_to") then + place_pos = pt.above + end + + if not minetest.is_protected(place_pos, placer:get_player_name()) then + + local nodename = "default:cobble" -- :D + + if not keys["sneak"] then + --local node = minetest.get_node(pt.under) + local seaweed = math.random(1,4) + if seaweed == 1 then + nodename = "flowers:seaweed" + elseif seaweed == 2 then + nodename = "flowers:seaweed_2" + elseif seaweed == 3 then + nodename = "flowers:seaweed_3" + elseif seaweed == 4 then + nodename = "flowers:seaweed_4" + end + minetest.set_node(place_pos, {name = nodename, param2 = math.random(0,3) }) + else + local fdir = minetest.dir_to_facedir(placer:get_look_dir()) + minetest.set_node(place_pos, {name = "flowers:seaweed", param2 = fdir}) + end + + if not plantslib.expect_infinite_stacks then + itemstack:take_item() + end + return itemstack + end + end, + }) +end + +local box = { + type="fixed", + fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } }, +} + +minetest.register_node(":flowers:sunflower", { + description = "Sunflower", + drawtype = "mesh", + paramtype = "light", + paramtype2 = "facedir", + inventory_image = "flowers_sunflower_inv.png", + mesh = "flowers_sunflower.obj", + tiles = { "flowers_sunflower.png" }, + walkable = false, + buildable_to = true, + is_ground_content = true, + groups = { dig_immediate=3, flora=1, flammable=3 }, + sounds = default.node_sound_leaves_defaults(), + selection_box = box, + collision_box = box, +}) + +minetest.override_item("flowers:sunflower", {drop = { + max_items = 1, + items = { + {items = {"farming:seed_wheat"}, rarity = 8}, + {items = {"flowers:sunflower"}}, + } +}}) + +local extra_aliases = { + "waterlily", + "waterlily_225", + "waterlily_45", + "waterlily_675", + "seaweed" +} + +for i in ipairs(extra_aliases) do + local flower = extra_aliases[i] + minetest.register_alias("flowers:flower_"..flower, "flowers:"..flower) +end + +minetest.register_alias( "trunks:lilypad" , "flowers:waterlily_s1" ) +minetest.register_alias( "along_shore:lilypads_1" , "flowers:waterlily_s1" ) +minetest.register_alias( "along_shore:lilypads_2" , "flowers:waterlily_s2" ) +minetest.register_alias( "along_shore:lilypads_3" , "flowers:waterlily_s3" ) +minetest.register_alias( "along_shore:lilypads_4" , "flowers:waterlily_s4" ) +minetest.register_alias( "along_shore:pondscum_1" , "flowers:seaweed" ) +minetest.register_alias( "along_shore:seaweed_1" , "flowers:seaweed" ) +minetest.register_alias( "along_shore:seaweed_2" , "flowers:seaweed_2" ) +minetest.register_alias( "along_shore:seaweed_3" , "flowers:seaweed_3" ) +minetest.register_alias( "along_shore:seaweed_4" , "flowers:seaweed_4" ) + +-- ongen registrations + +flowers_plus.grow_waterlily = function(pos) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + for i in ipairs(lilies_list) do + local chance = math.random(1,8) + local ext = "" + local num = lilies_list[i][3] + + if lilies_list[i][1] ~= nil then + ext = "_"..lilies_list[i][1] + end + + if chance == num then + minetest.set_node(right_here, {name="flowers:waterlily"..ext, param2=math.random(0,3)}) + end + end +end + +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = lilies_max_count, + rarity = lilies_rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:dirt_with_grass"}, + near_nodes_size = 4, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + temp_max = -0.22, + temp_min = 0.22, + }, + flowers_plus.grow_waterlily +) + +flowers_plus.grow_seaweed = function(pos) + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + minetest.set_node(right_here, {name="along_shore:seaweed_"..math.random(1,4), param2=math.random(1,3)}) +end + +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = seaweed_max_count, + rarity = seaweed_rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:dirt_with_grass"}, + near_nodes_size = 4, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + flowers_plus.grow_seaweed +) + +-- seaweed at beaches +-- MM: not satisfied with it, but IMHO some beaches should have some algae +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = seaweed_max_count, + rarity = seaweed_rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:sand"}, + near_nodes_size = 1, + near_nodes_vertical = 0, + near_nodes_count = 3, + plantlife_limit = -0.9, + temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere + temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere + }, + flowers_plus.grow_seaweed +) +plantslib:register_generate_plant({ + surface = {"default:sand"}, + max_count = seaweed_max_count*2, + rarity = seaweed_rarity/2, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:water_source"}, + near_nodes_size = 1, + near_nodes_vertical = 0, + near_nodes_count = 3, + plantlife_limit = -0.9, + temp_max = -0.64, -- MM: more or less random values, just to make sure it's not everywhere + temp_min = -0.22, -- MM: more or less random values, just to make sure it's not everywhere + }, + flowers_plus.grow_seaweed +) + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + avoid_nodes = { "flowers:sunflower" }, + max_count = sunflowers_max_count, + rarity = sunflowers_rarity, + min_elevation = 0, + plantlife_limit = -0.9, + temp_max = 0.53, + random_facedir = {0,3}, + }, + "flowers:sunflower" +) + +-- spawn ABM registrations + +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY/2, + spawn_plants = { + "flowers:waterlily", + "flowers:waterlily_225", + "flowers:waterlily_45", + "flowers:waterlily_675", + "flowers:waterlily_s1", + "flowers:waterlily_s2", + "flowers:waterlily_s3", + "flowers:waterlily_s4" + }, + avoid_radius = 2.5, + spawn_chance = SPAWN_CHANCE*4, + spawn_surfaces = {"default:water_source"}, + avoid_nodes = {"group:flower", "group:flora" }, + seed_diff = flowers_seed_diff, + light_min = 9, + depth_max = 2, + random_facedir = {0,3} +}) + +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY*2, + spawn_plants = {"flowers:seaweed"}, + spawn_chance = SPAWN_CHANCE*2, + spawn_surfaces = {"default:water_source"}, + avoid_nodes = {"group:flower", "group:flora"}, + seed_diff = flowers_seed_diff, + light_min = 4, + light_max = 10, + neighbors = {"default:dirt_with_grass"}, + facedir = 1 +}) + +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY*2, + spawn_plants = {"flowers:seaweed"}, + spawn_chance = SPAWN_CHANCE*2, + spawn_surfaces = {"default:dirt_with_grass"}, + avoid_nodes = {"group:flower", "group:flora" }, + seed_diff = flowers_seed_diff, + light_min = 4, + light_max = 10, + neighbors = {"default:water_source"}, + ncount = 1, + facedir = 1 +}) + +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY*2, + spawn_plants = {"flowers:seaweed"}, + spawn_chance = SPAWN_CHANCE*2, + spawn_surfaces = {"default:stone"}, + avoid_nodes = {"group:flower", "group:flora" }, + seed_diff = flowers_seed_diff, + light_min = 4, + light_max = 10, + neighbors = {"default:water_source"}, + ncount = 6, + facedir = 1 +}) + +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY*2, + spawn_plants = {"flowers:sunflower"}, + spawn_chance = SPAWN_CHANCE*2, + spawn_surfaces = {"default:dirt_with_grass"}, + avoid_nodes = {"group:flower", "flowers:sunflower"}, + seed_diff = flowers_seed_diff, + light_min = 11, + light_max = 14, + min_elevation = 0, + plantlife_limit = -0.9, + temp_max = 0.53, + random_facedir = {0,3}, + avoid_radius = 5 +}) + +-- Cotton plants are now provided by the default "farming" mod. +-- old cotton plants -> farming cotton stage 8 +-- cotton wads -> string (can be crafted into wool blocks) +-- potted cotton plants -> potted white dandelions + +minetest.register_alias("flowers:cotton_plant", "farming:cotton_8") +minetest.register_alias("flowers:flower_cotton", "farming:cotton_8") +minetest.register_alias("flowers:flower_cotton_pot", "flowers:potted_dandelion_white") +minetest.register_alias("flowers:potted_cotton_plant", "flowers:potted_dandelion_white") +minetest.register_alias("flowers:cotton", "farming:string") +minetest.register_alias("flowers:cotton_wad", "farming:string") +minetest.register_alias("sunflower:sunflower", "flowers:sunflower") + +print(S("[Flowers] Loaded.")) diff --git a/mods/plantlife_modpack/flowers_plus/locale/de.txt b/mods/plantlife_modpack/flowers_plus/locale/de.txt new file mode 100644 index 0000000..5195be7 --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/locale/de.txt @@ -0,0 +1,13 @@ +# Translation by Xanthin + +Waterlily = Seerose +Seaweed = Seetang +Potted Rose = Eingetopfte Rose +Potted Tulip = Eingetopfte Tulpe +Potted Yellow Dandelion = Eingetopfter Loewenzahn +Potted White Dandelion = Eingetopfte Pusteblume +Potted Blue Geranium = Eingetopfte blaue Geranie +Potted Viola = Eingetopftes Veilchen +Flower Pot = Blumentopf + +[Flowers] Loaded. = [Flowers] Geladen. diff --git a/mods/plantlife_modpack/flowers_plus/locale/fr.txt b/mods/plantlife_modpack/flowers_plus/locale/fr.txt new file mode 100644 index 0000000..c4f4737 --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/locale/fr.txt @@ -0,0 +1,13 @@ +# Template + +Waterlily = Nénuphar +Seaweed = Algues +Potted Rose = Rose en pot +Potted Tulip = Tulipe en pot +Potted Yellow Dandelion = Pissenlit jaune en pot +Potted White Dandelion = Pissenlit blanc en pot +Potted Blue Geranium = Géranium bleu en pot +Potted Viola = Violette en pot +Flower Pot = Fleurs en pot + +[Flowers] Loaded. = [Fleurs] Chargées. diff --git a/mods/plantlife_modpack/flowers_plus/locale/template.txt b/mods/plantlife_modpack/flowers_plus/locale/template.txt new file mode 100644 index 0000000..42ac830 --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/locale/template.txt @@ -0,0 +1,13 @@ +# Template + +Waterlily = +Seaweed = +Potted Rose = +Potted Tulip = +Potted Yellow Dandelion = +Potted White Dandelion = +Potted Blue Geranium = +Potted Viola = +Flower Pot = + +[Flowers] Loaded. = diff --git a/mods/plantlife_modpack/flowers_plus/models/flowers_potted.obj b/mods/plantlife_modpack/flowers_plus/models/flowers_potted.obj new file mode 100644 index 0000000..bd6e84d --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/models/flowers_potted.obj @@ -0,0 +1,510 @@ +# Blender v2.73 (sub 0) OBJ File: 'flowersplus_potted.blend' +# www.blender.org +o Plane_Plane_None +v -0.280963 0.570852 -0.280962 +v -0.280963 -0.122043 -0.280962 +v 0.280961 -0.122043 0.280962 +v 0.280961 0.570851 0.280962 +v 0.280961 0.570852 -0.280962 +v 0.280961 -0.122043 -0.280962 +v -0.280963 -0.122043 0.280962 +v -0.280963 0.570851 0.280962 +vt 0.000015 0.999998 +vt 0.000016 0.000012 +vt 0.999986 0.000012 +vt 0.999986 0.999990 +vn -0.707100 -0.000000 0.707100 +vn -0.707100 -0.000000 -0.707100 +g Plane_Plane_None_Plane_Plane_None_None +s off +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/1/2 6/2/2 7/3/2 8/4/2 +o Cylinder.001_Cylinder.001_None +v 0.039325 -0.147239 -0.197702 +v 0.039325 -0.096845 -0.197702 +v 0.111989 -0.096845 -0.167603 +v 0.111989 -0.147239 -0.167603 +v 0.167603 -0.096845 -0.111989 +v 0.167603 -0.147239 -0.111989 +v 0.197702 -0.096845 -0.039325 +v 0.197702 -0.147239 -0.039325 +v 0.197702 -0.096845 0.039325 +v 0.197702 -0.147239 0.039325 +v 0.167603 -0.096845 0.111989 +v 0.167603 -0.147239 0.111989 +v 0.111989 -0.096845 0.167604 +v 0.111989 -0.147239 0.167604 +v 0.039325 -0.096845 0.197702 +v 0.039325 -0.147239 0.197702 +v -0.039325 -0.096845 0.197702 +v -0.039325 -0.147239 0.197702 +v -0.111989 -0.096845 0.167604 +v -0.111989 -0.147239 0.167604 +v -0.167603 -0.096845 0.111989 +v -0.167603 -0.147239 0.111989 +v -0.197702 -0.096845 0.039325 +v -0.197702 -0.147239 0.039325 +v -0.197702 -0.096845 -0.039326 +v -0.197702 -0.147239 -0.039326 +v -0.167603 -0.096845 -0.111989 +v -0.167603 -0.147239 -0.111989 +v -0.111989 -0.096845 -0.167603 +v -0.111989 -0.147239 -0.167603 +v -0.039325 -0.147239 -0.197702 +v -0.039325 -0.096845 -0.197702 +v 0.098851 -0.499995 -0.019663 +v 0.000000 -0.499995 -0.000000 +v -0.083802 -0.499995 0.055994 +v 0.055995 -0.499995 -0.083802 +v 0.055995 -0.499995 0.083802 +v -0.098851 -0.499995 -0.019663 +v -0.055995 -0.499995 0.083802 +v -0.083802 -0.499995 -0.055995 +v -0.019663 -0.499995 0.098851 +v -0.055994 -0.499995 -0.083802 +v 0.019663 -0.499995 0.098851 +v 0.098851 -0.499995 0.019662 +v 0.083802 -0.499995 0.055994 +v 0.083802 -0.499995 -0.055995 +v -0.098851 -0.499995 0.019662 +v -0.019662 -0.499995 -0.098851 +v 0.097990 -0.122042 -0.146653 +v 0.097990 -0.096845 -0.146653 +v 0.172989 -0.122042 0.034410 +v 0.172989 -0.096845 0.034410 +v 0.146653 -0.122042 -0.097990 +v 0.146653 -0.096845 -0.097990 +v -0.034409 -0.122042 -0.172989 +v -0.034409 -0.096845 -0.172989 +v -0.172989 -0.122042 0.034410 +v -0.172989 -0.096845 0.034410 +v -0.146653 -0.122042 0.097990 +v -0.146653 -0.096845 0.097990 +v 0.172989 -0.122042 -0.034410 +v 0.172989 -0.096845 -0.034410 +v 0.146653 -0.122042 0.097990 +v 0.146653 -0.096845 0.097990 +v 0.034410 -0.122042 -0.172989 +v 0.034410 -0.096845 -0.172989 +v -0.146653 -0.122042 -0.097990 +v -0.146653 -0.096845 -0.097990 +v 0.034410 -0.122042 0.172989 +v 0.034410 -0.096845 0.172989 +v -0.172989 -0.122042 -0.034410 +v -0.172989 -0.096845 -0.034410 +v -0.034410 -0.122042 0.172989 +v -0.034410 -0.096845 0.172989 +v 0.097990 -0.122042 0.146653 +v 0.097990 -0.096845 0.146653 +v -0.097990 -0.122042 -0.146653 +v -0.097990 -0.096845 -0.146653 +v -0.097990 -0.122042 0.146653 +v -0.097990 -0.096845 0.146653 +v 0.000000 -0.122042 -0.000000 +v 0.019663 -0.499995 -0.098851 +v 0.034410 -0.147239 -0.172989 +v 0.097990 -0.147239 -0.146653 +v 0.146653 -0.147239 -0.097990 +v 0.172989 -0.147239 -0.034410 +v 0.172989 -0.147239 0.034410 +v 0.146653 -0.147239 0.097990 +v 0.097990 -0.147239 0.146653 +v 0.034410 -0.147239 0.172989 +v -0.034410 -0.147239 0.172989 +v -0.097990 -0.147239 0.146653 +v -0.146653 -0.147239 0.097990 +v -0.172989 -0.147239 0.034410 +v -0.172989 -0.147239 -0.034410 +v -0.146653 -0.147239 -0.097990 +v -0.097990 -0.147239 -0.146653 +v -0.034409 -0.147239 -0.172989 +vt 0.156250 0.593750 +vt 0.156250 0.375000 +vt 0.218750 0.375000 +vt 0.218750 0.593750 +vt 0.925348 0.807408 +vt 0.942592 0.824652 +vt 0.890625 0.859375 +vt 0.611122 0.768387 +vt 0.602441 0.755395 +vt 0.647502 0.736730 +vt 0.650550 0.752055 +vt 0.468750 0.656250 +vt 0.406250 0.656250 +vt 0.406250 0.625000 +vt 0.468750 0.625000 +vt 0.093750 0.656250 +vt 0.093750 0.625000 +vt 0.156250 0.625000 +vt 0.156250 0.656250 +vt 0.031250 0.656250 +vt 0.031250 0.625000 +vt 0.343750 0.656250 +vt 0.343750 0.625000 +vt 0.031250 0.593750 +vt 0.968750 0.593750 +vt 0.968750 0.375000 +vt 0.031250 0.375000 +vt 0.718750 0.656250 +vt 0.718750 0.625000 +vt 0.781250 0.625000 +vt 0.781250 0.656250 +vt 0.656250 0.656250 +vt 0.656250 0.625000 +vt 0.650550 0.966602 +vt 0.693226 0.966602 +vt 0.696274 0.981927 +vt 0.647501 0.981927 +vt 0.906250 0.656250 +vt 0.906250 0.625000 +vt 0.968750 0.625000 +vt 0.968750 0.656250 +vt 0.406250 0.593750 +vt 0.343750 0.593750 +vt 0.343750 0.375000 +vt 0.406250 0.375000 +vt 0.531250 0.656250 +vt 0.531250 0.625000 +vt 0.593750 0.625000 +vt 0.593750 0.656250 +vt 0.564614 0.837990 +vt 0.564614 0.880667 +vt 0.549289 0.883715 +vt 0.549289 0.834942 +vt 0.580946 0.798563 +vt 0.567954 0.789882 +vt 0.902818 0.798076 +vt 0.656250 0.593750 +vt 0.593750 0.593750 +vt 0.593750 0.375000 +vt 0.656250 0.375000 +vt 0.951924 0.847182 +vt 0.033364 0.838084 +vt 0.018040 0.835036 +vt 0.036704 0.789976 +vt 0.049696 0.798656 +vt 0.779161 0.837991 +vt 0.762830 0.798563 +vt 0.775821 0.789882 +vt 0.794486 0.834942 +vt 0.906250 0.593750 +vt 0.906250 0.375000 +vt 0.218750 0.625000 +vt 0.218750 0.656250 +vt 0.406250 0.859375 +vt 0.467016 0.950317 +vt 0.427588 0.966648 +vt 0.794486 0.883715 +vt 0.779161 0.880667 +vt 0.775821 0.928775 +vt 0.762830 0.920094 +vt 0.210084 0.755488 +vt 0.244571 0.789976 +vt 0.231580 0.798656 +vt 0.201403 0.768480 +vt 0.384912 0.966648 +vt 0.696274 0.736730 +vt 0.693226 0.752055 +vt 0.593750 0.687500 +vt 0.656250 0.687500 +vt 0.656250 0.703125 +vt 0.593750 0.703125 +vt 0.156250 0.687500 +vt 0.218750 0.687500 +vt 0.218750 0.703125 +vt 0.156250 0.703125 +vt 0.611122 0.950271 +vt 0.602441 0.963262 +vt 0.718750 0.687500 +vt 0.718750 0.703125 +vt 0.263236 0.883808 +vt 0.244571 0.928868 +vt 0.231580 0.920187 +vt 0.247911 0.880760 +vt 0.567954 0.928775 +vt 0.580946 0.920094 +vt 0.781250 0.687500 +vt 0.781250 0.703125 +vt 0.781250 0.593750 +vt 0.718750 0.593750 +vt 0.718750 0.375000 +vt 0.781250 0.375000 +vt 0.951924 0.871568 +vt 0.071191 0.755488 +vt 0.116251 0.736824 +vt 0.119300 0.752149 +vt 0.079872 0.768480 +vt 0.298977 0.838037 +vt 0.315308 0.798609 +vt 0.467016 0.768433 +vt 0.497192 0.798609 +vt 0.210084 0.963356 +vt 0.201403 0.950364 +vt 0.843750 0.687500 +vt 0.843750 0.703125 +vt 0.468750 0.687500 +vt 0.531250 0.687500 +vt 0.531250 0.703125 +vt 0.468750 0.703125 +vt 0.071192 0.963356 +vt 0.079872 0.950364 +vt 0.119300 0.966695 +vt 0.116252 0.982020 +vt 0.942592 0.894098 +vt 0.281250 0.687500 +vt 0.281250 0.703125 +vt 0.165024 0.982020 +vt 0.161976 0.966695 +vt 0.161976 0.752149 +vt 0.165024 0.736824 +vt 0.513523 0.838037 +vt 0.531250 0.593750 +vt 0.531250 0.375000 +vt 0.878432 0.920674 +vt 0.855901 0.911342 +vt 0.843750 0.656250 +vt 0.843750 0.625000 +vt 0.468750 0.593750 +vt 0.468750 0.375000 +vt 0.031250 0.687500 +vt 0.093750 0.687500 +vt 0.093750 0.703125 +vt 0.031250 0.703125 +vt 0.406250 0.687500 +vt 0.406250 0.703125 +vt 0.741334 0.963262 +vt 0.732653 0.950271 +vt 0.018040 0.883808 +vt 0.033364 0.880760 +vt 0.049696 0.920188 +vt 0.036704 0.928868 +vt 0.315308 0.920140 +vt 0.298977 0.880713 +vt 0.345485 0.768433 +vt 0.513523 0.880713 +vt 0.855902 0.807408 +vt 0.878432 0.798076 +vt 0.906250 0.687500 +vt 0.968750 0.687500 +vt 0.968750 0.703125 +vt 0.906250 0.703125 +vt 0.829326 0.871568 +vt 0.829326 0.847182 +vt 0.247911 0.838084 +vt 0.263236 0.835036 +vt 0.925348 0.911342 +vt 0.384912 0.752101 +vt 0.902818 0.920674 +vt 0.732653 0.768387 +vt 0.741334 0.755395 +vt 0.281250 0.625000 +vt 0.281250 0.656250 +vt 0.345485 0.950317 +vt 0.843750 0.593750 +vt 0.843750 0.375000 +vt 0.281250 0.593750 +vt 0.281250 0.375000 +vt 0.343750 0.687500 +vt 0.343750 0.703125 +vt 0.093750 0.593750 +vt 0.093750 0.375000 +vt 0.427588 0.752101 +vt 0.838658 0.894098 +vt 0.838658 0.824652 +vt 0.497192 0.920140 +vn 0.479200 -0.817200 0.320200 +vn 0.813000 -0.209500 0.543200 +vn 0.959000 -0.209500 0.190800 +vn 0.565300 -0.817200 0.112400 +vn 0.000000 -1.000000 0.000000 +vn -0.320200 -0.817200 -0.479200 +vn -0.414600 -0.665700 -0.620400 +vn -0.145600 -0.665700 -0.731900 +vn -0.112400 -0.817200 -0.565300 +vn 0.195100 0.000000 -0.980800 +vn 0.555600 0.000000 -0.831500 +vn 0.414600 -0.665700 -0.620400 +vn 0.145600 -0.665700 -0.731900 +vn 0.555600 0.000000 0.831500 +vn 0.414600 -0.665700 0.620400 +vn 0.620400 -0.665700 0.414600 +vn 0.831500 0.000000 0.555600 +vn 0.195100 0.000000 0.980800 +vn 0.145600 -0.665700 0.731900 +vn 0.831500 -0.000000 -0.555600 +vn 0.620400 -0.665700 -0.414600 +vn 0.112400 -0.817200 0.565300 +vn -0.112400 -0.817200 0.565300 +vn -0.190800 -0.209500 0.959000 +vn 0.190800 -0.209500 0.959000 +vn -0.980800 -0.000000 -0.195100 +vn -0.731900 -0.665700 -0.145600 +vn -0.731900 -0.665700 0.145600 +vn -0.980800 -0.000000 0.195100 +vn -0.831500 -0.000000 -0.555600 +vn -0.620400 -0.665700 -0.414600 +vn -0.145600 -0.665700 0.731900 +vn -0.555600 0.000000 0.831500 +vn -0.414600 -0.665700 0.620400 +vn -0.195100 0.000000 0.980800 +vn 0.320200 -0.817200 -0.479200 +vn 0.479200 -0.817200 -0.320200 +vn 0.813000 -0.209500 -0.543200 +vn 0.543200 -0.209500 -0.813000 +vn -0.195100 0.000000 -0.980800 +vn -0.555600 0.000000 -0.831500 +vn -0.565300 -0.817200 -0.112400 +vn -0.565300 -0.817200 0.112400 +vn -0.479200 -0.817200 -0.320200 +vn -0.543200 -0.209500 -0.813000 +vn -0.813000 -0.209500 -0.543200 +vn 0.644500 0.753700 -0.128200 +vn 0.000000 1.000000 0.000000 +vn 0.546400 0.753700 -0.365100 +vn 0.565300 -0.817200 -0.112400 +vn 0.731900 -0.665700 -0.145600 +vn -0.320200 -0.817200 0.479200 +vn -0.543200 -0.209500 0.813000 +vn 0.731900 -0.665700 0.145600 +vn 0.980800 0.000000 0.195100 +vn -0.546400 0.753700 -0.365100 +vn -0.365100 0.753700 -0.546400 +vn 0.112400 -0.817200 -0.565300 +vn -0.831500 0.000000 0.555600 +vn -0.546400 0.753700 0.365100 +vn -0.365100 0.753700 0.546400 +vn 0.980800 0.000000 -0.195100 +vn -0.644500 0.753700 0.128200 +vn -0.620400 -0.665700 0.414600 +vn -0.479200 -0.817200 0.320200 +vn -0.644500 0.753700 -0.128200 +vn -0.959000 -0.209500 -0.190800 +vn -0.959000 -0.209500 0.190800 +vn 0.128200 0.753700 -0.644500 +vn 0.365100 0.753700 -0.546400 +vn -0.128200 0.753700 0.644500 +vn 0.128200 0.753700 0.644500 +vn 0.365100 0.753700 0.546400 +vn 0.644500 0.753700 0.128200 +vn -0.128200 0.753700 -0.644500 +vn -0.190800 -0.209500 -0.959000 +vn 0.190800 -0.209500 -0.959000 +vn 0.320200 -0.817200 0.479200 +vn 0.546400 0.753700 0.365100 +vn -0.813000 -0.209500 0.543200 +vn 0.959000 -0.209500 -0.190800 +vn 0.543200 -0.209500 0.813000 +g Cylinder.001_Cylinder.001_None_Cylinder.001_Cylinder.001_None_None_flowers_potted.png +s 1 +f 96/5/3 53/6/4 52/7/5 95/8/6 +f 44/9/7 54/10/7 42/11/7 +f 105/12/8 38/13/9 39/14/10 106/15/11 +f 10/16/12 11/17/13 12/18/14 9/19/15 +f 21/20/16 22/21/17 20/22/18 19/23/19 +f 23/24/20 24/25/21 22/21/17 21/20/16 +f 13/26/22 14/27/23 12/18/14 11/17/13 +f 98/28/24 99/29/25 49/30/26 51/31/27 +f 33/32/28 34/33/29 32/34/30 31/35/31 +f 35/36/32 36/37/33 34/33/29 33/32/28 +f 99/38/25 98/39/24 24/40/21 26/41/34 +f 27/42/35 28/43/36 26/44/34 25/45/37 +f 92/46/38 93/47/39 54/48/40 44/49/41 +f 40/50/42 39/51/10 38/52/9 37/53/43 +f 103/54/44 102/55/45 32/56/30 34/57/29 +f 104/58/46 36/59/33 38/13/9 105/12/8 +f 90/60/7 44/9/7 42/11/7 +f 104/61/46 105/62/8 50/63/47 48/64/48 +f 54/10/7 41/65/7 42/11/7 +f 66/66/49 31/67/50 29/68/50 68/69/51 +f 94/70/52 93/71/39 14/72/23 16/73/53 +f 100/74/54 47/75/55 49/30/26 99/29/25 +f 19/23/19 20/22/18 18/76/56 17/77/57 +f 89/78/50 57/79/50 73/80/50 +f 94/70/52 16/73/53 18/81/56 95/82/6 +f 25/45/37 26/44/34 24/25/21 23/24/20 +f 95/82/6 18/81/56 20/83/18 96/84/3 +f 21/85/50 19/86/50 72/87/58 84/88/59 +f 63/89/50 89/78/50 73/80/50 +f 9/90/15 91/91/60 106/15/11 39/14/10 +f 57/92/35 61/93/61 62/94/62 58/95/63 +f 67/96/22 65/97/64 66/98/49 68/99/51 +f 100/100/54 99/38/25 26/41/34 28/101/36 +f 61/93/61 69/102/31 70/103/65 62/94/62 +f 15/104/50 13/105/50 62/106/62 70/107/65 +f 30/108/66 32/56/30 102/55/45 101/109/67 +f 59/110/28 60/111/68 70/103/65 69/102/31 +f 102/112/45 103/113/44 46/114/69 55/115/70 +f 41/65/7 52/116/7 42/11/7 +f 27/117/50 25/118/50 82/119/71 88/120/72 +f 89/78/50 65/121/50 67/122/50 +f 89/78/50 83/123/50 71/124/50 +f 11/125/50 58/126/63 62/106/62 13/105/50 +f 59/110/28 71/127/32 72/128/58 60/111/68 +f 63/129/20 73/130/37 74/131/73 64/132/74 +f 37/133/50 86/134/75 64/135/74 40/136/50 +f 52/116/7 53/137/7 42/11/7 +f 79/138/57 80/139/76 66/98/49 65/97/64 +f 10/140/50 74/141/73 58/126/63 11/125/50 +f 78/142/77 23/143/50 21/85/50 84/88/59 +f 89/78/50 71/124/50 59/144/50 +f 105/62/8 106/145/11 56/146/78 50/63/47 +f 49/147/7 47/148/7 42/11/7 +f 29/149/61 30/150/66 28/43/36 27/42/35 +f 56/146/78 106/145/11 91/151/60 90/152/79 +f 81/153/12 87/154/13 88/155/72 82/156/71 +f 9/19/15 39/51/10 40/50/42 10/16/12 +f 85/157/16 63/129/20 64/132/74 86/158/75 +f 20/83/18 22/159/17 97/160/80 96/84/3 +f 92/46/38 44/49/41 90/152/79 91/151/60 +f 33/161/50 80/162/76 76/163/81 35/164/50 +f 89/78/50 75/165/50 79/166/50 +f 89/78/50 67/122/50 87/167/50 +f 89/78/50 59/144/50 69/168/50 +f 50/169/7 56/170/7 42/11/7 +f 83/171/43 77/172/42 78/173/77 84/174/59 +f 77/172/42 81/153/12 82/156/71 78/173/77 +f 98/39/24 97/160/80 22/159/17 24/40/21 +f 55/175/7 46/176/7 42/11/7 +f 60/177/68 17/178/50 15/104/50 70/107/65 +f 45/179/7 42/11/7 53/137/7 +f 87/154/13 67/96/22 68/99/51 88/155/72 +f 28/101/36 30/108/66 101/109/67 100/100/54 +f 72/87/58 19/86/50 17/178/50 60/177/68 +f 40/136/50 64/135/74 74/141/73 10/140/50 +f 89/78/50 87/167/50 81/180/50 +f 51/181/7 49/147/7 42/11/7 +f 71/127/32 83/171/43 84/174/59 72/128/58 +f 31/35/31 32/34/30 30/150/66 29/149/61 +f 93/71/39 92/182/38 12/183/14 14/72/23 +f 92/182/38 91/91/60 9/90/15 12/183/14 +f 37/53/43 38/52/9 36/37/33 35/36/32 +f 17/77/57 18/76/56 16/184/53 15/185/64 +f 89/78/50 63/89/50 85/186/50 +f 90/60/7 42/11/7 56/170/7 +f 101/187/67 102/112/45 55/115/70 43/188/82 +f 93/47/39 94/189/52 41/190/83 54/48/40 +f 15/185/64 16/184/53 14/27/23 13/26/22 +f 89/78/50 79/166/50 65/121/50 +f 94/189/52 95/8/6 52/7/5 41/190/83 +f 75/191/19 76/192/81 80/139/76 79/138/57 +f 97/193/80 98/28/24 51/31/27 45/194/84 +f 104/58/46 103/54/44 34/57/29 36/59/33 +f 89/78/50 81/180/50 77/195/50 +f 85/157/16 86/158/75 76/192/81 75/191/19 +f 43/196/7 55/175/7 42/11/7 +f 104/61/46 48/64/48 46/114/69 103/113/44 +f 89/78/50 85/186/50 75/165/50 +f 47/148/7 43/196/7 42/11/7 +f 76/163/81 86/134/75 37/133/50 35/164/50 +f 100/74/54 101/187/67 43/188/82 47/75/55 +f 50/169/7 42/11/7 48/197/7 +f 89/78/50 77/195/50 83/123/50 +f 96/5/3 97/193/80 45/194/84 53/6/4 +f 89/78/50 69/168/50 61/198/50 +f 25/118/50 23/143/50 78/142/77 82/119/71 +f 48/197/7 42/11/7 46/176/7 +f 88/120/72 68/69/51 29/68/50 27/117/50 +f 66/66/49 80/162/76 33/161/50 31/67/50 +f 89/78/50 61/198/50 57/79/50 +f 51/181/7 42/11/7 45/179/7 +f 73/130/37 57/92/35 58/95/63 74/131/73 diff --git a/mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj b/mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj new file mode 100644 index 0000000..35beb8d --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/models/flowers_sunflower.obj @@ -0,0 +1,73 @@ +# Blender v2.70 (sub 0) OBJ File: 'sunflower.blend' +# www.blender.org +mtllib sunflower_sunflower.mtl +o Cube +v -0.015625 -0.500000 0.028125 +v -0.015625 -0.500000 -0.028125 +v 0.028125 -0.500000 -0.028125 +v 0.028125 -0.500000 0.028125 +v -0.015625 0.790890 0.028125 +v -0.015625 0.689140 -0.028125 +v 0.028125 0.689140 -0.028125 +v 0.028125 0.790890 0.028125 +v 0.250000 0.533494 -0.125000 +v -0.250000 0.533494 -0.125000 +v 0.250000 0.966506 0.125000 +v -0.250000 0.966506 0.125000 +v 0.267063 0.373606 -0.088749 +v 0.044375 0.303464 -0.141576 +v 0.239202 0.473737 0.108253 +v -0.008452 0.378817 0.108253 +v 0.017721 0.016639 -0.112053 +v -0.231280 0.110242 -0.115181 +v -0.030356 -0.036246 0.146223 +v -0.252831 0.028885 0.088910 +v 0.062500 0.641747 -0.057917 +v -0.106953 0.097386 -0.113617 +v -0.006318 -0.053008 0.024707 +v 0.118968 0.360674 0.006909 +v 0.116101 0.452031 0.108253 +v 0.017962 0.298392 -0.019504 +v 0.145794 0.358736 -0.115163 +v 0.240237 0.375544 0.033323 +v -0.224509 0.021356 -0.032606 +v -0.131273 0.023638 0.117567 +v -0.102951 0.016109 -0.003950 +vt 0.750000 0.875000 +vt 0.625000 0.875000 +vt 0.625000 0.750000 +vt 0.750000 0.750000 +vt 0.750000 1.000000 +vt 0.625000 1.000000 +vt 0.625000 0.500000 +vt 0.500000 0.500000 +vt 0.500000 1.000000 +vt 0.000100 0.500100 +vt 0.499900 0.500100 +vt 0.499900 0.999900 +vt 0.000100 0.999900 +vt 0.250000 0.250000 +vt 0.500000 0.250000 +vt 0.250000 0.500000 +vt 0.000000 0.250000 +vt 0.000000 0.000000 +vt 0.250000 0.000000 +vt 0.000000 0.500000 +vt 0.500000 0.000000 +usemtl Sunflower +s off +f 1/1 2/2 3/3 4/4 +f 5/5 8/6 7/2 6/1 +f 1/7 5/8 6/9 2/6 +f 2/7 6/6 7/9 3/8 +f 3/7 7/8 8/9 4/6 +f 5/7 1/8 4/9 8/6 +f 9/10 10/11 12/12 11/13 +f 24/14 26/15 16/8 25/16 +f 31/14 29/17 20/18 30/19 +f 17/8 22/16 31/14 23/15 +f 22/16 18/20 29/17 31/14 +f 27/19 14/21 26/15 24/14 +f 13/18 27/19 24/14 28/17 +f 23/15 31/14 30/19 19/21 +f 28/17 24/14 25/16 15/20 diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_flowerpot.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_flowerpot.png new file mode 100644 index 0000000..acd7c8d Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_flowerpot.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted.png new file mode 100644 index 0000000..6505f05 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_bonsai.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_bonsai.png new file mode 100644 index 0000000..f2a8c6c Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_bonsai.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_cactus.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_cactus.png new file mode 100644 index 0000000..725c630 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_cactus.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_dandelion_white.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_dandelion_white.png new file mode 100644 index 0000000..0b0a823 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_dandelion_white.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_dandelion_yellow.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_dandelion_yellow.png new file mode 100644 index 0000000..ec11c1c Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_dandelion_yellow.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_geranium.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_geranium.png new file mode 100644 index 0000000..88de1d7 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_geranium.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_rose.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_rose.png new file mode 100644 index 0000000..e3b841d Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_rose.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_tulip.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_tulip.png new file mode 100644 index 0000000..471fcd3 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_tulip.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_viola.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_viola.png new file mode 100644 index 0000000..7971c76 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_potted_viola.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed.png new file mode 100644 index 0000000..b5bd99c Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweedLight.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweedLight.png new file mode 100644 index 0000000..7595ebc Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweedLight.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_2.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_2.png new file mode 100644 index 0000000..0b24730 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_2.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_3.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_3.png new file mode 100644 index 0000000..d9b7f43 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_3.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_4.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_4.png new file mode 100644 index 0000000..887c183 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_seaweed_4.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower.png new file mode 100644 index 0000000..fb95cb4 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower_inv.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower_inv.png new file mode 100644 index 0000000..c36ed01 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_sunflower_inv.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily.png new file mode 100644 index 0000000..7b58bb2 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_22.5.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_22.5.png new file mode 100644 index 0000000..73647ac Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_22.5.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_45.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_45.png new file mode 100644 index 0000000..7ca683e Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_45.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_67.5.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_67.5.png new file mode 100644 index 0000000..234da60 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_67.5.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_1.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_1.png new file mode 100644 index 0000000..a2d88cd Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_1.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_2.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_2.png new file mode 100644 index 0000000..7d2ba86 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_2.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_3.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_3.png new file mode 100644 index 0000000..bfcab90 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_3.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_4.png b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_4.png new file mode 100644 index 0000000..8119ea7 Binary files /dev/null and b/mods/plantlife_modpack/flowers_plus/textures/flowers_waterlily_small_4.png differ diff --git a/mods/plantlife_modpack/flowers_plus/textures/tr.txt b/mods/plantlife_modpack/flowers_plus/textures/tr.txt new file mode 100644 index 0000000..9e6372e --- /dev/null +++ b/mods/plantlife_modpack/flowers_plus/textures/tr.txt @@ -0,0 +1,14 @@ +# Turkish translation +# mahmutelmas06@hotmail.com + +Waterlily = Nilüfer +Seaweed = Deniz yosunu +Potted Rose = Saksı gülü +Potted Tulip = Saksı lalesi +Potted Yellow Dandelion = Sarı hindiba +Potted White Dandelion = Beyaz hindiba +Potted Blue Geranium = Mavi hindiba +Potted Viola = Saksı Menekşesi +Flower Pot = Saksı + +[Flowers] Loaded. = [Flowers] yüklendi. diff --git a/mods/plantlife_modpack/junglegrass/init.lua b/mods/plantlife_modpack/junglegrass/init.lua new file mode 100644 index 0000000..a394d93 --- /dev/null +++ b/mods/plantlife_modpack/junglegrass/init.lua @@ -0,0 +1,3 @@ +minetest.register_alias("junglegrass:shortest", "air") +minetest.register_alias("junglegrass:short", "air") +minetest.register_alias("junglegrass:medium", "air") diff --git a/mods/plantlife_modpack/modpack.txt b/mods/plantlife_modpack/modpack.txt new file mode 100644 index 0000000..e69de29 diff --git a/mods/plantlife_modpack/molehills/depends.txt b/mods/plantlife_modpack/molehills/depends.txt new file mode 100644 index 0000000..bde0bdf --- /dev/null +++ b/mods/plantlife_modpack/molehills/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/mods/plantlife_modpack/molehills/init.lua b/mods/plantlife_modpack/molehills/init.lua new file mode 100644 index 0000000..28e157a --- /dev/null +++ b/mods/plantlife_modpack/molehills/init.lua @@ -0,0 +1,110 @@ +----------------------------------------------------------------------------------------------- +local title = "Mole Hills" +local version = "0.0.3" +local mname = "molehills" +----------------------------------------------------------------------------------------------- +-- Idea by Sokomine +-- Code & textures by Mossmanikin + +abstract_molehills = {} + +dofile(minetest.get_modpath("molehills").."/molehills_settings.txt") + +----------------------------------------------------------------------------------------------- +-- NoDe +----------------------------------------------------------------------------------------------- +minetest.register_node("molehills:molehill",{ + drawtype = "nodebox", + description = "Mole Hill", + inventory_image = "molehills_side.png", + tiles = { + "molehills_dirt.png",--"molehill_top.png", + "molehills_dirt.png",--"molehill_top.png", + "molehills_dirt.png"--"molehill_side.png" + }, + paramtype = "light", + node_box = { + type = "fixed", + fixed = { +-- { left, bottom, front, right, top, back} + {-2/16, -3/16, -1/16, 2/16, -2/16, 1/16}, + {-1/16, -3/16, -2/16, 1/16, -2/16, 2/16}, +-- { left, bottom, front, right, top, back} + {-4/16, -4/16, -2/16, 4/16, -3/16, 2/16}, + {-2/16, -4/16, -4/16, 2/16, -3/16, 4/16}, + {-3/16, -4/16, -3/16, 3/16, -3/16, 3/16}, +-- { left, bottom, front, right, top, back} + {-5/16, -5/16, -2/16, 5/16, -4/16, 2/16}, + {-2/16, -5/16, -5/16, 2/16, -4/16, 5/16}, + {-4/16, -5/16, -4/16, 4/16, -4/16, 4/16}, +-- { left, bottom, front, right, top, back} + {-6/16, -6/16, -2/16, 6/16, -5/16, 2/16}, + {-2/16, -6/16, -6/16, 2/16, -5/16, 6/16}, + {-5/16, -6/16, -4/16, 5/16, -5/16, 4/16}, + {-4/16, -6/16, -5/16, 4/16, -5/16, 5/16}, +-- { left, bottom, front, right, top, back} + {-7/16, -7/16, -3/16, 7/16, -6/16, 3/16}, + {-3/16, -7/16, -7/16, 3/16, -6/16, 7/16}, + {-6/16, -7/16, -4/16, 6/16, -6/16, 4/16}, + {-4/16, -7/16, -6/16, 4/16, -6/16, 6/16}, + {-5/16, -7/16, -5/16, 5/16, -6/16, 5/16}, +-- { left, bottom, front, right, top, back} +--[[b]] {-1/2 , -1/2 , -3/16, 1/2 , -7/16, 3/16}, -- left to right +--[[o]] {-3/16, -1/2 , -1/2 , 3/16, -7/16, 1/2 }, -- front to back +--[[t]] {-7/16, -1/2 , -5/16, 7/16, -7/16, 5/16}, +--[[t]] {-5/16, -1/2 , -7/16, 5/16, -7/16, 7/16}, +--[[m]] {-6/16, -1/2 , -6/16, 6/16, -7/16, 6/16}, -- mid + }, + }, + selection_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 2/16, 1/2}, + }, + groups = {crumbly=3}, + sounds = default.node_sound_dirt_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- CRaFTiNG +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- molehills --> dirt + output = "default:dirt", + recipe = { + {"molehills:molehill","molehills:molehill"}, + {"molehills:molehill","molehills:molehill"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- GeNeRaTiNG +----------------------------------------------------------------------------------------------- +abstract_molehills.place_molehill = function(pos) + local right_here = {x=pos.x , y=pos.y+1, z=pos.z } + if minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }).name ~= "air" + and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }).name ~= "air" + and minetest.get_node({x=pos.x , y=pos.y, z=pos.z+1}).name ~= "air" + and minetest.get_node({x=pos.x , y=pos.y, z=pos.z-1}).name ~= "air" + and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z+1}).name ~= "air" + and minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z-1}).name ~= "air" + and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z+1}).name ~= "air" + and minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z-1}).name ~= "air" then + minetest.set_node(right_here, {name="molehills:molehill"}) + end +end + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Molehills_Max_Count, + rarity = Molehills_Rarity, + min_elevation = 1, + max_elevation = 40, + avoid_nodes = {"group:tree","group:liquid","group:stone","group:falling_node"--[[,"air"]]}, + avoid_radius = 4, + plantlife_limit = -0.3, + }, + abstract_molehills.place_molehill +) + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- diff --git a/mods/plantlife_modpack/molehills/molehills_settings.txt b/mods/plantlife_modpack/molehills/molehills_settings.txt new file mode 100644 index 0000000..2079574 --- /dev/null +++ b/mods/plantlife_modpack/molehills/molehills_settings.txt @@ -0,0 +1,6 @@ +-- Settings for generation of stuff (at map-generation time) + +Molehills_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + +Molehills_Rarity = 87 -- larger values make molehills more rare (100 means chance of 0 %) + diff --git a/mods/plantlife_modpack/molehills/textures/molehills_dirt.png b/mods/plantlife_modpack/molehills/textures/molehills_dirt.png new file mode 100644 index 0000000..79ffa85 Binary files /dev/null and b/mods/plantlife_modpack/molehills/textures/molehills_dirt.png differ diff --git a/mods/plantlife_modpack/molehills/textures/molehills_side.png b/mods/plantlife_modpack/molehills/textures/molehills_side.png new file mode 100644 index 0000000..554bbec Binary files /dev/null and b/mods/plantlife_modpack/molehills/textures/molehills_side.png differ diff --git a/mods/plantlife_modpack/molehills/textures/old & unused/molehill_side.png b/mods/plantlife_modpack/molehills/textures/old & unused/molehill_side.png new file mode 100644 index 0000000..5f0f976 Binary files /dev/null and b/mods/plantlife_modpack/molehills/textures/old & unused/molehill_side.png differ diff --git a/mods/plantlife_modpack/molehills/textures/old & unused/molehill_top.png b/mods/plantlife_modpack/molehills/textures/old & unused/molehill_top.png new file mode 100644 index 0000000..55cc541 Binary files /dev/null and b/mods/plantlife_modpack/molehills/textures/old & unused/molehill_top.png differ diff --git a/mods/plantlife_modpack/mushroom/compat.lua b/mods/plantlife_modpack/mushroom/compat.lua new file mode 100644 index 0000000..c7a1009 --- /dev/null +++ b/mods/plantlife_modpack/mushroom/compat.lua @@ -0,0 +1,41 @@ + +-- Redefine grass and dirt nodes + +minetest.override_item("default:dirt", { + drop = { + max_items = 2, + items = { + { + items = {"mushroom:spore1"}, + rarity = 40, + }, + { + items = {"mushroom:spore2"}, + rarity = 40, + }, + { + items = {"default:dirt"}, + } + } + } +}) + +minetest.override_item("default:dirt_with_grass", { + drop = { + max_items = 2, + items = { + { + items = {"mushroom:spore1"}, + rarity = 40, + }, + { + items = {"mushroom:spore2"}, + rarity = 40, + }, + { + items = {"default:dirt"}, + } + } + } +}) + diff --git a/mods/plantlife_modpack/mushroom/crafting.lua b/mods/plantlife_modpack/mushroom/crafting.lua new file mode 100644 index 0000000..b05762b --- /dev/null +++ b/mods/plantlife_modpack/mushroom/crafting.lua @@ -0,0 +1,91 @@ +-- craft items + +minetest.register_craftitem("mushroom:spore1",{ + description = "Unidentified Mushroom Spore", + inventory_image = "mushroom_spore.png", + wield_image = "mushroom_spore.png", +}) + +minetest.register_craftitem("mushroom:spore2",{ + description = "Unidentified Mushroom Spore", + inventory_image = "mushroom_spore.png", + wield_image = "mushroom_spore.png", +}) + +minetest.register_craftitem("mushroom:identifier",{ + description = "Mushroom Spore Identifier/Spore Extractor", + inventory_image = "mushroom_identifier.png", + wield_image = "mushroom_identifier.png", +}) + +minetest.register_craftitem("mushroom:brown_essence",{ + description = "Healthy Brown Mushroom Essence", + inventory_image = "mushroom_essence.png", + wield_image = "mushroom_essence.png", + on_use = minetest.item_eat(10), +}) + +minetest.register_craftitem("mushroom:poison",{ + description = "Red Mushroom Poison", + inventory_image = "mushroom_poison.png", + wield_image = "mushroom_poison.png", + on_use = minetest.item_eat(-10), +}) + +-- recipes + +minetest.register_craft( { + output = "mushroom:identifier", + recipe = { + { "", "default:torch", "" }, + { "default:steel_ingot", "default:mese_crystal_fragment", "default:steel_ingot" }, + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "mushroom:brown_essence", + recipe = { "mushroom:brown" , "vessels:glass_bottle" }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "mushroom:poison", + recipe = { "mushroom:red" , "vessels:glass_bottle" }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "mushroom:spore_brown", + recipe = { "mushroom:identifier" , "mushroom:spore1" }, + replacements = { + { 'mushroom:identifier', 'mushroom:identifier' } + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "mushroom:spore_red", + recipe = { "mushroom:identifier" , "mushroom:spore2" }, + replacements = { + { 'mushroom:identifier', 'mushroom:identifier' } + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "mushroom:spore_red 2", + recipe = { "mushroom:identifier" , "mushroom:red" }, + replacements = { + { 'mushroom:identifier', 'mushroom:identifier' } + } +}) + +minetest.register_craft( { + type = "shapeless", + output = "mushroom:spore_brown 2", + recipe = { "mushroom:identifier" , "mushroom:brown" }, + replacements = { + { 'mushroom:identifier', 'mushroom:identifier' } + } +}) diff --git a/mods/plantlife_modpack/mushroom/depends.txt b/mods/plantlife_modpack/mushroom/depends.txt new file mode 100644 index 0000000..0a3c3f8 --- /dev/null +++ b/mods/plantlife_modpack/mushroom/depends.txt @@ -0,0 +1,3 @@ +default +vessels? +woodsoils? diff --git a/mods/plantlife_modpack/mushroom/init.lua b/mods/plantlife_modpack/mushroom/init.lua new file mode 100644 index 0000000..8c5b9ee --- /dev/null +++ b/mods/plantlife_modpack/mushroom/init.lua @@ -0,0 +1,261 @@ + +-- Mushroom mod by DanDuncombe and VanessaE +-- +-- License: CC-By-SA for texures derived from Minetest defaults, +-- WTFPL for all code and everything else. + +mushroom = {} + +minetest.register_node("mushroom:brown",{ + description = "Brown Mushroom", + drawtype = "mesh", + mesh = "plantlife_mushroom.obj", + tiles = {"mushroom_brown_3d.png"}, + sunlight_propagates = true, + inventory_image = "mushroom_brown_inv.png", + groups = {oddly_breakable_by_hand=3,attached_node=1}, + paramtype = "light", + walkable = false, + on_use = minetest.item_eat(5), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + drop = "mushroom:brown", +}) + +minetest.register_node("mushroom:red",{ + description = "Red Mushroom", + drawtype = "mesh", + mesh = "plantlife_mushroom.obj", + tiles = {"mushroom_red_3d.png"}, + sunlight_propagates = true, + inventory_image = "mushroom_red_inv.png", + groups = {oddly_breakable_by_hand=3,attached_node=1}, + paramtype = "light", + walkable = false, + on_use = minetest.item_eat(-5), + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + drop = "mushroom:red", +}) + +minetest.register_node("mushroom:spore_brown",{ + description = "Brown Mushroom Spore", + drawtype = "raillike", + paramtype = "light", + tiles = {"mushroom_spore_brown.png"}, + sunlight_propagates = true, + walkable = false, + groups = {oddly_breakable_by_hand=3,attached_node=1}, + inventory_image = "mushroom_spore_brown.png", + wield_image = "mushroom_spore_brown.png", + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + }, +}) + +minetest.register_node("mushroom:spore_red",{ + description = "Red Mushroom Spore", + drawtype = "raillike", + paramtype = "light", + tiles = {"mushroom_spore_red.png"}, + sunlight_propagates = true, + walkable = false, + groups = {oddly_breakable_by_hand=3,attached_node=1}, + inventory_image = "mushroom_spore_red.png", + wield_image = "mushroom_spore_red.png", + selection_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, -0.4, 0.5} + }, +}) + +--Natural Mushrooms + +minetest.register_node("mushroom:brown_natural",{ + description = "Brown Mushroom (Naturally Spawned)", + drawtype = "mesh", + mesh = "plantlife_mushroom.obj", + tiles = {"mushroom_brown_3d.png"}, + sunlight_propagates = true, + inventory_image = "mushroom_brown_inv.png", + groups = {oddly_breakable_by_hand=3, not_in_creative_inventory=1}, + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + drop = "mushroom:brown", +}) + +minetest.register_node("mushroom:red_natural",{ + description = "Red Mushroom (Naturally Spawned)", + drawtype = "mesh", + mesh = "plantlife_mushroom.obj", + tiles = {"mushroom_red_3d.png"}, + sunlight_propagates = true, + inventory_image = "mushroom_red_inv.png", + groups = {oddly_breakable_by_hand=3, not_in_creative_inventory=1}, + paramtype = "light", + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0, 0.3} + }, + drop = "mushroom:red", +}) + +-- Spore Growing ABMs + +minetest.register_abm({ + nodenames = {"mushroom:spore_brown"}, + neighbors = {"air"}, + interval = 120, + chance = 4, + action = function(pos, node) + local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) + if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_")) + and minetest.get_node_light(pos, nil) < 8 then + minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:brown"}) + end + end +}) + +minetest.register_abm({ + nodenames = {"mushroom:spore_red"}, + neighbors = {"air"}, + interval = 120, + chance = 4, + action = function(pos, node) + local soil = minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}) + if (soil.name == "farming:soil_wet" or string.find(soil.name, "homedecor:flower_pot_")) + and minetest.get_node_light(pos, nil) < 8 then + minetest.set_node({x=pos.x,y=pos.y,z=pos.z}, {name="mushroom:red"}) + end + end +}) + +-- list of trees that mushrooms can grow next to + +local trees_list = { + "default:tree", + "default:jungletree", + "moretrees:apple_tree_trunk", + "moretrees:beech_trunk", + "moretrees:birch_trunk", + "moretrees:fir_trunk", + "moretrees:oak_trunk", + "moretrees:pine_trunk", + "moretrees:rubber_tree_trunk", + "moretrees:rubber_tree_trunk_empty", + "moretrees:sequoia_trunk", + "moretrees:spruce_trunk", + "moretrees:willow_trunk", +} + +-- Natural Spawning ABM + +minetest.register_abm({ + nodenames = { + "default:dirt_with_grass", + "default:dirt", + "woodsoils:dirt_with_leaves_1", + "woodsoils:dirt_with_leaves_2", + "woodsoils:grass_with_leaves_1", + "woodsoils:grass_with_leaves_2", + "farming:soil_wet" + }, + neighbors = {"air"}, + interval = 300, + chance = 100, + action = function(pos, node) + local top_pos = {x=pos.x, y=pos.y+1, z=pos.z} + if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 + and minetest.find_node_near(pos, 1, trees_list) + and minetest.find_node_near(pos, 3, "default:water_source") then + if math.random(0, 1) == 0 then + minetest.set_node(top_pos, {name="mushroom:brown_natural"}) + else + minetest.set_node(top_pos, {name="mushroom:red_natural"}) + end + end + end +}) + +minetest.register_abm({ + nodenames = {"default:stone"}, + neighbors = {"air"}, + interval = 300, + chance = 100, + action = function(pos, node) + local top_pos = {x=pos.x, y=pos.y+1, z=pos.z} + if minetest.get_node(top_pos).name == "air" and minetest.get_node_light(top_pos, nil) < 8 + and minetest.find_node_near(pos, 1, {"default:water_source"}) then + if math.random(0,1) == 0 then + minetest.set_node(top_pos, {name="mushroom:brown_natural"}) + else + minetest.set_node(top_pos, {name="mushroom:red_natural"}) + end + end + end +}) + +-- Spreading ABM + +minetest.register_abm({ + nodenames = { + "mushroom:brown_natural", + "mushroom:red_natural" + }, + neighbors = {"air"}, + interval = 120, + chance = 100, + action = function(pos, node) + local soil_pos = {x=pos.x, y=pos.y-1, z=pos.z} + local soil = minetest.get_node(soil_pos) + local woodsoil_str = "woodsoils:.+_with_leaves_?" + if minetest.get_node_light(pos, nil) < 8 + and minetest.find_node_near(pos, 1, trees_list) then + local spread_x = math.random(-1, 1) + local spread_z = math.random(-1, 1) + local newpos = {x=pos.x+spread_x, y=pos.y, z=pos.z+spread_z} + local newsoil = minetest.get_node({x=newpos.x, y=newpos.y-1, z=newpos.z}) + if minetest.get_node(newpos).name == "air" + and (newsoil.name == "default:dirt_with_grass" + or newsoil.name == "default:dirt" + or string.match(newsoil.name, woodsoil_str)) + and minetest.find_node_near(newpos, 3, "default:water_source") then + minetest.set_node(newpos, {name=node.name}) + end + end + end +}) + +-- Dying ABM + +minetest.register_abm({ + nodenames = { + "mushroom:brown", + "mushroom:red", + }, + neighbors = {"air"}, + interval = 120, + chance = 50, + action = function(pos, node) + local soil = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}) + if soil.name ~= "farming:soil_wet" + and not string.find(soil.name, "homedecor:flower_pot_") then + minetest.remove_node(pos) + end + end +}) + +dofile(minetest.get_modpath("mushroom").."/crafting.lua") +dofile(minetest.get_modpath("mushroom").."/compat.lua") + +print("[Mushrooms] loaded.") diff --git a/mods/plantlife_modpack/mushroom/models/plantlife_mushroom.obj b/mods/plantlife_modpack/mushroom/models/plantlife_mushroom.obj new file mode 100644 index 0000000..bce1ed6 --- /dev/null +++ b/mods/plantlife_modpack/mushroom/models/plantlife_mushroom.obj @@ -0,0 +1,329 @@ +# Blender v2.73 (sub 0) OBJ File: 'plantlife_mushroom.blend' +# www.blender.org +o Cylinder +v 0.261489 -0.177877 -0.000000 +v 0.165972 -0.203714 -0.000000 +v 0.210761 -0.224729 -0.000000 +v 0.258520 -0.211811 -0.000000 +v 0.185335 -0.171215 -0.184553 +v 0.116925 -0.199423 -0.118862 +v 0.148161 -0.219252 -0.151707 +v 0.182366 -0.205148 -0.184553 +v 0.001484 -0.155130 -0.260997 +v -0.001484 -0.189063 -0.168096 +v -0.002969 -0.206030 -0.214547 +v -0.001484 -0.189063 -0.260997 +v -0.182366 -0.139045 -0.184553 +v -0.119894 -0.178704 -0.118862 +v -0.154099 -0.192808 -0.151707 +v -0.185335 -0.172979 -0.184553 +v -0.258520 -0.132382 -0.000000 +v -0.168941 -0.174413 -0.000000 +v -0.216699 -0.187331 -0.000000 +v -0.261489 -0.166316 -0.000000 +v -0.182366 -0.139045 0.184553 +v -0.119894 -0.178704 0.118862 +v -0.154099 -0.192808 0.151707 +v -0.185335 -0.172979 0.184553 +v 0.001484 -0.155130 0.260997 +v -0.001484 -0.189063 0.168096 +v -0.002969 -0.206030 0.214547 +v -0.001484 -0.189063 0.260997 +v 0.185335 -0.171215 0.184553 +v 0.116925 -0.199423 0.118862 +v 0.148161 -0.219252 0.151708 +v 0.182366 -0.205148 0.184553 +v 0.059333 -0.075538 0.000000 +v 0.044915 -0.074277 -0.034942 +v 0.010106 -0.071232 -0.049416 +v -0.024704 -0.068186 -0.034942 +v -0.039122 -0.066925 0.000000 +v -0.024704 -0.068186 0.034942 +v 0.010106 -0.071232 0.049416 +v 0.044915 -0.074277 0.034942 +v 0.004580 -0.119744 -0.206430 +v 0.149993 -0.132466 -0.145968 +v 0.004580 -0.119744 0.206430 +v -0.140833 -0.107022 0.145968 +v 0.210225 -0.137736 -0.000000 +v 0.149993 -0.132466 0.145968 +v -0.201064 -0.101752 -0.000000 +v -0.140833 -0.107022 -0.145968 +v 0.033054 -0.500000 -0.079800 +v 0.025067 -0.177627 -0.060518 +v 0.079800 -0.500000 -0.033054 +v 0.060518 -0.177627 -0.025067 +v 0.079800 -0.500000 0.033054 +v 0.060518 -0.177627 0.025067 +v 0.033054 -0.500000 0.079800 +v 0.025067 -0.177627 0.060518 +v -0.033054 -0.500000 0.079800 +v -0.025067 -0.177627 0.060518 +v -0.079800 -0.500000 0.033054 +v -0.060518 -0.177627 0.025067 +v -0.079800 -0.500000 -0.033054 +v -0.060518 -0.177627 -0.025067 +v -0.033054 -0.500000 -0.079800 +v -0.025067 -0.177627 -0.060518 +v 0.014323 -0.253674 -0.065067 +v 0.012105 -0.382623 -0.072780 +v 0.052438 -0.253674 -0.026952 +v 0.054739 -0.382623 -0.030146 +v 0.052438 -0.253674 0.026952 +v 0.054739 -0.382623 0.030146 +v 0.014323 -0.253674 0.065067 +v 0.012105 -0.382623 0.072780 +v -0.039580 -0.253674 0.065067 +v -0.048187 -0.382623 0.072780 +v -0.077695 -0.253674 0.026952 +v -0.090820 -0.382623 0.030146 +v -0.077695 -0.253674 -0.026952 +v -0.090820 -0.382623 -0.030146 +v -0.039580 -0.253674 -0.065067 +v -0.048187 -0.382623 -0.072780 +vt 0.261010 0.917920 +vt 0.235559 0.983636 +vt 0.016350 0.764426 +vt 0.080814 0.737724 +vt 0.545568 0.235207 +vt 0.764778 0.454417 +vt 0.690996 0.484978 +vt 0.517617 0.311599 +vt 0.235559 0.235207 +vt 0.515845 0.302693 +vt 0.261010 0.302693 +vt 0.578125 0.234375 +vt 0.765625 0.234375 +vt 0.765625 0.312500 +vt 0.578125 0.312500 +vt 0.015625 0.234375 +vt 0.203125 0.234375 +vt 0.203125 0.312500 +vt 0.015625 0.312500 +vt 0.390625 0.312500 +vt 0.578125 0.390625 +vt 0.390625 0.390625 +vt 0.016350 0.454417 +vt 0.080814 0.482889 +vt 0.545569 0.983636 +vt 0.515845 0.917920 +vt 0.099043 0.730173 +vt 0.272422 0.903553 +vt 0.290733 0.368408 +vt 0.490395 0.368408 +vt 0.149550 0.709253 +vt 0.149550 0.509591 +vt 0.764778 0.764426 +vt 0.696041 0.737725 +vt 0.696041 0.482889 +vt 0.099043 0.484978 +vt 0.203125 0.390625 +vt 0.765625 0.390625 +vt 0.272422 0.311599 +vt 0.631577 0.509591 +vt 0.390625 0.234375 +vt 0.517617 0.903553 +vt 0.690996 0.730173 +vt 0.432320 0.675133 +vt 0.473823 0.633629 +vt 0.015625 0.390625 +vt 0.490395 0.850435 +vt 0.290733 0.850435 +vt 0.631577 0.709253 +vt 0.373624 0.533431 +vt 0.332121 0.574934 +vt 0.473823 0.574934 +vt 0.432320 0.533431 +vt 0.332121 0.633630 +vt 0.373624 0.675133 +vt 0.935126 0.767633 +vt 0.998032 0.830539 +vt 0.998032 0.919502 +vt 0.935126 0.982408 +vt 0.846164 0.982408 +vt 0.783257 0.919502 +vt 0.783258 0.830539 +vt 0.846164 0.767633 +vt 0.375000 0.187500 +vt 0.375000 0.031250 +vt 0.500000 0.031250 +vt 0.500000 0.187500 +vt 0.625000 0.031250 +vt 0.625000 0.187500 +vt 0.750000 0.031250 +vt 0.750000 0.187500 +vt 0.875000 0.031250 +vt 0.875000 0.187500 +vt 1.000000 0.031250 +vt 1.000000 0.187500 +vt 0.000000 0.031250 +vt 0.125000 0.031250 +vt 0.125000 0.187500 +vt 0.000000 0.187500 +vt 0.250000 0.031250 +vt 0.250000 0.187500 +vt 0.542224 0.015885 +vt 0.601585 0.075246 +vt 0.601585 0.159195 +vt 0.542224 0.218556 +vt 0.458275 0.218556 +vt 0.398914 0.159195 +vt 0.398914 0.075246 +vt 0.458275 0.015885 +vt 0.625000 0.125000 +vt 0.500000 0.125000 +vt 0.750000 0.125000 +vt 0.875000 0.125000 +vt 1.000000 0.125000 +vt 0.125000 0.125000 +vt 0.000000 0.125000 +vt 0.250000 0.125000 +vt 0.375000 0.125000 +vn -0.147000 -0.987300 0.060400 +vn -0.648700 -0.460200 0.606100 +vn -0.898800 -0.438400 0.000000 +vn -0.172000 -0.985100 0.000000 +vn 0.672500 0.376500 0.637100 +vn 0.935400 0.353500 0.000000 +vn 0.529200 0.848500 0.000000 +vn 0.396700 0.860200 0.320400 +vn -0.044900 -0.513100 -0.857100 +vn 0.558900 -0.565900 -0.606100 +vn -0.026600 -0.997800 -0.060400 +vn -0.086800 -0.992500 -0.085500 +vn -0.044900 -0.513100 0.857100 +vn 0.037800 0.432000 0.901100 +vn -0.596900 0.487600 0.637100 +vn -0.648700 -0.460200 -0.606100 +vn -0.596900 0.487600 -0.637100 +vn 0.037800 0.432000 -0.901100 +vn 0.809000 -0.587800 0.000000 +vn 0.672500 0.376500 -0.637100 +vn -0.147000 -0.987300 -0.060400 +vn -0.086800 -0.992500 0.085500 +vn -0.859800 0.510500 0.000000 +vn -0.372100 0.928200 0.000000 +vn -0.240600 0.916500 -0.319400 +vn -0.085100 -0.972600 0.216400 +vn -0.237500 -0.959200 0.153000 +vn 0.130500 -0.991400 0.000000 +vn 0.067400 -0.985900 0.153000 +vn 0.558900 -0.565900 0.606100 +vn -0.026600 -0.997800 0.060400 +vn -0.001700 -1.000000 0.000000 +vn -0.240600 0.916500 0.319400 +vn 0.077500 0.888400 0.452400 +vn -0.300700 -0.953700 0.000000 +vn 0.077500 0.888400 -0.452400 +vn 0.396700 0.860200 -0.320400 +vn 0.086200 0.978700 -0.186300 +vn 0.217800 0.967000 -0.132200 +vn -0.085100 -0.972600 -0.216400 +vn 0.067400 -0.985900 -0.153000 +vn -0.237500 -0.959200 -0.153000 +vn 0.086200 0.978700 0.186300 +vn -0.044600 0.990300 0.131300 +vn 0.272600 0.962100 0.000000 +vn 0.217800 0.967000 0.132200 +vn -0.098600 0.995100 0.000000 +vn -0.044600 0.990300 -0.131300 +vn -0.273500 -0.626100 -0.730200 +vn -0.402500 0.040600 -0.914500 +vn 0.360300 0.084000 -0.929000 +vn 0.335600 -0.581700 -0.740900 +vn 0.369900 0.027700 -0.928600 +vn 0.921100 -0.031200 -0.388000 +vn 0.913800 0.116800 -0.388800 +vn 0.921100 -0.031200 0.388000 +vn 0.913800 0.116800 0.388800 +vn 0.369900 0.027700 0.928600 +vn 0.360300 0.084000 0.929000 +vn -0.391600 0.105700 0.914000 +vn -0.402500 0.040600 0.914500 +vn -0.914200 0.156600 0.373800 +vn -0.927200 0.012400 0.374500 +vn -0.914200 0.156600 -0.373800 +vn -0.927200 0.012400 -0.374500 +vn -0.391600 0.105700 -0.914000 +vn 0.774400 -0.552100 -0.309000 +vn 0.774400 -0.552100 0.309000 +vn 0.335600 -0.581700 0.740900 +vn -0.273500 -0.626100 0.730200 +vn -0.690800 -0.658600 0.298100 +vn -0.690800 -0.658600 -0.298100 +vn 0.416700 -0.004500 -0.909100 +vn 0.925800 -0.089300 -0.367400 +vn 0.925800 -0.089300 0.367400 +vn 0.416700 -0.004500 0.909100 +vn -0.344300 0.121400 0.931000 +vn -0.896600 0.212200 0.388700 +vn -0.896600 0.212200 -0.388700 +vn -0.344300 0.121400 -0.931000 +s 1 +f 23/1/1 24/2/2 20/3/3 19/4/4 +f 29/5/5 1/6/6 45/7/7 46/8/8 +f 12/9/9 8/5/10 7/10/11 11/11/12 +f 24/12/2 28/13/13 25/14/14 21/15/15 +f 12/16/9 16/17/16 13/18/17 9/19/18 +f 4/20/19 8/15/10 5/21/20 1/22/6 +f 16/23/16 12/9/9 11/11/12 15/24/21 +f 28/25/13 24/2/2 23/1/1 27/26/22 +f 13/2/17 17/3/23 47/27/24 48/28/25 +f 10/29/26 11/11/12 7/10/11 6/30/27 +f 18/31/28 19/4/4 15/24/21 14/32/29 +f 4/6/19 32/33/30 31/34/31 3/35/32 +f 17/3/23 21/23/15 44/36/33 47/27/24 +f 32/18/30 4/20/19 1/22/6 29/37/5 +f 8/5/10 4/6/19 3/35/32 7/10/11 +f 8/15/10 12/14/9 9/38/18 5/21/20 +f 25/9/14 29/5/5 46/8/8 43/39/34 +f 6/30/27 7/10/11 3/35/32 2/40/35 +f 16/17/16 20/41/3 17/20/23 13/18/17 +f 31/34/31 32/33/30 28/25/13 27/26/22 +f 5/33/20 9/25/18 41/42/36 42/43/37 +f 41/42/36 35/44/38 34/45/39 42/43/37 +f 15/24/21 11/11/12 10/29/26 14/32/29 +f 20/41/3 24/12/2 21/15/15 17/20/23 +f 1/6/6 5/33/20 42/43/37 45/7/7 +f 19/4/4 20/3/3 16/23/16 15/24/21 +f 28/19/13 32/18/30 29/37/5 25/46/14 +f 26/47/40 27/26/22 23/1/1 22/48/41 +f 21/23/15 25/9/14 43/39/34 44/36/33 +f 9/25/18 13/2/17 48/28/25 41/42/36 +f 23/1/1 19/4/4 18/31/28 22/48/41 +f 2/40/35 3/35/32 31/34/31 30/49/42 +f 43/39/34 39/50/43 38/51/44 44/36/33 +f 45/7/7 33/52/45 40/53/46 46/8/8 +f 42/43/37 34/45/39 33/52/45 45/7/7 +f 46/8/8 40/53/46 39/50/43 43/39/34 +f 44/36/33 38/51/44 37/54/47 47/27/24 +f 47/27/24 37/54/47 36/55/48 48/28/25 +f 48/28/25 36/55/48 35/44/38 41/42/36 +f 35/44/38 36/55/48 37/54/47 38/51/44 39/50/43 40/53/46 33/52/45 34/45/39 +f 6/56/27 2/57/35 30/58/42 26/59/40 22/60/41 18/61/28 14/62/29 10/63/26 +f 63/64/49 80/65/50 66/66/51 49/67/52 +f 65/66/53 67/68/54 68/69/55 66/67/51 +f 67/68/54 69/70/56 70/71/57 68/69/55 +f 69/70/56 71/72/58 72/73/59 70/71/57 +f 71/72/58 73/74/60 74/75/61 72/73/59 +f 73/76/60 75/77/62 76/78/63 74/79/61 +f 75/77/62 77/80/64 78/81/65 76/78/63 +f 77/80/64 79/65/66 80/64/50 78/81/65 +f 49/82/52 51/83/67 53/84/68 55/85/69 57/86/70 59/87/71 61/88/72 63/89/49 +f 50/66/73 52/68/74 67/90/54 65/91/53 +f 52/68/74 54/70/75 69/92/56 67/90/54 +f 66/66/51 68/68/55 51/69/67 49/67/52 +f 54/70/75 56/72/76 71/93/58 69/92/56 +f 68/68/55 70/70/57 53/71/68 51/69/67 +f 56/72/76 58/74/77 73/94/60 71/93/58 +f 70/70/57 72/72/59 55/73/69 53/71/68 +f 58/76/77 60/77/78 75/95/62 73/96/60 +f 72/72/59 74/74/61 57/75/70 55/73/69 +f 60/77/78 62/80/79 77/97/64 75/95/62 +f 74/76/61 76/77/63 59/78/71 57/79/70 +f 62/80/79 64/65/80 79/98/66 77/97/64 +f 76/77/63 78/80/65 61/81/72 59/78/71 +f 31/34/31 27/26/22 26/47/40 30/49/42 +f 78/80/65 80/65/50 63/64/49 61/81/72 +f 79/98/66 64/65/80 50/66/73 65/91/53 +f 79/65/66 65/66/53 66/67/51 80/64/50 diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_brown.png b/mods/plantlife_modpack/mushroom/textures/mushroom_brown.png new file mode 100644 index 0000000..15f8712 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_brown.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_brown_3d.png b/mods/plantlife_modpack/mushroom/textures/mushroom_brown_3d.png new file mode 100644 index 0000000..c36f524 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_brown_3d.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_brown_inv.png b/mods/plantlife_modpack/mushroom/textures/mushroom_brown_inv.png new file mode 100644 index 0000000..c9a7b3c Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_brown_inv.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_essence.png b/mods/plantlife_modpack/mushroom/textures/mushroom_essence.png new file mode 100644 index 0000000..b192a30 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_essence.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_identifier.png b/mods/plantlife_modpack/mushroom/textures/mushroom_identifier.png new file mode 100644 index 0000000..189f054 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_identifier.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_poison.png b/mods/plantlife_modpack/mushroom/textures/mushroom_poison.png new file mode 100644 index 0000000..76337f0 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_poison.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_red.png b/mods/plantlife_modpack/mushroom/textures/mushroom_red.png new file mode 100644 index 0000000..0b83830 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_red.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_red_3d.png b/mods/plantlife_modpack/mushroom/textures/mushroom_red_3d.png new file mode 100644 index 0000000..dc80e32 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_red_3d.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_red_inv.png b/mods/plantlife_modpack/mushroom/textures/mushroom_red_inv.png new file mode 100644 index 0000000..796f867 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_red_inv.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_spore.png b/mods/plantlife_modpack/mushroom/textures/mushroom_spore.png new file mode 100644 index 0000000..3c950d5 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_spore.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_spore_brown.png b/mods/plantlife_modpack/mushroom/textures/mushroom_spore_brown.png new file mode 100644 index 0000000..a0818d2 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_spore_brown.png differ diff --git a/mods/plantlife_modpack/mushroom/textures/mushroom_spore_red.png b/mods/plantlife_modpack/mushroom/textures/mushroom_spore_red.png new file mode 100644 index 0000000..1f1d3a4 Binary files /dev/null and b/mods/plantlife_modpack/mushroom/textures/mushroom_spore_red.png differ diff --git a/mods/plantlife_modpack/nature_classic/blossom.lua b/mods/plantlife_modpack/nature_classic/blossom.lua new file mode 100644 index 0000000..7e41910 --- /dev/null +++ b/mods/plantlife_modpack/nature_classic/blossom.lua @@ -0,0 +1,75 @@ +-- Blossoms and such + +local function spawn_apple_under(pos) + local below = { + x = pos.x, + y = pos.y - 1, + z = pos.z, + } + if minetest.get_node(below).name == "air" then + minetest.set_node(below, { name = "default:apple" }) + end +end + +minetest.register_node(":"..nature.blossom_node, { + description = "Apple blossoms", + drawtype = "allfaces_optional", + tiles = nature.blossom_textures, + paramtype = "light", + groups = { snappy = 3, leafdecay = 3, flammable = 2 }, + sounds = default.node_sound_leaves_defaults(), + waving = 1 +}) + +minetest.register_craft({ + type = "fuel", + recipe = nature.blossom_node, + burntime = 2, +}) + +-- these ABMs can get heavy, so just enqueue the nodes + +-- Adding Blossoms +-- Limit mass changes after block has not been loaded for some time: +-- Run ABM with higher frequency, but don't enqueue all blocks +minetest.register_abm({ + nodenames = { nature.blossom_leaves }, + interval = nature.blossom_delay / nature.leaves_blossom_chance, + chance = nature.leaves_blossom_chance, + + action = function(pos, node, active_object_count, active_object_count_wider) + if math.random(nature.leaves_blossom_chance) == 1 then + nature.enqueue_node(pos, node, nature.blossom_node) + end + end +}) + +-- Removing blossoms +-- Limit mass changes after block has not been loaded for some time: +-- Run ABM with higher frequency, but don't enqueue all blocks +minetest.register_abm({ + nodenames = { nature.blossom_node }, + interval = nature.blossom_delay / nature.blossom_leaves_chance, + chance = nature.blossom_leaves_chance, + + action = function(pos, node, active_object_count, active_object_count_wider) + if math.random(nature.blossom_leaves_chance) == 1 then + nature.enqueue_node(pos, node, nature.blossom_leaves) + end + end +}) + +-- Spawning apples +-- Limit mass changes after block has not been loaded for some time: +-- spawn apples with 10% chance, but with 10 times higher frequency +minetest.register_abm({ + nodenames = { nature.blossom_node }, + interval = nature.blossom_delay / 10, + chance = nature.apple_chance, + + action = function(pos, node, active_object_count, active_object_count_wider) + if math.random(10) == 0 and nature.dtime < 0.2 and not minetest.find_node_near(pos, nature.apple_spread, { "default:apple" }) then + spawn_apple_under(pos) + end + end +}) diff --git a/mods/plantlife_modpack/nature_classic/config.lua b/mods/plantlife_modpack/nature_classic/config.lua new file mode 100644 index 0000000..8f67b1c --- /dev/null +++ b/mods/plantlife_modpack/nature_classic/config.lua @@ -0,0 +1,6 @@ +-- Set on which distance from water can the tree still grow. +-- Grows anywhere if set to -1. +nature.distance_from_water = 20 + +-- Minimum light level needed to grow. Default is 8, which means daylight. +nature.minimum_growth_light = 8 diff --git a/mods/plantlife_modpack/nature_classic/depends.txt b/mods/plantlife_modpack/nature_classic/depends.txt new file mode 100644 index 0000000..1246684 --- /dev/null +++ b/mods/plantlife_modpack/nature_classic/depends.txt @@ -0,0 +1,2 @@ +default +moretrees? diff --git a/mods/plantlife_modpack/nature_classic/global_function.lua b/mods/plantlife_modpack/nature_classic/global_function.lua new file mode 100644 index 0000000..3a5b9e3 --- /dev/null +++ b/mods/plantlife_modpack/nature_classic/global_function.lua @@ -0,0 +1,82 @@ +-- helper functions + +local function process_blossom_queue_item() + local pos = nature.blossomqueue[1][1] + local node = nature.blossomqueue[1][2] + local replace = nature.blossomqueue[1][3] + if (nature.blossomqueue[1][3] == nature.blossom_node and not nature:is_near_water(pos)) then + table.remove(nature.blossomqueue, 1) -- don't grow if it's not near water, pop from queue. + return + end + nature:grow_node(pos, replace) -- now actually grow it. + table.remove(nature.blossomqueue, 1) +end + +minetest.register_globalstep(function(dtime) + nature.dtime = dtime + if #nature.blossomqueue > 0 and dtime < 0.2 then + local i = 1 + if dtime < 0.1 then + i = i + 4 + end + if dtime < 0.05 then + i = i + 10 + end + while #nature.blossomqueue > 0 and i > 0 do + process_blossom_queue_item() + i = i - 1 + end + end +end) + +function nature.enqueue_node(pos, node, replace) + local idx = #nature.blossomqueue + if idx < nature.blossomqueue_max then + local enqueue_prob = 0 + if idx < nature.blossomqueue_max * 0.8 then + enqueue_prob = 1 + else + -- Reduce queue growth as it gets closer to its max. + enqueue_prob = 1 - (idx - nature.blossomqueue_max * 0.8) / (nature.blossomqueue_max * 0.2) + end + if enqueue_prob == 1 or math.random(100) <= 100 * enqueue_prob then + nature.blossomqueue[idx+1] = {} + nature.blossomqueue[idx+1][1] = pos + nature.blossomqueue[idx+1][2] = node + nature.blossomqueue[idx+1][3] = replace + end + end +end + +local function set_young_node(pos) + local meta = minetest.get_meta(pos) + + meta:set_int(nature.meta_blossom_time, minetest.get_gametime()) +end + +local function is_not_young(pos) + local meta = minetest.get_meta(pos) + + local blossom_time = meta:get_int(nature.meta_blossom_time) + return not (blossom_time and minetest.get_gametime() - blossom_time < nature.blossom_duration) +end + +function nature:grow_node(pos, nodename) + if pos ~= nil then + local light_enough = (minetest.get_node_light(pos, nil) or 0) + >= nature.minimum_growth_light + + if is_not_young(pos) and light_enough then + minetest.set_node(pos, { name = nodename }) + set_young_node(pos) + + minetest.log("info", nodename .. " has grown at " .. pos.x .. "," + .. pos.y .. "," .. pos.z) + end + end +end + +function nature:is_near_water(pos) + return nature.distance_from_water == -1 or minetest.find_node_near(pos, nature.distance_from_water, + { "default:water_source" }) ~= nil +end diff --git a/mods/plantlife_modpack/nature_classic/init.lua b/mods/plantlife_modpack/nature_classic/init.lua new file mode 100644 index 0000000..f88ec6e --- /dev/null +++ b/mods/plantlife_modpack/nature_classic/init.lua @@ -0,0 +1,40 @@ +-- Nature Classic mod +-- Originally by neko259 + +-- Nature is slowly capturing the world! + +local current_mod_name = minetest.get_current_modname() + +nature = {} +nature.blossomqueue = {} +nature.blossomqueue_max = 1000 + +nature.blossom_node = "nature:blossom" +nature.blossom_leaves = "default:leaves" +nature.blossom_textures = { "default_leaves.png^nature_blossom.png" } + +if minetest.get_modpath("moretrees") then + nature.blossom_node = "moretrees:apple_blossoms" + nature.blossom_leaves = "moretrees:apple_tree_leaves" + nature.blossom_textures = { "moretrees_apple_tree_leaves.png^nature_blossom.png" } + minetest.register_alias("nature:blossom", "default:leaves") +end + +nature.leaves_blossom_chance = 15 +nature.blossom_leaves_chance = 5 +nature.blossom_delay = 3600 +nature.apple_chance = 10 +nature.apple_spread = 2 + +nature.meta_blossom_time = "blossom_time" +nature.blossom_duration = nature.blossom_delay + +function dumppos(pos) + return "("..pos.x..","..pos.y..","..pos.z..")" +end + +dofile(minetest.get_modpath(current_mod_name) .. "/config.lua") +dofile(minetest.get_modpath(current_mod_name) .. "/global_function.lua") +dofile(minetest.get_modpath(current_mod_name) .. "/blossom.lua") + +minetest.log("info", "[Nature Classic] loaded!") diff --git a/mods/plantlife_modpack/nature_classic/textures/nature_blossom.png b/mods/plantlife_modpack/nature_classic/textures/nature_blossom.png new file mode 100644 index 0000000..9d90336 Binary files /dev/null and b/mods/plantlife_modpack/nature_classic/textures/nature_blossom.png differ diff --git a/mods/plantlife_modpack/plants_lib/API.txt b/mods/plantlife_modpack/plants_lib/API.txt new file mode 100644 index 0000000..8f6455c --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/API.txt @@ -0,0 +1,579 @@ +This document describes the Plantlife mod API. + +Last revision: 2015-02-16 + + +========= +Functions +========= + +There are three main functions defined by the main "plants_lib" mod: + +spawn_on_surfaces() +register_generate_plant() +grow_plants() + +There are also several internal, helper functions that can be called if so +desired, but they are not really intended for use by other mods and may change +at any time. They are briefly described below these main functions, but see +init.lua for details. + +Most functions in plants lib are declared locally to avoid namespace +collisions with other mods. They are accessible via the "plantslib" method, +e.g. plantslib:spawn_on_surfaces() and so forth. + +===== +spawn_on_surfaces(biome) +spawn_on_surfaces(sdelay, splant, sradius, schance, ssurface, savoid) + +This first function is an ABM-based spawner function originally created as +part of Ironzorg's flowers mod. It has since been largely extended and +expanded. There are two ways to call this function: You can either pass it +several individual string and number parameters to use the legacy interface, +or you can pass a single biome definition as a table, with all of your options +spelled out nicely. This is the preferred method. + +When used with the legacy interface, you must specify the parameters exactly +in order, with the first five being mandatory (even if some are set to nil), +and the last one being optional: + +sdelay: The value passed to the ABM's interval parameter, in seconds. +splant: The node name of the item to spawn (e.g. + "flowers:flower_rose"). A plant will of course only be + spawned if the node about to be replaced is air. +sradius: Don't spawn within this many nodes of the avoid items + mentioned below. If set to nil, this check is skipped. +schance: The value passed to the ABM's chance parameter, normally in + the 10-100 range (1-in-X chance of operating on a given node) +ssurface: String with the name of the node on which to spawn the plant + in question, such as "default:sand" or + "default:dirt_with_grass". It is not recommended to put air, + stone, or plain dirt here if you can use some other node, as + doing so will cause the engine to process potentially large + numbers of such nodes when deciding when to execute the ABM + and where it should operate. +savoid: Table with a list of groups and/or node names to avoid when + spawning the plant, such as {"group:flowers", "default:tree"}. + +When passed a table as the argument, and thus using the modern calling method, +you must pass a number of arguments in the form of an ordinary keyed-value +table. Below is a list of everything supported by this function: + +biome = { + spawn_plants = something, -- [*] String or table; see below. + spawn_delay = number, -- same as sdelay, above. + spawn_chance = number, -- same as schance, above. + spawn_surfaces = {table}, -- List of node names on which the plants + -- should be spawned. As with the single-node "ssurface" + -- option in the legacy API, you should not put stone, air, + -- etc. here. + + ---- From here down are a number of optional parameters. You will + ---- most likely want to use at least some of these to limit how and + ---- where your objects are spawned. + + avoid_nodes = {table}, -- same meaning as savoid, above + avoid_radius = num, -- same as sradius + seed_diff = num, -- The Perlin seed difference value passed to the + -- minetest.get_perlin() function. Used along with + -- the global Perlin controls below to create the + -- "biome" in which the plants will spawn. Defaults + -- to 0 if not provided. + light_min = num, -- Minimum amount of light necessary to make a plant + -- spawn. Defaults to 0. + light_max = num, -- Maximum amount of light needed to spawn. Defaults + -- to the engine's MAX_LIGHT value of 14. + neighbors = {table}, -- List of neighboring nodes that need to be + -- immediately next to the node the plant is about to + -- spawn on. Can also be a string with a single node + -- name. It is both passed to the ABM as the + -- "neighbors" parameter, and is used to manually + -- check the adjacent nodes. It only takes one of + -- these for the spawn routine to mark the target as + -- spawnable. Defaults to nil (ignored). + ncount = num, -- There must be at least this many of the above + -- neighbors in the eight spaces immediately + -- surrounding the node the plant is about to spawn on + -- for it to happen. If not provided, this check is + -- disabled. + facedir = num, -- The value passed to the param2 variable when adding + -- the node to the map. Defaults to 0. Be sure that + -- the value you use here (and the range thereof) is + -- appropriate for the type of node you're spawning. + random_facedir = {table}, -- If set, the table should contain two values. + -- If they're both provided, the spawned plant will be + -- given a random facedir value in the range specified + -- by these two numbers. Overrides the facedir + -- parameter above, if it exists. Use {0,3} if you + -- want the full range for wallmounted nodes, or {2,5} + -- for most everything else, or any other pair of + -- numbers appropriate for the node you want to spawn. + depth_max = num, -- If the object spawns on top of a water source, the + -- water must be at most this deep. Defaults to 1. + min_elevation = num, -- Surface must be at this altitude or higher to + -- spawn at all. Defaults to -31000... + max_elevation = num, -- ...but must be no higher than this altitude. + -- Defaults to +31000. + near_nodes = {table}, -- List of nodes that must be somewhere in the + -- vicinity in order for the plant to spawn. Can also + -- be a string with a single node name. If not + -- provided, this check is disabled. + near_nodes_size = num, -- How large of an area to check for the above + -- node. Specifically, this checks a flat, horizontal + -- area centered on the node to be spawned on. + -- Defaults to 0, but is ignored if the above + -- near_nodes value is not set. + near_nodes_vertical = num, -- Used with the size value above, this extends + -- the vertical range of the near nodes search. + -- Basically, this turns the flat region described + -- above into a cuboid region. The area to be checked + -- will extend this high and this low above/below the + -- target node, centered thereon. Defaults to 1 (only + -- check the layer above, the layer at, and the layer + -- below the target node), but is ignored if + -- near_nodes is not set. + near_nodes_count = num, -- How many of the above nodes must be within that + -- radius. Defaults to 1 but is ignored if near_nodes + -- isn't set. Bear in mind that the total area to be + -- checked is equal to: + -- (near_nodes_size^2)*near_nodes_vertical*2 + -- For example, if size is 10 and vertical is 4, then + -- the area is (10^2)*8 = 800 nodes in size, so you'll + -- want to make sure you specify a value appropriate + -- for the size of the area being tested. + air_size = num, -- How large of an area to check for air above and + -- around the target. If omitted, only the space + -- above the target is checked. This does not check + -- for air at the sides or below the target. + air_count = num, -- How many of the surrounding nodes need to be air + -- for the above check to return true. If omitted, + -- only the space above the target is checked. + plantlife_limit = num, -- The value compared against the generic "plants + -- can grow here" Perlin noise layer. Smaller numbers + -- result in more abundant plants. Range of -1 to +1, + -- with values in the range of about 0 to 0.5 being + -- most useful. Defaults to 0.1. + temp_min = num, -- Minimum temperature needed for the desired object + -- to spawn. This is a 2d Perlin value, which has an + -- inverted range of +1 to -1. Larger values + -- represent *colder* temperatures, so this value is + -- actually the upper end of the desired Perlin range. + -- See the temperature map section at the bottom of + -- this document for details on how these values work. + -- Defaults to +1 (unlimited coldness). + temp_max = num, -- Maximum temperature/lower end of the Perlin range. + -- Defaults to -1 (unlimited heat). + humidity_min = num, -- Minimum humidity for the plant to spawn in. Like + -- the temperature map, this is a Perlin value where + -- lower numbers mean more humidity in the area. + -- Defaults to +1 (0% humidity). + humidity_max = num, -- Maximum humidity for the plant to spawn at. + -- Defaults to -1 (100% humidity). + verticals_list = {table}, -- List of nodes that should be considered to be + -- natural walls. + alt_wallnode = "string", -- If specified, this node will be substituted in + -- place of the plant(s) defined by spawn_plants + -- above, if the spawn target has one or more adjacent + -- walls. In such a case, the two above facedir + -- parameters will be ignored. + spawn_on_side = bool, -- Set this to true to immediately spawn the node on + -- one side of the target node rather than the top. + -- The code will search for an airspace to the side of + -- the target, then spawn the plant at the first one + -- found. The above facedir and random_facedir + -- parameters are ignored in this case. If the above + -- parameters for selecting generic wall nodes are + -- provided, this option is ignored. Important note: + -- the facedir values assigned by this option only + -- make sense with wallmounted nodes (nodes which + -- don't use facedir won't be affected). + choose_random_wall = bool, -- if set to true, and searching for walls is + -- being done, just pick any random wall if there is + -- one, rather than returning the first one. + spawn_on_bottom = bool, -- If set to true, spawn the object below the + -- target node instead of above it. The above + -- spawn_on_side variable takes precedence over this + -- one if both happen to be true. When using this + -- option with the random facedir function above, the + -- values given to the facedir parameter are for + -- regular nodes, not wallmounted. + spawn_replace_node = bool, -- If set to true, the target node itself is + -- replaced by the spawned object. Overrides the + -- spawn_on_bottom and spawn_on_side settings. +} + +[*] spawn_plants must be either a table or a string. If it's a table, the +values therein are treated as a list of nodenames to pick from randomly on +each application of the ABM code. The more nodes you can pack into this +parameter to avoid making too many calls to this function, the lower the CPU +load will likely be. + +You can also specify a string containing the name of a function to execute. +In this case, the function will be passed a single position parameter +indicating where the function should place the desired object, and the checks +for spawning on top vs. sides vs. bottom vs. replacing the target node will be +skipped. + +By default, if a biome node, size, and count are not defined, the biome +checking is disabled. Same holds true for the nneighbors bit above that. + + +===== +plantslib:register_generate_plant(biome, nodes_or_function_or_treedef) + +To register an object to be spawned at mapgen time rather than via an ABM, +call this function with two parameters: a table with your object's biome +information, and a string, function, or table describing what to do if the +engine finds a suitable surface node (see below). + +The biome table contains quite a number of options, though there are fewer +here than are available in the ABM-based spawner, as some stuff doesn't make +sense at map-generation time. + +biome = { + surface = something, -- What node(s). May be a string such as + -- "default:dirt_with_grass" or a table with + -- multiple such entries. + + ---- Everything else is optional, but you'll definitely want to use + ---- some of these other fields to limit where and under what + ---- conditions the objects are spawned. + + below_nodes = {table}, -- List of nodes that must be below the target + -- node. Useful in snow biomes to keep objects from + -- spawning in snow that's on the wrong surface for + -- that object. + avoid_nodes = {table}, -- List of nodes to avoid when spawning. Groups are + -- not supported here. + avoid_radius = num, -- How much distance to leave between the object to be + -- added and the objects to be avoided. If this or + -- the avoid_nodes value is nil/omitted, this check is + -- skipped. Avoid using excessively large radii. + rarity = num, -- How rare should this object be in its biome? Larger + -- values make objects more rare, via: + -- math.random(1,100) > this + max_count = num, -- The absolute maximum number of your object that + -- should be allowed to spawn in a 5x5x5 mapblock area + -- (80x80x80 nodes). Defaults to 5, but be sure you + -- set this to some reasonable value depending on your + -- object and its size if 5 is insufficient. + seed_diff = num, -- Perlin seed-diff value. Defaults to 0, which + -- causes the function to inherit the global value of + -- 329. + neighbors = {table}, -- What ground nodes must be right next to and at the + -- same elevation as the node to be spawned on. + ncount = num, -- At least this many of the above nodes must be next + -- to the node to spawn on. Any value greater than 8 + -- will probably cause the code to never spawn + -- anything. Defaults to 0. + depth = num, -- How deep/thick of a layer the spawned-on node must + -- be. Typically used for water. + min_elevation = num, -- Minimum elevation in meters/nodes. Defaults to + -- -31000 (unlimited). + max_elevation = num, -- Max elevation. Defaults to +31000 (unlimited). + near_nodes = {table}, -- what nodes must be in the general vicinity of the + -- object being spawned. + near_nodes_size = num, -- how wide of a search area to look for the nodes + -- in that list. + near_nodes_vertical = num, -- How high/low of an area to search from the + -- target node. + near_nodes_count = num, -- at least this many of those nodes must be in + -- the area. + plantlife_limit = num, -- The value compared against the generic "plants + -- can grow here" Perlin noise layer. Smaller numbers + -- result in more abundant plants. Range of -1 to +1, + -- with values in the range of about 0 to 0.5 being + -- most useful. Defaults to 0.1. + temp_min = num, -- Coldest allowable temperature for a plant to spawn + -- (that is, the largest Perlin value). + temp_max = num, -- warmest allowable temperature to spawn a plant + -- (lowest Perlin value). + verticals_list = {table}, -- Same as with the spawn_on_surfaces function. + check_air = bool, -- Flag to tell the mapgen code to check for air above + -- the spawn target. Defaults to true if not + -- explicitly set to false. Set this to false VERY + -- SPARINGLY, as it will slow the map generator down. + delete_above = bool, -- Flag to tell the mapgen code to delete the two + -- nodes directly above the spawn target just before + -- adding the plant or tree. Useful when generating + -- in snow biomes. Defaults to false. + delete_above_surround = bool, -- Flag to tell the mapgen code to also + -- delete the five nodes surrounding the above space, + -- and the five nodes above those, resulting in a two- + -- node-deep cross-shaped empty region above/around + -- the spawn target. Useful when adding trees to snow + -- biomes. Defaults to false. + spawn_replace_node = bool, -- same as with the ABM spawner. + random_facedir = {table}, -- same as with the ABM spawner. +} + +Regarding nodes_or_function_or_treedef, this must either be a string naming +a node to spawn, a table with a list of nodes to choose from, a table with an +L-Systems tree definition, or a function. + +If you specified a string, the code will attempt to determine whether that +string specifies a valid node name. If it does, that node will be placed on +top of the target position directly (unless one of the other mapgen options +directs the code to do otherwise). + +If you specified a table and there is no "axiom" field, the code assumes that +it is a list of nodes. Simply name one node per entry in the list, e.g. +{"default:junglegrass", "default:dry_shrub"} and so on, for as many nodes as +you want to list. A random node from the list will be chosen each time the +code goes to place a node. + +If you specified a table, and there *is* an "axiom" field, the code assumes +that this table contains an L-Systems tree definition, which will be passed +directly to the engine's spawn_tree() function along with the position on +which to spawn the tree. + +You can also supply a function to be directly executed, which is given the +current node position (the usual "pos" table format) as its sole argument. It +will be called in the form: + + somefunction(pos) + + +===== +plantslib:grow_plants(options) + +The third function, grow_plants() is used to turn the spawned nodes above +into something else over time. This function has no return value, and accepts +a biome definition table as the only parameter. These are defined like so: + +options = { + grow_plant = "string", -- Name of the node to be grown into something + -- else. This value is passed to the ABM as the + -- "nodenames" parameter, so it is the plants + -- themselves that are the ABM trigger, rather than + -- the ground they spawned on. A plant will only grow + -- if the node above it is air. Can also be a table, + -- but note that all nodes referenced therein will be + -- grown into the same object. + grow_delay = num, -- Passed as the ABM "interval" parameter, as with + -- spawning. + grow_chance = num, -- Passed as the ABM "chance" parameter. + grow_result = "string", -- Name of the node into which the grow_plant + -- node(s) should transform when the ABM executes. + + ---- Everything from here down is optional. + + dry_early_node = "string", -- This value is ignored except for jungle + -- grass (a corner case needed by that mod), where it + -- indicates which node the grass must be on in order + -- for it to turn from the short size to + -- "default:dry_shrub" instead of the medium size. + grow_nodes = {table}, -- One of these nodes must be under the plant in + -- order for it to grow at all. Normally this should + -- be the same as the list of surfaces passed to the + -- spawning ABM as the "nodenames" parameter. This is + -- so that the plant can be manually placed on + -- something like a flower pot or something without it + -- necessarily growing and perhaps dieing. Defaults + -- to "default:dirt_with_grass". + facedir = num, -- Same as with spawning a plant. + need_wall = bool, -- Set this to true if you the plant needs to grow + -- against a wall. Defaults to false. + verticals_list = {table}, -- same as with spawning a plant. + choose_random_wall = bool, -- same as with spawning a plant. + grow_vertically = bool, -- Set this to true if the plant needs to grow + -- vertically, as in climbing poison ivy. Defaults to + -- false. + height_limit = num, -- Set this to limit how tall the desired node can + -- grow. The mod will search straight down from the + -- position being spawned at to find a ground node, + -- set via the field below. Defaults to 5 nodes. + ground_nodes = {table}, -- What nodes should be treated as "the ground" + -- below a vertically-growing plant. Usually this + -- should be the same as the grow_nodes table, but + -- might also include, for example, water or some + -- other surrounding material. Defaults to + -- "default:dirt_with_grass". + grow_function = something, -- [*] see below. + seed_diff = num, -- [*] see below. +} + +[*] grow_function can take one of three possible settings: it can be nil (or + not provided), a string, or a table. + +If it is not provided or it's set to nil, all of the regular growing code is +executed normally, the value of seed_diff, if any, is ignored, and the node to +be placed is assumed to be specified in the grow_result variable. + +If this value is set to a simple string, this is treated as the name of the +function to use to grow the plant. In this case, all of the usual growing +code is executeed, but then instead of a plant being simply added to the +world, grow_result is ignored and the named function is executed and passed a +few parmeters in the following general form: + + somefunction(pos, perlin1, perlin2) + +These values represent the current position (the usual table), the Perlin +noise value for that spot in the generic "plants can grow here" map for the +seed_diff value above, the Perlin value for that same spot from the +temperature map, and the detected neighboring wall face, if there was one (or +nil if not). If seed_diff is not provided, it defaults to 0. + +If this variable is instead set to a table, it is treated an an L-Systems tree +definition. All of the growing code is executed in the usual manner, then the +tree described by that definition is spawned at the current position instead, +and grow_result is ignored. + + +===== +find_adjacent_wall(pos, verticals, randomflag) + +Of the few helper functions, this one expects a position parameter and a table +with the list of nodes that should be considered as walls. The code will +search around the given position for a neighboring wall, returning the first +one it finds as a facedir value, or nil if there are no adjacent walls. + +If randomflag is set to true, the function will just return the facedir of any +random wall it finds adjacent to the target position. Defaults to false if +not specified. + +===== +is_node_loaded(pos) + +This acts as a wrapper for the minetest.get_node_or_nil(node_pos) +function and accepts a single position parameter. Returns true if the node in +question is already loaded, or false if not. + + +===== +dbg(string) + +This is a simple debug output function which takes one string parameter. It +just checks if DEBUG is true and outputs the phrase "[Plantlife] " followed by +the supplied string, via the print() function, if so. + +===== +plantslib:generate_tree(pos, treemodel) +plantslib:grow_tree(pos, treemodel) + +In the case of the growing code and the mapgen-based tree generator code, +generating a tree is done via the above two calls, which in turn immediately +call the usual spawn_tree() functions. This rerouting exists as a way for +other mods to hook into plants_lib's tree-growing functions in general, +perhaps to execute something extra whenever a tree is spawned. + +plantslib:generate_tree(pos, treemodel) is called any time a tree is spawned +at map generation time. 'pos' is the position of the block on which the tree +is to be placed. 'treemodel' is the standard L-Systems tree definition table +expected by the spawn_tree() function. Refer to the 'trunk' field in that +table to derive the name of the tree being spawned. + +plantslib:grow_tree(pos, treemodel) does the same sort of thing whenever a +tree is spawned within the abm-based growing code, for example when growing a +sapling into a tree. + + +===== +There are other, internal helper functions that are not meant for use by other +mods. Don't rely on them, as they are subject to change without notice. + + +=============== +Global Settings +=============== + +Set this to true if you want the mod to spam your console with debug info :-) + + plantlife_debug = false + + +====================== +Fertile Ground Mapping +====================== + +The mod uses Perlin noise to create "biomes" of the various plants, via the +minetest.get_perlin() function. At present, there are three layers of +Perlin noise used. + +The first one is for a "fertile ground" layer, which I tend to refer to as the +generic "stuff can potentially grow here" layer. Its values are hard-coded: + + plantslib.plantlife_seed_diff = 329 + perlin_octaves = 3 + perlin_persistence = 0.6 + perlin_scale = 100 + +For more information on how Perlin noise is generated, you will need to search +the web, as these default values were from that which is used by minetest_game +to spawn jungle grass at mapgen time, and I'm still learning how Perlin noise +works. ;-) + + +=================== +Temperature Mapping +=================== + +The second Perlin layer is a temperature map, with values taken from +SPlizard's Snow Biomes mod so that the two will be compatible, since that mod +appears to be the standard now. Those values are: + + temperature_seeddiff = 112 + temperature_octaves = 3 + temperature_persistence = 0.5 + temperature_scale = 150 + +The way Perlin values are used by this mod, in keeping with the snow mod's +apparent methods, larger values returned by the Perlin function represent +*colder* temperatures. In this mod, the following table gives a rough +approximation of how temperature maps to these values, normalized to +0.53 = 0 °C and +1.0 = -25 °C. + +Perlin Approx. Temperature +-1.0 81 °C ( 178 °F) +-0.75 68 °C ( 155 °F) +-0.56 58 °C ( 136 °F) +-0.5 55 °C ( 131 °F) +-0.25 41 °C ( 107 °F) +-0.18 38 °C ( 100 °F) + 0 28 °C ( 83 °F) + 0.13 21 °C ( 70 °F) + 0.25 15 °C ( 59 °F) + 0.5 2 °C ( 35 °F) + 0.53 0 °C ( 32 °F) + 0.75 -12 °C ( 11 °F) + 0.86 -18 °C ( 0 °F) + 1.0 -25 °C (- 13 °F) + +Included in this table are even 0.25 steps in Perlin values along with some +common temperatures on both the Centigrade and Fahrenheit scales. Note that +unless you're trying to model the Moon or perhaps Mercury in your mods/maps, +you probably won't need to bother with Perlin values of less than -0.56 or so. + + +================ +Humidity Mapping +================ + +Last but not least is a moisture/humidity map. Like the temperature map +above, Perlin values can be tested to determine the approximate humidity of +the *air* in the area. This humidity map is basically the perlin layer used +for deserts. + +A value of +1.0 is very moist (basically a thick fog, if it could be seen), a +value of roughly +0.25 represents the edge of a desert as usually seen in the +game, and a value of -1.0 is as dry as a bone. + +This does not check for nearby water, just general air humidity, and that +being the case, nearby ground does not affect the reported humidity of a +region (because this isn't yet possible to calculate yet). Use the near_nodes +and avoid_nodes parameters and their related options to check for water and +such. + +The Perlin values use for this layer are: + + humidity_seeddiff = 9130 + humidity_octaves = 3 + humidity_persistence = 0.5 + humidity_scale = 250 + +And this particular one is mapped slightly differently from the others: + + noise3 = perlin3:get2d({x=p_top.x+150, y=p_top.z+50}) + +(Note the +150 and +50 offsets) + diff --git a/mods/plantlife_modpack/plants_lib/depends.txt b/mods/plantlife_modpack/plants_lib/depends.txt new file mode 100644 index 0000000..c48fe0d --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/depends.txt @@ -0,0 +1,3 @@ +default +intllib? + diff --git a/mods/plantlife_modpack/plants_lib/init.lua b/mods/plantlife_modpack/plants_lib/init.lua new file mode 100644 index 0000000..d0401ae --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/init.lua @@ -0,0 +1,735 @@ +-- Plantlife library mod by Vanessa Ezekowitz +-- +-- License: WTFPL +-- +-- I got the temperature map idea from "hmmmm", values used for it came from +-- Splizard's snow mod. +-- + +-- Various settings - most of these probably won't need to be changed + +plantslib = {} + +plantslib.blocklist_aircheck = {} +plantslib.blocklist_no_aircheck = {} + +plantslib.surface_nodes_aircheck = {} +plantslib.surface_nodes_no_aircheck = {} + +plantslib.surfaceslist_aircheck = {} +plantslib.surfaceslist_no_aircheck = {} + +plantslib.actioncount_aircheck = {} +plantslib.actioncount_no_aircheck = {} + +plantslib.actionslist_aircheck = {} +plantslib.actionslist_no_aircheck = {} + +plantslib.modpath = minetest.get_modpath("plants_lib") + +plantslib.total_no_aircheck_calls = 0 + +-- Boilerplate to support localized strings if intllib mod is installed. +local S +if minetest.get_modpath("intllib") then + S = intllib.Getter() +else + S = function(s) return s end +end +plantslib.intllib = S + +local DEBUG = false --... except if you want to spam the console with debugging info :-) + +function plantslib:dbg(msg) + if DEBUG then + print("[Plantlife] "..msg) + minetest.log("verbose", "[Plantlife] "..msg) + end +end + +plantslib.plantlife_seed_diff = 329 -- needs to be global so other mods can see it + +local perlin_octaves = 3 +local perlin_persistence = 0.6 +local perlin_scale = 100 + +local temperature_seeddiff = 112 +local temperature_octaves = 3 +local temperature_persistence = 0.5 +local temperature_scale = 150 + +local humidity_seeddiff = 9130 +local humidity_octaves = 3 +local humidity_persistence = 0.5 +local humidity_scale = 250 + +local time_scale = 1 +local time_speed = tonumber(minetest.setting_get("time_speed")) + +if time_speed and time_speed > 0 then + time_scale = 72 / time_speed +end + +--PerlinNoise(seed, octaves, persistence, scale) + +plantslib.perlin_temperature = PerlinNoise(temperature_seeddiff, temperature_octaves, temperature_persistence, temperature_scale) +plantslib.perlin_humidity = PerlinNoise(humidity_seeddiff, humidity_octaves, humidity_persistence, humidity_scale) + +-- Local functions + +function plantslib:is_node_loaded(node_pos) + local n = minetest.get_node_or_nil(node_pos) + if (not n) or (n.name == "ignore") then + return false + end + return true +end + +function plantslib:set_defaults(biome) + biome.seed_diff = biome.seed_diff or 0 + biome.min_elevation = biome.min_elevation or -31000 + biome.max_elevation = biome.max_elevation or 31000 + biome.temp_min = biome.temp_min or 1 + biome.temp_max = biome.temp_max or -1 + biome.humidity_min = biome.humidity_min or 1 + biome.humidity_max = biome.humidity_max or -1 + biome.plantlife_limit = biome.plantlife_limit or 0.1 + biome.near_nodes_vertical = biome.near_nodes_vertical or 1 + +-- specific to on-generate + + biome.neighbors = biome.neighbors or biome.surface + biome.near_nodes_size = biome.near_nodes_size or 0 + biome.near_nodes_count = biome.near_nodes_count or 1 + biome.rarity = biome.rarity or 50 + biome.max_count = biome.max_count or 5 + if biome.check_air ~= false then biome.check_air = true end + +-- specific to abm spawner + biome.seed_diff = biome.seed_diff or 0 + biome.light_min = biome.light_min or 0 + biome.light_max = biome.light_max or 15 + biome.depth_max = biome.depth_max or 1 + biome.facedir = biome.facedir or 0 +end + +local function search_table(t, s) + for i = 1, #t do + if t[i] == s then return true end + end + return false +end + +-- register the list of surfaces to spawn stuff on, filtering out all duplicates. +-- separate the items by air-checking or non-air-checking map eval methods + +function plantslib:register_generate_plant(biomedef, nodes_or_function_or_model) + + -- if calling code passes an undefined node for a surface or + -- as a node to be spawned, don't register an action for it. + + if type(nodes_or_function_or_model) == "string" + and string.find(nodes_or_function_or_model, ":") + and not minetest.registered_nodes[nodes_or_function_or_model] then + plantslib:dbg("Warning: Ignored registration for undefined spawn node: "..dump(nodes_or_function_or_model)) + return + end + + if type(nodes_or_function_or_model) == "string" + and not string.find(nodes_or_function_or_model, ":") then + plantslib:dbg("Warning: Registered function call using deprecated string method: "..dump(nodes_or_function_or_model)) + end + + if biomedef.check_air == false then + plantslib:dbg("Register no-air-check mapgen hook: "..dump(nodes_or_function_or_model)) + plantslib.actionslist_no_aircheck[#plantslib.actionslist_no_aircheck + 1] = { biomedef, nodes_or_function_or_model } + local s = biomedef.surface + if type(s) == "string" then + if s and (string.find(s, "^group:") or minetest.registered_nodes[s]) then + if not search_table(plantslib.surfaceslist_no_aircheck, s) then + plantslib.surfaceslist_no_aircheck[#plantslib.surfaceslist_no_aircheck + 1] = s + end + else + plantslib:dbg("Warning: Ignored no-air-check registration for undefined surface node: "..dump(s)) + end + else + for i = 1, #biomedef.surface do + local s = biomedef.surface[i] + if s and (string.find(s, "^group:") or minetest.registered_nodes[s]) then + if not search_table(plantslib.surfaceslist_no_aircheck, s) then + plantslib.surfaceslist_no_aircheck[#plantslib.surfaceslist_no_aircheck + 1] = s + end + else + plantslib:dbg("Warning: Ignored no-air-check registration for undefined surface node: "..dump(s)) + end + end + end + else + plantslib:dbg("Register with-air-checking mapgen hook: "..dump(nodes_or_function_or_model)) + plantslib.actionslist_aircheck[#plantslib.actionslist_aircheck + 1] = { biomedef, nodes_or_function_or_model } + local s = biomedef.surface + if type(s) == "string" then + if s and (string.find(s, "^group:") or minetest.registered_nodes[s]) then + if not search_table(plantslib.surfaceslist_aircheck, s) then + plantslib.surfaceslist_aircheck[#plantslib.surfaceslist_aircheck + 1] = s + end + else + plantslib:dbg("Warning: Ignored with-air-checking registration for undefined surface node: "..dump(s)) + end + else + for i = 1, #biomedef.surface do + local s = biomedef.surface[i] + if s and (string.find(s, "^group:") or minetest.registered_nodes[s]) then + if not search_table(plantslib.surfaceslist_aircheck, s) then + plantslib.surfaceslist_aircheck[#plantslib.surfaceslist_aircheck + 1] = s + end + else + plantslib:dbg("Warning: Ignored with-air-checking registration for undefined surface node: "..dump(s)) + end + end + end + end +end + +function plantslib:populate_surfaces(biome, nodes_or_function_or_model, snodes, checkair) + + plantslib:set_defaults(biome) + + -- filter stage 1 - find nodes from the supplied surfaces that are within the current biome. + + local in_biome_nodes = {} + local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) + + for i = 1, #snodes do + local pos = snodes[i] + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + local noise1 = perlin_fertile_area:get2d({x=pos.x, y=pos.z}) + local noise2 = plantslib.perlin_temperature:get2d({x=pos.x, y=pos.z}) + local noise3 = plantslib.perlin_humidity:get2d({x=pos.x+150, y=pos.z+50}) + local biome_surfaces_string = dump(biome.surface) + local surface_ok = false + + if not biome.depth then + local dest_node = minetest.get_node(pos) + if string.find(biome_surfaces_string, dest_node.name) then + surface_ok = true + else + if string.find(biome_surfaces_string, "group:") then + for j = 1, #biome.surface do + if string.find(biome.surface[j], "^group:") + and minetest.get_item_group(dest_node.name, biome.surface[j]) then + surface_ok = true + break + end + end + end + end + elseif not string.find(biome_surfaces_string, minetest.get_node({ x = pos.x, y = pos.y-biome.depth-1, z = pos.z }).name) then + surface_ok = true + end + + if surface_ok + and (not checkair or minetest.get_node(p_top).name == "air") + and pos.y >= biome.min_elevation + and pos.y <= biome.max_elevation + and noise1 > biome.plantlife_limit + and noise2 <= biome.temp_min + and noise2 >= biome.temp_max + and noise3 <= biome.humidity_min + and noise3 >= biome.humidity_max + and (not biome.ncount or #(minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, biome.neighbors)) > biome.ncount) + and (not biome.near_nodes or #(minetest.find_nodes_in_area({x=pos.x-biome.near_nodes_size, y=pos.y-biome.near_nodes_vertical, z=pos.z-biome.near_nodes_size}, {x=pos.x+biome.near_nodes_size, y=pos.y+biome.near_nodes_vertical, z=pos.z+biome.near_nodes_size}, biome.near_nodes)) >= biome.near_nodes_count) + and math.random(1,100) > biome.rarity + and (not biome.below_nodes or string.find(dump(biome.below_nodes), minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name) ) + then + in_biome_nodes[#in_biome_nodes + 1] = pos + end + end + + -- filter stage 2 - find places within that biome area to place the plants. + + local num_in_biome_nodes = #in_biome_nodes + + if num_in_biome_nodes > 0 then + for i = 1, math.min(biome.max_count, num_in_biome_nodes) do + local tries = 0 + local spawned = false + while tries < 2 and not spawned do + local pos = in_biome_nodes[math.random(1, num_in_biome_nodes)] + if biome.spawn_replace_node then + pos.y = pos.y-1 + end + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + + if not (biome.avoid_nodes and biome.avoid_radius and minetest.find_node_near(p_top, biome.avoid_radius + math.random(-1.5,2), biome.avoid_nodes)) then + if biome.delete_above then + minetest.remove_node(p_top) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z}) + end + + if biome.delete_above_surround then + minetest.remove_node({x=p_top.x-1, y=p_top.y, z=p_top.z}) + minetest.remove_node({x=p_top.x+1, y=p_top.y, z=p_top.z}) + minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z-1}) + minetest.remove_node({x=p_top.x, y=p_top.y, z=p_top.z+1}) + + minetest.remove_node({x=p_top.x-1, y=p_top.y+1, z=p_top.z}) + minetest.remove_node({x=p_top.x+1, y=p_top.y+1, z=p_top.z}) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z-1}) + minetest.remove_node({x=p_top.x, y=p_top.y+1, z=p_top.z+1}) + end + + if biome.spawn_replace_node then + minetest.remove_node(pos) + end + + local objtype = type(nodes_or_function_or_model) + + if objtype == "table" then + if nodes_or_function_or_model.axiom then + plantslib:generate_tree(pos, nodes_or_function_or_model) + spawned = true + else + local fdir = nil + if biome.random_facedir then + fdir = math.random(biome.random_facedir[1], biome.random_facedir[2]) + end + minetest.set_node(p_top, { name = nodes_or_function_or_model[math.random(#nodes_or_function_or_model)], param2 = fdir }) + spawned = true + end + elseif objtype == "string" and + minetest.registered_nodes[nodes_or_function_or_model] then + local fdir = nil + if biome.random_facedir then + fdir = math.random(biome.random_facedir[1], biome.random_facedir[2]) + end + minetest.set_node(p_top, { name = nodes_or_function_or_model, param2 = fdir }) + spawned = true + elseif objtype == "function" then + nodes_or_function_or_model(pos) + spawned = true + elseif objtype == "string" and pcall(loadstring(("return %s(...)"): + format(nodes_or_function_or_model)),pos) then + spawned = true + else + plantslib:dbg("Warning: Ignored invalid definition for object "..dump(nodes_or_function_or_model).." that was pointed at {"..dump(pos).."}") + end + else + tries = tries + 1 + end + end + end + end +end + +-- Primary mapgen spawner, for mods that can work with air checking enabled on +-- a surface during the initial map read stage. + +function plantslib:generate_block_with_air_checking() + if #plantslib.blocklist_aircheck > 0 then + + local minp = plantslib.blocklist_aircheck[1][1] + local maxp = plantslib.blocklist_aircheck[1][2] + + -- use the block hash as a unique key into the surface nodes + -- tables, so that we can write the tables thread-safely. + + local blockhash = minetest.hash_node_position(minp) + + if not plantslib.surface_nodes_aircheck.blockhash then + + if type(minetest.find_nodes_in_area_under_air) == "function" then -- use newer API call + plantslib.surface_nodes_aircheck.blockhash = + minetest.find_nodes_in_area_under_air(minp, maxp, plantslib.surfaceslist_aircheck) + else + local search_area = minetest.find_nodes_in_area(minp, maxp, plantslib.surfaceslist_aircheck) + + -- search the generated block for air-bounded surfaces the slow way. + + plantslib.surface_nodes_aircheck.blockhash = {} + + for i = 1, #search_area do + local pos = search_area[i] + local p_top = { x=pos.x, y=pos.y+1, z=pos.z } + if minetest.get_node(p_top).name == "air" then + plantslib.surface_nodes_aircheck.blockhash[#plantslib.surface_nodes_aircheck.blockhash + 1] = pos + end + end + end + plantslib.actioncount_aircheck.blockhash = 1 + + else + if plantslib.actioncount_aircheck.blockhash <= #plantslib.actionslist_aircheck then + -- [1] is biome, [2] is node/function/model + plantslib:populate_surfaces( + plantslib.actionslist_aircheck[plantslib.actioncount_aircheck.blockhash][1], + plantslib.actionslist_aircheck[plantslib.actioncount_aircheck.blockhash][2], + plantslib.surface_nodes_aircheck.blockhash, true) + plantslib.actioncount_aircheck.blockhash = plantslib.actioncount_aircheck.blockhash + 1 + else + if plantslib.surface_nodes_aircheck.blockhash then + table.remove(plantslib.blocklist_aircheck, 1) + plantslib.surface_nodes_aircheck.blockhash = nil + end + end + end + end +end + +-- Secondary mapgen spawner, for mods that require disabling of +-- checking for air during the initial map read stage. + +function plantslib:generate_block_no_aircheck() + if #plantslib.blocklist_no_aircheck > 0 then + + local minp = plantslib.blocklist_no_aircheck[1][1] + local maxp = plantslib.blocklist_no_aircheck[1][2] + + local blockhash = minetest.hash_node_position(minp) + + if not plantslib.surface_nodes_no_aircheck.blockhash then + + -- directly read the block to be searched into the chunk cache + + plantslib.surface_nodes_no_aircheck.blockhash = + minetest.find_nodes_in_area(minp, maxp, plantslib.surfaceslist_no_aircheck) + plantslib.actioncount_no_aircheck.blockhash = 1 + + else + if plantslib.actioncount_no_aircheck.blockhash <= #plantslib.actionslist_no_aircheck then + plantslib:populate_surfaces( + plantslib.actionslist_no_aircheck[plantslib.actioncount_no_aircheck.blockhash][1], + plantslib.actionslist_no_aircheck[plantslib.actioncount_no_aircheck.blockhash][2], + plantslib.surface_nodes_no_aircheck.blockhash, false) + plantslib.actioncount_no_aircheck.blockhash = plantslib.actioncount_no_aircheck.blockhash + 1 + else + if plantslib.surface_nodes_no_aircheck.blockhash then + table.remove(plantslib.blocklist_no_aircheck, 1) + plantslib.surface_nodes_no_aircheck.blockhash = nil + end + end + end + end +end + +-- "Record" the chunks being generated by the core mapgen + +minetest.register_on_generated(function(minp, maxp, blockseed) + plantslib.blocklist_aircheck[#plantslib.blocklist_aircheck + 1] = { minp, maxp } +end) + +minetest.register_on_generated(function(minp, maxp, blockseed) + plantslib.blocklist_no_aircheck[#plantslib.blocklist_no_aircheck + 1] = { minp, maxp } +end) + +-- "Play" them back, populating them with new stuff in the process + +minetest.register_globalstep(function(dtime) + if dtime < 0.2 and -- don't attempt to populate if lag is already too high + (#plantslib.blocklist_aircheck > 0 or #plantslib.blocklist_no_aircheck > 0) then + plantslib.globalstep_start_time = minetest.get_us_time() + plantslib.globalstep_runtime = 0 + while (#plantslib.blocklist_aircheck > 0 or #plantslib.blocklist_no_aircheck > 0) + and plantslib.globalstep_runtime < 200000 do -- 0.2 seconds, in uS. + if #plantslib.blocklist_aircheck > 0 then + plantslib:generate_block_with_air_checking() + end + if #plantslib.blocklist_no_aircheck > 0 then + plantslib:generate_block_no_aircheck() + end + plantslib.globalstep_runtime = minetest.get_us_time() - plantslib.globalstep_start_time + end + end +end) + +-- Play out the entire log all at once on shutdown +-- to prevent unpopulated map areas + +minetest.register_on_shutdown(function() + print("[plants_lib] Stand by, playing out the rest of the aircheck mapblock log") + print("(there are "..#plantslib.blocklist_aircheck.." entries)...") + while true do + plantslib:generate_block_with_air_checking(0.1) + if #plantslib.blocklist_aircheck == 0 then return end + end +end) + +minetest.register_on_shutdown(function() + print("[plants_lib] Stand by, playing out the rest of the no-aircheck mapblock log") + print("(there are "..#plantslib.blocklist_aircheck.." entries)...") + while true do + plantslib:generate_block_no_aircheck(0.1) + if #plantslib.blocklist_no_aircheck == 0 then return end + end +end) + +-- The spawning ABM + +function plantslib:spawn_on_surfaces(sd,sp,sr,sc,ss,sa) + + local biome = {} + + if type(sd) ~= "table" then + biome.spawn_delay = sd -- old api expects ABM interval param here. + biome.spawn_plants = {sp} + biome.avoid_radius = sr + biome.spawn_chance = sc + biome.spawn_surfaces = {ss} + biome.avoid_nodes = sa + else + biome = sd + end + + if biome.spawn_delay*time_scale >= 1 then + biome.interval = biome.spawn_delay*time_scale + else + biome.interval = 1 + end + + plantslib:set_defaults(biome) + biome.spawn_plants_count = #(biome.spawn_plants) + + minetest.register_abm({ + nodenames = biome.spawn_surfaces, + interval = biome.interval, + chance = biome.spawn_chance, + neighbors = biome.neighbors, + action = function(pos, node, active_object_count, active_object_count_wider) + local p_top = { x = pos.x, y = pos.y + 1, z = pos.z } + local n_top = minetest.get_node(p_top) + local perlin_fertile_area = minetest.get_perlin(biome.seed_diff, perlin_octaves, perlin_persistence, perlin_scale) + local noise1 = perlin_fertile_area:get2d({x=p_top.x, y=p_top.z}) + local noise2 = plantslib.perlin_temperature:get2d({x=p_top.x, y=p_top.z}) + local noise3 = plantslib.perlin_humidity:get2d({x=p_top.x+150, y=p_top.z+50}) + if noise1 > biome.plantlife_limit + and noise2 <= biome.temp_min + and noise2 >= biome.temp_max + and noise3 <= biome.humidity_min + and noise3 >= biome.humidity_max + and plantslib:is_node_loaded(p_top) then + local n_light = minetest.get_node_light(p_top, nil) + if not (biome.avoid_nodes and biome.avoid_radius and minetest.find_node_near(p_top, biome.avoid_radius + math.random(-1.5,2), biome.avoid_nodes)) + and n_light >= biome.light_min + and n_light <= biome.light_max + and (not(biome.neighbors and biome.ncount) or #(minetest.find_nodes_in_area({x=pos.x-1, y=pos.y, z=pos.z-1}, {x=pos.x+1, y=pos.y, z=pos.z+1}, biome.neighbors)) > biome.ncount ) + and (not(biome.near_nodes and biome.near_nodes_count and biome.near_nodes_size) or #(minetest.find_nodes_in_area({x=pos.x-biome.near_nodes_size, y=pos.y-biome.near_nodes_vertical, z=pos.z-biome.near_nodes_size}, {x=pos.x+biome.near_nodes_size, y=pos.y+biome.near_nodes_vertical, z=pos.z+biome.near_nodes_size}, biome.near_nodes)) >= biome.near_nodes_count) + and (not(biome.air_count and biome.air_size) or #(minetest.find_nodes_in_area({x=p_top.x-biome.air_size, y=p_top.y, z=p_top.z-biome.air_size}, {x=p_top.x+biome.air_size, y=p_top.y, z=p_top.z+biome.air_size}, "air")) >= biome.air_count) + and pos.y >= biome.min_elevation + and pos.y <= biome.max_elevation + then + local walldir = plantslib:find_adjacent_wall(p_top, biome.verticals_list, biome.choose_random_wall) + if biome.alt_wallnode and walldir then + if n_top.name == "air" then + minetest.set_node(p_top, { name = biome.alt_wallnode, param2 = walldir }) + end + else + local currentsurface = minetest.get_node(pos).name + if currentsurface ~= "default:water_source" + or (currentsurface == "default:water_source" and #(minetest.find_nodes_in_area({x=pos.x, y=pos.y-biome.depth_max-1, z=pos.z}, {x=pos.x, y=pos.y, z=pos.z}, {"default:dirt", "default:dirt_with_grass", "default:sand"})) > 0 ) + then + local rnd = math.random(1, biome.spawn_plants_count) + local plant_to_spawn = biome.spawn_plants[rnd] + local fdir = biome.facedir + if biome.random_facedir then + fdir = math.random(biome.random_facedir[1],biome.random_facedir[2]) + end + if type(biome.spawn_plants) == "string" then + assert(loadstring(biome.spawn_plants.."(...)"))(pos) + elseif not biome.spawn_on_side and not biome.spawn_on_bottom and not biome.spawn_replace_node then + if n_top.name == "air" then + minetest.set_node(p_top, { name = plant_to_spawn, param2 = fdir }) + end + elseif biome.spawn_replace_node then + minetest.set_node(pos, { name = plant_to_spawn, param2 = fdir }) + + elseif biome.spawn_on_side then + local onside = plantslib:find_open_side(pos) + if onside then + minetest.set_node(onside.newpos, { name = plant_to_spawn, param2 = onside.facedir }) + end + elseif biome.spawn_on_bottom then + if minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name == "air" then + minetest.set_node({x=pos.x, y=pos.y-1, z=pos.z}, { name = plant_to_spawn, param2 = fdir} ) + end + end + end + end + end + end + end + }) +end + +-- The growing ABM + +function plantslib:grow_plants(opts) + + local options = opts + + options.height_limit = options.height_limit or 5 + options.ground_nodes = options.ground_nodes or { "default:dirt_with_grass" } + options.grow_nodes = options.grow_nodes or { "default:dirt_with_grass" } + options.seed_diff = options.seed_diff or 0 + + if options.grow_delay*time_scale >= 1 then + options.interval = options.grow_delay*time_scale + else + options.interval = 1 + end + + minetest.register_abm({ + nodenames = { options.grow_plant }, + interval = options.interval, + chance = options.grow_chance, + action = function(pos, node, active_object_count, active_object_count_wider) + local p_top = {x=pos.x, y=pos.y+1, z=pos.z} + local p_bot = {x=pos.x, y=pos.y-1, z=pos.z} + local n_top = minetest.get_node(p_top) + local n_bot = minetest.get_node(p_bot) + local root_node = minetest.get_node({x=pos.x, y=pos.y-options.height_limit, z=pos.z}) + local walldir = nil + if options.need_wall and options.verticals_list then + walldir = plantslib:find_adjacent_wall(p_top, options.verticals_list, options.choose_random_wall) + end + if n_top.name == "air" and (not options.need_wall or (options.need_wall and walldir)) + then + -- corner case for changing short junglegrass + -- to dry shrub in desert + if n_bot.name == options.dry_early_node and options.grow_plant == "junglegrass:short" then + minetest.set_node(pos, { name = "default:dry_shrub" }) + + elseif options.grow_vertically and walldir then + if plantslib:search_downward(pos, options.height_limit, options.ground_nodes) then + minetest.set_node(p_top, { name = options.grow_plant, param2 = walldir}) + end + + elseif not options.grow_result and not options.grow_function then + minetest.remove_node(pos) + + else + plantslib:replace_object(pos, options.grow_result, options.grow_function, options.facedir, options.seed_diff) + end + end + end + }) +end + +-- Function to decide how to replace a plant - either grow it, replace it with +-- a tree, run a function, or die with an error. + +function plantslib:replace_object(pos, replacement, grow_function, walldir, seeddiff) + local growtype = type(grow_function) + if growtype == "table" then + minetest.remove_node(pos) + plantslib:grow_tree(pos, grow_function) + return + elseif growtype == "function" then + local perlin_fertile_area = minetest.get_perlin(seeddiff, perlin_octaves, perlin_persistence, perlin_scale) + local noise1 = perlin_fertile_area:get2d({x=pos.x, y=pos.z}) + local noise2 = plantslib.perlin_temperature:get2d({x=pos.x, y=pos.z}) + grow_function(pos,noise1,noise2,walldir) + return + elseif growtype == "string" then + local perlin_fertile_area = minetest.get_perlin(seeddiff, perlin_octaves, perlin_persistence, perlin_scale) + local noise1 = perlin_fertile_area:get2d({x=pos.x, y=pos.z}) + local noise2 = plantslib.perlin_temperature:get2d({x=pos.x, y=pos.z}) + assert(loadstring(grow_function.."(...)"))(pos,noise1,noise2,walldir) + return + elseif growtype == "nil" then + minetest.set_node(pos, { name = replacement, param2 = walldir}) + return + elseif growtype ~= "nil" and growtype ~= "string" and growtype ~= "table" then + error("Invalid grow function "..dump(grow_function).." used on object at ("..dump(pos)..")") + end +end + +-- function to decide if a node has a wall that's in verticals_list{} +-- returns wall direction of valid node, or nil if invalid. + +function plantslib:find_adjacent_wall(pos, verticals, randomflag) + local verts = dump(verticals) + if randomflag then + local walltab = {} + + if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 3 end + if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then walltab[#walltab + 1] = 2 end + if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then walltab[#walltab + 1] = 5 end + if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z+1 }).name) then walltab[#walltab + 1] = 4 end + + if #walltab > 0 then return walltab[math.random(1, #walltab)] end + + else + if string.find(verts, minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name) then return 3 end + if string.find(verts, minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name) then return 2 end + if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z-1 }).name) then return 5 end + if string.find(verts, minetest.get_node({ x=pos.x , y=pos.y, z=pos.z+1 }).name) then return 4 end + end + return nil +end + +-- Function to search downward from the given position, looking for the first +-- node that matches the ground table. Returns the new position, or nil if +-- height limit is exceeded before finding it. + +function plantslib:search_downward(pos, heightlimit, ground) + for i = 0, heightlimit do + if string.find(dump(ground), minetest.get_node({x=pos.x, y=pos.y-i, z = pos.z}).name) then + return {x=pos.x, y=pos.y-i, z = pos.z} + end + end + return false +end + +function plantslib:find_open_side(pos) + if minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name == "air" then + return {newpos = { x=pos.x-1, y=pos.y, z=pos.z }, facedir = 2} + end + if minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name == "air" then + return {newpos = { x=pos.x+1, y=pos.y, z=pos.z }, facedir = 3} + end + if minetest.get_node({ x=pos.x, y=pos.y, z=pos.z-1 }).name == "air" then + return {newpos = { x=pos.x, y=pos.y, z=pos.z-1 }, facedir = 4} + end + if minetest.get_node({ x=pos.x, y=pos.y, z=pos.z+1 }).name == "air" then + return {newpos = { x=pos.x, y=pos.y, z=pos.z+1 }, facedir = 5} + end + return nil +end + +-- spawn_tree() on generate is routed through here so that other mods can hook +-- into it. + +function plantslib:generate_tree(pos, nodes_or_function_or_model) + minetest.spawn_tree(pos, nodes_or_function_or_model) +end + +-- and this one's for the call used in the growing code + +function plantslib:grow_tree(pos, nodes_or_function_or_model) + minetest.spawn_tree(pos, nodes_or_function_or_model) +end + +-- Check for infinite stacks + +if minetest.get_modpath("unified_inventory") or not minetest.setting_getbool("creative_mode") then + plantslib.expect_infinite_stacks = false +else + plantslib.expect_infinite_stacks = true +end + +-- read a field from a node's definition + +function plantslib:get_nodedef_field(nodename, fieldname) + if not minetest.registered_nodes[nodename] then + return nil + end + return minetest.registered_nodes[nodename][fieldname] +end + +print("[Plants Lib] Loaded") + +minetest.after(0, function() + print("[Plants Lib] Registered a total of "..(#plantslib.surfaceslist_aircheck)+(#plantslib.surfaceslist_no_aircheck).." surface types to be evaluated, spread") + print("[Plants Lib] across "..#plantslib.actionslist_aircheck.." actions with air-checking and "..#plantslib.actionslist_no_aircheck.." actions without.") +end) + diff --git a/mods/plantlife_modpack/plants_lib/locale/de.txt b/mods/plantlife_modpack/plants_lib/locale/de.txt new file mode 100644 index 0000000..2886786 --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/locale/de.txt @@ -0,0 +1,5 @@ +# Translation by Xanthin + +someone = jemand +Sorry, %s owns that spot. = Entschuldige, %s gehoert diese Stelle. +[Plantlife Library] Loaded = [Plantlife Library] Geladen diff --git a/mods/plantlife_modpack/plants_lib/locale/fr.txt b/mods/plantlife_modpack/plants_lib/locale/fr.txt new file mode 100644 index 0000000..9070900 --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/locale/fr.txt @@ -0,0 +1,5 @@ +# Template + +someone = quelqu'un +Sorry, %s owns that spot. = Désolé, %s possède cet endroit. +[Plantlife Library] Loaded = [Librairie Plantlife] Chargée. diff --git a/mods/plantlife_modpack/plants_lib/locale/template.txt b/mods/plantlife_modpack/plants_lib/locale/template.txt new file mode 100644 index 0000000..0f5fbbd --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/locale/template.txt @@ -0,0 +1,5 @@ +# Template + +someone = +Sorry, %s owns that spot. = +[Plantlife Library] Loaded = diff --git a/mods/plantlife_modpack/plants_lib/locale/tr.txt b/mods/plantlife_modpack/plants_lib/locale/tr.txt new file mode 100644 index 0000000..4b596f4 --- /dev/null +++ b/mods/plantlife_modpack/plants_lib/locale/tr.txt @@ -0,0 +1,5 @@ +# Turkish translation by mahmutelmas06 + +someone = birisi +Sorry, %s owns that spot. = Üzgünüm, buranın sahibi %s. +[Plantlife Library] Loaded = [Plantlife Library] yüklendi diff --git a/mods/plantlife_modpack/poisonivy/depends.txt b/mods/plantlife_modpack/poisonivy/depends.txt new file mode 100644 index 0000000..6a66906 --- /dev/null +++ b/mods/plantlife_modpack/poisonivy/depends.txt @@ -0,0 +1,2 @@ +plants_lib + diff --git a/mods/plantlife_modpack/poisonivy/init.lua b/mods/plantlife_modpack/poisonivy/init.lua new file mode 100644 index 0000000..bb32121 --- /dev/null +++ b/mods/plantlife_modpack/poisonivy/init.lua @@ -0,0 +1,103 @@ +-- This file supplies poison ivy for the plantlife modpack +-- Last revision: 2013-01-24 + +local S = plantslib.intllib + +local SPAWN_DELAY = 1000 +local SPAWN_CHANCE = 200 +local GROW_DELAY = 500 +local GROW_CHANCE = 30 +local poisonivy_seed_diff = 339 +local walls_list = { + "default:dirt", + "default:dirt_with_grass", + "default:stone", + "default:cobble", + "default:mossycobble", + "default:brick", + "default:tree", + "default:jungletree", + "default:stone_with_coal", + "default:stone_with_iron" +}, +minetest.register_node('poisonivy:seedling', { + description = S("Poison ivy (seedling)"), + drawtype = 'plantlike', + waving = 1, + tile_images = { 'poisonivy_seedling.png' }, + inventory_image = 'poisonivy_seedling.png', + wield_image = 'poisonivy_seedling.png', + sunlight_propagates = true, + paramtype = 'light', + walkable = false, + groups = { snappy = 3, poisonivy=1, flora_block=1 }, + sounds = default.node_sound_leaves_defaults(), + buildable_to = true, +}) + +minetest.register_node('poisonivy:sproutling', { + description = S("Poison ivy (sproutling)"), + drawtype = 'plantlike', + waving = 1, + tile_images = { 'poisonivy_sproutling.png' }, + inventory_image = 'poisonivy_sproutling.png', + wield_image = 'poisonivy_sproutling.png', + sunlight_propagates = true, + paramtype = 'light', + walkable = false, + groups = { snappy = 3, poisonivy=1, flora_block=1 }, + sounds = default.node_sound_leaves_defaults(), + buildable_to = true, +}) + +minetest.register_node('poisonivy:climbing', { + description = S("Poison ivy (climbing plant)"), + drawtype = 'signlike', + tile_images = { 'poisonivy_climbing.png' }, + inventory_image = 'poisonivy_climbing.png', + wield_image = 'poisonivy_climbing.png', + sunlight_propagates = true, + paramtype = 'light', + paramtype2 = 'wallmounted', + walkable = false, + groups = { snappy = 3, poisonivy=1, flora_block=1 }, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "wallmounted", + --wall_side = = + }, + buildable_to = true, +}) + +plantslib:spawn_on_surfaces({ + spawn_delay = SPAWN_DELAY, + spawn_plants = {"poisonivy:seedling"}, + avoid_radius = 10, + spawn_chance = SPAWN_CHANCE/10, + spawn_surfaces = {"default:dirt_with_grass"}, + avoid_nodes = {"group:poisonivy", "group:flower", "group:flora"}, + seed_diff = poisonivy_seed_diff, + light_min = 7, + alt_wallnode = "poisonivy:climbing", + verticals_list = walls_list +}) + +plantslib:grow_plants({ + grow_delay = SPAWN_DELAY, + grow_chance = GROW_CHANCE, + grow_plant = "poisonivy:seedling", + grow_result = "poisonivy:sproutling", + grow_nodes = {"default:dirt_with_grass"} +}) + +plantslib:grow_plants({ + grow_delay = GROW_DELAY, + grow_chance = GROW_CHANCE*2, + grow_plant = "poisonivy:climbing", + need_wall = true, + grow_vertically = true, + verticals_list = walls_list, + ground_nodes = {"default:dirt_with_grass"} +}) + +print(S("[Poison Ivy] Loaded.")) diff --git a/mods/plantlife_modpack/poisonivy/locale/de.txt b/mods/plantlife_modpack/poisonivy/locale/de.txt new file mode 100644 index 0000000..5c099ce --- /dev/null +++ b/mods/plantlife_modpack/poisonivy/locale/de.txt @@ -0,0 +1,7 @@ +# Translation by Xanthin + +Poison ivy (seedling) = Giftefeu (Saemling) +Poison ivy (sproutling) = Giftefeu (Sproessling) +Poison ivy (climbing plant) = Giftefeu (Kletterpflanze) + +[Poison Ivy] Loaded. = [Poison Ivy] Geladen. diff --git a/mods/plantlife_modpack/poisonivy/locale/fr.txt b/mods/plantlife_modpack/poisonivy/locale/fr.txt new file mode 100644 index 0000000..f033dc3 --- /dev/null +++ b/mods/plantlife_modpack/poisonivy/locale/fr.txt @@ -0,0 +1,7 @@ +# Template + +Poison ivy (seedling) = Sumac vénéneux (semis) +Poison ivy (sproutling) = Sumac vénéneux (pousse) +Poison ivy (climbing plant) = Sumac vénéneux (grimpant) + +[Poison Ivy] Loaded. = [Sumac vénéneux] Chargé. diff --git a/mods/plantlife_modpack/poisonivy/locale/template.txt b/mods/plantlife_modpack/poisonivy/locale/template.txt new file mode 100644 index 0000000..35fb12d --- /dev/null +++ b/mods/plantlife_modpack/poisonivy/locale/template.txt @@ -0,0 +1,7 @@ +# Template + +Poison ivy (seedling) = +Poison ivy (sproutling) = +Poison ivy (climbing plant) = + +[Poison Ivy] Loaded. = diff --git a/mods/plantlife_modpack/poisonivy/locale/tr.txt b/mods/plantlife_modpack/poisonivy/locale/tr.txt new file mode 100644 index 0000000..a7a5b69 --- /dev/null +++ b/mods/plantlife_modpack/poisonivy/locale/tr.txt @@ -0,0 +1,7 @@ +# Turkish translation by mahmutelmas06 + +Poison ivy (seedling) = Sarmaşık (Fidan) +Poison ivy (sproutling) = Sarmaşık (Filiz) +Poison ivy (climbing plant) = Sarmaşık (Dolanan) + +[Poison Ivy] Loaded. = Sarmaşık yüklendi diff --git a/mods/plantlife_modpack/poisonivy/textures/poisonivy_climbing.png b/mods/plantlife_modpack/poisonivy/textures/poisonivy_climbing.png new file mode 100644 index 0000000..f53f7a3 Binary files /dev/null and b/mods/plantlife_modpack/poisonivy/textures/poisonivy_climbing.png differ diff --git a/mods/plantlife_modpack/poisonivy/textures/poisonivy_seedling.png b/mods/plantlife_modpack/poisonivy/textures/poisonivy_seedling.png new file mode 100644 index 0000000..281fa75 Binary files /dev/null and b/mods/plantlife_modpack/poisonivy/textures/poisonivy_seedling.png differ diff --git a/mods/plantlife_modpack/poisonivy/textures/poisonivy_sproutling.png b/mods/plantlife_modpack/poisonivy/textures/poisonivy_sproutling.png new file mode 100644 index 0000000..92d2742 Binary files /dev/null and b/mods/plantlife_modpack/poisonivy/textures/poisonivy_sproutling.png differ diff --git a/mods/plantlife_modpack/trunks/crafting.lua b/mods/plantlife_modpack/trunks/crafting.lua new file mode 100644 index 0000000..02f3991 --- /dev/null +++ b/mods/plantlife_modpack/trunks/crafting.lua @@ -0,0 +1,133 @@ +-- Code by Mossmanikin +----------------------------------------------------------------------------------------------- +-- TWiGS +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- *leaves --> twigs + output = "trunks:twig_1 2", + recipe = {{"group:leafdecay"}} +}) +if minetest.get_modpath("moretrees") ~= nil then +minetest.register_craft({ -- moretrees_leaves --> twigs + output = "trunks:twig_1 2", + recipe = {{"group:moretrees_leaves"}} +}) +minetest.register_craft({ -- except moretrees:palm_leaves + output = "moretrees:palm_leaves", + recipe = {{"moretrees:palm_leaves"}} +}) +end +if minetest.get_modpath("bushes") ~= nil then +minetest.register_craft({ -- BushLeaves --> twigs + output = "trunks:twig_1 2", + recipe = {{"bushes:BushLeaves1"}} +}) +minetest.register_craft({ + output = "trunks:twig_1 2", + recipe = {{"bushes:BushLeaves2"}} +}) +minetest.register_craft({ -- bushbranches --> twigs + output = "trunks:twig_1 4", + recipe = {{"bushes:bushbranches1"}} +}) +minetest.register_craft({ + output = "trunks:twig_1 4", + recipe = {{"bushes:bushbranches2"}} +}) +minetest.register_craft({ + output = "trunks:twig_1 4", + recipe = {{"bushes:bushbranches2a"}} +}) +minetest.register_craft({ + output = "trunks:twig_1 4", + recipe = {{"bushes:bushbranches3"}} +}) +end +minetest.register_craft({ -- twigs block --> twigs + output = "trunks:twig_1 8", + recipe = {{"trunks:twigs"}} +}) +minetest.register_craft({ -- twigs_slab --> twigs + output = "trunks:twig_1 4", + recipe = {{"trunks:twigs_slab"}} +}) +minetest.register_craft({ -- twigs_roof --> twigs + output = "trunks:twig_1 4", + recipe = {{"trunks:twigs_roof"}} +}) +minetest.register_craft({ -- twigs_roof_corner --> twigs + output = "trunks:twig_1 3", + recipe = {{"trunks:twigs_roof_corner"}} +}) +minetest.register_craft({ -- twigs_roof_corner_2 --> twigs + output = "trunks:twig_1 3", + recipe = {{"trunks:twigs_roof_corner_2"}} +}) +----------------------------------------------------------------------------------------------- +-- STiCK +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- twig --> stick + output = "default:stick", + recipe = {{"trunks:twig_1"}} +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS BLoCK +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- twigs --> twigs block + output = "trunks:twigs", + recipe = { + {"trunks:twig_1","trunks:twig_1","trunks:twig_1"}, + {"trunks:twig_1", "" ,"trunks:twig_1"}, + {"trunks:twig_1","trunks:twig_1","trunks:twig_1"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS SLaBS +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- twigs blocks --> twigs_slabs + output = "trunks:twigs_slab 6", + recipe = { + {"trunks:twigs","trunks:twigs","trunks:twigs"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooFS +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- twigs blocks --> twigs_roofs + output = "trunks:twigs_roof 4", + recipe = { + {"trunks:twigs",""}, + {"","trunks:twigs"}, + } +}) +minetest.register_craft({ + output = "trunks:twigs_roof 4", + recipe = { + {"","trunks:twigs"}, + {"trunks:twigs",""}, + } +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooF CoRNeRS +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- twigs blocks --> twigs_roof_corners + output = "trunks:twigs_roof_corner 8", + recipe = { + { "" ,"trunks:twigs", "" }, + {"trunks:twigs", "" ,"trunks:twigs"}, + } +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooF CoRNeRS 2 +----------------------------------------------------------------------------------------------- +minetest.register_craft({ -- twigs blocks --> twigs_roof_corner_2's + output = "trunks:twigs_roof_corner_2 8", + recipe = { + {"trunks:twigs", "" ,"trunks:twigs"}, + { "" ,"trunks:twigs", "" }, + } +}) \ No newline at end of file diff --git a/mods/plantlife_modpack/trunks/depends.txt b/mods/plantlife_modpack/trunks/depends.txt new file mode 100644 index 0000000..9c27f3b --- /dev/null +++ b/mods/plantlife_modpack/trunks/depends.txt @@ -0,0 +1,6 @@ +default +plants_lib +bushes? +ferns? +moretrees? +trees? \ No newline at end of file diff --git a/mods/plantlife_modpack/trunks/generating.lua b/mods/plantlife_modpack/trunks/generating.lua new file mode 100644 index 0000000..7796213 --- /dev/null +++ b/mods/plantlife_modpack/trunks/generating.lua @@ -0,0 +1,554 @@ +-- Code by Mossmanikin, Neuromancer, and others + +local function clone_node(name) + local node2 = {} + local node = minetest.registered_nodes[name] + for k,v in pairs(node) do + node2[k]=v + end + return node2 +end + +----------------------------------------------------------------------------------------------- +-- TWiGS +----------------------------------------------------------------------------------------------- + +abstract_trunks.place_twig = function(pos) + local twig_size = math.random(1,27) + + local right_here = {x=pos.x , y=pos.y+1, z=pos.z } + local north = {x=pos.x , y=pos.y+1, z=pos.z+1} + local north_east = {x=pos.x+1, y=pos.y+1, z=pos.z+1} + local east = {x=pos.x+1, y=pos.y+1, z=pos.z } + local south_east = {x=pos.x+1, y=pos.y+1, z=pos.z-1} + local south = {x=pos.x , y=pos.y+1, z=pos.z-1} + local south_west = {x=pos.x-1, y=pos.y+1, z=pos.z-1} + local west = {x=pos.x-1, y=pos.y+1, z=pos.z } + local north_west = {x=pos.x-1, y=pos.y+1, z=pos.z+1} + + local node_here = minetest.get_node(right_here) + local node_north = minetest.get_node(north) + local node_n_e = minetest.get_node(north_east) + local node_east = minetest.get_node(east) + local node_s_e = minetest.get_node(south_east) + local node_south = minetest.get_node(south) + local node_s_w = minetest.get_node(south_west) + local node_west = minetest.get_node(west) + local node_n_w = minetest.get_node(north_west) +-- small twigs + if twig_size <= 16 then + minetest.set_node(right_here, {name="trunks:twig_"..math.random(1,4), param2=math.random(0,3)}) + end +-- big twigs + if Big_Twigs == true then +-- big twig 1 + if twig_size == 17 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_5"}) + end + if minetest.registered_nodes[node_n_e.name].buildable_to then + minetest.set_node(north_east, {name="trunks:twig_7"}) + end + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.set_node(east, {name="trunks:twig_8"}) + end + end + elseif twig_size == 18 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_5", param2=1}) + end + if minetest.registered_nodes[node_s_e.name].buildable_to then + minetest.set_node(south_east, {name="trunks:twig_7", param2=1}) + end + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.set_node(south, {name="trunks:twig_8", param2=1}) + end + end + elseif twig_size == 19 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_5", param2=2}) + end + if minetest.registered_nodes[node_s_w.name].buildable_to then + minetest.set_node(south_west, {name="trunks:twig_7", param2=2}) + end + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.set_node(west, {name="trunks:twig_8", param2=2}) + end + end + elseif twig_size == 20 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_5", param2=3}) + end + if minetest.registered_nodes[node_n_w.name].buildable_to then + minetest.set_node(north_west, {name="trunks:twig_7", param2=3}) + end + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.set_node(north, {name="trunks:twig_8", param2=3}) + end + end +-- big twig 2 + elseif twig_size == 21 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z+1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z+1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_9"}) + end + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.set_node(north, {name="trunks:twig_10"}) + end + if minetest.registered_nodes[node_n_e.name].buildable_to then + minetest.set_node(north_east, {name="trunks:twig_11"}) + end + end + elseif twig_size == 22 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x+1,y=pos.y,z=pos.z-1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_9", param2=1}) + end + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.set_node(east, {name="trunks:twig_10", param2=1}) + end + if minetest.registered_nodes[node_s_e.name].buildable_to then + minetest.set_node(south_east, {name="trunks:twig_11", param2=1}) + end + end + elseif twig_size == 23 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x,y=pos.y,z=pos.z-1}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z-1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_9", param2=2}) + end + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.set_node(south, {name="trunks:twig_10", param2=2}) + end + if minetest.registered_nodes[node_s_w.name].buildable_to then + minetest.set_node(south_west, {name="trunks:twig_11", param2=2}) + end + end + elseif twig_size == 24 then + if not (minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z}).name].buildable_to + or minetest.registered_nodes[minetest.get_node({x=pos.x-1,y=pos.y,z=pos.z+1}).name].buildable_to) then + + if minetest.registered_nodes[node_here.name].buildable_to then + minetest.set_node(right_here, {name="trunks:twig_9", param2=3}) + end + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.set_node(west, {name="trunks:twig_10", param2=3}) + end + if minetest.registered_nodes[node_n_w.name].buildable_to then + minetest.set_node(north_west, {name="trunks:twig_11", param2=3}) + end + end + elseif twig_size <= 25 then + minetest.set_node(right_here, {name="trunks:twig_"..math.random(12,13), param2=math.random(0,3)}) + end + end +end + +if Twigs_on_ground == true then +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Twigs_on_ground_Max_Count, + rarity = Twigs_on_ground_Rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"}, + near_nodes_size = 3, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_trunks.place_twig +) +end + +if Twigs_on_water == true then +plantslib:register_generate_plant({ + surface = {"default:water_source"}, + max_count = Twigs_on_water_Max_Count, + rarity = Twigs_on_water_Rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"group:tree"}, + near_nodes_size = 3, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_trunks.place_twig +) +end + +----------------------------------------------------------------------------------------------- +-- TRuNKS +----------------------------------------------------------------------------------------------- +local TRuNKS = { +-- MoD TRuNK NR + {"default", "tree", 1}, + {"default", "jungletree", 2}, + + {"trees", "tree_conifer", 3}, + {"trees", "tree_mangrove", 4}, + {"trees", "tree_palm", 5}, + + {"moretrees", "apple_tree_trunk", 6}, + {"moretrees", "beech_trunk", 7}, + {"moretrees", "birch_trunk", 8}, + {"moretrees", "fir_trunk", 9}, + {"moretrees", "oak_trunk", 10}, + {"moretrees", "palm_trunk", 11}, + {"moretrees", "pine_trunk", 12}, + {"moretrees", "rubber_tree_trunk", 13}, + {"moretrees", "rubber_tree_trunk_empty", 14}, + {"moretrees", "sequoia_trunk", 15}, + {"moretrees", "spruce_trunk", 16}, + {"moretrees", "willow_trunk", 17}, +} + +if Horizontal_Trunks == true then -- see settings.txt +for i in pairs(TRuNKS) do + local MoD = TRuNKS[i][1] + local TRuNK = TRuNKS[i][2] + local NR = TRuNKS[i][3] + local trunkname = MoD..":"..TRuNK + if minetest.get_modpath(MoD) ~= nil + and NR < 6 -- moretrees trunks allready have facedir + and minetest.registered_nodes[trunkname] then -- the node being called exists. + temptrunk = clone_node(trunkname) + temptrunk.paramtype2 = "facedir" + minetest.register_node(":"..trunkname, temptrunk) + end +end +end + +abstract_trunks.place_trunk = function(pos) + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local north = {x=pos.x, y=pos.y+1, z=pos.z+1} + local north2 = {x=pos.x, y=pos.y+1, z=pos.z+2} + local south = {x=pos.x, y=pos.y+1, z=pos.z-1} + local south2 = {x=pos.x, y=pos.y+1, z=pos.z-2} + local west = {x=pos.x-1, y=pos.y+1, z=pos.z} + local west2 = {x=pos.x-2, y=pos.y+1, z=pos.z} + local east = {x=pos.x+1, y=pos.y+1, z=pos.z} + local east2 = {x=pos.x+2, y=pos.y+1, z=pos.z} + + local node_here = minetest.get_node(right_here) + local node_north = minetest.get_node(north) + local node_north2 = minetest.get_node(north2) + local node_south = minetest.get_node(south) + local node_south2 = minetest.get_node(south2) + local node_west = minetest.get_node(west) + local node_west2 = minetest.get_node(west2) + local node_east = minetest.get_node(east) + local node_east2 = minetest.get_node(east2) + if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true, + for i in pairs(TRuNKS) do + local MoD = TRuNKS[i][1] + local TRuNK = TRuNKS[i][2] + local NR = TRuNKS[i][3] + local chance = math.random(1, 17) + local length = math.random(3,5) + if chance == NR then + local trunk_type = math.random(1,3) + if trunk_type == 1 then + if minetest.get_modpath(MoD) ~= nil then + minetest.set_node(right_here, {name=MoD..":"..TRuNK}) + else + minetest.set_node(right_here, {name="default:tree"}) + end + elseif trunk_type == 2 and Horizontal_Trunks == true then + if minetest.get_modpath(MoD) ~= nil then + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.set_node(north, {name=MoD..":"..TRuNK, param2=4}) + end + + if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then + minetest.set_node(north2, {name=MoD..":"..TRuNK, param2=4}) + end + + minetest.set_node(right_here, {name=MoD..":"..TRuNK, param2=4}) + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.set_node(south, {name=MoD..":"..TRuNK, param2=4}) + end + if length == 5 and minetest.registered_nodes[node_south2.name].buildable_to then + minetest.set_node(south2, {name=MoD..":"..TRuNK, param2=4}) + end + else + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.set_node(north, {name="default:tree", param2=4}) + end + if length >= 4 and minetest.registered_nodes[node_north2.name].buildable_to then + minetest.set_node(north2, {name="default:tree", param2=4}) + end + minetest.set_node(right_here, {name="default:tree", param2=4}) + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.set_node(south, {name="default:tree", param2=4}) + end + if length == 5 and minetest.registered_nodes[node_south2.name].buildable_to then + minetest.set_node(south2, {name="default:tree", param2=4}) + end + end + elseif trunk_type == 3 and Horizontal_Trunks == true then + if minetest.get_modpath(MoD) ~= nil then + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.set_node(west, {name=MoD..":"..TRuNK, param2=12}) + end + if length >= 4 and minetest.registered_nodes[node_west2.name].buildable_to then + minetest.set_node(west2, {name=MoD..":"..TRuNK, param2=12}) + end + minetest.set_node(right_here, {name=MoD..":"..TRuNK, param2=12}) + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.set_node(east, {name=MoD..":"..TRuNK, param2=12}) + end + if length == 5 and minetest.registered_nodes[node_east2.name].buildable_to then + minetest.set_node(east2, {name=MoD..":"..TRuNK, param2=12}) + end + else + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.set_node(west, {name="default:tree", param2=12}) + end + if length >= 4 and minetest.registered_nodes[node_west2.name].buildable_to then + minetest.set_node(west2, {name="default:tree", param2=12}) + end + minetest.set_node(right_here, {name="default:tree", param2=12}) + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.set_node(east, {name="default:tree", param2=12}) + end + if length == 5 and minetest.registered_nodes[node_east2.name].buildable_to then + minetest.set_node(east2, {name="default:tree", param2=12}) + end + end + end + end + end + end +end + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Trunks_Max_Count, -- 320, + rarity = Trunks_Rarity, -- 99, + min_elevation = 1, + max_elevation = 40, + avoid_nodes = {"group:tree"}, + avoid_radius = 1, + near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"}, + near_nodes_size = 3, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_trunks.place_trunk +) + +----------------------------------------------------------------------------------------------- +-- MoSS & FuNGuS -- on ground +----------------------------------------------------------------------------------------------- +if Moss_on_ground == true then +abstract_trunks.grow_moss_on_ground = function(pos) + local on_ground = {x=pos.x, y=pos.y+1, z=pos.z} + local moss_type = math.random(1,21) + + if moss_type == 1 then + minetest.set_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3)}) + else + minetest.set_node(on_ground, {name="trunks:moss", param2=math.random(0,3)}) + end + +end + +plantslib:register_generate_plant({ + surface = {"default:dirt_with_grass"}, + max_count = Moss_on_ground_Max_Count, + rarity = Moss_on_ground_Rarity, + min_elevation = 1, + max_elevation = 40, + near_nodes = { + "group:tree", + "ferns:fern_03", + "ferns:fern_02", + "ferns:fern_01" + }, + near_nodes_size = 2, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -0.9, + }, + abstract_trunks.grow_moss_on_ground +) +end + +----------------------------------------------------------------------------------------------- +-- MoSS & FuNGuS -- on trunks +----------------------------------------------------------------------------------------------- +if Moss_on_trunk == true then +abstract_trunks.grow_moss_on_trunk = function(pos) + local on_ground = {x=pos.x, y=pos.y+1, z=pos.z} + local at_side_n = {x=pos.x, y=pos.y, z=pos.z+1} + local at_side_e = {x=pos.x+1, y=pos.y, z=pos.z} + local at_side_s = {x=pos.x, y=pos.y, z=pos.z-1} + local at_side_w = {x=pos.x-1, y=pos.y, z=pos.z} + local undrneath = {x=pos.x, y=pos.y-1, z=pos.z} + + local node_here = minetest.get_node(on_ground) + local node_north = minetest.get_node(at_side_n) + local node_east = minetest.get_node(at_side_e) + local node_south = minetest.get_node(at_side_s) + local node_west = minetest.get_node(at_side_w) + local node_under = minetest.get_node(undrneath) + + --if minetest.get_item_group(node_under.name, "tree") < 1 then + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_here.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.set_node(on_ground, {name="trunks:moss_fungus", param2=math.random(0,3) --[[1]]}) + elseif moss_type < 22 then + minetest.set_node(on_ground, {name="trunks:moss", param2=math.random(0,3) --[[1]]}) + end + end + local moss_type = math.random(1,31) -- cliche of more moss at north + if minetest.registered_nodes[node_north.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.set_node(at_side_n, {name="trunks:moss_fungus", param2=math.random(4,7)}) -- 5,4,6,7 + elseif moss_type < 22 then + minetest.set_node(at_side_n, {name="trunks:moss", param2=math.random(4,7)}) + end + end + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_east.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.set_node(at_side_e, {name="trunks:moss_fungus", param2=math.random(12,15)}) + elseif moss_type < 22 then + minetest.set_node(at_side_e, {name="trunks:moss", param2=math.random(12,15)}) + end + end + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_south.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.set_node(at_side_s, {name="trunks:moss_fungus", param2=math.random(8,11)}) + elseif moss_type < 22 then + minetest.set_node(at_side_s, {name="trunks:moss", param2=math.random(8,11)}) + end + end + local moss_type = math.random(1,41) + if minetest.registered_nodes[node_west.name].buildable_to then -- instead of check_air = true, + if moss_type == 1 then + minetest.set_node(at_side_w, {name="trunks:moss_fungus", param2=math.random(16,19)}) + elseif moss_type < 22 then + minetest.set_node(at_side_w, {name="trunks:moss", param2=math.random(16,19)}) + end + end + --end +end + +plantslib:register_generate_plant({ + surface = { + "default:tree", + "default:jungletree", + "trees:tree_conifer", + "trees:tree_mangrove", + --"trees:tree_palm", + "moretrees:apple_tree_trunk", + "moretrees:beech_trunk", + "moretrees:birch_trunk", + "moretrees:fir_trunk", + "moretrees:oak_trunk", + --"moretrees:palm_trunk", + "moretrees:pine_trunk", + "moretrees:rubber_tree_trunk", + "moretrees:rubber_tree_trunk_empty", + "moretrees:sequoia_trunk", + "moretrees:spruce_trunk", + "moretrees:willow_trunk", + "default:mossycobble" + }, + max_count = Moss_on_trunk_Max_Count, + rarity = Moss_on_trunk_Rarity, + min_elevation = 1, + max_elevation = 40, + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_trunks.grow_moss_on_trunk" +) +end + +----------------------------------------------------------------------------------------------- +-- RooTS +----------------------------------------------------------------------------------------------- +if Roots == true then -- see settings.txt + +abstract_trunks.grow_roots = function(pos) + local twig_size = math.random(1,27) + + local right_here = {x=pos.x , y=pos.y , z=pos.z } + local below = {x=pos.x , y=pos.y-1, z=pos.z } + local north = {x=pos.x , y=pos.y , z=pos.z+1} + local east = {x=pos.x+1, y=pos.y , z=pos.z } + local south = {x=pos.x , y=pos.y , z=pos.z-1} + local west = {x=pos.x-1, y=pos.y , z=pos.z } + + local node_here = minetest.get_node(right_here) + local node_below = minetest.get_node(below) + local node_north = minetest.get_node(north) + local node_east = minetest.get_node(east) + local node_south = minetest.get_node(south) + local node_west = minetest.get_node(west) + + for i in pairs(TRuNKS) do + local MoD = TRuNKS[i][1] + local TRuNK = TRuNKS[i][2] + if minetest.get_modpath(MoD) ~= nil + and node_here.name == MoD..":"..TRuNK + and string.find(node_below.name, "dirt") + and node_here.param2 == 0 then + if minetest.registered_nodes[node_north.name].buildable_to then + minetest.set_node(north, {name="trunks:"..TRuNK.."root", param2=2}) + end + if minetest.registered_nodes[node_east.name].buildable_to then + minetest.set_node(east, {name="trunks:"..TRuNK.."root", param2=3}) + end + if minetest.registered_nodes[node_south.name].buildable_to then + minetest.set_node(south, {name="trunks:"..TRuNK.."root", param2=0}) + end + if minetest.registered_nodes[node_west.name].buildable_to then + minetest.set_node(west, {name="trunks:"..TRuNK.."root", param2=1}) + end + end + end +end + +plantslib:register_generate_plant({ + surface = {"group:tree"}, + max_count = 1000, + rarity = 1, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"default:dirt_with_grass"}, + near_nodes_size = 1, + near_nodes_vertical = 1, + near_nodes_count = 1, + plantlife_limit = -1, + check_air = false, + }, + "abstract_trunks.grow_roots" +) + +end diff --git a/mods/plantlife_modpack/trunks/init.lua b/mods/plantlife_modpack/trunks/init.lua new file mode 100644 index 0000000..ee9427d --- /dev/null +++ b/mods/plantlife_modpack/trunks/init.lua @@ -0,0 +1,17 @@ +----------------------------------------------------------------------------------------------- +local title = "Trunks" +local version = "0.1.4" +local mname = "trunks" +----------------------------------------------------------------------------------------------- +-- Code by Mossmanikin & Neuromancer + +abstract_trunks = {} + +dofile(minetest.get_modpath("trunks").."/trunks_settings.txt") +dofile(minetest.get_modpath("trunks").."/generating.lua") +dofile(minetest.get_modpath("trunks").."/nodes.lua") +dofile(minetest.get_modpath("trunks").."/crafting.lua") + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/mods/plantlife_modpack/trunks/nodes.lua b/mods/plantlife_modpack/trunks/nodes.lua new file mode 100644 index 0000000..94aa74d --- /dev/null +++ b/mods/plantlife_modpack/trunks/nodes.lua @@ -0,0 +1,362 @@ +-- Code by Mossmanikin & Neuromancer +----------------------------------------------------------------------------------------------- +-- TWiGS +----------------------------------------------------------------------------------------------- +-- For compatibility with older stuff +minetest.register_alias("trunks:twig", "trunks:twig_1") + +local flat_stick = {-1/2, -1/2, -1/2, 1/2, -7/16, 1/2} +local NoDe = { {1}, {2}, {3}, {4}, {5}, --[[{6},]] {7}, {8}, {9}, {10}, {11}, {12}, {13} } + + +for i in pairs(NoDe) do + local NR = NoDe[i][1] + local iNV = NR - 1 + minetest.register_node("trunks:twig_"..NR, { + description = "Twig", + inventory_image = "trunks_twig_"..NR..".png", + wield_image = "trunks_twig_"..NR..".png", + drawtype = "nodebox", + tiles = { + "trunks_twig_"..NR..".png", + "trunks_twig_"..NR..".png^[transformFY", -- mirror + "trunks_twig_6.png" -- empty + }, + paramtype = "light", + paramtype2 = "facedir", + walkable = false, + sunlight_propagates = true, + buildable_to = true, + node_box = {type = "fixed", fixed = flat_stick}, + groups = { + choppy=2, + oddly_breakable_by_hand=2, + flammable=3, + attached_node=1, + not_in_creative_inventory=iNV, + kindling=1 + }, + drop = "trunks:twig_1", + sounds = default.node_sound_leaves_defaults(), + liquids_pointable = true, + on_place = function(itemstack, placer, pointed_thing) + local pt = pointed_thing + local direction = minetest.dir_to_facedir(placer:get_look_dir()) + if minetest.get_node(pt.above).name=="air" then + minetest.set_node(pt.above, {name="trunks:twig_"..math.random(1,4), param2=direction}) + if not minetest.setting_getbool("creative_mode") then + itemstack:take_item() + end + return itemstack + end + end, + }) +end + +----------------------------------------------------------------------------------------------- +-- MoSS +----------------------------------------------------------------------------------------------- +local flat_moss = {-1/2, -1/2, -1/2, 1/2, -15/32--[[<-flickers if smaller]], 1/2} + +minetest.register_node("trunks:moss", { + description = "Moss", + drawtype = "nodebox",--"signlike", + tiles = {"trunks_moss.png"}, + inventory_image = "trunks_moss.png", + wield_image = "trunks_moss.png", + paramtype = "light", + paramtype2 = "facedir",--"wallmounted", + sunlight_propagates = true, + walkable = false, + node_box = {type = "fixed", fixed = flat_moss}, + selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"}, + groups = {snappy = 3, flammable = 3 }, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- MoSS & FuNGuS +----------------------------------------------------------------------------------------------- +minetest.register_node("trunks:moss_fungus", { + description = "Moss with Fungus", + drawtype = "nodebox",--"signlike", + tiles = {"trunks_moss_fungus.png"}, + inventory_image = "trunks_moss_fungus.png", + wield_image = "trunks_moss_fungus.png", + paramtype = "light", + paramtype2 = "facedir",--"wallmounted", + sunlight_propagates = true, + walkable = false, + node_box = {type = "fixed", fixed = flat_moss}, + selection_box = {type = "fixed", fixed = flat_stick},--{type = "wallmounted"}, + groups = {snappy = 3, flammable = 3 }, + sounds = default.node_sound_leaves_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS BLoCK +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs", "trunks:twigs") + +minetest.register_node("trunks:twigs", { + description = "Twigs Block", + paramtype2 = "facedir", + tiles = {"trunks_twigs.png"}, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS SLaB +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs_slab", "trunks:twigs_slab") + +minetest.register_node("trunks:twigs_slab", { + description = "Twigs Slab", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"trunks_twigs.png"}, + node_box = { + type = "fixed", + fixed = {-1/2, -1/2, -1/2, 1/2, 0, 1/2}, + }, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooF +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs_roof", "trunks:twigs_roof") + +minetest.register_node("trunks:twigs_roof", { + description = "Twigs Roof", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = {"trunks_twigs.png"}, + node_box = { + type = "fixed", +-- { left, bottom, front, right, top, back } + fixed = { + {-1/2, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, -1/2, -1/2, 1/2, 0, 0}, + } + }, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooF CoRNeR +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs_roof_corner", "trunks:twigs_roof_corner") + +minetest.register_node("trunks:twigs_roof_corner", { + description = "Twigs Roof Corner 1", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = { + "trunks_twigs_corner.png", + "trunks_twigs_corner.png", + "trunks_twigs.png" + }, + node_box = { + type = "fixed", +-- { left, bottom, front, right, top, back } + fixed = { + {-1/2, 0, 0, 0, 1/2, 1/2}, + {0, -1/2, 0, 1/2, 0, 1/2}, + {-1/2, -1/2, -1/2, 0, 0, 0}, + } + }, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +----------------------------------------------------------------------------------------------- +-- TWiGS RooF CoRNeR 2 +----------------------------------------------------------------------------------------------- +minetest.register_alias("woodstuff:twigs_roof_corner_2", "trunks:twigs_roof_corner_2") + +minetest.register_node("trunks:twigs_roof_corner_2", { + description = "Twigs Roof Corner 2", + drawtype = "nodebox", + paramtype = "light", + paramtype2 = "facedir", + tiles = { + "trunks_twigs_corner.png", + "trunks_twigs_corner.png", + "trunks_twigs.png" + }, + node_box = { + type = "fixed", +-- { left, bottom, front, right, top, back } + fixed = { + {-1/2, -1/2, 0, 0, 0, 1/2}, + {0, 0, 0, 1/2, 1/2, 1/2}, + {-1/2, 0, -1/2, 0, 1/2, 0}, + } + }, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +if Auto_Roof_Corner == true then + + local roof = "trunks:twigs_roof" + local corner = "trunks:twigs_roof_corner" + local corner_2 = "trunks:twigs_roof_corner_2" + + minetest.register_abm({ + nodenames = {roof}, + interval = 1, + chance = 1, + action = function(pos) + + local node_east = minetest.get_node({x=pos.x+1, y=pos.y, z=pos.z }) + local node_west = minetest.get_node({x=pos.x-1, y=pos.y, z=pos.z }) + local node_north = minetest.get_node({x=pos.x, y=pos.y, z=pos.z+1}) + local node_south = minetest.get_node({x=pos.x, y=pos.y, z=pos.z-1}) + -- corner 1 + if ((node_west.name == roof and node_west.param2 == 0) + or (node_west.name == corner and node_west.param2 == 1)) + and ((node_north.name == roof and node_north.param2 == 3) + or (node_north.name == corner and node_north.param2 == 3)) + then + minetest.set_node(pos, {name=corner, param2=0}) + end + + if ((node_north.name == roof and node_north.param2 == 1) + or (node_north.name == corner and node_north.param2 == 2)) + and ((node_east.name == roof and node_east.param2 == 0) + or (node_east.name == corner and node_east.param2 == 0)) + then + minetest.set_node(pos, {name=corner, param2=1}) + end + + if ((node_east.name == roof and node_east.param2 == 2) + or (node_east.name == corner and node_east.param2 == 3)) + and ((node_south.name == roof and node_south.param2 == 1) + or (node_south.name == corner and node_south.param2 == 1)) + then + minetest.set_node(pos, {name=corner, param2=2}) + end + + if ((node_south.name == roof and node_south.param2 == 3) + or (node_south.name == corner and node_south.param2 == 0)) + and ((node_west.name == roof and node_west.param2 == 2) + or (node_west.name == corner and node_west.param2 == 2)) + then + minetest.set_node(pos, {name=corner, param2=3}) + end + -- corner 2 + if ((node_west.name == roof and node_west.param2 == 2) + or (node_west.name == corner_2 and node_west.param2 == 1)) + and ((node_north.name == roof and node_north.param2 == 1) + or (node_north.name == corner_2 and node_north.param2 == 3)) + then + minetest.set_node(pos, {name=corner_2, param2=0}) + end + + if ((node_north.name == roof and node_north.param2 == 3) + or (node_north.name == corner_2 and node_north.param2 == 2)) + and ((node_east.name == roof and node_east.param2 == 2) + or (node_east.name == corner_2 and node_east.param2 == 0)) + then + minetest.set_node(pos, {name=corner_2, param2=1}) + end + + if ((node_east.name == roof and node_east.param2 == 0) + or (node_east.name == corner_2 and node_east.param2 == 3)) + and ((node_south.name == roof and node_south.param2 == 3) + or (node_south.name == corner_2 and node_south.param2 == 1)) + then + minetest.set_node(pos, {name=corner_2, param2=2}) + end + + if ((node_south.name == roof and node_south.param2 == 1) + or (node_south.name == corner_2 and node_south.param2 == 0)) + and ((node_west.name == roof and node_west.param2 == 0) + or (node_west.name == corner_2 and node_west.param2 == 2)) + then + minetest.set_node(pos, {name=corner_2, param2=3}) + end + + end, + }) +end + +-- MM: The following stuff is just for testing purposes for now; no generating of roots. +-- I'm not satisfied with this; they should be either bigger or a different drawtype. +----------------------------------------------------------------------------------------------- +-- RooTS +----------------------------------------------------------------------------------------------- +if Roots == true then -- see settings.txt + +local roots_cube = {-2/16, -1/2, -3/16, 2/16, 1/16, 1/2} + +local roots_sheet = {0, -1/2, -1/2, 0, 1/16, 1/2} + +local TRuNKS = { +-- MoD TRuNK + {"default", "tree" }, + {"default", "jungletree" }, + + {"trees", "tree_conifer" }, + {"trees", "tree_mangrove" }, + {"trees", "tree_palm" }, + + {"moretrees", "apple_tree_trunk" }, + {"moretrees", "beech_trunk" }, + {"moretrees", "birch_trunk" }, + {"moretrees", "fir_trunk" }, + {"moretrees", "oak_trunk" }, + {"moretrees", "palm_trunk" }, + {"moretrees", "pine_trunk" }, + {"moretrees", "rubber_tree_trunk" }, + {"moretrees", "rubber_tree_trunk_empty" }, + {"moretrees", "sequoia_trunk" }, + {"moretrees", "spruce_trunk" }, + {"moretrees", "willow_trunk" }, +} + +for i in pairs(TRuNKS) do + local MoD = TRuNKS[i][1] + local TRuNK = TRuNKS[i][2] + if minetest.get_modpath(MoD) ~= nil then + + local des = minetest.registered_nodes[MoD..":"..TRuNK].description + + minetest.register_node("trunks:"..TRuNK.."root", { + description = des.." Root", + paramtype = "light", + paramtype2 = "facedir", + tiles = { +--[[top]] MoD.."_"..TRuNK..".png", +--[[bottom]] MoD.."_"..TRuNK..".png", +--[[right]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[makealpha:0,0,0", +--[[left]] MoD.."_"..TRuNK..".png^trunks_root_mask.png^[transformFX^[makealpha:0,0,0", +--[[back]] MoD.."_"..TRuNK..".png", +--[[front]] MoD.."_"..TRuNK..".png" + }, + drawtype = "nodebox", + selection_box = {type = "fixed", fixed = roots_cube}, + node_box = {type = "fixed", fixed = roots_sheet}, + groups = { + tree=1, + snappy=1, + choppy=2, + oddly_breakable_by_hand=1, + flammable=2--, + --not_in_creative_inventory=1 -- atm in inv for testing + }, + --drop = "trunks:twig_1", -- not sure about this yet + sounds = default.node_sound_wood_defaults(), + }) + + end +end +end diff --git a/mods/plantlife_modpack/trunks/textures/credit_textures.txt b/mods/plantlife_modpack/trunks/textures/credit_textures.txt new file mode 100644 index 0000000..b3893d5 --- /dev/null +++ b/mods/plantlife_modpack/trunks/textures/credit_textures.txt @@ -0,0 +1,34 @@ +------------------------------------------------------------- +Credit for textures of "trunks" +------------------------------------------------------------- +(If more than one author is listed the names are in alphabetical order) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +FOLDER TEXTURE AUTHORS +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../trunks/textures trunks_moss.png Neuromancer + trunks_moss_fungus.png Neuromancer + trunks_twig_1.png Mossmanikin + trunks_twig_2.png Mossmanikin, Neuromancer + trunks_twig_3.png Mossmanikin, Neuromancer + trunks_twig_4.png Mossmanikin, Neuromancer + trunks_twig_5.png Mossmanikin, Neuromancer + (trunks_twig_6.png) (Mossmanikin) + trunks_twig_7.png Mossmanikin, Neuromancer + trunks_twig_8.png Mossmanikin, Neuromancer + trunks_twig_9.png Mossmanikin, Neuromancer + trunks_twig_10.png Mossmanikin, Neuromancer + trunks_twig_11.png Mossmanikin, Neuromancer + trunks_twigs.png Mossmanikin + trunks_twigs_corner.png Mossmanikin + trunks_twigs_top.png Mossmanikin +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../trunks/textures/old & unused comboSticks.png Mossmanikin, Neuromancer + comboSticks_2.png Mossmanikin, Neuromancer + trunks_twig_1e.png Mossmanikin, Neuromancer + trunks_twig_1n.png Mossmanikin, Neuromancer + trunks_twig_2n.png Mossmanikin, Neuromancer + trunks_twig_3n.png Mossmanikin, Neuromancer + trunks_twig_4n.png Mossmanikin, Neuromancer + trunks_twig_5-8.png Mossmanikin, Neuromancer + trunks_twig_9-12.png Mossmanikin, Neuromancer +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/comboSticks.png b/mods/plantlife_modpack/trunks/textures/old & unused/comboSticks.png new file mode 100644 index 0000000..e3b7770 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/comboSticks.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/comboSticks_2.png b/mods/plantlife_modpack/trunks/textures/old & unused/comboSticks_2.png new file mode 100644 index 0000000..2053592 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/comboSticks_2.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_root_mask_old.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_root_mask_old.png new file mode 100644 index 0000000..51071c3 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_root_mask_old.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_1e.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_1e.png new file mode 100644 index 0000000..518955c Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_1e.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_1n.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_1n.png new file mode 100644 index 0000000..157c957 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_1n.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_2n.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_2n.png new file mode 100644 index 0000000..9945f22 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_2n.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_3n.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_3n.png new file mode 100644 index 0000000..6aacf9d Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_3n.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_4n.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_4n.png new file mode 100644 index 0000000..c5286b6 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_4n.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_5-8.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_5-8.png new file mode 100644 index 0000000..9dda478 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_5-8.png differ diff --git a/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_9-12.png b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_9-12.png new file mode 100644 index 0000000..42a5d45 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/old & unused/trunks_twig_9-12.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_moss.png b/mods/plantlife_modpack/trunks/textures/trunks_moss.png new file mode 100644 index 0000000..5ffe58f Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_moss.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_moss_fungus.png b/mods/plantlife_modpack/trunks/textures/trunks_moss_fungus.png new file mode 100644 index 0000000..fcd4ae2 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_moss_fungus.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_root_mask.png b/mods/plantlife_modpack/trunks/textures/trunks_root_mask.png new file mode 100644 index 0000000..5bfdac6 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_root_mask.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_1.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_1.png new file mode 100644 index 0000000..066bbfa Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_1.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_10.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_10.png new file mode 100644 index 0000000..062d8f6 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_10.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_11.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_11.png new file mode 100644 index 0000000..d9f41f8 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_11.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_12.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_12.png new file mode 100644 index 0000000..b8cf458 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_12.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_13.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_13.png new file mode 100644 index 0000000..64b08eb Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_13.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_2.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_2.png new file mode 100644 index 0000000..826253c Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_2.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_3.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_3.png new file mode 100644 index 0000000..4038e03 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_3.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_4.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_4.png new file mode 100644 index 0000000..971d649 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_4.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_5.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_5.png new file mode 100644 index 0000000..5f74334 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_5.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_6.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_6.png new file mode 100644 index 0000000..2f6464b Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_6.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_7.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_7.png new file mode 100644 index 0000000..8b5e4e1 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_7.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_8.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_8.png new file mode 100644 index 0000000..a9441e9 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_8.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twig_9.png b/mods/plantlife_modpack/trunks/textures/trunks_twig_9.png new file mode 100644 index 0000000..3e7a3f3 Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twig_9.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twigs.png b/mods/plantlife_modpack/trunks/textures/trunks_twigs.png new file mode 100644 index 0000000..20ae6ca Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twigs.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twigs_corner.png b/mods/plantlife_modpack/trunks/textures/trunks_twigs_corner.png new file mode 100644 index 0000000..60871bf Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twigs_corner.png differ diff --git a/mods/plantlife_modpack/trunks/textures/trunks_twigs_top.png b/mods/plantlife_modpack/trunks/textures/trunks_twigs_top.png new file mode 100644 index 0000000..baf797c Binary files /dev/null and b/mods/plantlife_modpack/trunks/textures/trunks_twigs_top.png differ diff --git a/mods/plantlife_modpack/trunks/trunks_settings.txt b/mods/plantlife_modpack/trunks/trunks_settings.txt new file mode 100644 index 0000000..7fe8822 --- /dev/null +++ b/mods/plantlife_modpack/trunks/trunks_settings.txt @@ -0,0 +1,70 @@ +-- Settings for generation of stuff (at map-generation time) + + + + + +Horizontal_Trunks = true + + + +Trunks_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + + +Trunks_Rarity = 99 -- larger values make trunks more rare (100 means chance of 0 %) + + + + + +Big_Twigs = true -- twigs larger than one node +Twigs_on_ground = true + + + +Twigs_on_ground_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes + +Twigs_on_ground_Rarity = 66 -- larger values make twigs more rare (100 means chance of 0 %) + + + + + +Twigs_on_water = true + + + +Twigs_on_water_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes + + +Twigs_on_water_Rarity = 33 -- larger values make twigs more rare (100 means chance of 0 %) + + + + + +Moss_on_ground = true + + + +Moss_on_ground_Max_Count = 400 -- absolute maximum number in an area of 80x80x80 nodes + +Moss_on_ground_Rarity = 79 -- larger values makes moss more rare (100 means chance of 0 %) + + + + + +Moss_on_trunk = true + + + +Moss_on_trunk_Max_Count = 640 -- absolute maximum number in an area of 80x80x80 nodes + +Moss_on_trunk_Rarity = 24 -- larger values makes moss more rare (100 means chance of 0 %) + + +Auto_Roof_Corner = true -- behavior is similar (not the same!) to the one of minecraft stairs + + +Roots = true \ No newline at end of file diff --git a/mods/plantlife_modpack/vines/LICENSE.md b/mods/plantlife_modpack/vines/LICENSE.md new file mode 100644 index 0000000..fb67788 --- /dev/null +++ b/mods/plantlife_modpack/vines/LICENSE.md @@ -0,0 +1,4 @@ +License +======= +- Code WTFPL +- Texture CC diff --git a/mods/plantlife_modpack/vines/README.md b/mods/plantlife_modpack/vines/README.md new file mode 100644 index 0000000..89fdb27 --- /dev/null +++ b/mods/plantlife_modpack/vines/README.md @@ -0,0 +1,56 @@ +# Vines + +## Features +- Rope block for spawning rope that slowly drops into the deep. +- Vines are climbable and slowly grow downward. +- Shears that allow the collecting of vines. +- Spawns vines on jungletree leaves. +- Roots on the bottom of dirt and dirt with grass nodes. +- Spawns vines on trees located in swampy area. +- Jungle vines that spawn on the side of jungletrees + +## API +The API is very minimal. It allows the registering of vines and the spawning of +existing vines on nodes of your own. + +If you want vines to spawn on a certain node then you can choose which vine by +adding to the node groups the unique group of that vine. This is determined by +the name of the vine ( see vines.lua ) appended with '_vines'. +An example would be. + +"willow_vines" or "jungle_vines" + +There are two types of vines. One that spawns at the bottom of nodes and uses the +plantlike drawtype, and vines that spawn on the side that use signlike +drawtype. The type is determined by the spawn_on_side property in the biome +table. + +### Example +*taken from mod* + +```lua + + vines.register_vine( name, definitions, biome ) + + --e.g. + + vines.register_vine( 'vine', { + description = "Vines", + average_length = 9 + }, biome ) + +``` + +### definitions +|key| type| description| +|---| ---| ---| +|description| string|The vine's tooltip description| +|average_length|int| The average length of vines| + +For biome definitions please see the [plants_lib API documentation](https://github.com/VanessaE/plantlife_modpack/blob/master/API.txt) + +## Notice +Vines use after_destruct on registered leave nodes to remove vines from which +the leaves are removed. This is done by using the override function. +Malfunctions may occur if other mods override the after_destruct of these nodes +also. diff --git a/mods/plantlife_modpack/vines/aliases.lua b/mods/plantlife_modpack/vines/aliases.lua new file mode 100644 index 0000000..fce7218 --- /dev/null +++ b/mods/plantlife_modpack/vines/aliases.lua @@ -0,0 +1,11 @@ +-- used to remove the old vine nodes. This gives room for the new nodes +minetest.register_alias( 'vines:root', 'air' ) +minetest.register_alias( 'vines:root_rotten', 'air' ) +minetest.register_alias( 'vines:vine', 'air' ) +minetest.register_alias( 'vines:vine_rotten', 'air' ) +minetest.register_alias( 'vines:side', 'air' ) +minetest.register_alias( 'vines:side_rotten', 'air' ) +minetest.register_alias( 'vines:jungle', 'air' ) +minetest.register_alias( 'vines:jungle_rotten', 'air' ) +minetest.register_alias( 'vines:willow', 'air' ) +minetest.register_alias( 'vines:willow_rotten', 'air' ) diff --git a/mods/plantlife_modpack/vines/crafts.lua b/mods/plantlife_modpack/vines/crafts.lua new file mode 100644 index 0000000..19e658b --- /dev/null +++ b/mods/plantlife_modpack/vines/crafts.lua @@ -0,0 +1,14 @@ +minetest.register_craft({ + output = 'vines:rope_block', + recipe = vines.recipes['rope_block'] +}) + +minetest.register_craft({ + output = 'vines:shears', + recipe = vines.recipes['shears'] +}) + +minetest.register_craftitem("vines:vines", { + description = "Vines", + inventory_image = "vines_item.png", +}) diff --git a/mods/plantlife_modpack/vines/depends.txt b/mods/plantlife_modpack/vines/depends.txt new file mode 100644 index 0000000..4146336 --- /dev/null +++ b/mods/plantlife_modpack/vines/depends.txt @@ -0,0 +1,3 @@ +default +plants_lib +moretrees? diff --git a/mods/plantlife_modpack/vines/functions.lua b/mods/plantlife_modpack/vines/functions.lua new file mode 100644 index 0000000..f7db03d --- /dev/null +++ b/mods/plantlife_modpack/vines/functions.lua @@ -0,0 +1,132 @@ +vines.register_vine = function( name, defs, biome ) + local biome = biome + local groups = { vines=1, snappy=3, flammable=2 } + + local vine_name_end = 'vines:'..name..'_end' + local vine_name_middle = 'vines:'..name..'_middle' + + local vine_image_end = "vines_"..name.."_end.png" + local vine_image_middle = "vines_"..name.."_middle.png" + + local drop_node = vine_name_end + + biome.spawn_plants = { vine_name_end } + + local vine_group = 'group:'..name..'_vines' + biome.spawn_surfaces[ #biome.spawn_surfaces + 1 ] = vine_group + + local selection_box = { type = "wallmounted", } + local drawtype = 'signlike' + if ( not biome.spawn_on_side ) then + --different properties for bottom and side vines. + selection_box = { type = "fixed", fixed = { -0.4, -1/2, -0.4, 0.4, 1/2, 0.4 }, } + drawtype = 'plantlike' + end + + minetest.register_node( vine_name_end, { + description = defs.description, + walkable = false, + climbable = true, + wield_image = vine_image_end, + drop = "", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "wallmounted", + buildable_to = true, + tile_images = { vine_image_end }, + drawtype = drawtype, + inventory_image = vine_image_end, + groups = groups, + sounds = default.node_sound_leaves_defaults(), + selection_box = selection_box, + on_construct = function( pos ) + local timer = minetest.get_node_timer( pos ) + timer:start( math.random(5, 10) ) + end, + on_timer = function( pos ) + local node = minetest.get_node( pos ) + local bottom = {x=pos.x, y=pos.y-1, z=pos.z} + local bottom_node = minetest.get_node( bottom ) + if bottom_node.name == "air" then + if not ( math.random( defs.average_length ) == 1 ) then + minetest.set_node( pos, { name = vine_name_middle, param2 = node.param2 } ) + minetest.set_node( bottom, { name = node.name, param2 = node.param2 } ) + local timer = minetest.get_node_timer( bottom_node ) + timer:start( math.random(5, 10) ) + end + end + end, + after_dig_node = function(pos, node, oldmetadata, user) + vines.dig_vine( pos, drop_node, user ) + end + }) + + + minetest.register_node( vine_name_middle, { + description = "Matured "..defs.description, + walkable = false, + climbable = true, + drop = "", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "wallmounted", + buildable_to = true, + tile_images = { vine_image_middle }, + wield_image = vine_image_middle, + drawtype = drawtype, + inventory_image = vine_image_middle, + groups = groups, + sounds = default.node_sound_leaves_defaults(), + selection_box = selection_box, + on_destruct = function( pos ) + local node = minetest.get_node( pos ) + local bottom = {x=pos.x, y=pos.y-1, z=pos.z} + local bottom_node = minetest.get_node( bottom ) + if minetest.get_item_group( bottom_node.name, "vines") then + minetest.remove_node( bottom ) + end + end, + after_dig_node = function( pos, node, oldmetadata, user ) + vines.dig_vine( pos, drop_node, user ) + end + }) + + plantslib:spawn_on_surfaces( biome ) + + local override_nodes = function( nodes, defs ) + function override( index, registered ) + local node = nodes[ index ] + if index > #nodes then return registered end + if minetest.registered_nodes[node] then + minetest.override_item( node, defs ) + registered[#registered+1] = node + end + override( index+1, registered ) + end + override( 1, {} ) + end + + override_nodes( biome.spawn_surfaces,{ + after_destruct = function( pos ) + local pos_min = { x = pos.x -1, y = pos.y - 1, z = pos.z - 1 } + local pos_max = { x = pos.x +1, y = pos.y + 1, z = pos.z + 1 } + local positions = minetest.find_nodes_in_area( pos_min, pos_max, "group:vines" ) + for index, position in pairs(positions) do + minetest.remove_node( position ) + end + end + }) + +end + +vines.dig_vine = function( pos, node_name, user ) + --only dig give the vine if shears are used + if not user then return false end + local wielded = user:get_wielded_item() + if 'vines:shears' == wielded:get_name() then + local inv = user:get_inventory() + if inv then + inv:add_item("main", ItemStack( node_name )) + end + end +end diff --git a/mods/plantlife_modpack/vines/init.lua b/mods/plantlife_modpack/vines/init.lua new file mode 100644 index 0000000..72eda93 --- /dev/null +++ b/mods/plantlife_modpack/vines/init.lua @@ -0,0 +1,14 @@ +vines = { + name = 'vines', + recipes = {} +} + +dofile( minetest.get_modpath( vines.name ) .. "/functions.lua" ) +dofile( minetest.get_modpath( vines.name ) .. "/aliases.lua" ) +dofile( minetest.get_modpath( vines.name ) .. "/recipes.lua" ) +dofile( minetest.get_modpath( vines.name ) .. "/crafts.lua" ) +dofile( minetest.get_modpath( vines.name ) .. "/nodes.lua" ) +dofile( minetest.get_modpath( vines.name ) .. "/shear.lua" ) +dofile( minetest.get_modpath( vines.name ) .. "/vines.lua" ) + +print("[Vines] Loaded!") diff --git a/mods/plantlife_modpack/vines/nodes.lua b/mods/plantlife_modpack/vines/nodes.lua new file mode 100644 index 0000000..ab14b28 --- /dev/null +++ b/mods/plantlife_modpack/vines/nodes.lua @@ -0,0 +1,83 @@ +minetest.register_node("vines:rope_block", { + description = "Rope", + sunlight_propagates = true, + paramtype = "light", + tile_images = { + "default_wood.png^vines_rope.png", + "default_wood.png^vines_rope.png", + "default_wood.png", + "default_wood.png", + "default_wood.png^vines_rope.png", + "default_wood.png^vines_rope.png", + }, + groups = { flammable=2, choppy=2, oddly_breakable_by_hand=1 }, + after_place_node = function(pos) + local p = {x=pos.x, y=pos.y-1, z=pos.z} + local n = minetest.get_node(p) + if n.name == "air" then + minetest.add_node(p, {name="vines:rope_end"}) + end + end, + after_dig_node = function(pos, node, digger) + local p = {x=pos.x, y=pos.y-1, z=pos.z} + local n = minetest.get_node(p) + while ( n.name == 'vines:rope' or n.name == 'vines:rope_end' ) do + minetest.remove_node(p) + p = {x=p.x, y=p.y-1, z=p.z} + n = minetest.get_node(p) + end + end +}) + +minetest.register_node("vines:rope", { + description = "Rope", + walkable = false, + climbable = true, + sunlight_propagates = true, + paramtype = "light", + drop = "", + tile_images = { "vines_rope.png" }, + drawtype = "plantlike", + groups = {flammable=2, not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, +}) + +minetest.register_node("vines:rope_end", { + description = "Rope", + walkable = false, + climbable = true, + sunlight_propagates = true, + paramtype = "light", + drop = "", + tile_images = { "vines_rope_end.png" }, + drawtype = "plantlike", + groups = {flammable=2, not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + after_place_node = function(pos) + yesh = {x = pos.x, y= pos.y-1, z=pos.z} + minetest.add_node(yesh, {name="vines:rope"}) + end, + selection_box = { + type = "fixed", + fixed = {-1/7, -1/2, -1/7, 1/7, 1/2, 1/7}, + }, + on_construct = function( pos ) + local timer = minetest.get_node_timer( pos ) + timer:start( 1 ) + end, + on_timer = function( pos, elapsed ) + local p = {x=pos.x, y=pos.y-1, z=pos.z} + local n = minetest.get_node(p) + if n.name == "air" then + minetest.set_node(pos, {name="vines:rope"}) + minetest.add_node(p, {name="vines:rope_end"}) + else + local timer = minetest.get_node_timer( pos ) + timer:start( 1 ) + end + end +}) diff --git a/mods/plantlife_modpack/vines/readme.txt b/mods/plantlife_modpack/vines/readme.txt new file mode 100644 index 0000000..0228a77 --- /dev/null +++ b/mods/plantlife_modpack/vines/readme.txt @@ -0,0 +1,43 @@ + __ __ ___ __ _ _______ _______ +| | | || | | | | || || | +| |_| || | | |_| || ___|| _____| +| || | | || |___ | |_____ +| || | | _ || ___||_____ | + | | | | | | | || |___ _____| | + |___| |___| |_| |__||_______||_______| + +BY: bas080 +DESCRIPTION: Vines and ropebox +VERSION: 2.2.1 +LICENCE: WTFPL +FORUM: http://forum.minetest.net/viewtopic.php?id=2344 + +Changelog +--------- +2.2.1 +* Also spawn on leaves that are near jungletree +* Uses default wood texture +* Drops actual vines +* Changed craft + +2.2 +* Spawns on all leaves that are near water + +2.1 +* Removed rope(end) from creative inventory + +2.0 +* Root vines texture and node (no spawn) +* Side vines spawn on leaves +* Willow vines spawns on moretrees willow leaves +* Ropebox after_dig_node re-defined + +1.5 +* Added side vines +* Uses plant_lib api +* Original vines do not spawn anymore but are still there. + +1.0 +* Vines spawn beneath leave nodes +* Has rotten and non rotten vines +* Ropebox with craft diff --git a/mods/plantlife_modpack/vines/recipes.lua b/mods/plantlife_modpack/vines/recipes.lua new file mode 100644 index 0000000..d2b928a --- /dev/null +++ b/mods/plantlife_modpack/vines/recipes.lua @@ -0,0 +1,12 @@ +vines.recipes['rope_block'] = { + {'', 'default:wood', ''}, + {'', 'group:vines', ''}, + {'', 'group:vines', ''} +} + +vines.recipes['shears'] = { + {'', 'default:steel_ingot', ''}, + {'default:stick', 'default:wood', 'default:steel_ingot'}, + {'', '', 'default:stick'} +} + diff --git a/mods/plantlife_modpack/vines/shear.lua b/mods/plantlife_modpack/vines/shear.lua new file mode 100644 index 0000000..e6d915a --- /dev/null +++ b/mods/plantlife_modpack/vines/shear.lua @@ -0,0 +1,15 @@ +minetest.register_tool("vines:shears", { + description = "Shears", + inventory_image = "vines_shears.png", + wield_image = "vines_shears.png", + stack_max = 1, + max_drop_level=3, + tool_capabilities = { + full_punch_interval = 1.0, + max_drop_level=0, + groupcaps={ + snappy={times={[3]=0.2}, maxwear=0.05, maxlevel=3}, + wool={times={[3]=0.2}, maxwear=0.05, maxlevel=3} + } + }, +}) diff --git a/mods/plantlife_modpack/vines/textures/new/bottomvine.png b/mods/plantlife_modpack/vines/textures/new/bottomvine.png new file mode 100644 index 0000000..49f88c0 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/new/bottomvine.png differ diff --git a/mods/plantlife_modpack/vines/textures/new/sidevine.png b/mods/plantlife_modpack/vines/textures/new/sidevine.png new file mode 100644 index 0000000..fdeaeae Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/new/sidevine.png differ diff --git a/mods/plantlife_modpack/vines/textures/new/vinesdead.png b/mods/plantlife_modpack/vines/textures/new/vinesdead.png new file mode 100644 index 0000000..3ac6ea5 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/new/vinesdead.png differ diff --git a/mods/plantlife_modpack/vines/textures/new/vineslive.png b/mods/plantlife_modpack/vines/textures/new/vineslive.png new file mode 100644 index 0000000..8afffe8 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/new/vineslive.png differ diff --git a/mods/plantlife_modpack/vines/textures/old/vines_vine2.png b/mods/plantlife_modpack/vines/textures/old/vines_vine2.png new file mode 100644 index 0000000..c755da9 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/old/vines_vine2.png differ diff --git a/mods/plantlife_modpack/vines/textures/old/vines_vine_rotten2.png b/mods/plantlife_modpack/vines/textures/old/vines_vine_rotten2.png new file mode 100644 index 0000000..c66e12e Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/old/vines_vine_rotten2.png differ diff --git a/mods/plantlife_modpack/vines/textures/shears.png b/mods/plantlife_modpack/vines/textures/shears.png new file mode 100644 index 0000000..c4c39f9 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/shears.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_item.png b/mods/plantlife_modpack/vines/textures/vines_item.png new file mode 100644 index 0000000..c66242e Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_item.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_jungle_end.png b/mods/plantlife_modpack/vines/textures/vines_jungle_end.png new file mode 100644 index 0000000..6c8d339 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_jungle_end.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_jungle_middle.png b/mods/plantlife_modpack/vines/textures/vines_jungle_middle.png new file mode 100644 index 0000000..bf838a5 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_jungle_middle.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_root.png b/mods/plantlife_modpack/vines/textures/vines_root.png new file mode 100644 index 0000000..49f88c0 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_root.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_root_end.png b/mods/plantlife_modpack/vines/textures/vines_root_end.png new file mode 100644 index 0000000..4fc3f87 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_root_end.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_root_middle.png b/mods/plantlife_modpack/vines/textures/vines_root_middle.png new file mode 100644 index 0000000..49f88c0 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_root_middle.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_rope.png b/mods/plantlife_modpack/vines/textures/vines_rope.png new file mode 100644 index 0000000..0045c4c Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_rope.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_rope_end.png b/mods/plantlife_modpack/vines/textures/vines_rope_end.png new file mode 100644 index 0000000..faf2c71 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_rope_end.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_shears.png b/mods/plantlife_modpack/vines/textures/vines_shears.png new file mode 100644 index 0000000..c4c39f9 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_shears.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_side.png b/mods/plantlife_modpack/vines/textures/vines_side.png new file mode 100644 index 0000000..fdeaeae Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_side.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_side_end.png b/mods/plantlife_modpack/vines/textures/vines_side_end.png new file mode 100644 index 0000000..5b3b28f Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_side_end.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_side_middle.png b/mods/plantlife_modpack/vines/textures/vines_side_middle.png new file mode 100644 index 0000000..2576e93 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_side_middle.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_side_rotten.png b/mods/plantlife_modpack/vines/textures/vines_side_rotten.png new file mode 100644 index 0000000..2576e93 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_side_rotten.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_vine.png b/mods/plantlife_modpack/vines/textures/vines_vine.png new file mode 100644 index 0000000..8afffe8 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_vine.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_vine_end.png b/mods/plantlife_modpack/vines/textures/vines_vine_end.png new file mode 100644 index 0000000..062857b Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_vine_end.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_vine_middle.png b/mods/plantlife_modpack/vines/textures/vines_vine_middle.png new file mode 100644 index 0000000..8afffe8 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_vine_middle.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_vine_rotten.png b/mods/plantlife_modpack/vines/textures/vines_vine_rotten.png new file mode 100644 index 0000000..3ac6ea5 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_vine_rotten.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_willow.png b/mods/plantlife_modpack/vines/textures/vines_willow.png new file mode 100644 index 0000000..ca0b831 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_willow.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_willow_end.png b/mods/plantlife_modpack/vines/textures/vines_willow_end.png new file mode 100644 index 0000000..b5b8e59 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_willow_end.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_willow_middle.png b/mods/plantlife_modpack/vines/textures/vines_willow_middle.png new file mode 100644 index 0000000..ca0b831 Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_willow_middle.png differ diff --git a/mods/plantlife_modpack/vines/textures/vines_willow_rotten.png b/mods/plantlife_modpack/vines/textures/vines_willow_rotten.png new file mode 100644 index 0000000..3c0622f Binary files /dev/null and b/mods/plantlife_modpack/vines/textures/vines_willow_rotten.png differ diff --git a/mods/plantlife_modpack/vines/vines.lua b/mods/plantlife_modpack/vines/vines.lua new file mode 100644 index 0000000..82c5b2a --- /dev/null +++ b/mods/plantlife_modpack/vines/vines.lua @@ -0,0 +1,104 @@ +vines.register_vine( 'root', { + description = "Roots", + average_length = 9, +},{ + choose_random_wall = true, + avoid_nodes = {"vines:root_middle"}, + avoid_radius = 5, + spawn_delay = 500, + spawn_chance = 10, + spawn_surfaces = { + "default:dirt_with_grass", + "default:dirt" + }, + spawn_on_bottom = true, + plantlife_limit = -0.6, + humidity_min = 0.4, +}) + +vines.register_vine( 'vine', { + description = "Vines", + average_length = 5, +},{ + choose_random_wall = true, + avoid_nodes = {"group:vines"}, + avoid_radius = 5, + spawn_delay = 500, + spawn_chance = 100, + spawn_surfaces = { + "default:jungleleaves", + "moretrees:jungletree_leaves_red", + "moretrees:jungletree_leaves_yellow", + "moretrees:jungletree_leaves_green" + }, + spawn_on_bottom = true, + plantlife_limit = -0.9, + humidity_min = 0.7, +}) + +vines.register_vine( 'side', { + description = "Vines", + average_length = 6, +},{ + choose_random_wall = true, + avoid_nodes = {"group:vines", "default:apple"}, + choose_random_wall = true, + avoid_radius = 3, + spawn_delay = 500, + spawn_chance = 100, + spawn_surfaces = { + "default:jungleleaves", + "moretrees:jungletree_leaves_red", + "moretrees:jungletree_leaves_yellow", + "moretrees:jungletree_leaves_green" + }, + spawn_on_side = true, + plantlife_limit = -0.9, + humidity_min = 0.4, +}) + +vines.register_vine( "jungle", { + description = "Jungle Vines", + average_length = 7, +},{ + choose_random_wall = true, + neighbors = { + "default:jungleleaves", + "moretrees:jungletree_leaves_red", + "moretrees:jungletree_leaves_yellow", + "moretrees:jungletree_leaves_green" + }, + avoid_nodes = { + "vines:jungle_middle", + "vines:jungle_end", + }, + avoid_radius = 5, + spawn_delay = 500, + spawn_chance = 100, + spawn_surfaces = { + "default:jungletree", + "moretrees:jungletree_trunk" + }, + spawn_on_side = true, + plantlife_limit = -0.9, + humidity_min = 0.2, +}) + +vines.register_vine( 'willow', { + description = "Willow Vines", + average_length = 9, +},{ + choose_random_wall = true, + avoid_nodes = { "vines:willow_middle" }, + avoid_radius = 5, + near_nodes = { 'default:water_source' }, + near_nodes_size = 1, + near_nodes_count = 1, + near_nodes_vertical = 7, + plantlife_limit = -0.8, + spawn_chance = 10, + spawn_delay = 500, + spawn_on_side = true, + spawn_surfaces = {"moretrees:willow_leaves"}, + humidity_min = 0.5 +}) diff --git a/mods/plantlife_modpack/woodsoils/depends.txt b/mods/plantlife_modpack/woodsoils/depends.txt new file mode 100644 index 0000000..462d183 --- /dev/null +++ b/mods/plantlife_modpack/woodsoils/depends.txt @@ -0,0 +1,7 @@ +default +plants_lib +bushes? +ferns? +moretrees? +trees? +trunks? \ No newline at end of file diff --git a/mods/plantlife_modpack/woodsoils/generating.lua b/mods/plantlife_modpack/woodsoils/generating.lua new file mode 100644 index 0000000..ff84477 --- /dev/null +++ b/mods/plantlife_modpack/woodsoils/generating.lua @@ -0,0 +1,152 @@ +-- generating of forest soils + +local RaDiuS = { +-- WE1 NS1 WE2 NS2 WE3 NS3 + {-1,-2, -2,-2, -2,-3}, + { 0,-2, -3,-1, -3,-2}, + { 1,-2, -3, 0, -4,-1}, + {-2,-1, -3, 1, -4, 0}, + {-1,-1, -2, 2, -4, 1}, + { 0,-1, -1, 3, -3, 2}, + { 1,-1, 0, 3, -2, 3}, + { 2,-1, 1, 3, -1, 4}, + {-2, 0, 2, 2, 0, 4}, + {-1, 0, 3, 1, 1, 4}, + { 0, 0, 3, 0, 2, 3}, + { 1, 0, 3,-1, 3, 2}, + { 2, 0, 2,-2, 4, 1}, + {-2, 1, 1,-3, 4, 0}, + {-1, 1, 0,-3, 4,-1}, + { 0, 1, -1,-3, 3,-2}, + { 1, 1, 0, 0, 2,-3}, + { 2, 1, 0, 0, 1,-4}, + {-1, 2, 0, 0, 0,-4}, + { 0, 2, 0, 0, -1,-4}, + { 1, 2, 0, 0, 0, 0}, +} +-- e = + , n = + +abstract_woodsoils.place_soil = function(pos) + + if minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name, "soil") > 0 + or minetest.get_item_group(minetest.get_node({x=pos.x,y=pos.y-2,z=pos.z}).name, "soil") > 0 then + for i in pairs(RaDiuS) do + local WE1 = RaDiuS[i][1] + local NS1 = RaDiuS[i][2] + local WE2 = RaDiuS[i][3] + local NS2 = RaDiuS[i][4] + local WE3 = RaDiuS[i][5] + local NS3 = RaDiuS[i][6] + local radius_1a = {x=pos.x+WE1,y=pos.y-1,z=pos.z+NS1} + local radius_1b = {x=pos.x+WE1,y=pos.y-2,z=pos.z+NS1} + local radius_2a = {x=pos.x+WE2,y=pos.y-1,z=pos.z+NS2} + local radius_2b = {x=pos.x+WE2,y=pos.y-2,z=pos.z+NS2} + local radius_3a = {x=pos.x+WE3,y=pos.y-1,z=pos.z+NS3} + local radius_3b = {x=pos.x+WE3,y=pos.y-2,z=pos.z+NS3} + --local node_1a = minetest.get_node(radius_1a) + --local node_1b = minetest.get_node(radius_1b) + local node_2a = minetest.get_node(radius_2a) + local node_2b = minetest.get_node(radius_2b) + local node_3a = minetest.get_node(radius_3a) + local node_3b = minetest.get_node(radius_3b) + -- Dirt with Leaves 1 + if minetest.get_item_group(minetest.get_node(radius_1a).name, "soil") > 0 then + minetest.set_node(radius_1a, {name="woodsoils:dirt_with_leaves_1"}) + end + if minetest.get_item_group(minetest.get_node(radius_1b).name, "soil") > 0 then + minetest.set_node(radius_1b, {name="woodsoils:dirt_with_leaves_1"}) + end + -- Grass with Leaves 2 + if string.find(node_2a.name, "dirt_with_grass") then + minetest.set_node(radius_2a, {name="woodsoils:grass_with_leaves_2"}) + end + if string.find(node_2b.name, "dirt_with_grass") then + minetest.set_node(radius_2b, {name="woodsoils:grass_with_leaves_2"}) + end + -- Grass with Leaves 1 + if string.find(node_3a.name, "dirt_with_grass") then + minetest.set_node(radius_3a, {name="woodsoils:grass_with_leaves_1"}) + end + if string.find(node_3b.name, "dirt_with_grass") then + minetest.set_node(radius_3b, {name="woodsoils:grass_with_leaves_1"}) + end + end + end +end + +plantslib:register_generate_plant({ + surface = { + "group:tree", + "ferns:fern_03", + "ferns:fern_02", + "ferns:fern_01" + }, + max_count = 1000, + rarity = 1, + min_elevation = 1, + max_elevation = 40, + near_nodes = {"group:tree","ferns:fern_03","ferns:fern_02","ferns:fern_01"}, + near_nodes_size = 5, + near_nodes_vertical = 1, + near_nodes_count = 4, + plantlife_limit = -1, + check_air = false, + }, + "abstract_woodsoils.place_soil" +) + +plantslib:register_generate_plant({ + surface = { + "moretrees:apple_tree_sapling_ongen", + "moretrees:beech_sapling_ongen", + "moretrees:birch_sapling_ongen", + "moretrees:fir_sapling_ongen", + "moretrees:jungletree_sapling_ongen", + "moretrees:oak_sapling_ongen", + "moretrees:palm_sapling_ongen", + "moretrees:pine_sapling_ongen", + "moretrees:rubber_tree_sapling_ongen", + "moretrees:sequoia_sapling_ongen", + "moretrees:spruce_sapling_ongen", + "moretrees:willow_sapling_ongen" + }, + max_count = 1000, + rarity = 2, + min_elevation = 1, + max_elevation = 40, + plantlife_limit = -0.9, + check_air = false, + }, + "abstract_woodsoils.place_soil" +) + +minetest.register_abm({ + nodenames = {"default:papyrus"}, + neighbors = { + "woodsoils:dirt_with_leaves_1", + "woodsoils:dirt_with_leaves_2", + "woodsoils:grass_with_leaves_1", + "woodsoils:grass_with_leaves_2" + }, + interval = 50, + chance = 20, + action = function(pos, node) + pos.y = pos.y-1 + local name = minetest.get_node(pos).name + if string.find(name, "_with_leaves_") then + if minetest.find_node_near(pos, 3, {"group:water"}) == nil then + return + end + pos.y = pos.y+1 + local height = 0 + while minetest.get_node(pos).name == "default:papyrus" and height < 4 do + height = height+1 + pos.y = pos.y+1 + end + if height < 4 then + if minetest.get_node(pos).name == "air" then + minetest.set_node(pos, {name="default:papyrus"}) + end + end + end + end, +}) diff --git a/mods/plantlife_modpack/woodsoils/init.lua b/mods/plantlife_modpack/woodsoils/init.lua new file mode 100644 index 0000000..9037d45 --- /dev/null +++ b/mods/plantlife_modpack/woodsoils/init.lua @@ -0,0 +1,29 @@ +----------------------------------------------------------------------------------------------- +local title = "Wood Soils" -- former "Forest Soils" +local version = "0.0.9" +local mname = "woodsoils" -- former "forestsoils" +----------------------------------------------------------------------------------------------- + +abstract_woodsoils = {} + +dofile(minetest.get_modpath("woodsoils").."/nodes.lua") +dofile(minetest.get_modpath("woodsoils").."/generating.lua") + +-- felt like playing a bit :D +--[[print(" _____ __") +print("_/ ____\\___________ ____ _______/ |_") +print("\\ __\\/ _ \\_ __ \\_/ __ \\ / ___/\\ __\\") +print(" | | ( <_> ) | \\/\\ ___/ \\___ \\ | |") +print(" |__| \\____/|__| \\___ >____ > |__|") +print(" \\/ \\/") + +print(" .__.__") +print(" __________ |__| | ______") +print(" / ___/ _ \\| | | / ___/") +print(" \\___ ( <_> ) | |__\\___ \\") +print("/____ >____/|__|____/____ >") +print(" \\/ \\/")]] + +----------------------------------------------------------------------------------------------- +print("[Mod] "..title.." ["..version.."] ["..mname.."] Loaded...") +----------------------------------------------------------------------------------------------- \ No newline at end of file diff --git a/mods/plantlife_modpack/woodsoils/nodes.lua b/mods/plantlife_modpack/woodsoils/nodes.lua new file mode 100644 index 0000000..e80c522 --- /dev/null +++ b/mods/plantlife_modpack/woodsoils/nodes.lua @@ -0,0 +1,79 @@ +-- nodes + +minetest.register_node("woodsoils:dirt_with_leaves_1", { + description = "Forest Soil 1", + tiles = { + "default_dirt.png^woodsoils_ground_cover.png", + "default_dirt.png", + "default_dirt.png^woodsoils_ground_cover_side.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +minetest.register_node("woodsoils:dirt_with_leaves_2", { + description = "Forest Soil 2", + tiles = { + "woodsoils_ground.png", + "default_dirt.png", + "default_dirt.png^woodsoils_ground_side.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +minetest.register_node("woodsoils:grass_with_leaves_1", { + description = "Forest Soil 3", + tiles = { + "default_grass.png^woodsoils_ground_cover2.png", + "default_dirt.png", + "default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side2.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +minetest.register_node("woodsoils:grass_with_leaves_2", { + description = "Forest Soil 4", + tiles = { + "default_grass.png^woodsoils_ground_cover.png", + "default_dirt.png", + "default_dirt.png^default_grass_side.png^woodsoils_ground_cover_side.png"}, + is_ground_content = true, + groups = { + crumbly=3, + soil=1--, + --not_in_creative_inventory=1 + }, + drop = 'default:dirt', + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.4}, + }), +}) + +-- For compatibility with older stuff +minetest.register_alias("forestsoils:dirt_with_leaves_1", "woodsoils:dirt_with_leaves_1") +minetest.register_alias("forestsoils:dirt_with_leaves_2", "woodsoils:dirt_with_leaves_2") +minetest.register_alias("forestsoils:grass_with_leaves_1", "woodsoils:grass_with_leaves_1") +minetest.register_alias("forestsoils:grass_with_leaves_2", "woodsoils:grass_with_leaves_2") diff --git a/mods/plantlife_modpack/woodsoils/textures/credit_textures.txt b/mods/plantlife_modpack/woodsoils/textures/credit_textures.txt new file mode 100644 index 0000000..45d582d --- /dev/null +++ b/mods/plantlife_modpack/woodsoils/textures/credit_textures.txt @@ -0,0 +1,16 @@ +------------------------------------------------------------- +Credit for textures of "woodsoils" +------------------------------------------------------------- +(If more than one author is listed the names are in alphabetical order) +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +FOLDER TEXTURE AUTHORS +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../woodsoils/textures woodsoils_ground.png Mossmanikin + woodsoils_ground_cover.png Mossmanikin + woodsoils_ground_cover_side.png Mossmanikin + woodsoils_ground_cover_side2.png Mossmanikin + woodsoils_ground_cover2.png Mossmanikin + woodsoils_ground_side.png Mossmanikin +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +../woodsoils/textures/not in use woodsoils.png Mossmanikin +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/mods/plantlife_modpack/woodsoils/textures/not in use/woodsoils.png b/mods/plantlife_modpack/woodsoils/textures/not in use/woodsoils.png new file mode 100644 index 0000000..67253bc Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/not in use/woodsoils.png differ diff --git a/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground.png b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground.png new file mode 100644 index 0000000..907b345 Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground.png differ diff --git a/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover.png b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover.png new file mode 100644 index 0000000..103f103 Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover.png differ diff --git a/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover2.png b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover2.png new file mode 100644 index 0000000..ec18dd6 Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover2.png differ diff --git a/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover_side.png b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover_side.png new file mode 100644 index 0000000..d21f2b9 Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover_side.png differ diff --git a/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover_side2.png b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover_side2.png new file mode 100644 index 0000000..f4e4ce6 Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_cover_side2.png differ diff --git a/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_side.png b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_side.png new file mode 100644 index 0000000..08fb4be Binary files /dev/null and b/mods/plantlife_modpack/woodsoils/textures/woodsoils_ground_side.png differ diff --git a/mods/plantlife_modpack/youngtrees/depends.txt b/mods/plantlife_modpack/youngtrees/depends.txt new file mode 100644 index 0000000..bde0bdf --- /dev/null +++ b/mods/plantlife_modpack/youngtrees/depends.txt @@ -0,0 +1,2 @@ +default +plants_lib \ No newline at end of file diff --git a/mods/plantlife_modpack/youngtrees/init.lua b/mods/plantlife_modpack/youngtrees/init.lua new file mode 100644 index 0000000..347af30 --- /dev/null +++ b/mods/plantlife_modpack/youngtrees/init.lua @@ -0,0 +1,146 @@ +abstract_youngtrees = {} + +minetest.register_node("youngtrees:bamboo", { + description = "Young Bamboo Tree", + drawtype="nodebox", + tiles = {"bamboo.png"}, + paramtype = "light", + walkable = false, + is_ground_content = true, + node_box = { + type = "fixed", + fixed = { + {-0.058251,-0.500000,-0.413681,0.066749,0.500000,-0.282500}, --NodeBox 1 + {-0.058251,-0.500000,-0.103123,0.066749,0.500000,0.038672}, --NodeBox 2 + {-0.058251,-0.500000,0.181227,0.066749,0.500000,0.342500}, --NodeBox 3 + } + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = 'trunks:twig_1' +}) + +minetest.register_node("youngtrees:youngtree2_middle",{ + description = "Young Tree 2 (middle)", + drawtype="nodebox", + tiles = {"youngtree2branch.png"}, + inventory_image = "youngtree2branch.png", + wield_image = "youngtree2branch.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + node_box = { + type = "fixed", + fixed = { + {0.125000,-0.500000,-0.500000,0.500000,-0.187500,-0.125000}, --NodeBox 1 + {-0.187500,-0.187500,-0.500000,0.500000,0.125000,0.250000}, --NodeBox 2 + {-0.500000,0.125000,-0.500000,0.500000,0.500000,0.500000}, --NodeBox 3 + } + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = 'trunks:twig_1' +}) + +minetest.register_node("youngtrees:youngtree_top", { + description = "Young Tree (top)", + drawtype = "plantlike", + tiles = {"youngtree16xa.png"}, + inventory_image = "youngtree16xa.png", + wield_image = "youngtree16xa.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = 'trunks:twig_1' +}) + + +minetest.register_node("youngtrees:youngtree_middle", { + description = "Young Tree (middle)", + drawtype = "plantlike", + tiles = {"youngtree16xb.png"}, + inventory_image = "youngtree16xb.png", + wield_image = "youngtree16xb.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = 'trunks:twig_1' +}) + + + +minetest.register_node("youngtrees:youngtree_bottom", { + description = "Young Tree (bottom)", + drawtype = "plantlike", + tiles = {"youngtree16xc.png"}, + inventory_image = "youngtree16xc.png", + wield_image = "youngtree16xc.png", + paramtype = "light", + walkable = false, + is_ground_content = true, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3} + }, + groups = {snappy=3,flammable=2}, + sounds = default.node_sound_leaves_defaults(), + drop = 'trunks:twig_1' +}) + + + abstract_youngtrees.grow_youngtree = function(pos) + local height = math.random(1,3) + abstract_youngtrees.grow_youngtree_node(pos,height) +end + +abstract_youngtrees.grow_youngtree_node = function(pos, height) + + + local right_here = {x=pos.x, y=pos.y+1, z=pos.z} + local above_right_here = {x=pos.x, y=pos.y+2, z=pos.z} + + if minetest.get_node(right_here).name == "air" -- instead of check_air = true, + or minetest.get_node(right_here).name == "default:junglegrass" then + if height == 1 then + minetest.set_node(right_here, {name="youngtrees:youngtree_top"}) + end + if height == 2 then + minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"}) + minetest.set_node(above_right_here, {name="youngtrees:youngtree_top"}) + end + if height == 3 then + local two_above_right_here = {x=pos.x, y=pos.y+3, z=pos.z} + minetest.set_node(right_here, {name="youngtrees:youngtree_bottom"}) + minetest.set_node(above_right_here, {name="youngtrees:youngtree_middle"}) + minetest.set_node(two_above_right_here, {name="youngtrees:youngtree_top"}) + end + end +end + + +plantslib:register_generate_plant({ + surface = { + "default:dirt_with_grass", + "stoneage:grass_with_silex", + "sumpf:peat", + "sumpf:sumpf" + }, + max_count = 55, --10,15 + rarity = 101 - 4, --3,4 + min_elevation = 1, -- above sea level + plantlife_limit = -0.9, + }, + abstract_youngtrees.grow_youngtree +) diff --git a/mods/plantlife_modpack/youngtrees/textures/bamboo.png b/mods/plantlife_modpack/youngtrees/textures/bamboo.png new file mode 100644 index 0000000..018d42e Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/bamboo.png differ diff --git a/mods/plantlife_modpack/youngtrees/textures/unused/sapling.png b/mods/plantlife_modpack/youngtrees/textures/unused/sapling.png new file mode 100644 index 0000000..a3d5127 Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/unused/sapling.png differ diff --git a/mods/plantlife_modpack/youngtrees/textures/unused/sapling16x.png b/mods/plantlife_modpack/youngtrees/textures/unused/sapling16x.png new file mode 100644 index 0000000..45b86ee Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/unused/sapling16x.png differ diff --git a/mods/plantlife_modpack/youngtrees/textures/youngtree16xa.png b/mods/plantlife_modpack/youngtrees/textures/youngtree16xa.png new file mode 100644 index 0000000..9bba623 Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/youngtree16xa.png differ diff --git a/mods/plantlife_modpack/youngtrees/textures/youngtree16xb.png b/mods/plantlife_modpack/youngtrees/textures/youngtree16xb.png new file mode 100644 index 0000000..d83b7a3 Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/youngtree16xb.png differ diff --git a/mods/plantlife_modpack/youngtrees/textures/youngtree16xc.png b/mods/plantlife_modpack/youngtrees/textures/youngtree16xc.png new file mode 100644 index 0000000..cfe3cf1 Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/youngtree16xc.png differ diff --git a/mods/plantlife_modpack/youngtrees/textures/youngtree2branch.png b/mods/plantlife_modpack/youngtrees/textures/youngtree2branch.png new file mode 100644 index 0000000..89b2f23 Binary files /dev/null and b/mods/plantlife_modpack/youngtrees/textures/youngtree2branch.png differ diff --git a/mods/railcorridors/README.md b/mods/railcorridors/README.md new file mode 100644 index 0000000..63335f9 --- /dev/null +++ b/mods/railcorridors/README.md @@ -0,0 +1,11 @@ +RailCaves +========= + +Minetest Mod for adding caves with rails and wood constructions similar to Minecraft. + +Screenshots and information: +https://forum.minetest.net/viewtopic.php?f=9&t=10225 + +License is WTFPL. You just do what the fuck you want to. + +You can install this mod by putting the directory "RailCorridors" into the "mods" subfolder of your minetest folder. diff --git a/mods/railcorridors/chests.lua b/mods/railcorridors/chests.lua new file mode 100644 index 0000000..f7edcb1 --- /dev/null +++ b/mods/railcorridors/chests.lua @@ -0,0 +1,50 @@ +-- Random chest items +-- Zufälliger Kisteninhalt +function rci() + if nextrandom(0,1) < 0.03 then + return "farming:bread "..nextrandom(1,3) + elseif nextrandom(0,1) < 0.05 then + if nextrandom(0,1) < 0.3 then + return "farming:seed_cotton "..math.floor(nextrandom(1,4)) + elseif nextrandom(0,1) < 0.5 then + return "default:sapling "..math.floor(nextrandom(1,4)) + else + return "farming:seed_wheat "..math.floor(nextrandom(1,4)) + end + elseif nextrandom(0,1) < 0.005 then + return "tnt:tnt "..nextrandom(1,3) + elseif nextrandom(0,1) < 0.003 then + if nextrandom(0,1) < 0.8 then + return "default:mese_crystal "..math.floor(nextrandom(1,3)) + else + return "default:diamond "..math.floor(nextrandom(1,3)) + end + end +end +-- chests +function place_chest(pos) + minetest.set_node(pos, {name="default:chest"}) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", + "invsize[8,9;]".. + "list[context;main;0,0;8,4;]".. + "list[current_player;main;0,5;8,4;]") + meta:set_string("infotext", "Chest"); + local inv = meta:get_inventory() + inv:set_size("main", 8*4) + --print(dump(meta:to_table())) + meta:from_table({ + inventory = { + main = { + [1] = rci(),[2] = rci(),[3] = rci(),[4] = rci(),[5] = rci(),[6] = rci(),[7] = rci(),[8] = rci(), + [9] = rci(),[10] = rci(),[11] = rci(),[12] = rci(),[13] = rci(),[14] = rci(),[15] = rci(),[16] = rci(), + [17] = rci(),[18] = rci(),[19] = rci(),[20] = rci(),[21] = rci(),[22] = rci(),[23] = rci(),[24] = rci(), + [25] = rci(),[26] = rci(),[27] = rci(),[28] = rci(),[29] = rci(),[30] = rci(),[31] = rci(),[32] = rci()} + }, -- Why the f does the number of fields vary in the mod?? + fields = { + formspec = "invsize[8,9;]list[context;main;0,0;8,4;]list[current_player;main;0,5;8,4;]", + infotext = "Chest" + } + } + ) + end diff --git a/mods/railcorridors/depends.txt b/mods/railcorridors/depends.txt new file mode 100644 index 0000000..d77ba25 --- /dev/null +++ b/mods/railcorridors/depends.txt @@ -0,0 +1,2 @@ +default +farming diff --git a/mods/railcorridors/description.txt b/mods/railcorridors/description.txt new file mode 100644 index 0000000..3348250 --- /dev/null +++ b/mods/railcorridors/description.txt @@ -0,0 +1,3 @@ +This mod tries to imitate the known rail corridors of Minecraft. + +Diese Modifikation versucht die aus Minecraft bekannten Minenschächte mit Schienen nachzubilden. diff --git a/mods/railcorridors/init.lua b/mods/railcorridors/init.lua new file mode 100644 index 0000000..efe7d8f --- /dev/null +++ b/mods/railcorridors/init.lua @@ -0,0 +1,351 @@ +-- „Parameter“/„Settings“ + +-- Wahrscheinlichkeit für jeden Chunk, solche Gänge mit Schienen zu bekommen +-- Probability for every newly generated chunk to get corridors +local probability_railcaves_in_chunk = 2/3 + +-- Innerhalb welcher Parameter soll sich die Pfadlänge bewegen? +-- Minimal and maximal value of path length +local way_min = 4; +local way_max = 7; + +-- Wahrsch. für jeden geraden Teil eines Korridors, keine Fackeln zu bekommen +-- Probability for every horizontal part of a corridor to be without light +local probability_torches_in_segment = 0.5 + +-- Wahrsch. für jeden Teil eines Korridors, nach oben oder nach unten zu gehen +-- Probability for every part of a corridor to go up or down +local probability_up_or_down = 0.2 + +-- Wahrscheinlichkeit für jeden Teil eines Korridors, sich zu verzweigen – vorsicht, wenn fast jeder Gang sich verzweigt, kann der Algorithmus unlösbar werden und MT hängt sich auf +-- Probability for every part of a corridor to fork – caution, too high values may cause MT to hang on. +local propability_fork = 0.5 + +-- Wahrscheinlichkeit für Kisten +-- Probability for chests +local probability_chest = 1/100 + +-- Spielerische Generation, braucht aber mehr Rechenleistung +-- Fancy mode; deactivate if world generation too laggy +local fancy = true + +-- Parameter Ende + +local node_maincave = {name="default:dirt"} +local node_air = {name="air"} +local node_rails = {name="default:rail"} +local node_woodplanks = {name="default:wood"} +local node_fence = {name="default:fence_wood"} +local name_torch = "default:torch" +local node_water = {name="default:water_source"} +local node_lava = {name="default:lava_source"} + +function nextrandom(min, max) + return pr:next() / 32767 * (max - min) + min +end + +dofile(minetest.get_modpath("railcorridors").."/chests.lua") + +function Between(a,b) + return a+(b-a)/2 +end + +function vec3_add(a,b) + return {x=a.x+b.x, y=a.y+b.y, z=a.z+b.z} +end + +function vec3_sub(a,b) + return {x=a.x-b.x, y=a.y-b.y, z=a.z-b.z} +end + +function vec3_mul(v,s) + return {x=s*v.x, y=s*v.y, z=s*v.z} +end + +function MinMax(a,b) + if a < b then + return {min=a, max=b} + else + return {min=b, max=a} + end +end + +function isPointProper(p) + return (minetest.get_node(p).name ~= "air") and (minetest.get_node(p).name ~= "default:water_source") +end + +function FillNodes(minp, maxp, node) + for yi = minp.y, maxp.y do + for zi = minp.z, maxp.z do + for xi = minp.x, maxp.x do + minetest.set_node({x=xi, y=yi, z=zi}, node) + end + end + end +end + +function FillNodesProbable(minp, maxp, p, node) + local y = MinMax(minp.y, maxp.y) + local z = MinMax(minp.z, maxp.z) + local x = MinMax(minp.x, maxp.x) + for yi = y.min, y.max do + for zi = z.min,z.max do + for xi = x.min, x.max do + if nextrandom(0,1) < p then + minetest.set_node({x=xi, y=yi, z=zi}, node) + end + end + end + end +end + +function sqDistance(a,b,c) + return a*a + b*b + c*c +end + +function FillNodesCircled(centrum, radius, node) + local sqradius = radius * radius + for yi = centrum.y-radius-1,centrum.y+radius+1 do + for zi = centrum.z-radius-1,centrum.z+radius+1 do + for xi = centrum.x-radius-1,centrum.x+radius+1 do + if sqDistance(centrum.x-xi, centrum.y-yi, centrum.z-zi) < sqradius then + minetest.set_node({x=xi, y=yi, z=zi}, node) + end + end + end + end +end + +function placeStaff(coord) + minetest.set_node(coord, node_woodplanks) + minetest.set_node({x=coord.x, y=coord.y-1, z=coord.z}, node_fence) + minetest.set_node({x=coord.x, y=coord.y-2, z=coord.z}, node_fence) +end + +function placeMaybePlanks(pt) + if minetest.get_node(pt).name == "air" then + if nextrandom(0,1) < 0.9 then + minetest.set_node(pt, node_woodplanks) + end + end +end + +function mainCave(coord) + local xdif = 4 + --air + FillNodes({x=coord.x-3, y=coord.y-2, z=coord.z-3}, {x=coord.x+3, y=coord.y+2, z=coord.z+3}, node_air) + -- roof + FillNodes({x=coord.x-3, z=coord.z-3, y=coord.y-3}, {x=coord.x+3, z=coord.z+3, y=coord.y-3}, node_maincave) + FillNodes({x=coord.x-3, z=coord.z-3, y=coord.y+3}, {x=coord.x+3, z=coord.z+3, y=coord.y+3}, node_maincave) + -- walls + FillNodes({x=coord.x-4, z=coord.z-3, y=coord.y-2}, {x=coord.x-4, z=coord.z+3, y=coord.y+2}, node_maincave) + FillNodes({x=coord.x+4, z=coord.z-3, y=coord.y-2}, {x=coord.x+4, z=coord.z+3, y=coord.y+2}, node_maincave) + + FillNodes({x=coord.x-3, z=coord.z-4, y=coord.y-2}, {x=coord.x+3, z=coord.z-4, y=coord.y+2}, node_maincave) + FillNodes({x=coord.x-3, z=coord.z+4, y=coord.y-2}, {x=coord.x+3, z=coord.z+4, y=coord.y+2}, node_maincave) + -- round inner edges + FillNodes({x=coord.x-3, z=coord.z-3, y=coord.y-2}, {x=coord.x+3, z=coord.z-3, y=coord.y-2}, node_maincave) + FillNodes({x=coord.x-3, z=coord.z+3, y=coord.y-2}, {x=coord.x+3, z=coord.z+3, y=coord.y-2}, node_maincave) + FillNodes({x=coord.x-3, z=coord.z-3, y=coord.y-2}, {x=coord.x-3, z=coord.z+3, y=coord.y-2}, node_maincave) + FillNodes({x=coord.x+3, z=coord.z-3, y=coord.y-2}, {x=coord.x+3, z=coord.z+3, y=coord.y-2}, node_maincave) + + FillNodes({x=coord.x-3, z=coord.z-3, y=coord.y+2}, {x=coord.x+3, z=coord.z-3, y=coord.y+2}, node_maincave) + FillNodes({x=coord.x-3, z=coord.z+3, y=coord.y+2}, {x=coord.x+3, z=coord.z+3, y=coord.y+2}, node_maincave) + FillNodes({x=coord.x-3, z=coord.z-3, y=coord.y+2}, {x=coord.x-3, z=coord.z+3, y=coord.y+2}, node_maincave) + FillNodes({x=coord.x+3, z=coord.z-3, y=coord.y+2}, {x=coord.x+3, z=coord.z+3, y=coord.y+2}, node_maincave) +end + +-- horizontal even corridor part +function corridor_part(point, direction, length, i_offset) + local vector = vec3_add(point, direction); + local place_torches = nextrandom(0,1) < probability_torches_in_segment + if place_torches then + torchdir = {1,1} + if direction.z > 0 then + torchdir = {5, 4} + elseif direction.z < 0 then + torchdir = {4,5} + elseif direction.x < 0 then + torchdir = {2, 3} + elseif direction.x > 0 then + torchdir = {3, 2} + else torchdir = {1,1} + end + end + for i = 1+i_offset,length+i_offset+2 do + minetest.set_node(vector, node_air) + + minetest.set_node({x=vector.x-direction.z, y=vector.y, z=vector.z+direction.x}, node_air) + minetest.set_node({x=vector.x-direction.z, y=vector.y-1, z=vector.z+direction.x}, node_air) + minetest.set_node({x=vector.x+direction.z, y=vector.y, z=vector.z-direction.x}, node_air) + minetest.set_node({x=vector.x+direction.z, y=vector.y-1, z=vector.z-direction.x}, node_air) + + -- Decke + FillNodesProbable({x=vector.x-direction.z, y=vector.y+1, z=vector.z-direction.x}, {x=vector.x+direction.z, y=vector.y+1, z=vector.z+direction.x}, 0.9, node_air) + if direction.y == 0 then + if nextrandom(0,2) < 1 then + minetest.set_node({x=vector.x, y=vector.y-1, z=vector.z}, node_rails) + elseif nextrandom(1,10) > 1 then + minetest.set_node({x=vector.x, y=vector.y-1, z=vector.z}, node_air) + end + -- when there is no floor: maybe wood will make it! + placeMaybePlanks({x=vector.x-direction.z, y=vector.y-2, z=vector.z+direction.x}) + placeMaybePlanks({x=vector.x, y=vector.y-2, z=vector.z}) + placeMaybePlanks({x=vector.x+direction.z, y=vector.y-2, z=vector.z-direction.x}) + vector.y = vector.y+1 + if i % 5 == 0 then + -- Wooden staff structures + minetest.set_node(vector, node_woodplanks) + placeStaff({x=vector.x+direction.z, y=vector.y, z=vector.z-direction.x}) + placeStaff({x=vector.x-direction.z, y=vector.y, z=vector.z+direction.x}) + -- torches + elseif place_torches and (i % 5 == 1) and (i > 1+i_offset) then + minetest.set_node(vector, {name=name_torch,param2=torchdir[1]}) + elseif place_torches and (i % 5 == 4) then + minetest.set_node(vector, {name=name_torch,param2=torchdir[2]}) + -- water or lava in the corridors? + elseif vector.y < 0 and nextrandom(0,1) < 0.001 then + local cnode + if nextrandom(0,02) < 0.3 then + cnode = node_lava + else + cnode = node_water + end + minetest.set_node({x=vector.x+2*direction.z, y=vector.y+nextrandom(-2,-1), z=vector.z-2*direction.x}, cnode) + -- chests? + elseif nextrandom(0,1) < probability_chest then + place_chest({x=vector.x-direction.z, y=vector.y-2, z=vector.z+direction.x}) + end + vector.y = vector.y-1 + end + + vector = vec3_add(vector, direction); + end + return vec3_sub(vector, vec3_mul(direction, 2)) +end + +-- up or down going corridor part +function coridor_part_with_y(point, direction) + local air_disc = function(p, facedir) + FillNodesProbable({x=p.x-facedir.z, y=p.y+1, z=p.z-facedir.x}, + {x=p.x+facedir.z, y=p.y-1, z=p.z+facedir.x}, 0.99, node_air) + --FillNodesProbable({x=p.x-direction.z, y=p.y-1, z=p.z-direction.x}, {x=p.x+direction.z, y=p.y-1, z=p.z+direction.x}, 0.95, node_air) + --FillNodesProbable({x=p.x-direction.z, y=p.y, z=p.z-direction.x}, {x=p.x+direction.z, y=p.y, z=p.z+direction.x}, 0.95, node_air) + --FillNodesProbable({x=p.x-direction.z, y=p.y+1, z=p.z-direction.x}, {x=p.x+direction.z, y=p.y+1, z=p.z+direction.x}, 0.95, node_air) + --minetest.set_node(p, node_air) + --print("air_disc at "..p.x..", "..p.y..", "..p.z) + end + if direction.y < 0 then + direction.y = -1 + else + direction.y = 1 + end + local vector = vec3_add(point, {x=direction.x, z=direction.z, y=0}) + air_disc(vector, direction) + vector = vec3_add(vector, direction) + air_disc(vector, direction) + vector = vec3_add(vector, {x=direction.x, z=direction.z, y=0}) + air_disc(vector, direction) + vector = vec3_add(vector, direction) + air_disc(vector, direction) + vector = vec3_add(vector, direction) + air_disc(vector, direction) + vector = vec3_add(vector, {x=direction.x, z=direction.z, y=0}) + air_disc(vector, direction) + vector = vec3_add(vector, direction) + air_disc(vector, direction) + return vector +end + +function BulkOfWood(pt, height) + -- Luftkreuz + FillNodes({x=pt.x-2, z=pt.z-1, y=pt.y-1}, {x=pt.x+2, z=pt.z+1, y=pt.y+height-1}, node_air) + FillNodes({x=pt.x-1, z=pt.z-2, y=pt.y-1}, {x=pt.x+1, z=pt.z+2, y=pt.y+height-1}, node_air) + for yi = -1,height-1 do + -- Holz + minetest.set_node({x=pt.x+1, z=pt.z+1, y=pt.y+yi-1}, node_woodplanks) + minetest.set_node({x=pt.x+1, z=pt.z-1, y=pt.y+yi-1}, node_woodplanks) + minetest.set_node({x=pt.x-1, z=pt.z+1, y=pt.y+yi-1}, node_woodplanks) + minetest.set_node({x=pt.x-1, z=pt.z-1, y=pt.y+yi-1}, node_woodplanks) + end +end + +function cross(point, lastdir, new_way_probability) + --print("cross at "..point.x..", "..point.y..", "..point.z) + local wood = nextrandom(0,5) < 1 + local second_floor = wood and nextrandom(1,3) < 2 + if wood then + if second_floor then + BulkOfWood(point, 7) + else + BulkOfWood(point, 3) + end + end + local startpoint + -- Code reduction by defining function + local newway_func = function(midpoint, direction) + if nextrandom(0,1) < new_way_probability then + if wood then + startpoint = vec3_add(midpoint, vec3_mul(direction, 2)) + else + startpoint = midpoint + end + start_corridors(startpoint, direction) + end + end + if not wood and nextrandom(0,1) < probability_up_or_down then + lastdir.y = nextrandom(-0.5, 0.5) + end + newway_func(point, lastdir) + newway_func(point, {x=-lastdir.z, y=0, z=lastdir.x}) + newway_func(point, {x=lastdir.z, y=0, z=-lastdir.x}) + if second_floor then + newway_func({x=point.x, y=point.y+4, z=point.z}, lastdir) + newway_func({x=point.x, y=point.y+4, z=point.z}, {x=-lastdir.z, y=0, z=lastdir.x}) + newway_func({x=point.x, y=point.y+4, z=point.z}, {x=lastdir.z, y=0, z=-lastdir.x}) + newway_func({x=point.x, y=point.y+4, z=point.z}, {x=-lastdir.x, y=0, z=-lastdir.z}) + end +end + +function start_corridors(startpoint, direction) + local length = nextrandom(1,4)*4 + local waypoint = vec3_add(startpoint, vec3_mul(direction, length)) + local gofurther = isPointProper(waypoint) + if direction.y ~= 0 then + waypoint = coridor_part_with_y(startpoint, direction) + else + waypoint = corridor_part(startpoint, direction, length, 3) + end + if not gofurther then + return + end + local fork = nextrandom(0,1) < propability_fork + if fork then + cross(waypoint, direction, 0.5) + end +end + +function railcaves(main_cave_coord) + mainCave(main_cave_coord) + local dir = {x=1,y=0,z=0} + local waypoint = corridor_part(vec3_add(main_cave_coord, vec3_mul(dir, 3)), dir, nextrandom(4,5)*3, 2) + cross(waypoint, dir, 1) +end + +minetest.register_on_generated(function(minp, maxp, seed) + if not pr then + pr = PseudoRandom(seed) + end + if nextrandom(0,1) < probability_railcaves_in_chunk then + local mp + for i = 1,3 do + mp = {x=nextrandom(minp.x,maxp.x), y=nextrandom(minp.y,maxp.y), z=nextrandom(minp.z,maxp.z)} + if isPointProper(mp) then + break + end + end + if isPointProper(mp) then + railcaves(mp) + end + end +end) diff --git a/mods/railcorridors/screenshot.png b/mods/railcorridors/screenshot.png new file mode 100644 index 0000000..be02a2e Binary files /dev/null and b/mods/railcorridors/screenshot.png differ diff --git a/mods/screwdriver/init.lua b/mods/screwdriver/init.lua new file mode 100644 index 0000000..0c77754 --- /dev/null +++ b/mods/screwdriver/init.lua @@ -0,0 +1,113 @@ +screwdriver = {} + +local function nextrange(x, max) + x = x + 1 + if x > max then + x = 0 + end + return x +end + +screwdriver.ROTATE_FACE = 1 +screwdriver.ROTATE_AXIS = 2 +screwdriver.disallow = function(pos, node, user, mode, new_param2) + return false +end +screwdriver.rotate_simple = function(pos, node, user, mode, new_param2) + if mode ~= screwdriver.ROTATE_FACE then + return false + end +end +local USES = 200 + +-- Handles rotation +local function screwdriver_handler(itemstack, user, pointed_thing, mode) + if pointed_thing.type ~= "node" then + return + end + + local pos = pointed_thing.under + + if minetest.is_protected(pos, user:get_player_name()) then + minetest.record_protection_violation(pos, user:get_player_name()) + return + end + + local node = minetest.get_node(pos) + local ndef = minetest.registered_nodes[node.name] + -- Compute param2 + local rotationPart = node.param2 % 32 -- get first 4 bits + local preservePart = node.param2 - rotationPart + local axisdir = math.floor(rotationPart / 4) + local rotation = rotationPart - axisdir * 4 + if mode == screwdriver.ROTATE_FACE then + rotationPart = axisdir * 4 + nextrange(rotation, 3) + elseif mode == screwdriver.ROTATE_AXIS then + rotationPart = nextrange(axisdir, 5) * 4 + end + + local new_param2 = preservePart + rotationPart + local should_rotate = true + + if ndef and ndef.on_rotate then -- Node provides a handler, so let the handler decide instead if the node can be rotated + -- Copy pos and node because callback can modify it + local result = ndef.on_rotate(vector.new(pos), + {name = node.name, param1 = node.param1, param2 = node.param2}, + user, mode, new_param2) + if result == false then -- Disallow rotation + return + elseif result == true then + should_rotate = false + end + else + if not ndef or not ndef.paramtype2 == "facedir" or + (ndef.drawtype == "nodebox" and + not ndef.node_box.type == "fixed") or + node.param2 == nil then + return + end + + if ndef.can_dig and not ndef.can_dig(pos, user) then + return + end + end + + if should_rotate then + node.param2 = new_param2 + minetest.swap_node(pos, node) + end + + if not minetest.setting_getbool("creative_mode") then + itemstack:add_wear(65535 / (USES - 1)) + end + + return itemstack +end + +-- Screwdriver +minetest.register_tool("screwdriver:screwdriver", { + description = "Screwdriver (left-click rotates face, right-click rotates axis)", + inventory_image = "screwdriver.png", + on_use = function(itemstack, user, pointed_thing) + screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_FACE) + return itemstack + end, + on_place = function(itemstack, user, pointed_thing) + screwdriver_handler(itemstack, user, pointed_thing, screwdriver.ROTATE_AXIS) + return itemstack + end, +}) + + +minetest.register_craft({ + output = "screwdriver:screwdriver", + recipe = { + {"default:steel_ingot"}, + {"group:stick"} + } +}) + +minetest.register_alias("screwdriver:screwdriver1", "screwdriver:screwdriver") +minetest.register_alias("screwdriver:screwdriver2", "screwdriver:screwdriver") +minetest.register_alias("screwdriver:screwdriver3", "screwdriver:screwdriver") +minetest.register_alias("screwdriver:screwdriver4", "screwdriver:screwdriver") diff --git a/mods/screwdriver/readme.txt b/mods/screwdriver/readme.txt new file mode 100644 index 0000000..ced1ff5 --- /dev/null +++ b/mods/screwdriver/readme.txt @@ -0,0 +1,21 @@ +Minetest mod: screwdriver +========================= + +License of source code: +----------------------- +Copyright (C) 2013 RealBadAngel, Maciej Kasatkin + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Created by Gambit (WTFPL): + screwdriver.png \ No newline at end of file diff --git a/mods/screwdriver/textures/screwdriver.png b/mods/screwdriver/textures/screwdriver.png new file mode 100644 index 0000000..b2a56d5 Binary files /dev/null and b/mods/screwdriver/textures/screwdriver.png differ diff --git a/mods/sethome/init.lua b/mods/sethome/init.lua new file mode 100644 index 0000000..590086b --- /dev/null +++ b/mods/sethome/init.lua @@ -0,0 +1,65 @@ +local homes_file = minetest.get_worldpath() .. "/homes" +local homepos = {} + +local function loadhomes() + local input = io.open(homes_file, "r") + if input then + repeat + local x = input:read("*n") + if x == nil then + break + end + local y = input:read("*n") + local z = input:read("*n") + local name = input:read("*l") + homepos[name:sub(2)] = {x = x, y = y, z = z} + until input:read(0) == nil + io.close(input) + else + homepos = {} + end +end + +loadhomes() + +minetest.register_privilege("home", "Can use /sethome and /home") + +local changed = false + +minetest.register_chatcommand("home", { + description = "Teleport you to your home point", + privs = {home=true}, + func = function(name) + local player = minetest.get_player_by_name(name) + if player == nil then + -- just a check to prevent the server crashing + return false + end + if homepos[player:get_player_name()] then + player:setpos(homepos[player:get_player_name()]) + minetest.chat_send_player(name, "Teleported to home!") + else + minetest.chat_send_player(name, "Set a home using /sethome") + end + end, +}) + +minetest.register_chatcommand("sethome", { + description = "Set your home point", + privs = {home=true}, + func = function(name) + local player = minetest.get_player_by_name(name) + local pos = player:getpos() + homepos[player:get_player_name()] = pos + minetest.chat_send_player(name, "Home set!") + changed = true + if changed then + local output = io.open(homes_file, "w") + for i, v in pairs(homepos) do + output:write(v.x.." "..v.y.." "..v.z.." "..i.."\n") + end + io.close(output) + changed = false + end + end, +}) diff --git a/mods/stairs/README.txt b/mods/stairs/README.txt new file mode 100644 index 0000000..716a677 --- /dev/null +++ b/mods/stairs/README.txt @@ -0,0 +1,26 @@ +Minetest 0.4 mod: stairs +========================= + +License of source code: +----------------------- +Copyright (C) 2011-2012 Kahrl +Copyright (C) 2011-2012 celeron55, Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Authors of media files +----------------------- +Everything not listed in here: +Copyright (C) 2010-2012 celeron55, Perttu Ahola + + diff --git a/mods/stairs/depends.txt b/mods/stairs/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/stairs/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/stairs/init.lua b/mods/stairs/init.lua new file mode 100644 index 0000000..645afb1 --- /dev/null +++ b/mods/stairs/init.lua @@ -0,0 +1,311 @@ +-- Minetest 0.4 mod: stairs +-- See README.txt for licensing and other information. + +stairs = {} + +-- Node will be called stairs:stair_ +function stairs.register_stair(subname, recipeitem, groups, images, description, sounds) + minetest.register_node(":stairs:stair_" .. subname, { + description = description, + drawtype = "nodebox", + tiles = images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + groups = groups, + sounds = sounds, + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + {-0.5, 0, 0, 0.5, 0.5, 0.5}, + }, + }, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + local p0 = pointed_thing.under + local p1 = pointed_thing.above + local param2 = 0 + + local placer_pos = placer:getpos() + if placer_pos then + local dir = { + x = p1.x - placer_pos.x, + y = p1.y - placer_pos.y, + z = p1.z - placer_pos.z + } + param2 = minetest.dir_to_facedir(dir) + end + + if p0.y-1 == p1.y then + param2 = param2 + 20 + if param2 == 21 then + param2 = 23 + elseif param2 == 23 then + param2 = 21 + end + end + + return minetest.item_place(itemstack, placer, pointed_thing, param2) + end, + }) + + -- for replace ABM + minetest.register_node(":stairs:stair_" .. subname.."upside_down", { + replace_name = "stairs:stair_" .. subname, + groups = {slabs_replace=1}, + }) + + minetest.register_craft({ + output = 'stairs:stair_' .. subname .. ' 6', + recipe = { + {recipeitem, "", ""}, + {recipeitem, recipeitem, ""}, + {recipeitem, recipeitem, recipeitem}, + }, + }) + + -- Flipped recipe for the silly minecrafters + minetest.register_craft({ + output = 'stairs:stair_' .. subname .. ' 6', + recipe = { + {"", "", recipeitem}, + {"", recipeitem, recipeitem}, + {recipeitem, recipeitem, recipeitem}, + }, + }) +end + +-- Node will be called stairs:slab_ +function stairs.register_slab(subname, recipeitem, groups, images, description, sounds) + minetest.register_node(":stairs:slab_" .. subname, { + description = description, + drawtype = "nodebox", + tiles = images, + paramtype = "light", + paramtype2 = "facedir", + is_ground_content = false, + groups = groups, + sounds = sounds, + node_box = { + type = "fixed", + fixed = {-0.5, -0.5, -0.5, 0.5, 0, 0.5}, + }, + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + -- If it's being placed on an another similar one, replace it with + -- a full block + local slabpos = nil + local slabnode = nil + local p0 = pointed_thing.under + local p1 = pointed_thing.above + local n0 = minetest.get_node(p0) + local n1 = minetest.get_node(p1) + local param2 = 0 + + local n0_is_upside_down = (n0.name == "stairs:slab_" .. subname and + n0.param2 >= 20) + + if n0.name == "stairs:slab_" .. subname and not n0_is_upside_down and p0.y+1 == p1.y then + slabpos = p0 + slabnode = n0 + elseif n1.name == "stairs:slab_" .. subname then + slabpos = p1 + slabnode = n1 + end + if slabpos then + -- Remove the slab at slabpos + minetest.remove_node(slabpos) + -- Make a fake stack of a single item and try to place it + local fakestack = ItemStack(recipeitem) + fakestack:set_count(itemstack:get_count()) + + pointed_thing.above = slabpos + local success + fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) + -- If the item was taken from the fake stack, decrement original + if success then + itemstack:set_count(fakestack:get_count()) + -- Else put old node back + else + minetest.set_node(slabpos, slabnode) + end + return itemstack + end + + -- Upside down slabs + if p0.y-1 == p1.y then + -- Turn into full block if pointing at a existing slab + if n0_is_upside_down then + -- Remove the slab at the position of the slab + minetest.remove_node(p0) + -- Make a fake stack of a single item and try to place it + local fakestack = ItemStack(recipeitem) + fakestack:set_count(itemstack:get_count()) + + pointed_thing.above = p0 + local success + fakestack, success = minetest.item_place(fakestack, placer, pointed_thing) + -- If the item was taken from the fake stack, decrement original + if success then + itemstack:set_count(fakestack:get_count()) + -- Else put old node back + else + minetest.set_node(p0, n0) + end + return itemstack + end + + -- Place upside down slab + param2 = 20 + end + + -- If pointing at the side of a upside down slab + if n0_is_upside_down and p0.y+1 ~= p1.y then + param2 = 20 + end + + return minetest.item_place(itemstack, placer, pointed_thing, param2) + end, + }) + + -- for replace ABM + minetest.register_node(":stairs:slab_" .. subname.."upside_down", { + replace_name = "stairs:slab_"..subname, + groups = {slabs_replace=1}, + }) + + minetest.register_craft({ + output = 'stairs:slab_' .. subname .. ' 6', + recipe = { + {recipeitem, recipeitem, recipeitem}, + }, + }) +end + +-- Replace old "upside_down" nodes with new param2 versions +minetest.register_abm({ + nodenames = {"group:slabs_replace"}, + interval = 1, + chance = 1, + action = function(pos, node) + node.name = minetest.registered_nodes[node.name].replace_name + node.param2 = node.param2 + 20 + if node.param2 == 21 then + node.param2 = 23 + elseif node.param2 == 23 then + node.param2 = 21 + end + minetest.set_node(pos, node) + end, +}) + +-- Nodes will be called stairs:{stair,slab}_ +function stairs.register_stair_and_slab(subname, recipeitem, groups, images, desc_stair, desc_slab, sounds) + stairs.register_stair(subname, recipeitem, groups, images, desc_stair, sounds) + stairs.register_slab(subname, recipeitem, groups, images, desc_slab, sounds) +end + +stairs.register_stair_and_slab("wood", "default:wood", + {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + {"default_wood.png"}, + "Wooden Stair", + "Wooden Slab", + default.node_sound_wood_defaults()) + +stairs.register_stair_and_slab("stone", "default:stone", + {cracky=3}, + {"default_stone.png"}, + "Stone Stair", + "Stone Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("cobble", "default:cobble", + {cracky=3}, + {"default_cobble.png"}, + "Cobblestone Stair", + "Cobblestone Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("desert_stone", "default:desert_stone", + {cracky=3}, + {"default_desert_stone.png"}, + "Desertstone Stair", + "Desertstone Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("desert_cobble", "default:desert_cobble", + {cracky=3}, + {"default_desert_cobble.png"}, + "Desert Cobblestone Stair", + "Desert Cobblestone Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("desert_stonebrick", "default:desert_stonebrick", + {cracky=3}, + {"default_desert_stone_brick.png"}, + "Desert Stone Brick Stair", + "Desert Stone Brick Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("brick", "default:brick", + {cracky=3}, + {"default_brick.png"}, + "Brick Stair", + "Brick Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("sandstone", "default:sandstone", + {crumbly=2,cracky=2}, + {"default_sandstone.png"}, + "Sandstone Stair", + "Sandstone Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("sandstonebrick", "default:sandstonebrick", + {crumbly=2,cracky=2}, + {"default_sandstone_brick.png"}, + "Sandstone Brick Stair", + "Sandstone Brick Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("junglewood", "default:junglewood", + {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + {"default_junglewood.png"}, + "Junglewood Stair", + "Junglewood Slab", + default.node_sound_wood_defaults()) + +stairs.register_stair_and_slab("stonebrick", "default:stonebrick", + {cracky=3}, + {"default_stone_brick.png"}, + "Stone Brick Stair", + "Stone Brick Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("pinewood", "default:pinewood", + {snappy=2,choppy=2,oddly_breakable_by_hand=2,flammable=3}, + {"default_pinewood.png"}, + "Pinewood Stair", + "Pinewood Slab", + default.node_sound_wood_defaults()) + +stairs.register_stair_and_slab("obsidian", "default:obsidian", + {cracky=1,level=2}, + {"default_obsidian.png"}, + "Obsidian Stair", + "Obsidian Slab", + default.node_sound_stone_defaults()) + +stairs.register_stair_and_slab("obsidianbrick", "default:obsidianbrick", + {cracky=1,level=2}, + {"default_obsidian_brick.png"}, + "Obsidian Brick Stair", + "Obsidian Brick Slab", + default.node_sound_stone_defaults()) diff --git a/mods/survival/abms.lua b/mods/survival/abms.lua new file mode 100644 index 0000000..ba4d420 --- /dev/null +++ b/mods/survival/abms.lua @@ -0,0 +1,33 @@ +minetest.register_abm({ + nodenames = {"default:sand"}, + neighbors = {"group:water"}, + interval = 30, + chance = 75, + action = function(pos, node) + local name = minetest.get_node(pos).name + if name == "default:sand" then + if minetest.find_node_near(pos, 3, {"group:water"}) == nil then + return + end + minetest.set_node(pos, {name='survival:sand_with_food'}) + end + end, +}) + +minetest.register_abm({ + nodenames = {"group:leaves"}, + neighbors = {"group:leafdecay"}, + interval = 30, + chance = 75, + action = function(pos, node) + local name = minetest.get_node(pos).name + if name == "default:leaves" then + if minetest.find_node_near(pos, 3, {"group:tree"}) == nil then + return + elseif minetest.find_node_near(pos, 10, {'survival:bird_nest'}) == nil then + return + end + minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z}, {name='survival:bird_nest'}) + end + end, +}) diff --git a/mods/survival/blends/bird_nest.blend b/mods/survival/blends/bird_nest.blend new file mode 100644 index 0000000..f9df3ad Binary files /dev/null and b/mods/survival/blends/bird_nest.blend differ diff --git a/mods/survival/blends/bird_nest.blend1 b/mods/survival/blends/bird_nest.blend1 new file mode 100644 index 0000000..58c7265 Binary files /dev/null and b/mods/survival/blends/bird_nest.blend1 differ diff --git a/mods/survival/changelog.txt b/mods/survival/changelog.txt new file mode 100644 index 0000000..1f833b6 --- /dev/null +++ b/mods/survival/changelog.txt @@ -0,0 +1,42 @@ +5-11-15: +Removed the drinking parts of code, the thirsty mod does a great job, just use that if you want drinking. +Updated the readme and cleaned up stray print code from debugging. + +4-29-15: +Kabobs are here, craft with three mussels, three oysters, and a stick, once crafted enjoy raw, or cook for more health. + +4-25-15: +Wells added, they require a hole in the ground three nodes deep to be placed on top. Just click on the inside of the hole, in the top node. They need to be placed in dirt. Right click on a well top and put in a bucket or canteen to get some water. The bucket will act exactly as any other bucket with water, the canteen with water can be cooked to purify and then be drank. Drinking dirty water can result in a loss of health. + +4-11-15: +Spigots are working!!! They can only be placed on tree trunks, and need a bucket to collect sap. Right now you just have the infotexts to give you statuses. Placing a bucket in the spigot will trigger a timer that will replace the empty bucket with a sap filled bucket. Cook the sap filled bucket to get sugar. Collection and cooking times will probably be tweaked yet. I want to add a graphic to the spigot that shows whether the bucket is placed and is empty or full, but I don't know if I can do that without creating three nodes. Updated the spigot model and texture. +Crafting recipe is +c +cs +c s where c is clay and s is group stick + +4-9-15: +Spigots now only place on tree trunks, though they have to be on the ground, not one node above the ground, not sure why... +added the bucket with sap and recipe for making sugar and the energy bar. + +3-29-15: +Started working on the system for creating tree sap, and coding the options that only allow the spigot to be placed on a tree. + +3-28-15: +Added an ABM that changes some sand near water to survival:sand_with_food, which, as the name suggests, can contain some oysters or mussels. Added the oyster and mussels, along with their craft recipes. I'm debating over whether I should allow eating them raw in shell, or if they should have to be crafted out of the shell to eat raw, but left in shell to cook. + +3-25-15: +Started work on the two new "beds". Added beds as a dependency and am using that code for the time being to handle sleeping. + +3-18-15: +Added a couple more machetes. Created the forum topic. Added five bugs, some are poisonous, so be careful. + +3-17-15: +Added a few machetes and start working on the drinking part of the mod. + + +3-11-15: +Added Barrels. + +3-4-15: +Started mod, added cotton recipe. Uploaded to GitHub diff --git a/mods/survival/crafting.lua b/mods/survival/crafting.lua new file mode 100644 index 0000000..c3bdffa --- /dev/null +++ b/mods/survival/crafting.lua @@ -0,0 +1,197 @@ +minetest.register_craft({ + output = 'farming:cotton 1', + recipe = { + {'default:grass_1', 'default:grass_1', 'default:grass_1'}, + {'default:grass_1', 'default:grass_1', 'default:grass_1'}, + {'default:grass_1', 'default:grass_1', 'default:grass_1'}, + } +}) + +minetest.register_craft({ + output = 'survival:barrel 1', + recipe = { + {'group:wood', 'default:tree', 'group:wood'}, + {'group:wood', '', 'group:wood'}, + {'group:wood', 'default:tree', 'group:wood'}, + } +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'default:stick 9', + recipe = {'survival:barrel'} +}) + +minetest.register_craft({ + output = 'survival:machete_wood 1', + recipe = { + {'', '', 'group:wood'}, + {'', 'group:wood', ''}, + {'group:stick', '', ''}, + } +}) + +minetest.register_craft({ + output = 'survival:machete_steel 1', + recipe = { + {'', '', 'default:steel_ingot'}, + {'', 'default:steel_ingot', ''}, + {'group:stick', '', ''}, + } +}) + +minetest.register_craft({ + output = 'survival:machete_bronze 1', + recipe = { + {'', '', 'default:bronze_ingot'}, + {'', 'default:bronze_ingot', ''}, + {'group:stick', '', ''}, + } +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'survival:machete_diamond 1', + recipe = {'survival:machete_steel', 'default:diamond'}, +}) + +minetest.register_craft({ + output = 'survival:machete_mese 1', + recipe = { + {'', '', 'default:mese_crystal'}, + {'', 'default:mese_crystal', ''}, + {'group:stick', '', ''}, + } +}) + +minetest.register_craft({ + output = 'survival:sleeping_bag 1', + recipe = { + {'group:wool', 'group:wool', 'group:wool'} + }, +}) + +minetest.register_craft({ + output = 'survival:leafy_bed 1', + recipe = { + {'default:leaves', '', 'default:leaves'}, + {'default:leaves', 'default:leaves', 'default:leaves'} + } +}) + +minetest.register_craft({ + output = 'survival:energy_bar 1', + recipe = { + {'default:apple', 'default:apple', 'default:apple'}, + {'survival:sugar', 'survival:sugar', 'survival:sugar'}, + {'farming:seed_wheat', 'farming:seed_wheat', 'farming:seed_wheat'}, + } +}) + +minetest.register_craft({ + output = 'survival:spigot 1', + recipe = { + {'default:clay', '', ''}, + {'default:clay', 'group:stick', ''}, + {'default:clay', '', 'group:stick'} + } +}) + +minetest.register_craft({ + output = 'survival:well_bottom 1', + recipe = { + {'default:cobble', 'default:cobble', 'default:cobble'}, + {'default:cobble', 'farming:cotton', 'default:cobble'}, + {'default:cobble', 'default:cobble', 'default:cobble'}, + } +}) + +minetest.register_craft({ + output = 'survival:well_top 1', + recipe = { + {'', 'group:wood', ''}, + {'group:wood', 'farming:cotton', 'group:wood'}, + {'group:stick', 'farming:cotton', 'group:stick'}, + } +}) + +minetest.register_craft({ + output = 'survival:raw_kabob 1', + recipe = { + {'survival:mussel_raw', 'survival:mussel_raw', 'survival:mussel_raw'}, + {'survival:oyster_raw', 'survival:oyster_raw', 'survival:oyster_raw'}, + {'group:stick', '', ''}, + } +}) + +minetest.register_craft({ + type = 'shapeless', + output = 'survival:salt 9', + recipe = {'survival:salt_lump'} + }) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:slug_cooked', + recipe = 'survival:slug_raw', + cooktime = 1, + }) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:cricket_cooked', + recipe = 'survival:cricket_raw', + cooktime = 1, + }) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:worm_cooked', + recipe = 'survival:worm_raw', + cooktime = 1, + }) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:centipede_cooked', + recipe = 'survival:centipede_raw', + cooktime = 1, + }) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:milipede_cooked', + recipe = 'survival:milipede_raw', + cooktime = 1, + }) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:oyster_cooked', + recipe = 'survival:oyster_raw', + cooktime = 3, + replacements = {{'survival:oyster_raw', 'survival:shell'}}, +}) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:mussel_cooked', + recipe = 'survival:mussel_raw', + cooktime = 3, + replacements = {{'survival:mussel_raw', 'survival:shell'}}, +}) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:sugar', + recipe = 'survival:bucket_sap', + cooktime = 30, + replacements = {{'survival:bucket_sap', 'bucket:bucket_empty'}}, +}) + +minetest.register_craft({ + type = 'cooking', + output = 'survival:cooked_kabob', + recipe = 'survival:raw_kabob', + cooktime = 7, +}) diff --git a/mods/survival/craftitem.lua b/mods/survival/craftitem.lua new file mode 100644 index 0000000..8b08de6 --- /dev/null +++ b/mods/survival/craftitem.lua @@ -0,0 +1,26 @@ +minetest.register_craftitem('survival:shell', { + description = 'old shell', + inventory_image = 'survival_shell.png', +}) + +minetest.register_craftitem('survival:bucket_sap', { + description = 'bucket with sap', + inventory_image = 'survival_bucket_sap.png', + stack_max = 1, +}) + +minetest.register_craftitem('survival:salt_lump', { + description = 'chunk of salt', + inventory_image = 'survival_salt_lump.png' +}) + +minetest.register_craftitem('survival:salt', { + description = 'salt', + inventory_image = 'survival_salt.png' +}) + +minetest.register_craftitem('survival:nesting', { + description = 'Nesting materials', + inventory_image = 'survival_nesting.png', + groups = {kindling=1}, +}) diff --git a/mods/survival/credits.txt b/mods/survival/credits.txt new file mode 100644 index 0000000..5b9ad9f --- /dev/null +++ b/mods/survival/credits.txt @@ -0,0 +1 @@ +Code and graphics by Nathan. diff --git a/mods/survival/depends.txt b/mods/survival/depends.txt new file mode 100644 index 0000000..d782b89 --- /dev/null +++ b/mods/survival/depends.txt @@ -0,0 +1,5 @@ +farming +default +wool +beds +thirsty? diff --git a/mods/survival/foods.lua b/mods/survival/foods.lua new file mode 100644 index 0000000..2636d1d --- /dev/null +++ b/mods/survival/foods.lua @@ -0,0 +1,47 @@ +minetest.register_craftitem('survival:slug_raw', { + description = 'slug', + inventory_image = 'survival_slug_raw.png', + on_use = function(player) + local hp_gain = math.random(-4,1) + local hp = player:get_hp() + player:set_hp(hp + hp_gain) + end +}) + +local food_table = { --craft, desc, invimg, health, hydration +{'slug_cooked', 'cooked slug', 'slug_cooked', .25, .1}, +{'cricket_raw', 'cricket', 'cricket_raw', .25, .1}, +{'cricket_cooked', 'cooked cricket', 'cricket_cooked', .125, .125}, +{'worm_raw', 'worm', 'worm_raw', .25, .2}, +{'worm_cooked', 'cooked worm', 'worm_cooked', .125, .1}, +{'centipede_raw', 'centipede', 'centipede_raw', .25, .15}, +{'centipede_cooked', 'cooked centipede', 'centipede_cooked', .25, .1}, +{'milipede_raw', 'milipede', 'milipede_raw', -4, .1}, +{'milipede_cooked', 'cooked milipede', 'milipede_cooked', -3, 0}, +{'oyster_raw', 'raw oyster', 'oyster_raw', .5, .45}, +{'oyster_cooked', 'cooked oyster', 'oyster_cooked', .6, .35}, +{'mussel_raw', 'raw mussel', 'mussel_raw', -.7, .6}, +{'mussel_cooked', 'cooked mussel', 'mussel_cooked', .6, .35}, +{'sugar', 'sugar', 'sugar', .1, -1}, +{'raw_kabob', 'uncooked seafood kabob', 'raw_kabob', 1, 1.5}, +{'cooked_kabob', 'seafood kabob', 'cooked_kabob', 2.5, 1}, +{'energy_bar', 'energy bar', 'energy_bar', 10, -4} +} + +for i in ipairs (food_table) do + local craft = food_table[i][1] + local desc = food_table[i][2] + local invimg = food_table[i][3] + local health = food_table[i][4] + local hydration = food_table[i][5] + +minetest.register_craftitem('survival:'..craft, { + description = desc, + inventory_image = 'survival_'..invimg..'.png', + on_use = function(itemstack, user, pointed_thing) + thirsty.drink(user, hydration, 20) + local eat_func = minetest.item_eat(health) + return eat_func(itemstack, user, pointed_thing) + end, +}) +end diff --git a/mods/survival/functions.lua b/mods/survival/functions.lua new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/mods/survival/functions.lua @@ -0,0 +1 @@ + diff --git a/mods/survival/init.lua b/mods/survival/init.lua new file mode 100644 index 0000000..691b917 --- /dev/null +++ b/mods/survival/init.lua @@ -0,0 +1,9 @@ +--Load File +dofile(minetest.get_modpath('survival')..'/crafting.lua') +dofile(minetest.get_modpath('survival')..'/nodes.lua') +dofile(minetest.get_modpath('survival')..'/tools.lua') +dofile(minetest.get_modpath('survival')..'/foods.lua') +dofile(minetest.get_modpath('survival')..'/abms.lua') +dofile(minetest.get_modpath('survival')..'/craftitem.lua') +dofile(minetest.get_modpath('survival')..'/functions.lua') +dofile(minetest.get_modpath('survival')..'/ores.lua') diff --git a/mods/survival/license.txt b/mods/survival/license.txt new file mode 100644 index 0000000..2663366 --- /dev/null +++ b/mods/survival/license.txt @@ -0,0 +1 @@ +All the graphics and code in this mod are licensed under creative commons 0. diff --git a/mods/survival/models/spigot.obj b/mods/survival/models/spigot.obj new file mode 100644 index 0000000..f8c3be2 --- /dev/null +++ b/mods/survival/models/spigot.obj @@ -0,0 +1,92 @@ +# Blender v2.74 (sub 4) OBJ File: '' +# www.blender.org +v 0.000000 0.110653 0.060066 +v 0.000000 0.237622 0.441510 +v 0.035355 0.096758 0.064691 +v 0.035355 0.223727 0.446135 +v 0.050000 0.063212 0.075858 +v 0.050000 0.190181 0.457301 +v 0.035355 0.029667 0.087024 +v 0.035355 0.156635 0.468467 +v -0.000000 0.015772 0.091649 +v -0.000000 0.142740 0.473092 +v -0.035355 0.029667 0.087024 +v -0.035355 0.156635 0.468467 +v -0.050000 0.063212 0.075858 +v -0.050000 0.190181 0.457301 +v -0.035355 0.096758 0.064691 +v -0.035355 0.223727 0.446135 +v -0.000000 0.097173 0.064553 +v 0.025309 0.087226 0.067864 +v 0.035792 0.063212 0.075858 +v 0.025309 0.039199 0.083851 +v -0.000000 0.029252 0.087162 +v -0.025309 0.039199 0.083851 +v -0.035792 0.063212 0.075858 +v -0.025309 0.087226 0.067864 +v -0.308226 0.455513 0.501121 +v -0.258129 0.405416 0.407224 +v -0.258129 -0.110552 0.407224 +v -0.308226 -0.160649 0.501121 +v 0.257839 -0.110552 0.407225 +v 0.257839 0.405416 0.407225 +v 0.307936 0.455513 0.501121 +v 0.307936 -0.160649 0.501121 +vt 1.000000 0.312500 +vt 0.000000 0.187500 +vt 0.000000 0.000000 +vt 1.000000 0.187500 +vt 1.000000 0.000000 +vt 1.000000 1.000000 +vt 0.000000 1.000000 +vt 1.000000 0.812500 +vt 0.000000 0.812500 +vt 1.000000 0.687500 +vt 0.000000 0.687500 +vt 0.000000 0.500000 +vt 1.000000 0.500000 +vt 0.000000 0.312500 +vt 0.023438 0.000000 +vt 0.171875 0.156250 +vt 0.171875 0.824219 +vt 0.828125 0.175781 +vt 0.976562 1.000000 +vt 0.828125 0.843750 +vn 0.382700 0.876600 -0.291800 +vn 0.923900 0.363100 -0.120900 +vn 0.923900 -0.363100 0.120900 +vn 0.382700 -0.876600 0.291800 +vn -0.382700 -0.876600 0.291800 +vn -0.923900 -0.363100 0.120900 +vn -0.382700 0.876600 -0.291800 +vn -0.923900 0.363100 -0.120900 +vn 0.000000 -0.315800 -0.948800 +vn -0.882300 0.000000 -0.470700 +vn 0.882300 0.000000 -0.470700 +vn 0.000000 -0.882300 -0.470700 +vn 0.000000 0.882300 -0.470700 +vn 0.000000 0.000000 -1.000000 +g Cylinder_Cylinder_Spigot +s off +f 1/1/1 2/2/1 4/3/1 3/4/1 +f 3/4/2 4/3/2 6/3/2 5/5/2 +f 5/6/3 6/7/3 8/7/3 7/8/3 +f 7/8/4 8/7/4 10/9/4 9/10/4 +f 9/10/5 10/9/5 12/11/5 11/10/5 +f 11/10/6 12/11/6 14/12/6 13/13/6 +f 15/1/7 16/14/7 2/2/7 1/1/7 +f 13/13/8 14/12/8 16/14/8 15/1/8 +f 15/1/9 1/1/9 17/1/9 24/1/9 +f 1/1/9 3/4/9 18/4/9 17/1/9 +f 5/6/9 7/8/9 20/8/9 19/8/9 +f 11/10/9 13/13/9 23/13/9 22/10/9 +f 7/8/9 9/10/9 21/10/9 20/8/9 +f 13/13/9 15/1/9 24/1/9 23/13/9 +f 3/4/9 5/5/9 19/5/9 18/4/9 +f 9/10/9 11/10/9 22/10/9 21/10/9 +g Cylinder_Cylinder_Plaque +f 25/15/10 26/16/10 27/17/10 28/7/10 +f 30/18/11 31/5/11 32/19/11 29/20/11 +f 32/19/12 28/7/12 27/17/12 29/20/12 +f 30/18/13 26/16/13 25/15/13 31/5/13 +f 30/18/14 29/20/14 27/17/14 26/16/14 diff --git a/mods/survival/models/survival_barrel.obj b/mods/survival/models/survival_barrel.obj new file mode 100644 index 0000000..e6d71ac --- /dev/null +++ b/mods/survival/models/survival_barrel.obj @@ -0,0 +1,747 @@ +# Blender v2.73 (sub 7) OBJ File: 'Survival_Barrel.blend' +# www.blender.org +mtllib barrel.mtl +o Cylinder.001 +v 0.000000 0.143105 -0.500000 +v 0.000000 0.243105 -0.500000 +v 0.154509 0.143105 -0.475528 +v 0.154509 0.243105 -0.475528 +v 0.293893 0.143105 -0.404509 +v 0.293893 0.243105 -0.404509 +v 0.404509 0.143105 -0.293893 +v 0.404509 0.243105 -0.293893 +v 0.475528 0.143105 -0.154509 +v 0.475528 0.243105 -0.154509 +v 0.500000 0.143105 -0.000000 +v 0.500000 0.243105 -0.000000 +v 0.475528 0.143105 0.154508 +v 0.475528 0.243105 0.154508 +v 0.404509 0.143105 0.293892 +v 0.404509 0.243105 0.293892 +v 0.293893 0.143105 0.404508 +v 0.293893 0.243105 0.404508 +v 0.154508 0.143105 0.475528 +v 0.154508 0.243105 0.475528 +v -0.000000 0.143105 0.500000 +v -0.000000 0.243105 0.500000 +v -0.154509 0.143105 0.475528 +v -0.154509 0.243105 0.475528 +v -0.293893 0.143105 0.404508 +v -0.293893 0.243105 0.404508 +v -0.404509 0.143105 0.293892 +v -0.404509 0.243105 0.293892 +v -0.475528 0.143105 0.154508 +v -0.475528 0.243105 0.154508 +v -0.500000 0.143105 -0.000001 +v -0.500000 0.243105 -0.000001 +v -0.475528 0.143105 -0.154509 +v -0.475528 0.243105 -0.154509 +v -0.404508 0.143105 -0.293893 +v -0.404508 0.243105 -0.293893 +v -0.293892 0.143105 -0.404509 +v -0.293892 0.243105 -0.404509 +v -0.154508 0.143105 -0.475529 +v -0.154508 0.243105 -0.475529 +v 0.000000 0.143105 -0.475683 +v 0.146994 0.143105 -0.452402 +v 0.146994 0.243105 -0.452402 +v 0.000000 0.243105 -0.475683 +v 0.279599 0.143105 -0.384836 +v 0.279599 0.243105 -0.384836 +v 0.384836 0.143105 -0.279600 +v 0.384836 0.243105 -0.279600 +v 0.452401 0.143105 -0.146994 +v 0.452401 0.243105 -0.146994 +v 0.475683 0.143105 -0.000000 +v 0.475683 0.243105 -0.000000 +v 0.452401 0.143105 0.146994 +v 0.452401 0.243105 0.146994 +v 0.384836 0.143105 0.279599 +v 0.384836 0.243105 0.279599 +v 0.279599 0.143105 0.384835 +v 0.279599 0.243105 0.384835 +v 0.146994 0.143105 0.452401 +v 0.146994 0.243105 0.452401 +v -0.000000 0.143105 0.475683 +v -0.000000 0.243105 0.475683 +v -0.146994 0.143105 0.452401 +v -0.146994 0.243105 0.452401 +v -0.279600 0.143105 0.384835 +v -0.279600 0.243105 0.384835 +v -0.384836 0.143105 0.279599 +v -0.384836 0.243105 0.279599 +v -0.452401 0.143105 0.146994 +v -0.452401 0.243105 0.146994 +v -0.475683 0.143105 -0.000001 +v -0.475683 0.243105 -0.000001 +v -0.452401 0.143105 -0.146995 +v -0.452401 0.243105 -0.146995 +v -0.384835 0.143105 -0.279600 +v -0.384835 0.243105 -0.279600 +v -0.279599 0.143105 -0.384836 +v -0.279599 0.243105 -0.384836 +v -0.146993 0.143105 -0.452402 +v -0.146993 0.243105 -0.452402 +v 0.000000 -0.242248 -0.500000 +v 0.000000 -0.142248 -0.500000 +v 0.154509 -0.242248 -0.475528 +v 0.154509 -0.142248 -0.475528 +v 0.293893 -0.242248 -0.404509 +v 0.293893 -0.142248 -0.404509 +v 0.404509 -0.242248 -0.293893 +v 0.404509 -0.142248 -0.293893 +v 0.475528 -0.242248 -0.154509 +v 0.475528 -0.142248 -0.154509 +v 0.500000 -0.242248 -0.000000 +v 0.500000 -0.142248 -0.000000 +v 0.475528 -0.242248 0.154508 +v 0.475528 -0.142248 0.154508 +v 0.404509 -0.242248 0.293892 +v 0.404509 -0.142248 0.293892 +v 0.293893 -0.242248 0.404508 +v 0.293893 -0.142248 0.404508 +v 0.154508 -0.242248 0.475528 +v 0.154508 -0.142248 0.475528 +v -0.000000 -0.242248 0.500000 +v -0.000000 -0.142248 0.500000 +v -0.154509 -0.242248 0.475528 +v -0.154509 -0.142248 0.475528 +v -0.293893 -0.242248 0.404508 +v -0.293893 -0.142248 0.404508 +v -0.404509 -0.242248 0.293892 +v -0.404509 -0.142248 0.293892 +v -0.475528 -0.242248 0.154508 +v -0.475528 -0.142248 0.154508 +v -0.500000 -0.242248 -0.000001 +v -0.500000 -0.142248 -0.000001 +v -0.475528 -0.242248 -0.154509 +v -0.475528 -0.142248 -0.154509 +v -0.404508 -0.242248 -0.293893 +v -0.404508 -0.142248 -0.293893 +v -0.293892 -0.242248 -0.404509 +v -0.293892 -0.142248 -0.404509 +v -0.154508 -0.242248 -0.475529 +v -0.154508 -0.142248 -0.475529 +v 0.000000 -0.242248 -0.475683 +v 0.146994 -0.242248 -0.452402 +v 0.146994 -0.142248 -0.452402 +v 0.000000 -0.142248 -0.475683 +v 0.279599 -0.242248 -0.384836 +v 0.279599 -0.142248 -0.384836 +v 0.384836 -0.242248 -0.279600 +v 0.384836 -0.142248 -0.279600 +v 0.452401 -0.242248 -0.146994 +v 0.452401 -0.142248 -0.146994 +v 0.475683 -0.242248 -0.000000 +v 0.475683 -0.142248 -0.000000 +v 0.452401 -0.242248 0.146994 +v 0.452401 -0.142248 0.146994 +v 0.384836 -0.242248 0.279599 +v 0.384836 -0.142248 0.279599 +v 0.279599 -0.242248 0.384835 +v 0.279599 -0.142248 0.384835 +v 0.146994 -0.242248 0.452401 +v 0.146994 -0.142248 0.452401 +v -0.000000 -0.242248 0.475683 +v -0.000000 -0.142248 0.475683 +v -0.146994 -0.242248 0.452401 +v -0.146994 -0.142248 0.452401 +v -0.279600 -0.242248 0.384835 +v -0.279600 -0.142248 0.384835 +v -0.384836 -0.242248 0.279599 +v -0.384836 -0.142248 0.279599 +v -0.452401 -0.242248 0.146994 +v -0.452401 -0.142248 0.146994 +v -0.475683 -0.242248 -0.000001 +v -0.475683 -0.142248 -0.000001 +v -0.452401 -0.242248 -0.146995 +v -0.452401 -0.142248 -0.146995 +v -0.384835 -0.242248 -0.279600 +v -0.384835 -0.142248 -0.279600 +v -0.279599 -0.242248 -0.384836 +v -0.279599 -0.142248 -0.384836 +v -0.146993 -0.242248 -0.452402 +v -0.146993 -0.142248 -0.452402 +vt 0.387030 0.670837 +vt 0.346104 0.670837 +vt 0.346104 0.618474 +vt 0.387030 0.618474 +vt 0.349770 0.615886 +vt 0.390697 0.615886 +vt 0.390697 0.668249 +vt 0.349770 0.668249 +vt 0.390697 0.729806 +vt 0.349770 0.729806 +vt 0.390697 0.794531 +vt 0.349770 0.794531 +vt 0.390697 0.856087 +vt 0.349770 0.856087 +vt 0.390697 0.908450 +vt 0.349770 0.908450 +vt 0.357103 0.917292 +vt 0.316177 0.917292 +vt 0.316177 0.864929 +vt 0.357103 0.864929 +vt 0.316177 0.803372 +vt 0.357103 0.803372 +vt 0.316177 0.738648 +vt 0.357103 0.738648 +vt 0.316177 0.677091 +vt 0.357103 0.677091 +vt 0.316177 0.624728 +vt 0.357103 0.624728 +vt 0.352541 0.776915 +vt 0.311615 0.776915 +vt 0.311615 0.724552 +vt 0.352541 0.724552 +vt 0.407791 0.903427 +vt 0.366864 0.903427 +vt 0.366864 0.841870 +vt 0.407791 0.841870 +vt 0.366864 0.777146 +vt 0.407791 0.777146 +vt 0.366864 0.715589 +vt 0.407791 0.715589 +vt 0.366864 0.663226 +vt 0.407791 0.663226 +vt 0.387030 0.911038 +vt 0.346104 0.911038 +vt 0.346104 0.858675 +vt 0.387030 0.858675 +vt 0.346104 0.797118 +vt 0.387030 0.797118 +vt 0.387030 0.732393 +vt 0.346104 0.732393 +vt 0.495503 0.743888 +vt 0.488910 0.744944 +vt 0.476286 0.705666 +vt 0.482234 0.702603 +vt 0.237676 0.830133 +vt 0.243623 0.827069 +vt 0.267635 0.860481 +vt 0.262915 0.865252 +vt 0.224393 0.743888 +vt 0.230986 0.744944 +vt 0.230986 0.786243 +vt 0.224393 0.787298 +vt 0.452275 0.672255 +vt 0.456994 0.667484 +vt 0.482234 0.828584 +vt 0.476286 0.825520 +vt 0.488910 0.786243 +vt 0.495503 0.787298 +vt 0.495516 0.788848 +vt 0.488924 0.787792 +vt 0.488924 0.746493 +vt 0.495516 0.745438 +vt 0.243609 0.825520 +vt 0.237662 0.828584 +vt 0.224407 0.788848 +vt 0.230999 0.787792 +vt 0.419225 0.647980 +vt 0.422256 0.641968 +vt 0.482247 0.830133 +vt 0.476300 0.827069 +vt 0.224407 0.745437 +vt 0.230999 0.746493 +vt 0.267621 0.858932 +vt 0.262901 0.863703 +vt 0.380374 0.635218 +vt 0.381418 0.628553 +vt 0.457008 0.865252 +vt 0.452288 0.860481 +vt 0.297654 0.643517 +vt 0.300684 0.649529 +vt 0.267635 0.673804 +vt 0.262915 0.669033 +vt 0.338492 0.630103 +vt 0.339536 0.636767 +vt 0.237676 0.704152 +vt 0.243623 0.707216 +vt 0.300670 0.883207 +vt 0.297640 0.889219 +vt 0.422269 0.890768 +vt 0.419239 0.884756 +vt 0.339522 0.635218 +vt 0.338478 0.628553 +vt 0.381431 0.630102 +vt 0.380387 0.636767 +vt 0.339522 0.895969 +vt 0.338478 0.902634 +vt 0.381431 0.904183 +vt 0.380387 0.897518 +vt 0.300671 0.647980 +vt 0.297640 0.641968 +vt 0.422269 0.643517 +vt 0.419239 0.649529 +vt 0.380373 0.895969 +vt 0.381418 0.902634 +vt 0.338492 0.904183 +vt 0.339536 0.897518 +vt 0.267621 0.672255 +vt 0.262902 0.667483 +vt 0.457008 0.669033 +vt 0.452288 0.673804 +vt 0.419225 0.883207 +vt 0.422256 0.889219 +vt 0.243610 0.705666 +vt 0.237662 0.702603 +vt 0.297654 0.890768 +vt 0.300684 0.884756 +vt 0.452275 0.858932 +vt 0.456994 0.863703 +vt 0.482247 0.704152 +vt 0.476300 0.707216 +vt 0.383364 0.671591 +vt 0.342437 0.671591 +vt 0.342437 0.619228 +vt 0.383364 0.619228 +vt 0.308844 0.615886 +vt 0.308844 0.668249 +vt 0.308844 0.729806 +vt 0.308844 0.794531 +vt 0.308844 0.856087 +vt 0.308844 0.908450 +vt 0.291701 0.670605 +vt 0.332628 0.670605 +vt 0.332628 0.722968 +vt 0.291701 0.722968 +vt 0.332628 0.784525 +vt 0.291701 0.784525 +vt 0.332628 0.849250 +vt 0.291701 0.849250 +vt 0.311615 0.838472 +vt 0.270688 0.838472 +vt 0.270688 0.776915 +vt 0.270688 0.724552 +vt 0.362008 0.625807 +vt 0.402934 0.625807 +vt 0.402934 0.678170 +vt 0.362008 0.678170 +vt 0.402934 0.739727 +vt 0.362008 0.739727 +vt 0.402934 0.804451 +vt 0.362008 0.804451 +vt 0.402934 0.866008 +vt 0.362008 0.866008 +vt 0.402934 0.918371 +vt 0.362008 0.918371 +vt 0.383364 0.911792 +vt 0.342437 0.911792 +vt 0.342437 0.859429 +vt 0.383364 0.859429 +vt 0.342437 0.797872 +vt 0.383364 0.797872 +vt 0.383364 0.733148 +vt 0.342437 0.733148 +vt 0.493953 0.747100 +vt 0.487361 0.748156 +vt 0.474737 0.708878 +vt 0.480684 0.705815 +vt 0.237676 0.828698 +vt 0.243623 0.825634 +vt 0.267635 0.859045 +vt 0.262915 0.863817 +vt 0.222844 0.747100 +vt 0.229437 0.748156 +vt 0.229437 0.789455 +vt 0.222844 0.790510 +vt 0.450725 0.675467 +vt 0.455445 0.670696 +vt 0.480684 0.831796 +vt 0.474737 0.828732 +vt 0.487361 0.789455 +vt 0.493953 0.790510 +vt 0.495516 0.787412 +vt 0.488924 0.786357 +vt 0.488924 0.745058 +vt 0.495516 0.744002 +vt 0.242060 0.828732 +vt 0.236113 0.831796 +vt 0.224407 0.787412 +vt 0.230999 0.786356 +vt 0.417676 0.651192 +vt 0.420707 0.645180 +vt 0.482247 0.828698 +vt 0.476300 0.825634 +vt 0.224407 0.744002 +vt 0.230999 0.745058 +vt 0.266072 0.862144 +vt 0.261352 0.866915 +vt 0.378824 0.638430 +vt 0.379869 0.631765 +vt 0.457008 0.863817 +vt 0.452288 0.859045 +vt 0.297654 0.642081 +vt 0.300684 0.648094 +vt 0.267635 0.672369 +vt 0.262915 0.667597 +vt 0.338492 0.628667 +vt 0.339536 0.635332 +vt 0.237676 0.702717 +vt 0.243623 0.705780 +vt 0.299121 0.886419 +vt 0.296091 0.892431 +vt 0.422269 0.889333 +vt 0.419239 0.883320 +vt 0.337973 0.638430 +vt 0.336929 0.631765 +vt 0.381431 0.628667 +vt 0.380387 0.635332 +vt 0.337973 0.899181 +vt 0.336929 0.905846 +vt 0.381431 0.902747 +vt 0.380387 0.896082 +vt 0.299122 0.651192 +vt 0.296091 0.645180 +vt 0.422269 0.642081 +vt 0.419239 0.648094 +vt 0.378824 0.899181 +vt 0.379868 0.905846 +vt 0.338492 0.902747 +vt 0.339536 0.896082 +vt 0.266072 0.675467 +vt 0.261352 0.670695 +vt 0.457008 0.667597 +vt 0.452288 0.672369 +vt 0.417676 0.886419 +vt 0.420706 0.892431 +vt 0.242060 0.708878 +vt 0.236113 0.705815 +vt 0.297654 0.889333 +vt 0.300684 0.883320 +vt 0.450725 0.862144 +vt 0.455445 0.866915 +vt 0.482247 0.702717 +vt 0.476300 0.705780 +usemtl None +s 1 +f 1/1 2/2 4/3 3/4 +f 3/5 4/6 6/7 5/8 +f 5/8 6/7 8/9 7/10 +f 7/10 8/9 10/11 9/12 +f 9/12 10/11 12/13 11/14 +f 11/14 12/13 14/15 13/16 +f 13/17 14/18 16/19 15/20 +f 15/20 16/19 18/21 17/22 +f 17/22 18/21 20/23 19/24 +f 19/24 20/23 22/25 21/26 +f 21/26 22/25 24/27 23/28 +f 23/29 24/30 26/31 25/32 +f 25/33 26/34 28/35 27/36 +f 27/36 28/35 30/37 29/38 +f 29/38 30/37 32/39 31/40 +f 31/40 32/39 34/41 33/42 +f 33/43 34/44 36/45 35/46 +f 35/46 36/45 38/47 37/48 +f 39/49 40/50 2/2 1/1 +f 37/48 38/47 40/50 39/49 +f 3/51 42/52 41/53 1/54 +f 12/55 52/56 54/57 14/58 +f 25/59 65/60 63/61 23/62 +f 1/54 41/53 79/63 39/64 +f 7/65 47/66 45/67 5/68 +f 28/69 68/70 70/71 30/72 +f 23/62 63/61 61/73 21/74 +f 10/75 50/76 52/56 12/55 +f 39/64 79/63 77/77 37/78 +f 5/68 45/67 42/52 3/51 +f 26/79 66/80 68/70 28/69 +f 8/81 48/82 50/76 10/75 +f 21/74 61/73 59/83 19/84 +f 37/78 77/77 75/85 35/86 +f 24/87 64/88 66/80 26/79 +f 2/89 44/90 43/91 4/92 +f 40/93 80/94 44/90 2/89 +f 6/95 46/96 48/82 8/81 +f 19/84 59/83 57/97 17/98 +f 22/99 62/100 64/88 24/87 +f 35/86 75/85 73/101 33/102 +f 38/103 78/104 80/94 40/93 +f 17/98 57/97 55/105 15/106 +f 4/92 43/91 46/96 6/95 +f 20/107 60/108 62/100 22/99 +f 33/102 73/101 71/109 31/110 +f 36/111 76/112 78/104 38/103 +f 15/106 55/105 53/113 13/114 +f 18/115 58/116 60/108 20/107 +f 31/110 71/109 69/117 29/118 +f 34/119 74/120 76/112 36/111 +f 13/114 53/113 51/121 11/122 +f 29/118 69/117 67/123 27/124 +f 16/125 56/126 58/116 18/115 +f 11/122 51/121 49/127 9/128 +f 32/129 72/130 74/120 34/119 +f 14/58 54/57 56/126 16/125 +f 27/124 67/123 65/60 25/59 +f 30/72 70/71 72/130 32/129 +f 9/128 49/127 47/66 7/65 +f 81/131 82/132 84/133 83/134 +f 83/135 84/5 86/8 85/136 +f 85/136 86/8 88/10 87/137 +f 87/137 88/10 90/12 89/138 +f 89/138 90/12 92/14 91/139 +f 91/139 92/14 94/16 93/140 +f 93/141 94/142 96/143 95/144 +f 95/144 96/143 98/145 97/146 +f 97/146 98/145 100/147 99/148 +f 99/149 100/150 102/151 101/30 +f 101/30 102/151 104/152 103/31 +f 103/153 104/154 106/155 105/156 +f 105/156 106/155 108/157 107/158 +f 107/158 108/157 110/159 109/160 +f 109/160 110/159 112/161 111/162 +f 111/162 112/161 114/163 113/164 +f 113/165 114/166 116/167 115/168 +f 115/168 116/167 118/169 117/170 +f 119/171 120/172 82/132 81/131 +f 117/170 118/169 120/172 119/171 +f 83/173 122/174 121/175 81/176 +f 92/177 132/178 134/179 94/180 +f 105/181 145/182 143/183 103/184 +f 81/176 121/175 159/185 119/186 +f 87/187 127/188 125/189 85/190 +f 108/191 148/192 150/193 110/194 +f 103/184 143/183 141/195 101/196 +f 90/197 130/198 132/178 92/177 +f 119/186 159/185 157/199 117/200 +f 85/190 125/189 122/174 83/173 +f 106/201 146/202 148/192 108/191 +f 88/203 128/204 130/198 90/197 +f 101/196 141/195 139/205 99/206 +f 117/200 157/199 155/207 115/208 +f 104/209 144/210 146/202 106/201 +f 82/211 124/212 123/213 84/214 +f 120/215 160/216 124/212 82/211 +f 86/217 126/218 128/204 88/203 +f 99/206 139/205 137/219 97/220 +f 102/221 142/222 144/210 104/209 +f 115/208 155/207 153/223 113/224 +f 118/225 158/226 160/216 120/215 +f 97/220 137/219 135/227 95/228 +f 84/214 123/213 126/218 86/217 +f 100/229 140/230 142/222 102/221 +f 113/224 153/223 151/231 111/232 +f 116/233 156/234 158/226 118/225 +f 95/228 135/227 133/235 93/236 +f 98/237 138/238 140/230 100/229 +f 111/232 151/231 149/239 109/240 +f 114/241 154/242 156/234 116/233 +f 93/236 133/235 131/243 91/244 +f 109/240 149/239 147/245 107/246 +f 96/247 136/248 138/238 98/237 +f 91/244 131/243 129/249 89/250 +f 112/251 152/252 154/242 114/241 +f 94/180 134/179 136/248 96/247 +f 107/246 147/245 145/182 105/181 +f 110/194 150/193 152/252 112/251 +f 89/250 129/249 127/188 87/187 +o Cylinder +v -0.000000 -0.500000 -0.392352 +v -0.000000 0.500000 -0.392352 +v 0.277435 -0.500000 -0.277435 +v 0.277435 0.500000 -0.277435 +v 0.392352 -0.500000 0.000000 +v 0.392352 0.500000 0.000000 +v 0.277435 -0.500000 0.277435 +v 0.277435 0.500000 0.277435 +v -0.000000 -0.500000 0.392352 +v -0.000000 0.500000 0.392352 +v -0.277435 -0.500000 0.277435 +v -0.277435 0.500000 0.277435 +v -0.392352 -0.500000 -0.000000 +v -0.392352 0.500000 -0.000000 +v -0.277435 -0.500000 -0.277435 +v -0.277435 0.500000 -0.277435 +v -0.000000 -0.250000 -0.490440 +v -0.000000 0.250000 -0.490440 +v 0.346794 0.250000 -0.346794 +v 0.346794 -0.250000 -0.346794 +v 0.490440 0.250000 0.000000 +v 0.490440 -0.250000 0.000000 +v 0.346794 0.250000 0.346794 +v 0.346794 -0.250000 0.346794 +v -0.000000 0.250000 0.490440 +v -0.000000 -0.250000 0.490440 +v -0.346794 0.250000 0.346794 +v -0.346794 -0.250000 0.346794 +v -0.490440 0.250000 -0.000000 +v -0.490440 -0.250000 -0.000000 +v -0.346794 0.250000 -0.346794 +v -0.346794 -0.250000 -0.346794 +v 0.241740 0.500000 -0.241741 +v -0.000000 0.500000 -0.341873 +v 0.341873 0.500000 0.000000 +v 0.241740 0.500000 0.241741 +v -0.000000 0.500000 0.341873 +v -0.241741 0.500000 0.241740 +v -0.341873 0.500000 -0.000000 +v -0.241741 0.500000 -0.241740 +v 0.263927 0.403206 -0.263927 +v -0.000000 0.403206 -0.373249 +v 0.373249 0.403206 0.000000 +v 0.263927 0.403206 0.263927 +v -0.000000 0.403206 0.373249 +v -0.263927 0.403206 0.263927 +v -0.373249 0.403206 -0.000000 +v -0.263927 0.403206 -0.263927 +vt 0.590774 0.126113 +vt 0.735231 0.146505 +vt 0.735231 0.309636 +vt 0.590774 0.330028 +vt 0.824991 0.175319 +vt 0.969448 0.195712 +vt 0.969447 0.358843 +vt 0.824990 0.379234 +vt 0.601148 0.325106 +vt 0.745605 0.345497 +vt 0.745605 0.508629 +vt 0.601148 0.529020 +vt 0.443962 0.030274 +vt 0.588419 0.050665 +vt 0.588419 0.213797 +vt 0.443962 0.234188 +vt 0.829319 0.056419 +vt 0.973776 0.076811 +vt 0.973776 0.239942 +vt 0.829319 0.260334 +vt 0.794424 0.024977 +vt 0.938881 0.045368 +vt 0.938881 0.208500 +vt 0.794424 0.228891 +vt 0.554299 0.854893 +vt 0.438948 0.970245 +vt 0.428454 0.944909 +vt 0.528964 0.844399 +vt 0.442557 0.133633 +vt 0.587015 0.154025 +vt 0.587015 0.317156 +vt 0.442557 0.337548 +vt 0.833610 0.299149 +vt 0.978068 0.319541 +vt 0.978068 0.482672 +vt 0.833610 0.503064 +vt 0.969280 0.812257 +vt 0.853928 0.927608 +vt 0.690797 0.927608 +vt 0.575445 0.812257 +vt 0.575445 0.649125 +vt 0.690797 0.533774 +vt 0.853928 0.533774 +vt 0.969280 0.649125 +vt 0.417533 0.319541 +vt 0.561990 0.299149 +vt 0.561990 0.503064 +vt 0.417533 0.482672 +vt 0.026480 0.154025 +vt 0.170937 0.133634 +vt 0.170937 0.337548 +vt 0.026480 0.317157 +vt 0.378346 0.045368 +vt 0.522804 0.024977 +vt 0.522803 0.228891 +vt 0.378346 0.208500 +vt 0.413241 0.076811 +vt 0.557698 0.056420 +vt 0.557698 0.260334 +vt 0.413241 0.239943 +vt 0.027884 0.050665 +vt 0.172342 0.030273 +vt 0.172342 0.234188 +vt 0.027884 0.213796 +vt 0.185070 0.345497 +vt 0.329528 0.325105 +vt 0.329528 0.529020 +vt 0.185070 0.508628 +vt 0.408913 0.195709 +vt 0.553371 0.175318 +vt 0.553370 0.379233 +vt 0.408912 0.358840 +vt 0.174696 0.146505 +vt 0.319153 0.126113 +vt 0.319153 0.330027 +vt 0.174696 0.309636 +vt 0.162025 0.401574 +vt 0.112593 0.534845 +vt 0.058861 0.521872 +vt 0.112830 0.376370 +vt 0.275816 0.970245 +vt 0.286310 0.944909 +vt 0.160465 0.854893 +vt 0.185800 0.844399 +vt 0.160465 0.691761 +vt 0.185800 0.702256 +vt 0.275816 0.576410 +vt 0.286310 0.601745 +vt 0.438948 0.576410 +vt 0.428454 0.601745 +vt 0.554299 0.691762 +vt 0.528964 0.702256 +vt 0.907967 0.580128 +vt 0.973553 0.720777 +vt 0.920475 0.866607 +vt 0.779826 0.932193 +vt 0.633996 0.879115 +vt 0.568410 0.738466 +vt 0.621488 0.592636 +vt 0.762137 0.527050 +vt 0.095770 0.675989 +vt 0.040494 0.675970 +vt 0.112495 0.817145 +vt 0.058754 0.830081 +vt 0.161836 0.950450 +vt 0.112623 0.975621 +vt 0.163404 0.400082 +vt 0.114017 0.533370 +vt 0.060281 0.520416 +vt 0.114200 0.374895 +vt 0.097244 0.674520 +vt 0.041968 0.674520 +vt 0.114017 0.815670 +vt 0.060281 0.828625 +vt 0.163404 0.948958 +vt 0.114200 0.974146 +usemtl None +s off +f 178/253 162/254 164/255 179/256 +f 179/257 164/258 166/259 181/260 +f 181/261 166/262 168/263 183/264 +f 183/265 168/266 170/267 185/268 +f 185/269 170/270 172/271 187/272 +f 187/273 172/274 174/275 189/276 +f 162/277 176/278 200/279 194/280 +f 191/281 176/282 162/283 178/284 +f 189/285 174/286 176/287 191/288 +f 161/289 163/290 165/291 167/292 169/293 171/294 173/295 175/296 +f 173/297 190/298 192/299 175/300 +f 190/298 189/285 191/288 192/299 +f 175/301 192/302 177/303 161/304 +f 192/302 191/281 178/284 177/303 +f 171/305 188/306 190/307 173/308 +f 188/306 187/273 189/276 190/307 +f 169/309 186/310 188/311 171/312 +f 186/310 185/269 187/272 188/311 +f 167/313 184/314 186/315 169/316 +f 184/314 183/265 185/268 186/315 +f 165/317 182/318 184/319 167/320 +f 182/318 181/261 183/264 184/319 +f 163/321 180/322 182/323 165/324 +f 180/322 179/257 181/260 182/323 +f 161/325 177/326 180/327 163/328 +f 177/326 178/253 179/256 180/327 +f 194/329 200/330 208/331 202/332 +f 176/278 174/333 199/334 200/279 +f 174/333 172/335 198/336 199/334 +f 172/335 170/337 197/338 198/336 +f 170/337 168/339 196/340 197/338 +f 168/339 166/341 195/342 196/340 +f 166/341 164/343 193/344 195/342 +f 164/343 162/277 194/280 193/344 +f 201/345 202/346 208/347 207/348 206/349 205/350 204/351 203/352 +f 200/330 199/353 207/354 208/331 +f 199/353 198/355 206/356 207/354 +f 198/355 197/357 205/358 206/356 +f 197/359 196/360 204/361 205/362 +f 196/360 195/363 203/364 204/361 +f 195/363 193/365 201/366 203/364 +f 193/365 194/367 202/368 201/366 diff --git a/mods/survival/models/survival_leafy_bed.obj b/mods/survival/models/survival_leafy_bed.obj new file mode 100644 index 0000000..0fb02fe --- /dev/null +++ b/mods/survival/models/survival_leafy_bed.obj @@ -0,0 +1,247 @@ +# Blender v2.74 (sub 2) OBJ File: '' +# www.blender.org +mtllib survival_leafy_bed.mtl +o Cube.002 +v -0.500000 -0.376458 0.018219 +v -0.472603 -0.376458 -0.445205 +v -0.448870 -0.500000 -0.397741 +v -0.474892 -0.500000 0.018219 +v 0.283539 -0.376458 -0.500000 +v 0.472603 -0.376458 -0.445205 +v 0.448870 -0.500000 -0.397741 +v 0.269301 -0.500000 -0.449784 +v 0.500000 -0.376458 1.109777 +v 0.472603 -0.376458 1.445205 +v 0.448870 -0.500000 1.397741 +v 0.474892 -0.500000 1.109777 +v -0.283539 -0.376458 1.500000 +v -0.472603 -0.376458 1.445205 +v -0.448870 -0.500000 1.397741 +v -0.269301 -0.500000 1.449784 +v 0.269301 -0.500000 0.018219 +v 0.474892 -0.500000 0.018219 +v -0.205573 -0.334398 0.018219 +v -0.131040 -0.260015 -0.310682 +v -0.231080 -0.260015 -0.310682 +v -0.362513 -0.277820 0.018219 +v -0.131040 -0.260015 1.324487 +v -0.205573 -0.334398 1.109777 +v -0.362513 -0.277820 1.109777 +v -0.231080 -0.260015 1.324487 +v 0.269301 -0.500000 1.449784 +v 0.269301 -0.500000 1.109777 +v 0.500000 -0.376458 0.018219 +v -0.500000 -0.376458 1.109777 +v -0.474892 -0.500000 1.109777 +v -0.439622 -0.260015 0.018219 +v -0.463662 -0.260015 1.109777 +v -0.438256 -0.260015 1.445205 +v 0.362513 -0.277820 0.018219 +v 0.362513 -0.277820 1.109777 +v 0.463662 -0.260015 1.109777 +v 0.439622 -0.260015 0.018219 +v 0.231080 -0.260015 -0.310682 +v 0.438256 -0.260015 -0.445205 +v -0.262933 -0.260015 1.500000 +v 0.231080 -0.260015 1.324487 +v 0.438256 -0.260015 1.445205 +v 0.131040 -0.260015 -0.310682 +v 0.262933 -0.260015 -0.500000 +v -0.438256 -0.260015 -0.445205 +v -0.262933 -0.260015 -0.500000 +v -0.283539 -0.376458 -0.500000 +v 0.262933 -0.260015 1.500000 +v 0.283539 -0.376458 1.500000 +v 0.131040 -0.260015 1.324487 +v -0.269301 -0.500000 0.018219 +v -0.269301 -0.500000 1.109777 +v 0.205573 -0.334398 0.018219 +v 0.205573 -0.334398 1.109777 +v -0.269301 -0.500000 -0.449784 +vt 0.644634 0.296517 +vt 0.646528 -0.485298 +vt 0.739940 -0.437463 +vt 0.738141 0.296950 +vt 0.842223 0.649116 +vt 0.849688 0.460028 +vt 0.946772 0.483763 +vt 0.939682 0.663356 +vt 0.448255 -0.147622 +vt 0.450150 -0.483793 +vt 0.543562 -0.436736 +vt 0.541762 -0.148055 +vt 0.842223 -0.296210 +vt 0.849688 -0.485298 +vt 0.946772 -0.461563 +vt 0.939682 -0.281970 +vt 0.638911 0.728107 +vt 1.426577 0.728107 +vt 1.374527 0.862074 +vt 0.638911 0.881487 +vt 0.326519 0.407661 +vt -0.322424 0.407661 +vt -0.321854 0.333027 +vt 0.326830 0.333027 +vt 1.312591 0.407661 +vt 1.098037 0.407661 +vt 1.098037 0.333027 +vt 1.312793 0.333027 +vt -0.473234 0.728107 +vt -0.133183 0.728107 +vt -0.133183 0.881487 +vt -0.421184 0.862074 +vt 0.450150 1.405895 +vt 0.448255 0.624079 +vt 0.541762 0.623646 +vt 0.543562 1.358060 +vt 0.646528 1.404390 +vt 0.644634 1.068218 +vt 0.738141 1.068651 +vt 0.739940 1.357332 +vt 0.328164 0.177445 +vt 1.098996 0.159510 +vt 0.543562 1.069786 +vt 0.599315 0.298634 +vt 1.434424 0.178464 +vt 0.545318 1.405895 +vt 0.326830 0.677820 +vt 1.098038 0.677820 +vt 1.098996 0.851337 +vt 0.328165 0.833402 +vt 0.402937 0.621962 +vt 0.347183 -0.149190 +vt -0.321854 0.677820 +vt -0.455986 0.832383 +vt 0.348940 1.404390 +vt 1.489219 0.309263 +vt 0.739940 -0.275602 +vt 0.747405 -0.450947 +vt 1.312793 0.677820 +vt 1.434424 0.832383 +vt 0.348940 -0.485298 +vt -0.322424 0.603186 +vt -0.510781 0.701584 +vt 0.739940 0.669725 +vt 0.747405 0.494379 +vt -0.455986 0.178464 +vt 0.545318 -0.483793 +vt 0.747405 1.371003 +vt 0.739940 1.195657 +vt 0.842223 1.216266 +vt 0.849688 1.405354 +vt -0.510781 0.309263 +vt 0.747405 0.425677 +vt 0.739940 0.250331 +vt 0.842223 0.270940 +vt 1.312591 0.603186 +vt 1.489219 0.701584 +vt -0.133183 0.172904 +vt 0.638911 0.172904 +vt 0.638911 0.326285 +vt -0.133183 0.326285 +vt -0.421184 0.192318 +vt -0.473234 0.326285 +vt 0.326519 0.603186 +vt 1.098038 0.603186 +vt 1.374527 0.192318 +vt 1.426577 0.326285 +vt 0.939682 0.256700 +vt 0.946772 0.436293 +vt 0.939682 1.202026 +vt 0.946772 1.381619 +vn -0.977100 -0.204500 -0.059400 +vn 0.256400 -0.389200 -0.884800 +vn 0.974400 -0.208700 0.083500 +vn -0.256400 -0.389200 0.884800 +vn 0.000000 -1.000000 -0.000000 +vn 0.210700 0.956900 0.200100 +vn 0.205200 0.932100 -0.298500 +vn 0.339100 0.940700 0.000000 +vn 0.977100 -0.204500 -0.059400 +vn 0.980000 -0.199200 -0.000000 +vn -0.974400 -0.208700 0.083500 +vn -0.980000 -0.199200 -0.000000 +vn 0.195900 0.980600 0.002200 +vn -0.923500 0.383500 -0.010200 +vn 0.040500 0.998200 -0.043800 +vn -0.954200 0.289600 0.075100 +vn -0.195900 0.980600 0.002200 +vn 0.923500 0.383500 -0.010200 +vn -0.048100 0.998400 0.030500 +vn 0.925900 0.376600 -0.028700 +vn 0.000000 1.000000 0.000000 +vn -0.287300 0.067800 0.955400 +vn -0.040500 0.998200 -0.043800 +vn 0.954200 0.289600 0.075100 +vn 0.287300 0.067800 -0.955400 +vn 0.048100 0.998400 0.030500 +vn -0.925900 0.376600 -0.028700 +vn -0.287300 0.067800 -0.955400 +vn 0.000000 0.000000 -1.000000 +vn 0.287300 0.067800 0.955400 +vn 0.000000 0.000000 1.000000 +vn -0.339100 0.940700 0.000000 +vn -0.205200 0.932100 -0.298500 +vn 0.000000 0.944900 -0.327300 +vn -0.210700 0.956900 0.200100 +vn 0.000000 0.975400 0.220600 +vn 0.256400 -0.389200 0.884800 +vn 0.000000 -0.376600 0.926400 +vn -0.256400 -0.389200 -0.884800 +vn 0.000000 -0.376600 -0.926400 +usemtl Material.001 +s 1 +f 1/1/1 2/2/1 3/3/1 4/4/1 +f 5/5/2 6/6/2 7/7/2 8/8/2 +f 9/9/3 10/10/3 11/11/3 12/12/3 +f 13/13/4 14/14/4 15/15/4 16/16/4 +f 17/17/5 8/18/5 7/19/5 18/20/5 +f 19/21/6 20/22/6 21/23/6 22/24/6 +f 23/25/7 24/26/7 25/27/7 26/28/7 +f 24/26/8 19/21/8 22/24/8 25/27/8 +f 27/29/5 28/30/5 12/31/5 11/32/5 +f 28/30/5 17/17/5 18/20/5 12/31/5 +f 6/33/9 29/34/9 18/35/9 7/36/9 +f 29/34/10 9/9/10 12/12/10 18/35/10 +f 14/37/11 30/38/11 31/39/11 15/40/11 +f 30/38/12 1/1/12 4/4/12 31/39/12 +f 25/27/13 22/24/13 32/41/13 33/42/13 +f 33/43/14 32/44/14 1/1/14 30/38/14 +f 26/28/15 25/27/15 33/42/15 34/45/15 +f 34/46/16 33/43/16 30/38/16 14/37/16 +f 35/47/17 36/48/17 37/49/17 38/50/17 +f 38/51/18 37/52/18 9/9/18 29/34/18 +f 39/53/19 35/47/19 38/50/19 40/54/19 +f 40/55/20 38/51/20 29/34/20 6/33/20 +f 23/25/21 26/28/21 34/45/21 41/56/21 +f 41/57/22 34/58/22 14/14/22 13/13/22 +f 36/48/23 42/59/23 43/60/23 37/49/23 +f 37/52/24 43/61/24 10/10/24 9/9/24 +f 44/62/21 39/53/21 40/54/21 45/63/21 +f 45/64/25 40/65/25 6/6/25 5/5/25 +f 22/24/26 21/23/26 46/66/26 32/41/26 +f 32/44/27 46/67/27 2/2/27 1/1/27 +f 46/68/28 47/69/28 48/70/28 2/71/28 +f 47/69/29 45/64/29 5/5/29 48/70/29 +f 21/23/21 20/22/21 47/72/21 46/66/21 +f 20/22/21 44/62/21 45/63/21 47/72/21 +f 43/73/30 49/74/30 50/75/30 10/6/30 +f 49/74/31 41/57/31 13/13/31 50/75/31 +f 42/59/21 51/76/21 49/77/21 43/60/21 +f 51/76/21 23/25/21 41/56/21 49/77/21 +f 31/78/5 4/79/5 52/80/5 53/81/5 +f 53/81/5 52/80/5 17/17/5 28/30/5 +f 15/82/5 31/78/5 53/81/5 16/83/5 +f 16/83/5 53/81/5 28/30/5 27/29/5 +f 36/48/32 35/47/32 54/84/32 55/85/32 +f 55/85/21 54/84/21 19/21/21 24/26/21 +f 42/59/33 36/48/33 55/85/33 51/76/33 +f 51/76/34 55/85/34 24/26/34 23/25/34 +f 35/47/35 39/53/35 44/62/35 54/84/35 +f 54/84/36 44/62/36 20/22/36 19/21/36 +f 4/79/5 3/86/5 56/87/5 52/80/5 +f 52/80/5 56/87/5 8/18/5 17/17/5 +f 10/6/37 50/75/37 27/88/37 11/89/37 +f 50/75/38 13/13/38 16/16/38 27/88/38 +f 2/71/39 48/70/39 56/90/39 3/91/39 +f 48/70/40 5/5/40 8/8/40 56/90/40 diff --git a/mods/survival/models/survival_nest.obj b/mods/survival/models/survival_nest.obj new file mode 100644 index 0000000..842ac01 --- /dev/null +++ b/mods/survival/models/survival_nest.obj @@ -0,0 +1,59 @@ +# Blender v2.75 (sub 2) OBJ File: 'bird_nest.blend' +# www.blender.org +v 0.000000 -0.497203 -0.204000 +v 0.000000 -0.297203 -0.340000 +v 0.176669 -0.497203 -0.102000 +v 0.294449 -0.297203 -0.170000 +v 0.176669 -0.497203 0.102000 +v 0.294449 -0.297203 0.170000 +v -0.000000 -0.497203 0.204000 +v -0.000000 -0.297203 0.340000 +v -0.176669 -0.497203 0.102000 +v -0.294449 -0.297203 0.170000 +v -0.176669 -0.497203 -0.102000 +v -0.294449 -0.297203 -0.170000 +v 0.000000 -0.197203 -0.340000 +v 0.294449 -0.197203 -0.170000 +v 0.294449 -0.197203 0.170000 +v -0.000000 -0.197203 0.340000 +v -0.294449 -0.197203 0.170000 +v -0.294449 -0.197203 -0.170000 +vt 0.602290 0.415650 +vt 0.788029 0.328931 +vt 0.781376 0.670558 +vt 0.612770 0.551143 +vt 0.480878 0.836026 +vt 0.498771 0.629353 +vt 0.186653 0.659574 +vt 0.373195 0.571881 +vt 0.193212 0.317425 +vt 0.360180 0.436822 +vt 0.910151 0.737588 +vt 0.487423 0.981095 +vt 0.475879 0.361535 +vt 0.492860 0.153808 +vt 0.491146 0.166331 +vt 0.767433 0.330354 +vt 0.763529 0.651637 +vt 0.483338 0.808897 +vt 0.207050 0.644874 +vt 0.210954 0.323591 +vt 0.064624 0.250492 +vt 0.486510 0.009265 +vt 0.910151 0.250184 +vt 0.064332 0.737960 +s off +f 1/1 2/2 4/3 3/4 +f 3/4 4/3 6/5 5/6 +f 5/6 6/5 8/7 7/8 +f 7/8 8/7 10/9 9/10 +f 6/5 4/3 14/11 15/12 +f 11/13 12/14 2/2 1/1 +f 9/10 10/9 12/14 11/13 +f 1/1 3/4 5/6 7/8 9/10 11/13 +f 14/15 13/16 18/17 17/18 16/19 15/20 +f 12/14 10/9 17/21 18/22 +f 4/3 2/2 13/23 14/11 +f 8/7 6/5 15/12 16/24 +f 2/2 12/14 18/22 13/23 +f 10/9 8/7 16/24 17/21 diff --git a/mods/survival/models/survival_sleeping_bag.obj b/mods/survival/models/survival_sleeping_bag.obj new file mode 100644 index 0000000..303dc2d --- /dev/null +++ b/mods/survival/models/survival_sleeping_bag.obj @@ -0,0 +1,253 @@ +# Blender v2.74 (sub 2) OBJ File: '' +# www.blender.org +mtllib survival_sleeping_bag.mtl +o Cube.002 +v -0.448870 -0.500000 1.397741 +v -0.231080 -0.179968 1.324487 +v -0.448870 -0.500000 -0.397741 +v -0.231080 -0.212580 -0.310682 +v 0.448870 -0.500000 1.397741 +v 0.231080 -0.179968 1.324487 +v 0.448870 -0.500000 -0.397741 +v 0.231080 -0.212580 -0.310682 +v -0.231080 -0.177113 1.109777 +v -0.231080 -0.226383 0.337781 +v -0.474892 -0.500000 0.337781 +v -0.474892 -0.500000 1.109777 +v 0.231080 -0.226383 0.337781 +v 0.231080 -0.177113 1.109777 +v 0.474892 -0.500000 1.109777 +v 0.474892 -0.500000 0.337781 +v -0.472603 -0.376458 1.445205 +v -0.438256 -0.237014 1.445205 +v -0.438256 -0.237014 -0.445205 +v -0.472603 -0.376458 -0.445205 +v 0.438256 -0.237014 -0.445205 +v 0.472603 -0.376458 -0.445205 +v 0.438256 -0.237014 1.445205 +v 0.472603 -0.376458 1.445205 +v 0.439622 -0.309831 0.337781 +v 0.500000 -0.376458 0.337781 +v 0.463662 -0.237014 1.109777 +v 0.500000 -0.376458 1.109777 +v -0.463662 -0.237014 1.109777 +v -0.500000 -0.376458 1.109777 +v -0.439622 -0.309831 0.337781 +v -0.500000 -0.376458 0.337781 +v -0.131040 -0.176978 -0.310682 +v 0.131040 -0.176978 -0.310682 +v 0.269301 -0.500000 -0.449784 +v -0.269301 -0.500000 -0.449784 +v 0.131040 -0.167302 1.324487 +v -0.131040 -0.167302 1.324487 +v -0.269301 -0.500000 1.449784 +v 0.269301 -0.500000 1.449784 +v 0.131040 -0.177113 1.109777 +v -0.131040 -0.177113 1.109777 +v 0.131040 -0.206973 0.337781 +v -0.131040 -0.206973 0.337781 +v -0.269301 -0.500000 1.109777 +v 0.269301 -0.500000 1.109777 +v -0.269301 -0.500000 0.337781 +v 0.269301 -0.500000 0.337781 +v -0.262933 -0.237014 1.500000 +v 0.262933 -0.237014 1.500000 +v -0.283539 -0.376458 1.500000 +v 0.283539 -0.376458 1.500000 +v 0.262933 -0.237014 -0.500000 +v -0.262933 -0.237014 -0.500000 +v 0.283539 -0.376458 -0.500000 +v -0.283539 -0.376458 -0.500000 +vt 0.644634 0.296517 +vt 0.646528 -0.485298 +vt 0.739940 -0.437463 +vt 0.738141 0.296950 +vt 0.842223 0.649116 +vt 0.849688 0.460028 +vt 0.946772 0.483763 +vt 0.939682 0.663356 +vt 0.448255 -0.147622 +vt 0.450150 -0.483793 +vt 0.543562 -0.436736 +vt 0.541762 -0.148055 +vt 0.842223 -0.296210 +vt 0.849688 -0.485298 +vt 0.946772 -0.461563 +vt 0.939682 -0.281970 +vt 0.638911 0.728107 +vt 1.426577 0.728107 +vt 1.374527 0.862074 +vt 0.638911 0.881487 +vt 0.326519 0.407661 +vt -0.322424 0.407661 +vt -0.321854 0.333027 +vt 0.326830 0.333027 +vt 1.312591 0.407661 +vt 1.098037 0.407661 +vt 1.098037 0.333027 +vt 1.312793 0.333027 +vt -0.473234 0.728107 +vt -0.133183 0.728107 +vt -0.133183 0.881487 +vt -0.421184 0.862074 +vt 0.450150 1.405895 +vt 0.448255 0.624079 +vt 0.541762 0.623646 +vt 0.543562 1.358060 +vt 0.646528 1.404390 +vt 0.644634 1.068218 +vt 0.738141 1.068651 +vt 0.739940 1.357332 +vt 0.328164 0.177445 +vt 1.098996 0.159510 +vt 0.543562 1.069786 +vt 0.599315 0.298634 +vt 1.434424 0.178464 +vt 0.545318 1.405895 +vt 0.326830 0.677820 +vt 1.098038 0.677820 +vt 1.098996 0.851337 +vt 0.328165 0.833402 +vt 0.402937 0.621962 +vt 0.347183 -0.149190 +vt -0.321854 0.677820 +vt -0.455986 0.832383 +vt 0.348940 1.404390 +vt 1.489219 0.309263 +vt 0.739940 -0.275602 +vt 0.747405 -0.450947 +vt 1.312793 0.677820 +vt 1.434424 0.832383 +vt 0.348940 -0.485298 +vt -0.322424 0.603186 +vt -0.510781 0.701584 +vt 0.739940 0.669725 +vt 0.747405 0.494379 +vt -0.455986 0.178464 +vt 0.545318 -0.483793 +vt 0.747405 1.371003 +vt 0.739940 1.195657 +vt 0.842223 1.216266 +vt 0.849688 1.405354 +vt -0.510781 0.309263 +vt 0.747405 0.425677 +vt 0.739940 0.250331 +vt 0.842223 0.270940 +vt 1.312591 0.603186 +vt 1.489219 0.701584 +vt -0.133183 0.172904 +vt 0.638911 0.172904 +vt 0.638911 0.326285 +vt -0.133183 0.326285 +vt -0.421184 0.192318 +vt -0.473234 0.326285 +vt 0.326519 0.603186 +vt 1.098038 0.603186 +vt 1.374527 0.192318 +vt 1.426577 0.326285 +vt 0.939682 0.256700 +vt 0.946772 0.436293 +vt 0.939682 1.202026 +vt 0.946772 1.381619 +vn -0.979200 -0.200200 -0.034400 +vn 0.256400 -0.389200 -0.884800 +vn 0.974400 -0.208700 0.083500 +vn -0.256400 -0.389200 0.884800 +vn 0.000000 -1.000000 0.000000 +vn -0.265000 0.963700 0.032500 +vn -0.063200 0.997900 -0.016200 +vn -0.096400 0.994000 -0.050900 +vn 0.979200 -0.200200 -0.034400 +vn 0.980000 -0.199200 0.000000 +vn -0.974400 -0.208700 0.083500 +vn -0.980000 -0.199200 0.000000 +vn -0.308100 0.948000 -0.079800 +vn -0.904700 0.424600 -0.034100 +vn -0.252700 0.967400 0.016700 +vn -0.966500 0.245000 0.076100 +vn 0.308100 0.948000 -0.079800 +vn 0.904700 0.424600 -0.034100 +vn 0.268300 0.961600 0.057900 +vn 0.908600 0.417700 0.002700 +vn -0.101600 0.951400 0.290800 +vn -0.287500 0.056700 0.956100 +vn 0.252700 0.967400 0.016700 +vn 0.966500 0.245000 0.076100 +vn 0.147500 0.983800 -0.102100 +vn 0.287500 0.056700 -0.956100 +vn -0.268300 0.961600 0.057900 +vn -0.908600 0.417700 0.002700 +vn -0.287500 0.056700 -0.956100 +vn 0.000000 0.000000 -1.000000 +vn -0.147500 0.983800 -0.102100 +vn 0.000000 0.953200 -0.302300 +vn 0.287500 0.056700 0.956100 +vn 0.000000 0.000000 1.000000 +vn 0.101600 0.951400 0.290800 +vn 0.000000 0.929400 0.369100 +vn 0.096400 0.994000 -0.050900 +vn 0.000000 0.999300 -0.038700 +vn 0.063200 0.997900 -0.016200 +vn 0.000000 0.999000 -0.045600 +vn 0.265000 0.963700 0.032500 +vn 0.000000 0.998900 0.046200 +vn 0.256400 -0.389200 0.884800 +vn 0.000000 -0.376600 0.926400 +vn -0.256400 -0.389200 -0.884800 +vn 0.000000 -0.376600 -0.926400 +usemtl Material +s off +f 32/1/1 20/2/1 3/3/1 11/4/1 +f 55/5/2 22/6/2 7/7/2 35/8/2 +f 28/9/3 24/10/3 5/11/3 15/12/3 +f 51/13/4 17/14/4 1/15/4 39/16/4 +f 48/17/5 35/18/5 7/19/5 16/20/5 +f 44/21/6 33/22/6 4/23/6 10/24/6 +f 38/25/7 42/26/7 9/27/7 2/28/7 +f 42/26/8 44/21/8 10/24/8 9/27/8 +f 40/29/5 46/30/5 15/31/5 5/32/5 +f 46/30/5 48/17/5 16/20/5 15/31/5 +f 22/33/9 26/34/9 16/35/9 7/36/9 +f 26/34/10 28/9/10 15/12/10 16/35/10 +f 17/37/11 30/38/11 12/39/11 1/40/11 +f 30/38/12 32/1/12 11/4/12 12/39/12 +f 9/27/13 10/24/13 31/41/13 29/42/13 +f 29/43/14 31/44/14 32/1/14 30/38/14 +f 2/28/15 9/27/15 29/42/15 18/45/15 +f 18/46/16 29/43/16 30/38/16 17/37/16 +f 13/47/17 14/48/17 27/49/17 25/50/17 +f 25/51/18 27/52/18 28/9/18 26/34/18 +f 8/53/19 13/47/19 25/50/19 21/54/19 +f 21/55/20 25/51/20 26/34/20 22/33/20 +f 38/25/21 2/28/21 18/45/21 49/56/21 +f 49/57/22 18/58/22 17/14/22 51/13/22 +f 14/48/23 6/59/23 23/60/23 27/49/23 +f 27/52/24 23/61/24 24/10/24 28/9/24 +f 34/62/25 8/53/25 21/54/25 53/63/25 +f 53/64/26 21/65/26 22/6/26 55/5/26 +f 10/24/27 4/23/27 19/66/27 31/41/27 +f 31/44/28 19/67/28 20/2/28 32/1/28 +f 19/68/29 54/69/29 56/70/29 20/71/29 +f 54/69/30 53/64/30 55/5/30 56/70/30 +f 4/23/31 33/22/31 54/72/31 19/66/31 +f 33/22/32 34/62/32 53/63/32 54/72/32 +f 23/73/33 50/74/33 52/75/33 24/6/33 +f 50/74/34 49/57/34 51/13/34 52/75/34 +f 6/59/35 37/76/35 50/77/35 23/60/35 +f 37/76/36 38/25/36 49/56/36 50/77/36 +f 12/78/5 11/79/5 47/80/5 45/81/5 +f 45/81/5 47/80/5 48/17/5 46/30/5 +f 1/82/5 12/78/5 45/81/5 39/83/5 +f 39/83/5 45/81/5 46/30/5 40/29/5 +f 14/48/37 13/47/37 43/84/37 41/85/37 +f 41/85/38 43/84/38 44/21/38 42/26/38 +f 6/59/39 14/48/39 41/85/39 37/76/39 +f 37/76/40 41/85/40 42/26/40 38/25/40 +f 13/47/41 8/53/41 34/62/41 43/84/41 +f 43/84/42 34/62/42 33/22/42 44/21/42 +f 11/79/5 3/86/5 36/87/5 47/80/5 +f 47/80/5 36/87/5 35/18/5 48/17/5 +f 24/6/43 52/75/43 40/88/43 5/89/43 +f 52/75/44 51/13/44 39/16/44 40/88/44 +f 20/71/45 56/70/45 36/90/45 3/91/45 +f 56/70/46 55/5/46 35/8/46 36/90/46 diff --git a/mods/survival/models/survival_well_bottom.obj b/mods/survival/models/survival_well_bottom.obj new file mode 100644 index 0000000..07007fb --- /dev/null +++ b/mods/survival/models/survival_well_bottom.obj @@ -0,0 +1,125 @@ +# Blender v2.74 (sub 4) OBJ File: '' +# www.blender.org +o Circle_Circle.001 +v 0.000000 0.283161 -0.634972 +v -0.448993 0.283161 -0.448993 +v -0.634972 0.283161 0.000000 +v -0.448993 0.283161 0.448993 +v 0.000000 0.283161 0.634972 +v 0.448993 0.283161 0.448993 +v 0.634972 0.283161 -0.000000 +v 0.448993 0.283161 -0.448993 +v 0.000000 0.283161 -0.468916 +v -0.331573 0.283161 -0.331573 +v -0.468916 0.283161 0.000000 +v -0.331573 0.283161 0.331573 +v 0.000000 0.283161 0.468916 +v 0.331574 0.283161 0.331573 +v 0.468916 0.283161 -0.000000 +v 0.331574 0.283161 -0.331573 +v 0.000000 -0.500000 -0.634972 +v -0.448993 -0.500000 -0.448993 +v -0.634972 -0.500000 0.000000 +v -0.448993 -0.500000 0.448993 +v 0.000000 -0.500000 0.634972 +v 0.448993 -0.500000 0.448993 +v 0.634972 -0.500000 -0.000000 +v 0.448993 -0.500000 -0.448993 +v 0.000000 -0.500000 -0.468916 +v -0.331573 -0.500000 -0.331573 +v -0.468916 -0.500000 0.000000 +v -0.331573 -0.500000 0.331573 +v 0.000000 -0.500000 0.468916 +v 0.331574 -0.500000 0.331573 +v 0.468916 -0.500000 -0.000000 +v 0.331574 -0.500000 -0.331573 +vt -0.608080 0.074124 +vt -0.327469 0.190357 +vt -0.327470 0.846802 +vt -0.608081 0.963035 +vt 0.020474 1.591590 +vt 0.136707 1.310979 +vt 0.793152 1.310979 +vt 0.909385 1.591590 +vt 1.257329 0.846802 +vt 1.537940 0.963035 +vt 1.537940 0.074125 +vt 1.257329 0.190357 +vt 0.793153 -0.273820 +vt 0.909385 -0.554430 +vt 0.020475 -0.554430 +vt 0.136707 -0.273820 +vt 0.515697 1.565113 +vt 0.025118 1.565113 +vt 0.025118 0.494591 +vt 0.515697 0.494591 +vt -0.814013 0.503505 +vt -0.155051 0.503733 +vt -0.155418 1.565641 +vt -0.814379 1.565413 +vt -0.465460 1.565113 +vt -0.465460 0.494591 +vt 1.162871 -0.559966 +vt 1.821833 -0.559966 +vt 1.821833 0.501942 +vt 1.162871 0.501942 +vt 1.496855 0.493016 +vt 1.006276 0.493016 +vt 1.006276 -0.577506 +vt 1.496855 -0.577506 +vt 0.503910 -0.559966 +vt 0.503910 0.501942 +vt 0.515697 0.493016 +vt 0.515697 -0.577506 +vt -0.155051 -0.559966 +vt -0.155051 0.501942 +vt 0.025118 0.493016 +vt 0.025119 -0.577506 +vt -0.814013 -0.559966 +vt -0.814013 0.501942 +vt 1.162872 0.504188 +vt 1.821833 0.504415 +vt 1.821467 1.566324 +vt 1.162505 1.566096 +vt -0.465460 0.493016 +vt -0.465460 -0.577506 +vt 1.496855 1.565113 +vt 1.006276 1.565113 +vt 1.006276 0.494591 +vt 1.496855 0.494591 +vt 0.503910 0.503960 +vt 0.503544 1.565869 +vn 0.000000 1.000000 0.000000 +vn 0.923900 0.000000 -0.382700 +vn -0.382700 0.000000 0.923900 +vn 0.382700 0.000000 -0.923900 +vn 0.382700 0.000000 0.923900 +vn -0.382700 0.000000 -0.923900 +vn 0.923900 0.000000 0.382700 +vn -0.923900 0.000000 -0.382700 +vn -0.923900 0.000000 0.382700 +s off +f 4/1/1 12/2/1 11/3/1 3/4/1 +f 2/5/1 10/6/1 9/7/1 1/8/1 +f 1/8/1 9/7/1 16/9/1 8/10/1 +f 7/11/1 15/12/1 14/13/1 6/14/1 +f 5/15/1 13/16/1 12/2/1 4/1/1 +f 3/4/1 11/3/1 10/6/1 2/5/1 +f 8/10/1 16/9/1 15/12/1 7/11/1 +f 6/14/1 14/13/1 13/16/1 5/15/1 +f 11/17/2 12/18/2 28/19/2 27/20/2 +f 5/21/3 4/22/3 20/23/3 21/24/3 +f 12/18/4 13/25/4 29/26/4 28/19/4 +f 6/27/5 5/28/5 21/29/5 22/30/5 +f 13/31/6 14/32/6 30/33/6 29/34/6 +f 7/35/7 6/27/7 22/30/7 23/36/7 +f 14/32/8 15/37/8 31/38/8 30/33/8 +f 8/39/2 7/35/2 23/36/2 24/40/2 +f 15/37/9 16/41/9 32/42/9 31/38/9 +f 1/43/4 8/39/4 24/40/4 17/44/4 +f 2/45/6 1/46/6 17/47/6 18/48/6 +f 16/41/3 9/49/3 25/50/3 32/42/3 +f 9/51/5 10/52/5 26/53/5 25/54/5 +f 3/55/8 2/45/8 18/48/8 19/56/8 +f 10/52/7 11/17/7 27/20/7 26/53/7 +f 4/22/9 3/55/9 19/56/9 20/23/9 diff --git a/mods/survival/models/survival_well_top.obj b/mods/survival/models/survival_well_top.obj new file mode 100644 index 0000000..222762b --- /dev/null +++ b/mods/survival/models/survival_well_top.obj @@ -0,0 +1,124 @@ +# Blender v2.74 (sub 4) OBJ File: '' +# www.blender.org +o Plane +v -0.594368 -0.025786 0.594368 +v 0.594368 -0.025786 0.594368 +v -0.594368 -0.025786 -0.594368 +v 0.594368 -0.025786 -0.594368 +v -0.594368 0.213800 -0.110024 +v -0.594368 0.213800 0.110024 +v 0.594368 0.213800 0.110024 +v 0.594368 0.213800 -0.110024 +v -0.594368 0.074214 0.594368 +v 0.594368 0.074214 0.594368 +v -0.594368 0.074214 -0.594368 +v 0.594368 0.074214 -0.594368 +v -0.594368 0.395477 -0.037573 +v -0.594368 0.395477 0.037573 +v 0.594368 0.395477 0.037573 +v 0.594368 0.395477 -0.037573 +v 0.580392 -0.716775 -0.100000 +v 0.580392 0.207742 -0.100000 +v 0.580392 -0.716775 0.100000 +v 0.580392 0.207742 0.100000 +v 0.484193 -0.716775 -0.100000 +v 0.484193 0.207742 -0.100000 +v 0.484193 -0.716775 0.100000 +v 0.484193 0.207742 0.100000 +v -0.580392 -0.716775 0.100000 +v -0.580392 0.207742 0.100000 +v -0.580392 -0.716775 -0.100000 +v -0.580392 0.207742 -0.100000 +v -0.484193 -0.716775 0.100000 +v -0.484193 0.207742 0.100000 +v -0.484193 -0.716775 -0.100000 +v -0.484193 0.207742 -0.100000 +vt -2.037692 -0.642955 +vt -2.037691 -1.795974 +vt 0.498825 -1.795974 +vt 0.498825 -0.642955 +vt -2.037692 0.979602 +vt -2.037692 -0.173418 +vt 0.498825 -0.173417 +vt 0.498825 0.979602 +vt -0.828274 0.554469 +vt 1.708243 0.554469 +vt 1.708243 1.926136 +vt -0.828275 1.926135 +vt -0.828275 -0.977544 +vt 1.708243 -0.977544 +vt 1.708243 0.394122 +vt -0.828274 0.394123 +vt 0.533815 0.318514 +vt 0.533815 0.838637 +vt 0.104389 0.667386 +vt 0.104389 0.489764 +vt -2.037692 -2.009354 +vt 0.498825 -2.009355 +vt 0.498825 1.192981 +vt -2.037692 1.192983 +vt -0.160681 2.007526 +vt 0.422098 0.829388 +vt 0.864017 0.653155 +vt 0.082564 2.007526 +vt 1.100118 -0.826317 +vt 0.863751 -0.826317 +vt 0.422098 0.294133 +vt -0.160680 -0.884004 +vt 0.082565 -0.884004 +vt 0.864017 0.470366 +vt 1.100117 1.983467 +vt 0.863749 1.983467 +vt -0.630533 1.126091 +vt -0.630534 0.699332 +vt 1.342194 0.699332 +vt 1.342194 1.126091 +vt -0.630534 0.494062 +vt 1.342194 0.494062 +vt -0.630534 0.067303 +vt 1.342194 0.067302 +vt -0.630534 -0.137967 +vt 1.342194 -0.137967 +vt -0.468279 1.205461 +vt -0.468279 0.778702 +vt 1.504448 0.778702 +vt 1.504449 1.205460 +vt -0.468279 0.573432 +vt 1.504448 0.573432 +vt -0.468279 0.146673 +vt 1.504448 0.146673 +vt -0.468279 -0.058597 +vt 1.504448 -0.058597 +vn 0.000000 -0.896300 0.443400 +vn 0.000000 -0.896300 -0.443400 +vn 0.000000 -1.000000 0.000000 +vn 0.000000 0.866200 -0.499800 +vn 0.000000 0.866200 0.499800 +vn 0.000000 1.000000 0.000000 +vn -1.000000 -0.000000 0.000000 +vn 0.000000 0.000000 -1.000000 +vn 0.000000 0.000000 1.000000 +vn 1.000000 -0.000000 0.000000 +s off +f 5/1/1 3/2/1 4/3/1 8/4/1 +f 1/5/2 6/6/2 7/7/2 2/8/2 +f 6/6/3 5/1/3 8/4/3 7/7/3 +f 13/9/4 16/10/4 12/11/4 11/12/4 +f 9/13/5 10/14/5 15/15/5 14/16/5 +f 14/16/6 15/15/6 16/10/6 13/9/6 +f 5/17/7 6/18/7 14/19/7 13/20/7 +f 4/3/8 3/2/8 11/21/8 12/22/8 +f 1/5/9 2/8/9 10/23/9 9/24/9 +f 2/25/10 7/26/10 15/27/10 10/28/10 +f 3/29/7 5/17/7 13/20/7 11/30/7 +f 8/31/10 4/32/10 12/33/10 16/34/10 +f 6/18/7 1/35/7 9/36/7 14/19/7 +f 7/26/10 8/31/10 16/34/10 15/27/10 +f 18/37/10 20/38/10 19/39/10 17/40/10 +f 20/38/9 24/41/9 23/42/9 19/39/9 +f 24/41/7 22/43/7 21/44/7 23/42/7 +f 22/43/8 18/45/8 17/46/8 21/44/8 +f 26/47/7 28/48/7 27/49/7 25/50/7 +f 28/48/8 32/51/8 31/52/8 27/49/8 +f 32/51/10 30/53/10 29/54/10 31/52/10 +f 30/53/9 26/55/9 25/56/9 29/54/9 diff --git a/mods/survival/nodes.lua b/mods/survival/nodes.lua new file mode 100644 index 0000000..81b3da8 --- /dev/null +++ b/mods/survival/nodes.lua @@ -0,0 +1,449 @@ +local barrel_formspec = + 'size[8,9]'.. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + 'list[current_name;main;0,0.3;8,4;]'.. + 'list[current_player;main;0,4.85;8,1;]'.. + 'list[current_player;main;0,6.08;8,3;8]'.. + default.get_hotbar_bg(0,4.85) + +minetest.register_node('survival:barrel', { + description = 'Barrel', + drawtype = 'mesh', + mesh = 'survival_barrel.obj', + tiles = {'survival_barrel.png'}, + groups = {choppy=2,oddly_breakable_by_hand=2}, + paramtype = 'light', + paramtype2 = 'facedir', + sounds = default.node_sound_wood_defaults(), + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string('formspec', barrel_formspec) + meta:set_string('infotext', 'Barrel') + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + 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 barrel 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 barrel 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 barrel at '..minetest.pos_to_string(pos)) + end, +}) + +minetest.override_item('default:dirt_with_grass',{ + drop = { + max_items = 2, + items = { + { + items = {'survival:slug_raw'}, + rarity = 30, + }, + { + items = {'survival:worm_raw'}, + rarity = 30, + }, + { + items = {'survival:centipede_raw'}, + rarity = 30, + }, + { + items = {'survival:milipede_raw'}, + rarity = 30, + }, + { + items = {'default:dirt'}, + }, + }, + }, +}) +--This will probably need to be a few nodes to show the states it can be in. +minetest.register_node('survival:spigot', { + description = 'spigot', + drawtype = 'mesh', + mesh = 'spigot.obj', + tiles = {{name='default_wood.png'},{name='default_clay.png'}}, +-- inventory_image = 'placeholder.png', + groups = {choppy=2, dig_immediate=2,}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-.35, -.2, 0, .35, .5, .5}, -- Right, Bottom, Back, Left, Top, Front + }, + collision_box = { + type = 'fixed', + fixed = {-.35, -.2, 0, .35, .5, .5}, -- Right, Bottom, Back, Left, Top, Front + }, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('sap', 1) + meta:set_string('formspec', + 'size[8,9]'.. + 'label[1,0;You need a bucket to collect sap.]' .. + 'list[current_name;sap;1,1.5;1,1]'.. + 'list[current_player;main;0,5;8,4;]') + meta:set_string('infotext', 'Sap Spigot') + end, + on_timer = function(pos, elapsed) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('sap', 'bucket:bucket_empty') then --make sure the bucket is still there + inv:set_stack('sap', 1,'survival:bucket_sap') + meta:set_string('infotext', 'bucket filled with sap, please replace.') + timer:stop() + return + end + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('sap', 'bucket:bucket_empty') then + timer:start(240) + meta:set_string('infotext', 'gathering sap.. this could take a while.') + end + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local timer = minetest.get_node_timer(pos) + local meta = minetest.env:get_meta(pos) + meta:set_string('infotext', 'You need a bucket to collect sap.') + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if listname == 'sap' then + if stack:get_name() == ('bucket:bucket_empty') then + return 1 + else + return 0 + end + end + end, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node(pos) --get the location of the placed node + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local dir = minetest.facedir_to_dir(n.param2) + local p1 = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} --node placed on + local p2 = {x=pos.x+dir.x, y=pos.y+1, z=pos.z+dir.z} --node above previous + local p3 = {x=pos.x+dir.x, y=pos.y-1, z=pos.z+dir.z} --node below first + local n2 = minetest.get_node_or_nil(p1) + local n3 = minetest.get_node_or_nil(p2) + local n4 = minetest.get_node_or_nil(p3) + if n2.name and n3.name and n4.name ~= 'default:tree' then + minetest.remove_node(pos) + return true + --TODO make the spigot place only one node above the ground. + end + end, +}) + +minetest.register_node('survival:sleeping_bag', { + description = 'sleeping bag', + drawtype = 'mesh', + mesh = 'survival_sleeping_bag.obj', + tiles = {'wool_white.png'}, + groups = {choppy=2, snappy=3,}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-0.5, -0.5, -0.5, 0.5, -0.2, 1.5}, -- Right, Bottom, Back, Left, Top, Front + }, + collision_box = { + type = 'fixed', + fixed = {-0.5, -0.5, -0.5, 0.5, -0.2, 1.5}, + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node_or_nil(pos) --get the location of the placed node + if not n or not n.param2 then + minetest.remove_node(pos) --??? + return true + end + local dir = minetest.facedir_to_dir(n.param2) --figure out what direction the node is facing + local p = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} --position + local n2 = minetest.get_node_or_nil(p) --what node is next in line after the node we placed? + local def = minetest.registered_items[n2.name] or nil + if not n2 or not def or not def.buildable_to then --remove the node if it shouldn't be placeable. + minetest.remove_node(pos) + return true + end + end, + on_rightclick = function(pos, node, clicker) + beds.on_rightclick(pos, clicker) + end, +}) + +minetest.register_node('survival:leafy_bed', { + description = 'bed of leaves', + drawtype = 'mesh', + mesh = 'survival_leafy_bed.obj', + tiles = {'default_grass.png^default_jungleleaves.png'}, + groups = {choppy=2, snappy=3,}, + drop = { + max_items = 4, + items = { + { + items = {'survival:slug_raw'}, + rarity = 60, + }, + { + items = {'default:stick 4'}, + rarity = 10, + }, + { + items = {'default:stick 3'}, + rarity = 10, + }, + { + items = {'default:leaves 3'}, + rarity = 10, + }, + { + items = {'default:leaves 1'}, + }, + }, + }, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-0.5, -0.5, -0.5, 0.5, -0.2, 1.5}, -- Right, Bottom, Back, Left, Top, Front + }, + collision_box = { + type = 'fixed', + fixed = {-0.5, -0.5, -0.5, 0.5, -0.2, 1.5}, -- Right, Bottom, Back, Left, Top, Front + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node_or_nil(pos) --get the location of the placed node + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local dir = minetest.facedir_to_dir(n.param2) --figure out what direction the node is facing + local p = {x=pos.x+dir.x, y=pos.y, z=pos.z+dir.z} + local n2 = minetest.get_node_or_nil(p) + local def = minetest.registered_items[n2.name] or nil + if not n2 or not def or not def.buildable_to then --remove the node if it shouldn't be placeable. + minetest.remove_node(pos) + return true + end + end, + on_rightclick = function(pos, node, clicker) + beds.on_rightclick(pos, clicker) + end, +}) + +minetest.register_node('survival:sand_with_food', { + description = 'Sand', + tiles = {'default_sand.png'}, + is_ground_content = true, + groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1}, + sounds = default.node_sound_sand_defaults(), + drop = { + max_items = 2, + items = { + { + items = {'survival:oyster_raw'}, + rarity = 2, + }, + { + items = {'survival:mussel_raw'}, + rarity = 2, + }, + { + items = {'default:sand'}, + }, + }, + }, +}) + +minetest.register_node('survival:well_bottom', { + description = 'well bottom', + drawtype = 'mesh', + mesh = 'survival_well_bottom.obj', + tiles = {'default_cobble.png'}, + groups = {cracky=3, stone=2}, + paramtype = 'light', + paramtype2 = 'facedir', + sounds = default.node_sound_stone_defaults(), + selection_box = { + type = 'fixed', + fixed = {-0.6, -0.5, -0.6, 0.6, .3, .6}, -- Right, Bottom, Back, Left, Top, Front + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node(pos) + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local dir = minetest.facedir_to_dir(n.param2) + local b1 = {x=pos.x, y=pos.y-1, z=pos.z} + local b2 = {x=pos.x, y=pos.y-2, z=pos.z} + local b3 = {x=pos.x-dir.x, y=pos.y, z=pos.z-dir.z} + local n1 = minetest.get_node_or_nil(b1) + local n2 = minetest.get_node_or_nil(b2) + local n3 = minetest.get_node_or_nil(b3) + local def = minetest.registered_items[n2.name] or nil + if not n1 and n2 or not def.buildable_to then --not really sure if this is the best code, but it works. + minetest.remove_node(pos) + return true + end + if minetest.get_item_group(n3.name, 'soil') < 3 then + minetest.remove_node(pos) + minetest.set_node(pos,{name = 'air'}) + minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z},{name = 'survival:well_bottom', param2=n.param2}) + end + end, + }) + +minetest.register_node('survival:well_top', { + description = 'well top', + drawtype = 'mesh', + mesh = 'survival_well_top.obj', + tiles = {'default_wood.png'}, + groups = {choppy=2,oddly_breakable_by_hand=2, attached_node=1}, + paramtype = 'light', + paramtype2 = 'facedir', + selection_box = { + type = 'fixed', + fixed = {-0.6, -0.6, -0.6, 0.6, .4, .6}, -- Right, Bottom, Back, Left, Top, Front + }, + after_place_node = function(pos, placer, itemstack) + local n = minetest.get_node(pos) + if not n or not n.param2 then + minetest.remove_node(pos) + return true + end + local p = {x=pos.x, y=pos.y-1, z=pos.z} + local p2 = {x=pos.x, y=pos.y-2, z=pos.z} + local n2 = minetest.get_node_or_nil(p) + local n3 = minetest.get_node_or_nil(p2) + if n3.name ~= 'air' or n2.name ~= 'survival:well_bottom' then + minetest.remove_node(pos) + return true + end + end, + on_construct = function(pos) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('pail', 1) + meta:set_string('formspec', + 'size[8,6]'.. + 'label[2,.5;You need something to gather water in.]' .. + 'list[current_name;pail;1,.5;1,1]'.. + 'list[current_player;main;0,2;8,4;]') + meta:set_string('infotext', 'Well') + end, + on_timer = function(pos, elapsed) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('pail', 'bucket:bucket_empty') then + inv:set_stack('pail', 1,'bucket:bucket_water') + timer:stop() + return + elseif inv:contains_item('pail', 'thirsty:steel_canteen') then + inv:set_stack('pail', 1,({name='thirsty:steel_canteen', wear=1,})) + timer:stop() + return + elseif inv:contains_item('pail', 'thirsty:bronze_canteen') then + inv:set_stack('pail', 1,({name='thirsty:bronze_canteen', wear=1,})) + timer:stop() + end + end, + on_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + local timer = minetest.get_node_timer(pos) + if inv:contains_item('pail', 'bucket:bucket_empty') then + timer:start(7) + elseif inv:contains_item('pail', 'thirsty:steel_canteen') then + timer:start(6) + elseif inv:contains_item('pail', 'thirsty:bronze_canteen') then + timer:start(7) + end + end, + on_metadata_inventory_take = function(pos, listname, index, stack, player) + local chance = math.random(1,20) + if chance == 2 then + -- Let's change the formspec' + local meta = minetest.env:get_meta(pos) + local inv = meta:get_inventory() + inv:set_size('main', 8*4) + inv:set_size('pail', 0) + meta:set_string('formspec', + 'size[8,6]'.. + 'label[2,.5;This well has dried up!]' .. + 'list[current_player;main;0,2;8,4;]') + meta:set_string('infotext', 'Dead Well') + -- Now let's fill the well with dirt, so it has to be dug again. + for i=2,4 do + minetest.set_node({x=pos.x, y=pos.y-i, z=pos.z},{name = 'default:dirt'}) + end + end + end, + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + if listname == 'pail' then + if stack:get_name() == ('bucket:bucket_empty') then + return 1 + elseif stack:get_name() == ('thirsty:steel_canteen') then + return 1 + elseif stack:get_name() == ('thirsty:bronze_canteen') then + return 1 + else + return 0 + end + end + end, +}) + +minetest.register_node('survival:stone_with_salt', { + description = 'Salt Ore', + tiles = {'default_stone.png^survival_salt_ore.png'}, + is_ground_content = true, + groups = {cracky=3}, + drop = 'survival:salt_lump', + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_node('survival:bird_nest', { + description = 'Bird Nest', + drawtype = 'mesh', + mesh = 'survival_nest.obj', + tiles = {'survival_nest.png'}, + groups = {flammable=1, snappy=1, crumbly=3}, + drop = { + max_items = 2, + items = { + { + items = {'survival:nesting 4'}, + }, + { + items = {'default:gold_lump'}, + rarity = 15, + }, + { + items = {'default:mese_crystal'}, + rarity = 25, + }, + }, + }, +}) diff --git a/mods/survival/ores.lua b/mods/survival/ores.lua new file mode 100644 index 0000000..bd33852 --- /dev/null +++ b/mods/survival/ores.lua @@ -0,0 +1,9 @@ +minetest.register_ore({ + ore_type = 'sheet', + ore = 'survival:stone_with_salt', + wherein = 'default:stone', + clust_size = 6, + height_min = -3100, + height_max = 200, + noise_params = {offset=0, scale=7, spread={x=250, y=250, z=250}, seed=23, octaves=6, persist=0.70} +}) diff --git a/mods/survival/readme.md b/mods/survival/readme.md new file mode 100644 index 0000000..196508c --- /dev/null +++ b/mods/survival/readme.md @@ -0,0 +1,31 @@ +# Mod Contributors +Nathan + +# Survival +This is a Minetest mod that adds survival related items + +## Forum Topic +https://forum.minetest.net/viewtopic.php?f=9&t=11517 + +## Licensing +CC0 + +## Dependencies +- farming +- default +- wool +- beds +- thirsty? + + +# +Items currently included: +Machete +Bugs/food +Sleeping bags +Leafy beds +barrels, like chests but barrel shapes + +# +Planned: +Better integration with the Thirsty mod diff --git a/mods/survival/textures/bird_nest.png b/mods/survival/textures/bird_nest.png new file mode 100644 index 0000000..8c0f9c3 Binary files /dev/null and b/mods/survival/textures/bird_nest.png differ diff --git a/mods/survival/textures/bird_nest.png~ b/mods/survival/textures/bird_nest.png~ new file mode 100644 index 0000000..b24150b Binary files /dev/null and b/mods/survival/textures/bird_nest.png~ differ diff --git a/mods/survival/textures/survival_barrel.png b/mods/survival/textures/survival_barrel.png new file mode 100644 index 0000000..12d2394 Binary files /dev/null and b/mods/survival/textures/survival_barrel.png differ diff --git a/mods/survival/textures/survival_bucket_sap.png b/mods/survival/textures/survival_bucket_sap.png new file mode 100644 index 0000000..0b0f214 Binary files /dev/null and b/mods/survival/textures/survival_bucket_sap.png differ diff --git a/mods/survival/textures/survival_centipede_cooked.png b/mods/survival/textures/survival_centipede_cooked.png new file mode 100644 index 0000000..cffa4db Binary files /dev/null and b/mods/survival/textures/survival_centipede_cooked.png differ diff --git a/mods/survival/textures/survival_centipede_raw.png b/mods/survival/textures/survival_centipede_raw.png new file mode 100644 index 0000000..488ca02 Binary files /dev/null and b/mods/survival/textures/survival_centipede_raw.png differ diff --git a/mods/survival/textures/survival_cooked_kabob.png b/mods/survival/textures/survival_cooked_kabob.png new file mode 100644 index 0000000..dec684e Binary files /dev/null and b/mods/survival/textures/survival_cooked_kabob.png differ diff --git a/mods/survival/textures/survival_cricket_cooked.png b/mods/survival/textures/survival_cricket_cooked.png new file mode 100644 index 0000000..e108815 Binary files /dev/null and b/mods/survival/textures/survival_cricket_cooked.png differ diff --git a/mods/survival/textures/survival_cricket_raw.png b/mods/survival/textures/survival_cricket_raw.png new file mode 100644 index 0000000..f083be5 Binary files /dev/null and b/mods/survival/textures/survival_cricket_raw.png differ diff --git a/mods/survival/textures/survival_energy_bar.png b/mods/survival/textures/survival_energy_bar.png new file mode 100644 index 0000000..ca100d6 Binary files /dev/null and b/mods/survival/textures/survival_energy_bar.png differ diff --git a/mods/survival/textures/survival_machete_bronze.png b/mods/survival/textures/survival_machete_bronze.png new file mode 100644 index 0000000..12b449a Binary files /dev/null and b/mods/survival/textures/survival_machete_bronze.png differ diff --git a/mods/survival/textures/survival_machete_diamond.png b/mods/survival/textures/survival_machete_diamond.png new file mode 100644 index 0000000..0387bcd Binary files /dev/null and b/mods/survival/textures/survival_machete_diamond.png differ diff --git a/mods/survival/textures/survival_machete_mese.png b/mods/survival/textures/survival_machete_mese.png new file mode 100644 index 0000000..8fed16d Binary files /dev/null and b/mods/survival/textures/survival_machete_mese.png differ diff --git a/mods/survival/textures/survival_machete_steel.png b/mods/survival/textures/survival_machete_steel.png new file mode 100644 index 0000000..3c3e5e2 Binary files /dev/null and b/mods/survival/textures/survival_machete_steel.png differ diff --git a/mods/survival/textures/survival_machete_wood.png b/mods/survival/textures/survival_machete_wood.png new file mode 100644 index 0000000..ba8eae5 Binary files /dev/null and b/mods/survival/textures/survival_machete_wood.png differ diff --git a/mods/survival/textures/survival_milipede_cooked.png b/mods/survival/textures/survival_milipede_cooked.png new file mode 100644 index 0000000..2e30ae5 Binary files /dev/null and b/mods/survival/textures/survival_milipede_cooked.png differ diff --git a/mods/survival/textures/survival_milipede_raw.png b/mods/survival/textures/survival_milipede_raw.png new file mode 100644 index 0000000..bfed1c3 Binary files /dev/null and b/mods/survival/textures/survival_milipede_raw.png differ diff --git a/mods/survival/textures/survival_mussel_cooked.png b/mods/survival/textures/survival_mussel_cooked.png new file mode 100644 index 0000000..00e586e Binary files /dev/null and b/mods/survival/textures/survival_mussel_cooked.png differ diff --git a/mods/survival/textures/survival_mussel_raw.png b/mods/survival/textures/survival_mussel_raw.png new file mode 100644 index 0000000..ccbe44b Binary files /dev/null and b/mods/survival/textures/survival_mussel_raw.png differ diff --git a/mods/survival/textures/survival_nest.png b/mods/survival/textures/survival_nest.png new file mode 100644 index 0000000..0a00cbd Binary files /dev/null and b/mods/survival/textures/survival_nest.png differ diff --git a/mods/survival/textures/survival_nesting.png b/mods/survival/textures/survival_nesting.png new file mode 100644 index 0000000..a333075 Binary files /dev/null and b/mods/survival/textures/survival_nesting.png differ diff --git a/mods/survival/textures/survival_oyster_cooked.png b/mods/survival/textures/survival_oyster_cooked.png new file mode 100644 index 0000000..ab2a47a Binary files /dev/null and b/mods/survival/textures/survival_oyster_cooked.png differ diff --git a/mods/survival/textures/survival_oyster_raw.png b/mods/survival/textures/survival_oyster_raw.png new file mode 100644 index 0000000..ad30d3f Binary files /dev/null and b/mods/survival/textures/survival_oyster_raw.png differ diff --git a/mods/survival/textures/survival_raw_kabob.png b/mods/survival/textures/survival_raw_kabob.png new file mode 100644 index 0000000..6cca6f3 Binary files /dev/null and b/mods/survival/textures/survival_raw_kabob.png differ diff --git a/mods/survival/textures/survival_salt.png b/mods/survival/textures/survival_salt.png new file mode 100644 index 0000000..2cc73b7 Binary files /dev/null and b/mods/survival/textures/survival_salt.png differ diff --git a/mods/survival/textures/survival_salt_lump.png b/mods/survival/textures/survival_salt_lump.png new file mode 100644 index 0000000..e0e8986 Binary files /dev/null and b/mods/survival/textures/survival_salt_lump.png differ diff --git a/mods/survival/textures/survival_salt_ore.png b/mods/survival/textures/survival_salt_ore.png new file mode 100644 index 0000000..01b6f1f Binary files /dev/null and b/mods/survival/textures/survival_salt_ore.png differ diff --git a/mods/survival/textures/survival_shell.png b/mods/survival/textures/survival_shell.png new file mode 100644 index 0000000..fb8fa2c Binary files /dev/null and b/mods/survival/textures/survival_shell.png differ diff --git a/mods/survival/textures/survival_slug_cooked.png b/mods/survival/textures/survival_slug_cooked.png new file mode 100644 index 0000000..7d9bae1 Binary files /dev/null and b/mods/survival/textures/survival_slug_cooked.png differ diff --git a/mods/survival/textures/survival_slug_raw.png b/mods/survival/textures/survival_slug_raw.png new file mode 100644 index 0000000..34de456 Binary files /dev/null and b/mods/survival/textures/survival_slug_raw.png differ diff --git a/mods/survival/textures/survival_sugar.png b/mods/survival/textures/survival_sugar.png new file mode 100644 index 0000000..de087e5 Binary files /dev/null and b/mods/survival/textures/survival_sugar.png differ diff --git a/mods/survival/textures/survival_worm_cooked.png b/mods/survival/textures/survival_worm_cooked.png new file mode 100644 index 0000000..76eaf49 Binary files /dev/null and b/mods/survival/textures/survival_worm_cooked.png differ diff --git a/mods/survival/textures/survival_worm_raw.png b/mods/survival/textures/survival_worm_raw.png new file mode 100644 index 0000000..486d9da Binary files /dev/null and b/mods/survival/textures/survival_worm_raw.png differ diff --git a/mods/survival/tools.lua b/mods/survival/tools.lua new file mode 100644 index 0000000..0cc2325 --- /dev/null +++ b/mods/survival/tools.lua @@ -0,0 +1,81 @@ +-- Wooden Machete (This may be removed in the future, not sure how realistic it is.) +minetest.register_tool('survival:machete_wood', { + description = 'wooden machete', + inventory_image = 'survival_machete_wood.png', + tool_capabilities = { + full_punch_interval = 1.2, --amount of seconds between repeating action. + max_drop_level = 0, -- not sure what this does. + groupcaps= { --how many times the tool can 'attack' nodes of a type. + crumbly = {times = {[1]=3.00, [2]=1.60, [3]=0.60}, uses=10, maxlevel=1}, --dirt like + choppy = {times = {[2]=3.00, [3]=1.60}, uses=10, maxlevel=1}, --woody + snappy = {times = {[2]=1.6, [3]=0.40}, uses=10, maxlevel=1}, + }, + damage_groups = {fleshy=2}, --damage delt to mobs and other players? + }, +}) + +-- there will be no stone machete, ever. + +-- Steel machete +minetest.register_tool('survival:machete_steel', { + description = 'steel machete', + inventory_image = 'survival_machete_steel.png', + tool_capabilities = { + full_punch_interval = 1.1, + max_drop_level = 1, + groupcaps = { + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=30, maxlevel=2}, + choppy={times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=20, maxlevel=2}, + snappy={times={[1]=2.50, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2}, + }, + damage_groups = {fleshy=5} --a sword will do more damage than a machete. + }, +}) + +-- Bronze Machete +minetest.register_tool('survival:machete_bronze', { + description = 'bronze machete', + inventory_image = 'survival_machete_bronze.png', + tool_capabilities = { + full_punch_interval = 1, + max_drop_level = 1, + groupcaps = { + crumbly = {times={[1]=1.50, [2]=0.90, [3]=0.40}, uses=40, maxlevel=2}, + choppy = {times={[1]=2.50, [2]=1.40, [3]=1.00}, uses=30, maxlevel=2}, + snappy = {times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2}, + }, + damage_groups = {fleshy=5} + }, +}) + +-- Diamond Machete +minetest.register_tool('survival:machete_diamond', { + description = 'diamond machete', + inventory_image = 'survival_machete_diamond.png', + tool_capabilities = { + full_punch_interval = 1, + max_drop_level = 1, + groupcaps = { + crumbly = {times={[1]=1.10, [2]=0.50, [3]=0.30}, uses=30, maxlevel=3}, + choppy={times={[1]=2.10, [2]=0.90, [3]=0.50}, uses=30, maxlevel=2}, + snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3}, + }, + damage_groups = {fleshy=6}, + } +}) + +-- Mese Machete +minetest.register_tool('survival:machete_mese', { + description = 'mese machete', + inventory_image = 'survival_machete_mese.png', + tool_capabilities = { + full_punch_interval = 1, + max_drop_level = 3, + groupcaps = { + crumbly = {times={[1]=1.20, [2]=0.60, [3]=0.30}, uses=20, maxlevel=3}, + choppy={times={[1]=2.20, [2]=1.00, [3]=0.60}, uses=20, maxlevel=3}, + snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3}, + }, + damage_groups = {fleshy=7}, + } +}) diff --git a/mods/thirsty/HUD.txt b/mods/thirsty/HUD.txt new file mode 100644 index 0000000..5aa9426 --- /dev/null +++ b/mods/thirsty/HUD.txt @@ -0,0 +1,17 @@ +Configuration for Better HUD +---------------------------- + +The Better HUD mod positions the stat displays according to +a 'hud.conf' file in its mod directory. If you wish to shift +the positions of the stat displays around, you need to create or +edit the 'hud.conf' file. + +There should be two files in this mod directory, 'hud.conf.with_hunger' +and 'hud.conf.no_hunger'. These can be used as the basis for your +'hud.conf', depending on whether you are also using the Hunger mod +(which adds a hunger display), or not. + +The positions of the displays in those files correspond to the +default settings in Better HUD. In most cases, it's enough to +copy one of these files as 'hud.conf' in the Better HUD mod +directory 'mods/hud'. diff --git a/mods/thirsty/LICENSE b/mods/thirsty/LICENSE new file mode 100644 index 0000000..5f2dd7f --- /dev/null +++ b/mods/thirsty/LICENSE @@ -0,0 +1,505 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +(This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.) + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + {description} + Copyright (C) {year} {fullname} + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 + USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random + Hacker. + + {signature of Ty Coon}, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + diff --git a/mods/thirsty/README.md b/mods/thirsty/README.md new file mode 100644 index 0000000..82aec21 --- /dev/null +++ b/mods/thirsty/README.md @@ -0,0 +1,97 @@ +Thirsty [thirsty] +================= + +A Minetest mod that adds a "thirst" mechanic. + +Version: 0.9.0 + +License: + Code: LGPL 2.1 (see included LICENSE file) + Textures: CC-BY-SA (see http://creativecommons.org/licenses/by-sa/4.0/) + +Report bugs or request help on the forum topic. + +Description +----------- + +This is a mod for MineTest. It adds a thirst mechanic to the +game, similar to many hunger mods (but independent of them). +Players will slowly get thirstier over time, and will need to +drink or suffer damage. + +The point of this mod is not to make the game more realistic, +or harder. The point is to have another mechanic that rewards +preparation and infrastructure. Players will now have an incentive +to build their base next to water (or add some water to their base), +and/or take some water with them when mining or travelling. + +Terminology: "Thirst" vs. "hydration" +------------------------------------- + +"Thirst" is the absence of "hydration" (a term suggested by +everamzah on the Minetest forums, thanks!). The overall mechanic +is still called "thirst", but the visible bar is that of +"hydration", meaning a full bar represents full hydration, not full +thirst. Players lose hydration (or "hydro points") over time, and +gain hydration when drinking. + +Current behavior +---------------- + +**Tier 0**: stand in water (running or standing) to slowly drink. +You may not move during drinking (or you could cross an ocean without +getting thirsty). + +**Tier 1**: use a container (e.g. from `vessels`) on water to instantly +fill your hydration. Craftable wooden bowl included. + +**Tier 2**: craftable canteens: steel canteen holds two full hydration +bars, bronze canteen three bars worth of water. + +**Tier 3**: placeable drinking fountain / wash basin node: instantly +fills your hydration when used. + +**Tier 4+**: placeable fountain node(s) to fill the hydration of all +players within range. Placing more nodes increases the range. + +**Tier 5**: craftable trinkets/gadgets/amulets that constantly keep your +hydration filled when in your inventory, solving your thirst problem +once and for all. + +API +--- +Some functions of interest: + +* thirsty.drink(player, amount, [max]) : instantly drink a bit (up to a max value, default 20) +* thirsty.get_hydro(player) : returns the current hydration of a player +* thirsty.set_thirst_factor(player, factor) : how fast does the given player get thirsty (default is 1.0) +* thirsty.get_thirst_factor(player) : returns the current thirst factor of a player + +"player" refers to a player object, i.e. with a get_player_name() method. + +Future plans +------------ +Better configurability and an API. + +Dependencies +------------ +* default (optional but needed for included components) +* bucket (optional but needed for some included components) +* hud (optional): https://forum.minetest.net/viewtopic.php?f=11&t=6342 (see HUD.txt for configuration) +* hudbars (optional): https://forum.minetest.net/viewtopic.php?f=11&t=11153 +* vessels (optional): https://forum.minetest.net/viewtopic.php?id=2574 + +Installation +------------ + +Unzip the archive, rename the folder to to `thirsty` and +place it in minetest/mods/ + +( Linux: If you have a linux system-wide installation place + it in ~/.minetest/mods/. ) + +( If you only want this to be used in a single world, place + the folder in worldmods/ in your worlddirectory. ) + +For further information or help see: +http://wiki.minetest.com/wiki/Installing_Mods diff --git a/mods/thirsty/components.lua b/mods/thirsty/components.lua new file mode 100644 index 0000000..ae674c1 --- /dev/null +++ b/mods/thirsty/components.lua @@ -0,0 +1,256 @@ +--[[ + +Default components for Thirsty. + +These are nodes and items that "implement" the functionality +from functions.lua + +See init.lua for license. + +]] + + +--[[ + +Drinking containers (Tier 1) + +Defines a simple wooden bowl which can be used on water to fill +your hydration. + +Optionally also augments the nodes from vessels to enable drinking +on use. + +]] + +if minetest.get_modpath("vessels") and thirsty.config.register_vessels then + -- add "drinking" to vessels + thirsty.augment_item_for_drinking('vessels:drinking_glass', 22) + thirsty.augment_item_for_drinking('vessels:glass_bottle', 24) + thirsty.augment_item_for_drinking('vessels:steel_bottle', 26) +end + +if minetest.get_modpath("default") and thirsty.config.register_bowl then + -- our own simple wooden bowl + minetest.register_craftitem('thirsty:wooden_bowl', { + description = "Wooden bowl", + inventory_image = "thirsty_bowl_16.png", + liquids_pointable = true, + on_use = thirsty.on_use(nil), + }) + + minetest.register_craft({ + output = "thirsty:wooden_bowl", + recipe = { + {"group:wood", "", "group:wood"}, + {"", "group:wood", ""} + } + }) +end + +--[[ + +Hydro containers (Tier 2) + +Defines canteens (currently two types, with different capacities), +tools which store hydro. They use wear to show their content +level in their durability bar; they do not disappear when used up. + +Wear corresponds to hydro level as follows: +- a wear of 0 shows no durability bar -> empty (initial state) +- a wear of 1 shows a full durability bar -> full +- a wear of 65535 shows an empty durability bar -> empty + +]] + +if minetest.get_modpath("default") and thirsty.config.register_canteens then + + minetest.register_tool('thirsty:steel_canteen', { + description = 'Steel canteen', + inventory_image = "thirsty_steel_canteen_16.png", + liquids_pointable = true, + stack_max = 1, + on_use = thirsty.on_use(nil), + }) + + minetest.register_tool('thirsty:bronze_canteen', { + description = 'Bronze canteen', + inventory_image = "thirsty_bronze_canteen_16.png", + liquids_pointable = true, + stack_max = 1, + on_use = thirsty.on_use(nil), + }) + + minetest.register_craft({ + output = "thirsty:steel_canteen", + recipe = { + { "group:wood", ""}, + { "default:steel_ingot", "default:steel_ingot"}, + { "default:steel_ingot", "default:steel_ingot"} + } + }) + minetest.register_craft({ + output = "thirsty:bronze_canteen", + recipe = { + { "group:wood", ""}, + { "default:bronze_ingot", "default:bronze_ingot"}, + { "default:bronze_ingot", "default:bronze_ingot"} + } + }) + +end + +--[[ + +Tier 3 + +]] + +if minetest.get_modpath("default") and minetest.get_modpath("bucket") and thirsty.config.register_drinking_fountain then + + minetest.register_node('thirsty:drinking_fountain', { + description = 'Drinking fountain', + drawtype = 'nodebox', + tiles = { + -- top, bottom, right, left, front, back + 'thirsty_drinkfount_top.png', + 'thirsty_drinkfount_bottom.png', + 'thirsty_drinkfount_side.png', + 'thirsty_drinkfount_side.png', + 'thirsty_drinkfount_side.png', + 'thirsty_drinkfount_side.png', + }, + paramtype = 'light', + groups = { cracky = 2 }, + node_box = { + type = "fixed", + fixed = { + { -3/16, -8/16, -3/16, 3/16, 3/16, 3/16 }, + { -8/16, 3/16, -8/16, 8/16, 6/16, 8/16 }, + { -8/16, 6/16, -8/16, 8/16, 8/16, -6/16 }, + { -8/16, 6/16, 6/16, 8/16, 8/16, 8/16 }, + { -8/16, 6/16, -6/16, -6/16, 8/16, 6/16 }, + { 6/16, 6/16, -6/16, 8/16, 8/16, 6/16 }, + }, + }, + selection_box = { + type = "regular", + }, + collision_box = { + type = "regular", + }, + on_rightclick = thirsty.on_rightclick(nil), + }) + + minetest.register_craft({ + output = "thirsty:drinking_fountain", + recipe = { + { "default:stone", "bucket:bucket_water", "default:stone"}, + { "", "default:stone", ""}, + { "", "default:stone", ""} + } + }) + +end + +--[[ + +Tier 4+: the water fountains, plus extenders + +]] + +if minetest.get_modpath("default") and minetest.get_modpath("bucket") and thirsty.config.register_fountains then + + minetest.register_node('thirsty:water_fountain', { + description = 'Water fountain', + tiles = { + -- top, bottom, right, left, front, back + 'thirsty_waterfountain_top.png', + 'thirsty_waterfountain_top.png', + 'thirsty_waterfountain_side.png', + 'thirsty_waterfountain_side.png', + 'thirsty_waterfountain_side.png', + 'thirsty_waterfountain_side.png', + }, + paramtype = 'light', + groups = { cracky = 2 }, + }) + + minetest.register_node('thirsty:water_extender', { + description = 'Water fountain extender', + tiles = { + 'thirsty_waterextender_top.png', + 'thirsty_waterextender_top.png', + 'thirsty_waterextender_side.png', + 'thirsty_waterextender_side.png', + 'thirsty_waterextender_side.png', + 'thirsty_waterextender_side.png', + }, + paramtype = 'light', + groups = { cracky = 2 }, + }) + + minetest.register_craft({ + output = "thirsty:water_fountain", + recipe = { + { "default:copper_ingot", "bucket:bucket_water", "default:copper_ingot"}, + { "", "default:copper_ingot", ""}, + { "default:copper_ingot", "default:mese_crystal", "default:copper_ingot"} + } + }) + minetest.register_craft({ + output = "thirsty:water_extender", + recipe = { + { "", "bucket:bucket_water", ""}, + { "", "default:copper_ingot", ""}, + { "default:copper_ingot", "default:mese_crystal", "default:copper_ingot"} + } + }) + + + minetest.register_abm({ + nodenames = {'thirsty:water_fountain'}, + interval = 2, + chance = 5, + action = thirsty.fountain_abm, + }) + +end + +--[[ + +Tier 5 + +These amulets don't do much; the actual code is above, where +they are searched for in player's inventories + +]] + +if minetest.get_modpath("default") and minetest.get_modpath("bucket") and thirsty.config.register_amulets then + + minetest.register_craftitem('thirsty:injector', { + description = 'Water injector', + inventory_image = 'thirsty_injector.png', + }) + minetest.register_craft({ + output = "thirsty:injector", + recipe = { + { "default:diamond", "default:mese_crystal", "default:diamond"}, + { "default:mese_crystal", "bucket:bucket_water", "default:mese_crystal"}, + { "default:diamond", "default:mese_crystal", "default:diamond"} + } + }) + + minetest.register_craftitem('thirsty:extractor', { + description = 'Water extractor', + inventory_image = 'thirsty_extractor.png', + }) + minetest.register_craft({ + output = "thirsty:extractor", + recipe = { + { "default:mese_crystal", "default:diamond", "default:mese_crystal"}, + { "default:diamond", "bucket:bucket_water", "default:diamond"}, + { "default:mese_crystal", "default:diamond", "default:mese_crystal"} + } + }) + +end diff --git a/mods/thirsty/configuration.lua b/mods/thirsty/configuration.lua new file mode 100644 index 0000000..ef43670 --- /dev/null +++ b/mods/thirsty/configuration.lua @@ -0,0 +1,105 @@ +--[[ + +Configuration for Thirsty. + +See init.lua for license. + +]] + +--[[ + +Default values + +]] + +thirsty.config = { + + stash_filename = 'thirsty.dat', + + tick_time = 0.5, + + -- Tier 0 + thirst_per_second = 1.0 / 20.0, + damage_per_second = 1.0 / 10.0, -- when out of hydration + stand_still_for_drink = 1.0, + stand_still_for_afk = 120.0, -- 2 Minutes + + regen_from_node = { + -- value: hydration regen per second + ['default:water_source'] = 0.5, + ['default:water_flowing'] = 0.5, + ['default:river_water_source'] = 0.5, + ['default:river_water_flowing'] = 0.5, + }, + + -- which nodes can we drink from (given containers) + node_drinkable = { + ['default:water_source'] = true, + ['default:water_flowing'] = true, + ['default:river_water_source'] = true, + ['default:river_water_flowing'] = true, + ['thirsty:drinking_fountain'] = true, + }, + + drink_from_container = { + -- value: max hydration when drinking with item + ['thirsty:wooden_bowl'] = 25, + ['thirsty:steel_canteen'] = 25, + ['thirsty:bronze_canteen'] = 25, + }, + + container_capacity = { + -- value: hydro capacity in item + ['thirsty:steel_canteen'] = 40, + ['thirsty:bronze_canteen'] = 60, + }, + + drink_from_node = { + -- value: max hydration when drinking from node + ['thirsty:drinking_fountain'] = 30, + }, + + -- fountains are marked with 'f', water with 'w' + -- to determine the fountain level + fountain_type = { + ['thirsty:water_fountain'] = 'f', + ['thirsty:water_extender'] = 'f', + ['default:water_source'] = 'w', + ['default:water_flowing'] = 'w', + ['default:river_water_source'] = 'w', + ['default:river_water_flowing'] = 'w', + }, + regen_from_fountain = 0.5, -- compare regen_from_node + fountain_height = 4, + fountain_max_level = 20, + fountain_distance_per_level = 5, + + extraction_for_item = { + ['thirsty:extractor']= 0.6, + }, + injection_for_item = { + ['thirsty:injector'] = 0.5, + }, + + register_vessels = true, + register_bowl = true, + register_canteens = true, + register_drinking_fountain = true, + register_fountains = true, + register_amulets = true, + +} + +-- read more configuration from thirsty.conf + +local filename = minetest.get_modpath('thirsty') .. "/thirsty.conf" +local file, err = io.open(filename, 'r') +if file then + file:close() -- was just for checking existance + local confcode, err = loadfile(filename) + if confcode then + confcode() + else + minetest.log("error", "Could not load thirsty.conf: " .. err) + end +end diff --git a/mods/thirsty/depends.txt b/mods/thirsty/depends.txt new file mode 100644 index 0000000..d3d1e33 --- /dev/null +++ b/mods/thirsty/depends.txt @@ -0,0 +1,5 @@ +default +bucket? +hud? +hudbars? +vessels? diff --git a/mods/thirsty/description.txt b/mods/thirsty/description.txt new file mode 100644 index 0000000..97a7be3 --- /dev/null +++ b/mods/thirsty/description.txt @@ -0,0 +1,2 @@ +A mod that adds a "thirst" mechanic, similar to hunger. + diff --git a/mods/thirsty/functions.lua b/mods/thirsty/functions.lua new file mode 100644 index 0000000..f65306a --- /dev/null +++ b/mods/thirsty/functions.lua @@ -0,0 +1,455 @@ +--[[ + +Core functions for Thirsty. + +See init.lua for license. + +]] + +function thirsty.on_joinplayer(player) + local name = player:get_player_name() + -- default entry for new players + if not thirsty.players[name] then + local pos = player:getpos() + thirsty.players[name] = { + hydro = 20, + last_pos = math.floor(pos.x) .. ':' .. math.floor(pos.z), + time_in_pos = 0.0, + pending_dmg = 0.0, + thirst_factor = 1.0, + } + end + thirsty.hud_init(player) +end + +function thirsty.on_dieplayer(player) + local name = player:get_player_name() + local pl = thirsty.players[name] + -- reset after death + pl.hydro = 20 + pl.pending_dmg = 0.0 + pl.thirst_factor = 1.0 +end + +--[[ + +Getters, setters and such + +]] + +-- internal version, for speed +function thirsty._drink(pl, value, max) + -- test whether we're not *above* max; + -- this function should not remove any overhydration + if pl.hydro < max then + pl.hydro = math.min(pl.hydro + value, max) + --print("Drinking by "..value.." to "..pl.hydro) + return true + end + return false +end + +function thirsty.drink(player, value, max) + -- if max is not specified, assume 20 + if not max then + max = 20 + end + local name = player:get_player_name() + local pl = thirsty.players[name] + return thirsty._drink(pl, value, max) +end + +function thirsty.get_hydro(player) + local name = player:get_player_name() + local pl = thirsty.players[name] + return pl.hydro +end + +function thirsty.set_thirst_factor(player, factor) + local name = player:get_player_name() + local pl = thirsty.players[name] + pl.thirst_factor = factor +end + +function thirsty.get_thirst_factor(player) + local name = player:get_player_name() + local pl = thirsty.players[name] + return pl.thirst_factor +end + +--[[ + +Main Loop (Tier 0) + +]] + +function thirsty.main_loop(dtime) + -- get thirsty + thirsty.time_next_tick = thirsty.time_next_tick - dtime + while thirsty.time_next_tick < 0.0 do + -- time for thirst + thirsty.time_next_tick = thirsty.time_next_tick + thirsty.config.tick_time + for _,player in ipairs(minetest.get_connected_players()) do + + if player:get_hp() <= 0 then + -- dead players don't get thirsty, or full for that matter :-P + break + end + + local name = player:get_player_name() + local pos = player:getpos() + local pl = thirsty.players[name] + + -- how long have we been standing "here"? + -- (the node coordinates in X and Z should be enough) + local pos_hash = math.floor(pos.x) .. ':' .. math.floor(pos.z) + if pl.last_pos == pos_hash then + pl.time_in_pos = pl.time_in_pos + thirsty.config.tick_time + else + -- you moved! + pl.last_pos = pos_hash + pl.time_in_pos = 0.0 + end + local pl_standing = pl.time_in_pos > thirsty.config.stand_still_for_drink + local pl_afk = pl.time_in_pos > thirsty.config.stand_still_for_afk + --print("Standing: " .. (pl_standing and 'true' or 'false' ) .. ", AFK: " .. (pl_afk and 'true' or 'false')) + + pos.y = pos.y + 0.1 + local node = minetest.get_node(pos) + local drink_per_second = thirsty.config.regen_from_node[node.name] or 0 + + -- fountaining (uses pos, slight changes ok) + for k, fountain in pairs(thirsty.fountains) do + local dx = fountain.pos.x - pos.x + local dy = fountain.pos.y - pos.y + local dz = fountain.pos.z - pos.z + local dist2 = dx * dx + dy * dy + dz * dz + local fdist = fountain.level * thirsty.config.fountain_distance_per_level -- max 100 nodes radius + --print (string.format("Distance from %s (%d): %f out of %f", k, fountain.level, math.sqrt(dist2), fdist )) + if dist2 < fdist * fdist then + -- in range, drink as if standing (still) in water + drink_per_second = math.max(thirsty.config.regen_from_fountain or 0, drink_per_second) + pl_standing = true + break -- no need to check the other fountains + end + end + + -- amulets + -- TODO: I *guess* we need to optimize this, but I haven't + -- measured it yet. No premature optimizations! + local pl_inv = player:get_inventory() + local extractor_max = 0.0 + local injector_max = 0.0 + local container_not_full = nil + local container_not_empty = nil + local inv_main = player:get_inventory():get_list('main') + for i, itemstack in ipairs(inv_main) do + local name = itemstack:get_name() + local injector_this = thirsty.config.injection_for_item[name] + if injector_this and injector_this > injector_max then + injector_max = injector_this + end + local extractor_this = thirsty.config.extraction_for_item[name] + if extractor_this and extractor_this > extractor_max then + extractor_max = extractor_this + end + if thirsty.config.container_capacity[name] then + local wear = itemstack:get_wear() + -- can be both! + if wear == 0 or wear > 1 then + container_not_full = { i, itemstack } + end + if wear > 0 and wear < 65534 then + container_not_empty = { i, itemstack } + end + end + end + if extractor_max > 0.0 and container_not_full then + local i = container_not_full[1] + local itemstack = container_not_full[2] + local capacity = thirsty.config.container_capacity[itemstack:get_name()] + local wear = itemstack:get_wear() + if wear == 0 then wear = 65535.0 end + local drink = extractor_max * thirsty.config.tick_time + local drinkwear = drink / capacity * 65535.0 + wear = wear - drinkwear + if wear < 1 then wear = 1 end + itemstack:set_wear(wear) + player:get_inventory():set_stack("main", i, itemstack) + end + if injector_max > 0.0 and container_not_empty then + local i = container_not_empty[1] + local itemstack = container_not_empty[2] + local capacity = thirsty.config.container_capacity[itemstack:get_name()] + local wear = itemstack:get_wear() + if wear == 0 then wear = 65535.0 end + local drink = injector_max * thirsty.config.tick_time + local drink_missing = 20 - pl.hydro + drink = math.max(math.min(drink, drink_missing), 0) + local drinkwear = drink / capacity * 65535.0 + wear = wear + drinkwear + if wear > 65534 then wear = 65534 end + itemstack:set_wear(wear) + thirsty._drink(pl, drink, 20) + player:get_inventory():set_stack("main", i, itemstack) + end + + + if drink_per_second > 0 and pl_standing then + -- Drinking from the ground won't give you more than max + thirsty._drink(pl, drink_per_second * thirsty.config.tick_time, 20) + --print("Raising hydration by "..(drink_per_second*thirsty.config.tick_time).." to "..pl.hydro) + else + if not pl_afk then + -- only get thirsty if not AFK + local amount = thirsty.config.thirst_per_second * thirsty.config.tick_time * pl.thirst_factor + pl.hydro = pl.hydro - amount + if pl.hydro < 0 then pl.hydro = 0 end + --print("Lowering hydration by "..amount.." to "..pl.hydro) + end + end + + + -- should we only update the hud on an actual change? + thirsty.hud_update(player, pl.hydro) + + -- damage, if enabled + if minetest.setting_getbool("enable_damage") then + -- maybe not the best way to do this, but it does mean + -- we can do anything with one tick loop + if pl.hydro <= 0.0 and not pl_afk then + pl.pending_dmg = pl.pending_dmg + thirsty.config.damage_per_second * thirsty.config.tick_time + --print("Pending damage at " .. pl.pending_dmg) + if pl.pending_dmg > 1.0 then + local dmg = math.floor(pl.pending_dmg) + pl.pending_dmg = pl.pending_dmg - dmg + player:set_hp( player:get_hp() - dmg ) + end + else + -- forget any pending damage when not thirsty + pl.pending_dmg = 0.0 + end + end + end -- for players + + -- check fountains for expiration + for k, fountain in pairs(thirsty.fountains) do + fountain.time_until_check = fountain.time_until_check - thirsty.config.tick_time + if fountain.time_until_check <= 0 then + -- remove fountain, the abm will set it again + --print("Removing fountain at " .. k) + thirsty.fountains[k] = nil + end + end + + end +end + +--[[ + +Stash: persist the hydration values in a file in the world directory. + +If this is missing or corrupted, then no worries: nobody's thirsty ;-) + +]] + +function thirsty.read_stash() + local filename = minetest.get_worldpath() .. "/" .. thirsty.config.stash_filename + local file, err = io.open(filename, "r") + if not file then + -- no problem, it's just not there + -- TODO: or parse err? + return + end + thirsty.players = {} + for line in file:lines() do + if string.match(line, '^%-%-') then + -- comment, ignore + elseif string.match(line, '^P [%d.]+ [%d.]+ .+') then + -- player line + -- is matching again really the best solution? + local hydro, dmg, name = string.match(line, '^P ([%d.]+) ([%d.]+) (.+)') + thirsty.players[name] = { + hydro = tonumber(hydro), + last_pos = '0:0', -- not true, but no matter + time_in_pos = 0.0, + pending_dmg = tonumber(dmg), + thirst_factor = 1.0, + } + end + end + file:close() +end + +function thirsty.write_stash() + local filename = minetest.get_worldpath() .. "/" .. thirsty.config.stash_filename + local file, err = io.open(filename, "w") + if not file then + minetest.log("error", "Thirsty: could not write " .. thirsty.config.stash_filename .. ": " ..err) + return + end + file:write('-- Stash file for Minetest mod [thirsty] --\n') + -- write players: + -- P + file:write('-- Player format: "P "\n') + for name, data in pairs(thirsty.players) do + file:write("P " .. data.hydro .. " " .. data.pending_dmg .. " " .. name .. "\n") + end + file:close() +end + +--[[ + +General handler + +Most tools, nodes and craftitems use the same code, so here it is: + +]] + +function thirsty.drink_handler(player, itemstack, node) + local pl = thirsty.players[player:get_player_name()] + local old_hydro = pl.hydro + + -- selectors, always true, to make the following code easier + local item_name = itemstack and itemstack:get_name() or ':' + local node_name = node and node.name or ':' + + if thirsty.config.node_drinkable[node_name] then + -- we found something to drink! + local cont_level = thirsty.config.drink_from_container[item_name] or 0 + local node_level = thirsty.config.drink_from_node[node_name] or 0 + -- drink until level + local level = math.max(cont_level, node_level) + --print("Drinking to level " .. level) + if pl.hydro < level then + pl.hydro = level + end + + -- fill container, if applicable + if thirsty.config.container_capacity[item_name] then + --print("Filling a " .. item_name .. " to " .. thirsty.config.container_capacity[item_name]) + itemstack:set_wear(1) -- "looks full" + end + + elseif thirsty.config.container_capacity[item_name] then + -- drinking from a container + if itemstack:get_wear() ~= 0 then + local capacity = thirsty.config.container_capacity[item_name] + local hydro_missing = 20 - pl.hydro; + if hydro_missing > 0 then + local wear_missing = hydro_missing / capacity * 65535.0; + local wear = itemstack:get_wear() + local new_wear = math.ceil(math.max(wear + wear_missing, 1)) + if (new_wear > 65534) then + wear_missing = 65534 - wear + new_wear = 65534 + end + itemstack:set_wear(new_wear) + if wear_missing > 0 then -- rounding glitches? + thirsty._drink(pl, wear_missing * capacity / 65535.0, 20) + end + end + end + end + + -- update HUD if value changed + if pl.hydro ~= old_hydro then + thirsty.hud_update(player, pl.hydro) + end +end + +--[[ + +Adapters for drink_handler to on_use and on_rightclick slots. +These close over the next handler to call in a chain, if desired. + +]] + +function thirsty.on_use( old_on_use ) + return function(itemstack, player, pointed_thing) + local node = nil + if pointed_thing and pointed_thing.type == 'node' then + node = minetest.get_node(pointed_thing.under) + end + + thirsty.drink_handler(player, itemstack, node) + + -- call original on_use, if provided + if old_on_use ~= nil then + return old_on_use(itemstack, player, pointed_thing) + else + return itemstack + end + end +end + +function thirsty.on_rightclick( old_on_rightclick ) + return function(pos, node, player, itemstack, pointed_thing) + + thirsty.drink_handler(player, itemstack, node) + + -- call original on_rightclick, if provided + if old_on_rightclick ~= nil then + return old_on_rightclick(pos, node, player, itemstack, pointed_thing) + else + return itemstack + end + end +end + +--[[ + +Adapter to add "drink_handler" to any item (node, tool, craftitem). + +]] + +function thirsty.augment_item_for_drinking( itemname, level ) + local new_definition = {} + -- we need to be able to point at the water + new_definition.liquids_pointable = true + -- call closure generator with original on_use handler + new_definition.on_use = thirsty.on_use( + minetest.registered_items[itemname].on_use + ) + -- overwrite the node definition with almost the original + minetest.override_item(itemname, new_definition) + + -- add configuration settings + thirsty.config.drink_from_container[itemname] = level +end + +function thirsty.fountain_abm(pos, node) + local fountain_count = 0 + local water_count = 0 + local total_count = 0 + for y = 0, thirsty.config.fountain_height do + for x = -y, y do + for z = -y, y do + local n = minetest.get_node({ + x = pos.x + x, + y = pos.y - y + 1, -- start one *above* the fountain + z = pos.z + z + }) + if n then + --print(string.format("%s at %d:%d:%d", n.name, pos.x+x, pos.y-y+1, pos.z+z)) + total_count = total_count + 1 + local type = thirsty.config.fountain_type[n.name] or '' + if type == 'f' then + fountain_count = fountain_count + 1 + elseif type == 'w' then + water_count = water_count + 1 + end + end + end + end + end + local level = math.min(thirsty.config.fountain_max_level, math.min(fountain_count, water_count)) + --print(string.format("Fountain (%d): %d + %d / %d", level, fountain_count, water_count, total_count)) + thirsty.fountains[string.format("%d:%d:%d", pos.x, pos.y, pos.z)] = { + pos = { x=pos.x, y=pos.y, z=pos.z }, + level = level, + -- time until check is 20 seconds, or twice the average + -- time until the abm ticks again. Should be enough. + time_until_check = 20, + } +end diff --git a/mods/thirsty/hud.conf.no_hunger b/mods/thirsty/hud.conf.no_hunger new file mode 100644 index 0000000..df4b15d --- /dev/null +++ b/mods/thirsty/hud.conf.no_hunger @@ -0,0 +1,40 @@ +--[[ + +Better HUD config file, without Hunger mod. + +This file mirrors the default settings of the Better HUD mod, +except that it moves the "breath" bar upwards to make room +for the "thirst" bar. + +Use this config file as a starting point if you *don't* have the +Hunger mod enabled. + +For more information, see hud.conf.example in the mods/hud +directory. + +]] + +HUD_SB_SIZE = { x = 24, y = 24 } + +--[[ Layout: + + ARMOR | (AIR) + HEALTH | THIRST + +]] + +HUD_HEALTH_POS = { x = 0.5, y = 1 } +HUD_HEALTH_OFFSET = { x = -262, y = -87 } + +-- not used +HUD_HUNGER_POS = { x = 0.5, y = 1 } +HUD_HUNGER_OFFSET = { x = 15, y = -133 } + +HUD_AIR_POS = { x = 0.5, y = 1 } +HUD_AIR_OFFSET = { x = 15, y = -110 } + +HUD_ARMOR_POS = { x = 0.5, y = 1 } +HUD_ARMOR_OFFSET = { x = -262, y = -110 } + +HUD_THIRST_POS = { x = 0.5, y = 1 } +HUD_THIRST_OFFSET = { x = 15, y = -87 } diff --git a/mods/thirsty/hud.conf.with_hunger b/mods/thirsty/hud.conf.with_hunger new file mode 100644 index 0000000..6565c8d --- /dev/null +++ b/mods/thirsty/hud.conf.with_hunger @@ -0,0 +1,43 @@ +--[[ + +Better HUD config file, with Hunger mod. + +This file mirrors the default settings of the Better HUD mod, +except that it moves the "breath" bar upwards to make room +for the "thirst" bar. + +Use this config file as a starting point if you *do* have the +Hunger mod enabled. + +For more information, see hud.conf.example in the mods/hud +directory. + +]] + +HUD_SB_SIZE = { x = 24, y = 24 } + +--[[ Layout: + + (AIR) + ARMOR | THIRST + HEALTH | HUNGER + +]] + +HUD_HEALTH_POS = { x = 0.5, y = 1 } +HUD_HEALTH_OFFSET = { x = -262, y = -87 } + +-- At the time of writing, the Hunger mod contains code to swap +-- the positions of "hunger" and "air", so these positions are +-- "un-swapped"... +HUD_HUNGER_POS = { x = 0.5, y = 1 } +HUD_HUNGER_OFFSET = { x = 15, y = -133 } + +HUD_AIR_POS = { x = 0.5, y = 1 } +HUD_AIR_OFFSET = { x = 15, y = -87 } + +HUD_ARMOR_POS = { x = 0.5, y = 1 } +HUD_ARMOR_OFFSET = { x = -262, y = -110 } + +HUD_THIRST_POS = { x = 0.5, y = 1 } +HUD_THIRST_OFFSET = { x = 15, y = -110 } diff --git a/mods/thirsty/hud.lua b/mods/thirsty/hud.lua new file mode 100644 index 0000000..99580f5 --- /dev/null +++ b/mods/thirsty/hud.lua @@ -0,0 +1,87 @@ +--[[ + +HUD definitions for Thirsty + +Optionally from one of the supported mods + +Any hud needs to define the following functions: + +- thirsty.hud_init(player) + Initialize the HUD for a new player. + +- thirsty.hud_update(player, value) + Display the new value "value" for the given player. "value" is + a floating point number, not necessarily bounded. You can use the + "thirsty.hud_clamp(value)" function to get an integer between 0 + and 20. + +]] + +function thirsty.hud_clamp(value) + if value < 0 then + return 0 + elseif value > 20 then + return 20 + else + return math.ceil(value) + end +end + +if minetest.get_modpath("hudbars") then + hb.register_hudbar('thirst', 0xffffff, "Hydration", { + bar = 'thirsty_hudbars_bar.png', + icon = 'thirsty_cup_100_16.png' + }, 20, 20, false) + function thirsty.hud_init(player) + local name = player:get_player_name() + hb.init_hudbar(player, 'thirst', + thirsty.hud_clamp(thirsty.players[name].hydro), + 20, false) + end + function thirsty.hud_update(player, value) + local name = player:get_player_name() + hb.change_hudbar(player, 'thirst', thirsty.hud_clamp(value), 20) + end +elseif minetest.get_modpath("hud") then + -- default positions follow [hud] defaults + local position = HUD_THIRST_POS or { x=0.5, y=1 } + local offset = HUD_THIRST_OFFSET or { x=15, y=-133} -- above AIR + hud.register('thirst', { + hud_elem_type = "statbar", + position = position, + text = "thirsty_cup_100_24.png", + background = "thirsty_cup_0_24.png", + number = 20, + max = 20, + size = HUD_SD_SIZE, -- by default { x=24, y=24 }, + offset = offset, + }) + function thirsty.hud_init(player) + -- automatic by [hud] + end + function thirsty.hud_update(player, value) + hud.change_item(player, 'thirst', { + number = thirsty.hud_clamp(value) + }) + end +else + -- 'builtin' hud + function thirsty.hud_init(player) + -- above breath bar, for now + local name = player:get_player_name() + thirsty.players[name].hud_id = player:hud_add({ + hud_elem_type = "statbar", + position = { x=0.5, y=1 }, + text = "thirsty_cup_100_24.png", + number = thirsty.hud_clamp(thirsty.players[name].hydro), + direction = 0, + size = { x=24, y=24 }, + offset = { x=25, y=-(48+24+16+32)}, + }) + end + function thirsty.hud_update(player, value) + local name = player:get_player_name() + local hud_id = thirsty.players[name].hud_id + player:hud_change(hud_id, 'number', thirsty.hud_clamp(value)) + end +end diff --git a/mods/thirsty/init.lua b/mods/thirsty/init.lua new file mode 100644 index 0000000..4bcbd4b --- /dev/null +++ b/mods/thirsty/init.lua @@ -0,0 +1,93 @@ +--[[ + +Thirsty mod [thirsty] +========================== + +A mod that adds a "thirst" mechanic, similar to hunger. + +Copyright (C) 2015 Ben Deutsch + +License +------- + +This library is free software; you can redistribute it and/or +modify it under the terms of the GNU Lesser General Public +License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with this library; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 +USA + +Terminology: "Thirst" vs. "hydration" +------------------------------------- + +"Thirst" is the absence of "hydration" (a term suggested by +everamzah on the Minetest forums, thanks!). The overall mechanic +is still called "thirst", but the visible bar is that of +"hydration", filled with "hydro points". + +]] + +-- the main module variable +thirsty = { + + -- Configuration variables + config = { + -- see configuration.lua + }, + + -- the players' values + players = { + --[[ + name = { + hydro = 20, + last_pos = '-10:3', + time_in_pos = 0.0, + pending_dmg = 0.0, + thirst_factor = 1.0, + } + ]] + }, + + -- water fountains + fountains = { + --[[ + x:y:z = { + pos = { x=x, y=y, z=z }, + level = 4, + time_until_check = 20, + -- something about times + } + ]] + }, + + -- general settings + time_next_tick = 0.0, +} + +dofile(minetest.get_modpath('thirsty')..'/configuration.lua') + +thirsty.time_next_tick = thirsty.config.tick_time + +dofile(minetest.get_modpath('thirsty')..'/hud.lua') +dofile(minetest.get_modpath('thirsty')..'/functions.lua') + +minetest.register_on_joinplayer(thirsty.on_joinplayer) +minetest.register_on_dieplayer(thirsty.on_dieplayer) +minetest.register_globalstep(thirsty.main_loop) + +dofile(minetest.get_modpath('thirsty')..'/components.lua') + +-- read on startup +thirsty.read_stash() +-- write on shutdown +minetest.register_on_shutdown(thirsty.write_stash) + + diff --git a/mods/thirsty/textures/src/bowl.svg b/mods/thirsty/textures/src/bowl.svg new file mode 100644 index 0000000..1085aa3 --- /dev/null +++ b/mods/thirsty/textures/src/bowl.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/bronze_canteen.svg b/mods/thirsty/textures/src/bronze_canteen.svg new file mode 100644 index 0000000..3a33e99 --- /dev/null +++ b/mods/thirsty/textures/src/bronze_canteen.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/cup_0.svg b/mods/thirsty/textures/src/cup_0.svg new file mode 100644 index 0000000..037ec10 --- /dev/null +++ b/mods/thirsty/textures/src/cup_0.svg @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/cup_100.svg b/mods/thirsty/textures/src/cup_100.svg new file mode 100644 index 0000000..7a081b2 --- /dev/null +++ b/mods/thirsty/textures/src/cup_100.svg @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/cup_50.svg b/mods/thirsty/textures/src/cup_50.svg new file mode 100644 index 0000000..fc380fe --- /dev/null +++ b/mods/thirsty/textures/src/cup_50.svg @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/drinkfount_bottom.svg b/mods/thirsty/textures/src/drinkfount_bottom.svg new file mode 100644 index 0000000..189a693 --- /dev/null +++ b/mods/thirsty/textures/src/drinkfount_bottom.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/mods/thirsty/textures/src/drinkfount_side.svg b/mods/thirsty/textures/src/drinkfount_side.svg new file mode 100644 index 0000000..d0b3f4c --- /dev/null +++ b/mods/thirsty/textures/src/drinkfount_side.svg @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/drinkfount_top.svg b/mods/thirsty/textures/src/drinkfount_top.svg new file mode 100644 index 0000000..a9b1993 --- /dev/null +++ b/mods/thirsty/textures/src/drinkfount_top.svg @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/extractor.svg b/mods/thirsty/textures/src/extractor.svg new file mode 100644 index 0000000..f4c1112 --- /dev/null +++ b/mods/thirsty/textures/src/extractor.svg @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/injector.svg b/mods/thirsty/textures/src/injector.svg new file mode 100644 index 0000000..0969a78 --- /dev/null +++ b/mods/thirsty/textures/src/injector.svg @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/steel_canteen.svg b/mods/thirsty/textures/src/steel_canteen.svg new file mode 100644 index 0000000..89f2f01 --- /dev/null +++ b/mods/thirsty/textures/src/steel_canteen.svg @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/waterextender_side.svg b/mods/thirsty/textures/src/waterextender_side.svg new file mode 100644 index 0000000..fdf6326 --- /dev/null +++ b/mods/thirsty/textures/src/waterextender_side.svg @@ -0,0 +1,244 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/mods/thirsty/textures/src/waterextender_top.svg b/mods/thirsty/textures/src/waterextender_top.svg new file mode 100644 index 0000000..5f80814 --- /dev/null +++ b/mods/thirsty/textures/src/waterextender_top.svg @@ -0,0 +1,309 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/waterfountain_side.svg b/mods/thirsty/textures/src/waterfountain_side.svg new file mode 100644 index 0000000..410234e --- /dev/null +++ b/mods/thirsty/textures/src/waterfountain_side.svg @@ -0,0 +1,268 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/src/waterfountain_top.svg b/mods/thirsty/textures/src/waterfountain_top.svg new file mode 100644 index 0000000..4db3923 --- /dev/null +++ b/mods/thirsty/textures/src/waterfountain_top.svg @@ -0,0 +1,1051 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mods/thirsty/textures/thirsty_bowl_16.png b/mods/thirsty/textures/thirsty_bowl_16.png new file mode 100644 index 0000000..c7b8df6 Binary files /dev/null and b/mods/thirsty/textures/thirsty_bowl_16.png differ diff --git a/mods/thirsty/textures/thirsty_bowl_32.png b/mods/thirsty/textures/thirsty_bowl_32.png new file mode 100644 index 0000000..147fa86 Binary files /dev/null and b/mods/thirsty/textures/thirsty_bowl_32.png differ diff --git a/mods/thirsty/textures/thirsty_bowl_64.png b/mods/thirsty/textures/thirsty_bowl_64.png new file mode 100644 index 0000000..c8de654 Binary files /dev/null and b/mods/thirsty/textures/thirsty_bowl_64.png differ diff --git a/mods/thirsty/textures/thirsty_bronze_canteen_16.png b/mods/thirsty/textures/thirsty_bronze_canteen_16.png new file mode 100644 index 0000000..6c1555c Binary files /dev/null and b/mods/thirsty/textures/thirsty_bronze_canteen_16.png differ diff --git a/mods/thirsty/textures/thirsty_bronze_canteen_32.png b/mods/thirsty/textures/thirsty_bronze_canteen_32.png new file mode 100644 index 0000000..1ec8c9f Binary files /dev/null and b/mods/thirsty/textures/thirsty_bronze_canteen_32.png differ diff --git a/mods/thirsty/textures/thirsty_cup_0_16.png b/mods/thirsty/textures/thirsty_cup_0_16.png new file mode 100644 index 0000000..9c080ba Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_0_16.png differ diff --git a/mods/thirsty/textures/thirsty_cup_0_24.png b/mods/thirsty/textures/thirsty_cup_0_24.png new file mode 100644 index 0000000..aea96a3 Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_0_24.png differ diff --git a/mods/thirsty/textures/thirsty_cup_0_32.png b/mods/thirsty/textures/thirsty_cup_0_32.png new file mode 100644 index 0000000..105a2ef Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_0_32.png differ diff --git a/mods/thirsty/textures/thirsty_cup_100.png b/mods/thirsty/textures/thirsty_cup_100.png new file mode 100644 index 0000000..a2b9e1c Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_100.png differ diff --git a/mods/thirsty/textures/thirsty_cup_100_16.png b/mods/thirsty/textures/thirsty_cup_100_16.png new file mode 100644 index 0000000..a2b9e1c Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_100_16.png differ diff --git a/mods/thirsty/textures/thirsty_cup_100_24.png b/mods/thirsty/textures/thirsty_cup_100_24.png new file mode 100644 index 0000000..ee283b8 Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_100_24.png differ diff --git a/mods/thirsty/textures/thirsty_cup_100_32.png b/mods/thirsty/textures/thirsty_cup_100_32.png new file mode 100644 index 0000000..effe6fd Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_100_32.png differ diff --git a/mods/thirsty/textures/thirsty_cup_50_16.png b/mods/thirsty/textures/thirsty_cup_50_16.png new file mode 100644 index 0000000..64f7581 Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_50_16.png differ diff --git a/mods/thirsty/textures/thirsty_cup_50_24.png b/mods/thirsty/textures/thirsty_cup_50_24.png new file mode 100644 index 0000000..c5c7c69 Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_50_24.png differ diff --git a/mods/thirsty/textures/thirsty_cup_50_32.png b/mods/thirsty/textures/thirsty_cup_50_32.png new file mode 100644 index 0000000..ac33d2c Binary files /dev/null and b/mods/thirsty/textures/thirsty_cup_50_32.png differ diff --git a/mods/thirsty/textures/thirsty_drinkfount_bottom.png b/mods/thirsty/textures/thirsty_drinkfount_bottom.png new file mode 100644 index 0000000..1dcaf56 Binary files /dev/null and b/mods/thirsty/textures/thirsty_drinkfount_bottom.png differ diff --git a/mods/thirsty/textures/thirsty_drinkfount_side.png b/mods/thirsty/textures/thirsty_drinkfount_side.png new file mode 100644 index 0000000..5b568e3 Binary files /dev/null and b/mods/thirsty/textures/thirsty_drinkfount_side.png differ diff --git a/mods/thirsty/textures/thirsty_drinkfount_top.png b/mods/thirsty/textures/thirsty_drinkfount_top.png new file mode 100644 index 0000000..2440cbd Binary files /dev/null and b/mods/thirsty/textures/thirsty_drinkfount_top.png differ diff --git a/mods/thirsty/textures/thirsty_extractor.png b/mods/thirsty/textures/thirsty_extractor.png new file mode 100644 index 0000000..1c32fee Binary files /dev/null and b/mods/thirsty/textures/thirsty_extractor.png differ diff --git a/mods/thirsty/textures/thirsty_hudbars_bar.png b/mods/thirsty/textures/thirsty_hudbars_bar.png new file mode 100644 index 0000000..7e57b4a Binary files /dev/null and b/mods/thirsty/textures/thirsty_hudbars_bar.png differ diff --git a/mods/thirsty/textures/thirsty_injector.png b/mods/thirsty/textures/thirsty_injector.png new file mode 100644 index 0000000..d75621e Binary files /dev/null and b/mods/thirsty/textures/thirsty_injector.png differ diff --git a/mods/thirsty/textures/thirsty_steel_canteen_16.png b/mods/thirsty/textures/thirsty_steel_canteen_16.png new file mode 100644 index 0000000..abcc2a7 Binary files /dev/null and b/mods/thirsty/textures/thirsty_steel_canteen_16.png differ diff --git a/mods/thirsty/textures/thirsty_steel_canteen_32.png b/mods/thirsty/textures/thirsty_steel_canteen_32.png new file mode 100644 index 0000000..024daf0 Binary files /dev/null and b/mods/thirsty/textures/thirsty_steel_canteen_32.png differ diff --git a/mods/thirsty/textures/thirsty_waterextender_side.png b/mods/thirsty/textures/thirsty_waterextender_side.png new file mode 100644 index 0000000..ee8ef5a Binary files /dev/null and b/mods/thirsty/textures/thirsty_waterextender_side.png differ diff --git a/mods/thirsty/textures/thirsty_waterextender_top.png b/mods/thirsty/textures/thirsty_waterextender_top.png new file mode 100644 index 0000000..a68aa44 Binary files /dev/null and b/mods/thirsty/textures/thirsty_waterextender_top.png differ diff --git a/mods/thirsty/textures/thirsty_waterfountain_side.png b/mods/thirsty/textures/thirsty_waterfountain_side.png new file mode 100644 index 0000000..310966a Binary files /dev/null and b/mods/thirsty/textures/thirsty_waterfountain_side.png differ diff --git a/mods/thirsty/textures/thirsty_waterfountain_top.png b/mods/thirsty/textures/thirsty_waterfountain_top.png new file mode 100644 index 0000000..b4f4529 Binary files /dev/null and b/mods/thirsty/textures/thirsty_waterfountain_top.png differ diff --git a/mods/thirsty/thirsty.conf.example b/mods/thirsty/thirsty.conf.example new file mode 100644 index 0000000..c475bb9 --- /dev/null +++ b/mods/thirsty/thirsty.conf.example @@ -0,0 +1,109 @@ +--[[ + +Configuration file for Thirsty. + +Copy this file to "thirsty.conf" and place it in the mod's directory. +Modify to suit your needs; it will not get overwritten if you update +Thirsty. + +The following values are the default values; you can safely remove +or comment out any line you're not interested in. Commented lines +start with '--' + +]] + +-- Main loop tick time, in seconds +-- Increasing this value will make Thirsty less accurate, but will +-- generally behave the same. +thirsty.config.tick_time = 0.5 + +-- Thirst per second (full hydration is 20 hydro points) +thirsty.config.thirst_per_second = 1.0 / 20.0 +-- Damage per second if completely thirsty / out of hydration +thirsty.config.damage_per_second = 1.0 / 10.0 +-- How long in seconds you have to remain still to drink from standing +-- in water +thirsty.config.stand_still_for_drink = 1.0 +-- How long in seconds of not moving before a player is deemed AFK +-- (away from keyboard), such players no longer get thirsty or damaged +thirsty.config.stand_still_for_afk = 120.0 -- 2 Minutes + +-- regen_from_node is a table defining, for each node type, the +-- amount of hydro per second a player drinks by standing in it. +-- Assign 'nil' to stop a player from drinking from this node type. +thirsty.config.regen_from_node['default:water_source'] = 0.5 +thirsty.config.regen_from_node['default:water_flowing'] = 0.5 +thirsty.config.regen_from_node['default:river_water_source'] = 0.5 +thirsty.config.regen_from_node['default:river_water_flowing'] = 0.5 + +-- node_drinkable: which nodes can we drink from, given a +-- container (a cup, a bowl etc.) +thirsty.config.node_drinkable['default:water_source'] = true +thirsty.config.node_drinkable['default:water_flowing'] = true +thirsty.config.node_drinkable['default:river_water_source'] = true +thirsty.config.node_drinkable['default:river_water_flowing'] = true +thirsty.config.node_drinkable['thirsty:drinking_fountain'] = true + +-- drink_from_container: the hydration you drink to when +-- using each container. Remember that "full hydration" is +-- 20 points; these should be more to reward using them. +thirsty.config.drink_from_container['thirsty:wooden_bowl'] = 25 +thirsty.config.drink_from_container['thirsty:steel_canteen'] = 25 +thirsty.config.drink_from_container['thirsty:bronze_canteen'] = 25 + +-- container_capacity: how much hydration each container (canteens) +-- can hold. Remember that "full hydration" is 20 points +thirsty.config.container_capacity['thirsty:steel_canteen'] = 40 +thirsty.config.container_capacity['thirsty:bronze_canteen'] = 60 + +-- drink_from_node: if you use one of these nodes (i.e. fountains), +-- even without cups or bowls, how full will you get? +thirsty.config.drink_from_node['thirsty:drinking_fountain'] = 30 + +-- fountain_type: when scanning the surroundings of fountains, +-- which nodes are "fountains" and which are "water"? You need +-- at least one "fountain" and one "water" per fountain level. +thirsty.config.fountain_type['thirsty:water_fountain'] = 'f' +thirsty.config.fountain_type['thirsty:water_extender'] = 'f' +thirsty.config.fountain_type['default:water_source'] = 'w' +thirsty.config.fountain_type['default:water_flowing'] = 'w' +thirsty.config.fountain_type['default:river_water_source'] = 'w' +thirsty.config.fountain_type['default:river_water_flowing'] = 'w' + +-- Regeneration from being within a fountain's radius; see also +-- regen_from_node (it's as if you're standing in water) +thirsty.config.regen_from_fountain = 0.5 +-- How far should the fountain scanning pyramid go? +thirsty.config.fountain_height = 4 +-- The max level of a fountain +thirsty.config.fountain_max_level = 20 +-- How many nodes away can you still benefit from a fountain, +-- per fountain level +thirsty.config.fountain_distance_per_level = 5 + +-- How much hydration does a given item *extract* (pull out of the air) +thirsty.config.extraction_for_item['thirsty:extractor'] = 0.6 +-- How much hydration does a given item *inject* (fill you up with) +thirsty.config.injection_for_item['thirsty:injector'] = 0.5 + +-- Registration of individual components +-- These flags enable or disable the predefined components included +-- in this mod. They do *not* enable or disable the functionality. + +-- Should we augment the vessels from the "vessels" mod? +thirsty.config.register_vessels = true + +-- Add the wooden bowl and crafting recipe? +thirsty.config.register_bowl = true + +-- Add the canteens and crafting recipes? +thirsty.config.register_canteens = true + +-- Add the drinking fountain and crafting recipes? +thirsty.config.register_drinking_fountain = true + +-- Add the fountain and extenders and crafting recipes? +thirsty.config.register_fountains = true + +-- Add the amulets (extractor / injector) and crafting recipes? +thirsty.config.register_amulets = true diff --git a/mods/trail/README.txt b/mods/trail/README.txt new file mode 100644 index 0000000..0f5b361 --- /dev/null +++ b/mods/trail/README.txt @@ -0,0 +1,45 @@ +This is a fork of desire path mod by Casimir (https://forum.minetest.net/viewtopic.php?id=3390). +Trail mod 0.2.1 by paramat. +For latest stable Minetest and back to 0.4.4. +Depends default. +Licenses: Code CC BY-SA. Textures CC BY-SA. Textures are edited default Minetest textures. +The water sounds are from the ambience mod by Neuromancer (https://forum.minetest.net/viewtopic.php?id=2807), +and are by Robinhood76 (http://www.freesound.org/people/Robinhood76/sounds/79657/) license CC BY-NC. + +Version 0.1.0 +------------- +Creates a trail of footprints in grass, dirt, sand, desert sand, gravel and the snow and snow block of snow biomes mod. +Repeated walking of grass will wear it to dirt. +Temporary trail of bubbles on water surface with a bubbly swimming / underwater sound. +Trail creation can be disabled (while retaining footprint nodes) by editing parameter: FOO = false. +Lightweight mod that runs the footprint function on average every 1 in 2 globalsteps, this is still enough to detect almost every node walked. +Additionally parameter FOOCHA can be reduced for less per-node chance of a footprint, this works by randomly skipping the processing of certain players, +therefore making the mod even more lightweight, useful for multiplayer situations. +Pre 0.4.7 sand and desert sand footprint textures are also supplied in the texture folder but renamed. + +Version 0.1.1 +------------- +Improved textures. +Parameter FUNCHA to optimise per globalstep chance of running function, currently 0.3 seems optimum. +Added license.txt. +Abm to erode footprints back to default nodes. Walked dirt heals to grass. +Remove footprints in gravel, now 2 dirts, 2 sands, 2 snows. + +Version 0.1.2 +------------- +Water sounds played positionally not globally duh. +Water sounds are now mono, edited, improved and correct format (ogg mono 44.1khz 96kbps). + +Version 0.2.0 +------------- +Repeated walking of grass will now wear it to a path of compacted dirt (trail:trail). +Trail nodes regrow to default grass at a much slower rate than default:dirt, so creating long lived paths through normal biomes. +Repeated walking of snow:snow or snow:snow_block will compact it to snow:ice, creating permanent ice paths through the snow biomes of snow mod. +The nodes farming:wheat_5 to wheat_8 is now flattened to a 'crop circle' trail:flatwheat 1/8th height nodebox with random lay direction (to make messy crop circles). +To create a path of trail nodes quickly increase parameter TRACHA to 0.5+ and retrace your footprints. +The first pass over grass will leave medium-life footprints only, the second pass has a chance of wearing it to trail:trail nodes, +this applies to snow and ice paths also. + +Version 0.2.1 +------------- +Compatibility with farming mod bugfix: walked grass and walked dirt are now in the soil group to enable hoeing. \ No newline at end of file diff --git a/mods/trail/depends.txt b/mods/trail/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/mods/trail/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/mods/trail/init.lua b/mods/trail/init.lua new file mode 100644 index 0000000..3731b9a --- /dev/null +++ b/mods/trail/init.lua @@ -0,0 +1,302 @@ +-- This is a fork of desire path mod by Casimir (https://forum.minetest.net/viewtopic.php?id=3390). +-- Trail mod 0.2.1 by paramat. +-- For latest stable Minetest and back to 0.4.4. +-- Depends default. +-- Licenses: Code CC BY-SA. Textures CC BY-SA. Some textures are edited Minetest default textures. +-- The water sounds are from the ambience mod by Neuromancer (https://forum.minetest.net/viewtopic.php?id=2807), +-- and are by Robinhood76 (http://www.freesound.org/people/Robinhood76/sounds/79657/) license CC BY-NC. + +-- Some small updates and changes by Nathan Salapat July 2015. +-- Parameters + +local FOO = true -- (true/false) Enable footprints. +local FUNCHA = 0.3 -- 0.3 -- Per globalstep chance of running function. +local FOOCHA = .5 -- 1 -- Per player per node chance of footprint. +local TRACHA = 0.091 -- 0.091 -- Chance walked grass is worn and compacted to trail:trail. +local ICECHA = 0.091 -- 0.091 -- Chance walked snow is compacted to snow:ice. + +local EROSION = true -- Enable footprint erosion. +local EROINT = 30 -- 71 -- Erosion interval. +local EROCHA = 30 -- 121 -- Erosion 1/x chance. + +local REGROW = true -- Enable trail:trail regrowing to default:dirt_with_grass. +local REGINT = 60 -- 73 -- Regrow interval. +local REGCHA = 100 -- 1331 -- Regrow 1/x chance. + +local dirt_table = {-- original, walked on +{'default:dirt_with_grass', 'woodsoils:grass_with_leaves_1'}, +{'woodsoils:grass_with_leaves_1', 'woodsoils:grass_with_leaves_2'}, +{'woodsoils:grass_with_leaves_2', 'woodsoils:dirt_with_leaves_1'}, +{'woodsoils:dirt_with_leaves_1', 'default:dirt'}, +{'default:dirt', 'trail:dirt_walked'}, +{'trail:dirt_walked', 'trail:trail'}, +{'default:sand', 'trail:sand_walked'}, +{'default:desert_sand', 'trail:desert_sand_walked'} +} + +local grasses = {-- original, walked on +{'default:junglegrass', 'default:grass_5'}, +{'default:grass_5', 'default:grass_4'}, +{'default:grass_4', 'default:grass_3'}, +{'default:grass_3', 'default:grass_2'}, +{'default:grass_2', 'default:grass_1'}, +{'default:grass_1', 'air'} +} + +-- Stuff + +trail = {} + +-- PLayer positions + +local player_pos = {} +local player_pos_previous = {} +minetest.register_on_joinplayer(function(player) + player_pos_previous[player:get_player_name()] = {x=0,y=0,z=0} +end) +minetest.register_on_leaveplayer(function(player) + player_pos_previous[player:get_player_name()] = nil +end) + +-- Nodes + +minetest.register_node("trail:trail", { + tiles = {"trail_trailtop.png", "trail_trailside.png"}, + groups = {crumbly=2, soil=1, not_in_creative_inventory=1}, + drop = "default:dirt", + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("trail:dirt_walked", { + tiles = {"trail_dirt_footprint.png", "default_dirt.png"}, + groups = {crumbly=3, soil=1, not_in_creative_inventory=1}, + drop = "default:dirt", + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("trail:sand_walked", { + tiles = {"trail_sand_footprint.png", "default_sand.png"}, + groups = {crumbly=3, falling_node=1, not_in_creative_inventory=1}, + drop = "default:sand", + sounds = default.node_sound_sand_defaults(), +}) + +minetest.register_node("trail:desert_sand_walked", { + tiles = {"trail_desert_sand_footprint.png", "default_desert_sand.png"}, + groups = {sand=1, crumbly=3, falling_node=1, not_in_creative_inventory=1}, + drop = "default:desert_sand", + sounds = default.node_sound_sand_defaults(), +}) + +minetest.register_node("trail:water_source_swam", { + drawtype = "liquid", + tiles = { + {name="trail_water_source_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=2.0}} + }, + alpha = WATER_ALPHA, + paramtype = "light", + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + liquidtype = "source", + liquid_alternative_flowing = "default:water_flowing", + liquid_alternative_source = "default:water_source", + liquid_viscosity = WATER_VISC, + liquid_renewable = false, + post_effect_color = {a=64, r=100, g=100, b=200}, + groups = {water=3, liquid=3, puts_out_fire=1, not_in_creative_inventory=1}, + on_construct = function(pos) + if math.random(1, 2) == 1 then + minetest.sound_play("trail_water_bubbles", {pos = pos, gain = 0.2}) + end + end, +}) + +minetest.register_node("trail:snow_walked", { + tiles = {"trail_snow_footprint.png", "snow_snow.png"}, + drawtype = "nodebox", + sunlight_propagates = true, + paramtype = "light", + param2 = nil, + groups = {crumbly=3, melts=3, soil=1, not_in_creative_inventory=1}, + buildable_to = true, + drop = "snow:snowball", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.35, 0.5} + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.35, 0.5} + }, + }, + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_gravel_footstep", gain=0.3}, + }), + after_destruct = function(pos, node, digger) + if node.param2 == 1 then + local nodename = minetest.env:get_node(pos).name + if nodename == "air" or nodename == "default:water_flowing" or nodename == "default:water_source" then + minetest.env:add_node(pos,{name="snow:moss",param2=1}) + end + end + pos.y = pos.y - 1 + if minetest.env:get_node(pos).name == "snow:dirt_with_snow" then + minetest.env:add_node(pos,{name="default:dirt_with_grass"}) + end + end, + on_construct = function(pos, newnode) + pos.y = pos.y - 1 + local nodename = minetest.env:get_node(pos).name + if nodename == "default:dirt_with_grass" or nodename == "trail:dirt_with_grass_walked" + or nodename == "default:dirt" or nodename == "trail:dirt_walked" then + minetest.env:add_node(pos,{name="snow:dirt_with_snow"}) + elseif nodename == "air" then + pos.y = pos.y + 1 + minetest.env:remove_node(pos) + end + end, +}) + +minetest.register_node("trail:snow_block_walked", { + tiles = {"trail_snow_footprint.png", "snow_snow.png"}, + groups = {crumbly=3, melts=2, falling_node=1, not_in_creative_inventory=1}, + drop = "snow:snow_block", + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_gravel_footstep", gain=0.3}, + }), +}) + +minetest.register_node("trail:wheat_walked", { + description = "Flattened Wheat", + tiles = {"trail_flat_wheat.png"}, + drawtype = "nodebox", + sunlight_propagates = true, + paramtype = "light", + paramtype2 = "facedir", + groups = {snappy=3,flammable=2,plant=1,attached_node=1}, + buildable_to = true, + drop = "", + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5} + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.375, 0.5} + }, + }, + sounds = default.node_sound_leaves_defaults(), +}) + +-- Globalstep function + +if FOO then + minetest.register_globalstep(function(dtime) + if math.random() < FUNCHA then + local env = minetest.env + for _,player in ipairs(minetest.get_connected_players()) do + if math.random() <= FOOCHA then + local pos = player:getpos() + player_pos[player:get_player_name()] = {x=math.floor(pos.x+0.5),y=math.floor(pos.y+0.2),z=math.floor(pos.z+0.5)} + + local p_ground = {x=math.floor(pos.x+0.5),y=math.floor(pos.y+0.4),z=math.floor(pos.z+0.5)} + local n_ground = env:get_node(p_ground).name + local a_ground = {x=pos.x, y=pos.y, z=pos.z} + local a_ground_name = env:get_node(a_ground).name + local p_groundpl = {x=math.floor(pos.x+0.5),y=math.floor(pos.y-0.5),z=math.floor(pos.z+0.5)} + local p_snow = {x=math.floor(pos.x+0.5),y=math.floor(pos.y+1.2),z=math.floor(pos.z+0.5)} + local n_snow = env:get_node(p_snow).name + local p_snowpl = {x=math.floor(pos.x+0.5),y=math.floor(pos.y+0.5),z=math.floor(pos.z+0.5)} + local n_snowpl = env:get_node(p_snowpl).name + + if player_pos_previous[player:get_player_name()] == nil then break end + if player_pos[player:get_player_name()].x ~= player_pos_previous[player:get_player_name()].x + or player_pos[player:get_player_name()].y < player_pos_previous[player:get_player_name()].y + or player_pos[player:get_player_name()].z ~= player_pos_previous[player:get_player_name()].z then + + if a_ground_name == 'air' then + + for i in ipairs (dirt_table) do + local original = dirt_table[i][1] + local replacement = dirt_table[i][2] + + if n_ground == original then + env:add_node(p_groundpl,{name=replacement}) + end + end + end + + if a_ground_name ~= 'air' then + + for i in ipairs (grasses) do + local original1 = grasses[i][1] + local replacement1 = grasses[i][2] + + if a_ground_name == original1 then + env:add_node(a_ground,{name=replacement1}) + end + end + end + + player_pos_previous[player:get_player_name()] = { + x=player_pos[player:get_player_name()].x, + y=player_pos[player:get_player_name()].y, + z=player_pos[player:get_player_name()].z + } + end + end + end + end + end + ) +end +-- ABM + +if EROSION then + minetest.register_abm({ + nodenames = { + 'woodsoils:grass_with_leaves_1', + 'woodsoils:grass_with_leaves_2', + 'woodsoils:dirt_with_leaves_1', + 'default:dirt', + 'trail:dirt_walked', + 'trail:sand_walked', + 'trail:desert_sand_walked', + }, + interval = EROINT, + chance = EROCHA, + action = function(pos, node, active_object_count, active_object_count_wider) + local env = minetest.env + local nodename = node.name + for i in ipairs (dirt_table) do + local original = dirt_table[i][2] + local replacement = dirt_table[i][1] + if nodename == original then + env:add_node(pos,{name=replacement}) + end + end + end + }) +end + +if REGROW then + minetest.register_abm({ + nodenames = { + "trail:trail", + }, + interval = REGINT, + chance = REGCHA, + action = function(pos, node, active_object_count, active_object_count_wider) + local env = minetest.env + env:add_node(pos,{name="default:dirt_with_grass"}) + end + }) +end diff --git a/mods/trail/license.txt b/mods/trail/license.txt new file mode 100644 index 0000000..1c016ab --- /dev/null +++ b/mods/trail/license.txt @@ -0,0 +1,27 @@ +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) + +This is a human-readable summary of the Legal Code (the full license). +Disclaimer +This license is acceptable for Free Cultural Works. +You are free: + + to Share — to copy, distribute and transmit the work + to Remix — to adapt the work + to make commercial use of the work + +Under the following conditions: + + Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work). + + Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one. + +With the understanding that: + + Waiver — Any of the above conditions can be waived if you get permission from the copyright holder. + Public Domain — Where the work or any of its elements is in the public domain under applicable law, that status is in no way affected by the license. + Other Rights — In no way are any of the following rights affected by the license: + Your fair dealing or fair use rights, or other applicable copyright exceptions and limitations; + The author's moral rights; + Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights. + Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page. + diff --git a/mods/trail/sounds/trail_water_bubbles.1.ogg b/mods/trail/sounds/trail_water_bubbles.1.ogg new file mode 100644 index 0000000..4e09e31 Binary files /dev/null and b/mods/trail/sounds/trail_water_bubbles.1.ogg differ diff --git a/mods/trail/sounds/trail_water_bubbles.2.ogg b/mods/trail/sounds/trail_water_bubbles.2.ogg new file mode 100644 index 0000000..91c79d4 Binary files /dev/null and b/mods/trail/sounds/trail_water_bubbles.2.ogg differ diff --git a/mods/trail/sounds/trail_water_bubbles.3.ogg b/mods/trail/sounds/trail_water_bubbles.3.ogg new file mode 100644 index 0000000..af05bdc Binary files /dev/null and b/mods/trail/sounds/trail_water_bubbles.3.ogg differ diff --git a/mods/trail/sounds/trail_water_bubbles.4.ogg b/mods/trail/sounds/trail_water_bubbles.4.ogg new file mode 100644 index 0000000..33e9bc2 Binary files /dev/null and b/mods/trail/sounds/trail_water_bubbles.4.ogg differ diff --git a/mods/trail/textures/trail_desert_sand_footprint.png b/mods/trail/textures/trail_desert_sand_footprint.png new file mode 100644 index 0000000..4245b8d Binary files /dev/null and b/mods/trail/textures/trail_desert_sand_footprint.png differ diff --git a/mods/trail/textures/trail_dirt_footprint.png b/mods/trail/textures/trail_dirt_footprint.png new file mode 100644 index 0000000..fd138fa Binary files /dev/null and b/mods/trail/textures/trail_dirt_footprint.png differ diff --git a/mods/trail/textures/trail_flat_wheat.png b/mods/trail/textures/trail_flat_wheat.png new file mode 100644 index 0000000..24a87c2 Binary files /dev/null and b/mods/trail/textures/trail_flat_wheat.png differ diff --git a/mods/trail/textures/trail_sand_footprint.png b/mods/trail/textures/trail_sand_footprint.png new file mode 100644 index 0000000..d157541 Binary files /dev/null and b/mods/trail/textures/trail_sand_footprint.png differ diff --git a/mods/trail/textures/trail_snow_footprint.png b/mods/trail/textures/trail_snow_footprint.png new file mode 100644 index 0000000..a724dfd Binary files /dev/null and b/mods/trail/textures/trail_snow_footprint.png differ diff --git a/mods/trail/textures/trail_trailside.png b/mods/trail/textures/trail_trailside.png new file mode 100644 index 0000000..30ae3fe Binary files /dev/null and b/mods/trail/textures/trail_trailside.png differ diff --git a/mods/trail/textures/trail_trailtop.png b/mods/trail/textures/trail_trailtop.png new file mode 100644 index 0000000..dda9774 Binary files /dev/null and b/mods/trail/textures/trail_trailtop.png differ diff --git a/mods/trail/textures/trail_water_source_animated.png b/mods/trail/textures/trail_water_source_animated.png new file mode 100644 index 0000000..3d5c97b Binary files /dev/null and b/mods/trail/textures/trail_water_source_animated.png differ diff --git a/mods/tulips/depends.txt b/mods/tulips/depends.txt new file mode 100644 index 0000000..ac534af --- /dev/null +++ b/mods/tulips/depends.txt @@ -0,0 +1,3 @@ +farming_plus +plants_lib +dye diff --git a/mods/tulips/init.lua b/mods/tulips/init.lua new file mode 100644 index 0000000..fc50fb1 --- /dev/null +++ b/mods/tulips/init.lua @@ -0,0 +1,152 @@ +--make variables local +local HUES = { + "red", + "orange", + "yellow", + "lime", + "green", + "aqua", + "cyan", + "skyblue", + "blue", + "violet", + "magenta", + "redviolet" +} + +local HUES2 = { + "Red", + "Orange", + "Yellow", + "Lime", + "Green", + "Aqua", + "Cyan", + "Sky-blue", + "Blue", + "Violet", + "Magenta", + "Red-violet" +} + +local mod = "tulips" +tulips_table = {} +img = "" +tulips_seed_diff = 420420 +hue2 = "white" +minetest.register_node(mod..":plant", {--register wild plant + tile_images = {img}, + inventory_image = img, + description = hue2.." tulip", + drop = "", + drawtype = "plantlike", + paramtype = 'light', + sunlight_propagates = true, + walkable = false, + visual_scale = 1.3, + groups = {not_in_creative_inventory=1, snappy = 3,flammable=2, attached_node=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -0.25, -0.5, -0.25, 0.25, -3/16, 0.25 }, + }, +}) + + +for i = 1, 9 do + local hue = HUES[i] + local hue2 = HUES2[i] + local img = mod.."_"..hue..".png" + --farming + farming:add_plant(mod..":"..hue, {"tulips:"..hue.."_seeds",mod..":"..hue.."_sprout"}, 60, 2) + tulips_table[i] = mod..":"..hue + --node + --tulip + minetest.register_node(mod..":"..hue, {--register wild plant + tile_images = {img}, + inventory_image = img, + description = hue.." tulip", + drop = { + max_items = 3, + items = { + { items = {"dye:" .. hue} }, + { items = {mod..":"..hue.."_seeds"} }, + { items = {mod..":"..hue.."_seeds"}, rarity = 2}, + { items = {mod..":"..hue.."_seeds"}, rarity = 5}, + } + }, + drawtype = "plantlike", + paramtype = 'light', + sunlight_propagates = true, + walkable = false, + visual_scale = 1.3, + groups = { snappy = 3,flammable=2, attached_node=1, flower=1, not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -3/16, -8/16, -3/16, 3/16, 3/16, 3/16 }, + }, + }) + --sprout + img = "tulips_sprout.png" + minetest.register_node(mod..":"..hue.."_sprout", {--register wild plant + tile_images = {img}, + inventory_image = img, + description = hue2.." tulip", + drop = "", + drawtype = "plantlike", + paramtype = 'light', + sunlight_propagates = true, + walkable = false, + visual_scale = 1.3, + groups = { snappy = 3,flammable=2, attached_node=1, not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + selection_box = { + type = "fixed", + fixed = { -3/16, -8/16, -3/16, 3/16, 0, 3/16 }, + }, + }) + + --seed + img = mod.."_seeds.png" + minetest.register_node(mod..":"..hue.."_seeds", {--register wild plant + tile_images = {img}, + inventory_image = img, + description = hue.." tulip seeds", + drawtype = "nodebox", + paramtype = 'light', + sunlight_propagates = true, + walkable = false, + visual_scale = 1.3, + groups = { snappy = 3,flammable=2, attached_node=1, not_in_creative_inventory=1}, + sounds = default.node_sound_leaves_defaults(), + node_box = { + type = "fixed", + fixed = { + {-0.5, -0.5, -0.5, 0.5, -0.45, 0.5} + }, + }, + selection_box = { + type = "fixed", + fixed = { + {-0.5, -0.45, -0.5, 0.5, -0.5, 0.5} + }, + }, + + }) + +end + +--spawning +plantslib:spawn_on_surfaces({ + spawn_delay = 2, + spawn_plants = tulips_table, + avoid_radius = 50, + spawn_chance = 1500, + spawn_surfaces = {"default:dirt_with_grass"}, + avoid_nodes = {"group:flower"}, + seed_diff = tulips_seed_diff, + light_min = 9 +}) + +print("["..mod.."] Loaded!") diff --git a/mods/tulips/readme.txt b/mods/tulips/readme.txt new file mode 100644 index 0000000..01e19b5 --- /dev/null +++ b/mods/tulips/readme.txt @@ -0,0 +1,24 @@ + _______ __ __ ___ ___ _______ _______ +| || | | || | | | | || | +|_ _|| | | || | | | | _ || _____| + | | | |_| || | | | | |_| || |_____ + | | | || |___ | | | ___||_____ | + | | | || || | | | _____| | + |___| |_______||_______||___| |___| |_______| + +BY: bas080 +DESCRIPTION: Obtain dyes more rapidly by farming them +VERSION: 0.2 +LICENSE: WTFPL +FORUM: http://forum.minetest.net/viewtopic.php?id=5332 + +Changelog +--------- +0.2 +* Removed dyes craft, now drops dye on tulip dig + +0.1 +* Spawn on abm and very rarely (plants_lib) +* Drops only seeds +* Can be crafted to dyes +* Seeds grow into tulips over time (farming) diff --git a/mods/tulips/textures/gentextures.sh b/mods/tulips/textures/gentextures.sh new file mode 100755 index 0000000..c56c1b1 --- /dev/null +++ b/mods/tulips/textures/gentextures.sh @@ -0,0 +1,157 @@ +#!/bin/bash + +if [ -z "`which convert`" ] ; then { + echo "Please install Imagemagick." + exit 1 +} fi + +if [ -z "`which bc`" ] ; then { + echo "Please install GNU bc." + exit 1 +} fi + +if [ $1 = "-t" ] ; then { + TINT_OVERLAY=$1 + BASE=$2 + COMPOSITE=$3 +} else { + TINT_OVERLAY="" + BASE=$1 + COMPOSITE=$2 +} fi + +if [ -z $1 ] || [ $1 == "--help" ] || [ $1 == "-h" ] || [[ $1 == "-t" && -z $3 ]] ; then { + + echo -e "\nUsage: +\ngentextures.sh basename [overlay_filename] +gentextures.sh -t basename overlay_filename +\nThis script requires up to three parameters which supply the base filename +of the textures, an optional overlay, and possibly the '-t' switch. The +'basename' is the first part of the filename that your textures will use when +your mod is done, which should almost always be the same as the one-word name +of your mod. For example, if you supply the word 'mymod', this script will +produce filenames like mymod_red.png or 'mymod_dark_blue_s50.png'. The +texture that this script will read and recolor is derived from this parameter, +and will be of the form 'basename_base.png', i.e. 'mymod_base.png'. +\nYou can also supply an optional overlay image filename. This image will be +composited onto the output files after they have been colorized, but without +being modified. This is useful when you have some part of your base image +that will either get changed undesirably (for example, the mortar among +several bricks, or the shading detail of a stone pattern). Simply draw two +images: one containing the whole image to be colored, and one containing the +parts that should not be changed, with either full or partial alpha +transparency where the re-colored base image should show through. Skilled use +of color and alpha on this overlay can lead to some interesting effects. +\nIf you add '-t' as the first parameter, the script will switch to 'tint +overlay' mode. For this mode to work, you must also supply the base name as +usual, and you must include an overlay image filename. Rather than re-color +the base texture, the script will alter the hue/saturation/value of the +overlay texture file instead, and leave the base texture unchanged. When +using this mode, the base texture should be drawn in some neutral color, but +any color is fine if it results in what you wanted.\n" + exit 1 +} fi + +if [[ ! -e $BASE"_base.png" ]]; then { + echo -e "\nThe basename '"$BASE"_base.png' was not found." + echo -e "\nAborting.\n" + exit 1 +} fi + +if [[ ! -z $COMPOSITE && ! -e $COMPOSITE ]]; then { + echo -e "\nThe requested composite file '"$COMPOSITE"' was not found." + echo -e "\nAborting.\n" + exit 1 +} fi + +convert $BASE"_base.png" -modulate 1,2,3 tempfile.png 1>/dev/null 2>/dev/null + +if (( $? )) ; then { + echo -e "\nImagemagick failed while testing the base texture file." + echo -e "\nEither the base file '"$BASE"_base.png' isn't an image," + echo "or it is broken, or Imagemagick itself just didn't work." + echo -e "\nPlease check and correct your base image and try again." + echo -e "\nAborting.\n" + exit 1 +} fi + +if [ ! -z $COMPOSITE ] ; then { + convert $BASE"_base.png" -modulate 1,2,3 $COMPOSITE -composite tempfile.png 1>/dev/null 2>/dev/null + + if (( $? )) ; then { + echo -e "\nImagemagick failed while testing the composite file." + echo -e "\nEither the composite file '"$COMPOSITE"' isn't an image" + echo "or it is broken, or Imagemagick itself just didn't work." + echo -e "\nPlease check and correct your composite image and try again." + echo -e "\nAborting.\n" + exit 1 + } fi +} fi + +rm tempfile.png + +base_colors="red orange yellow lime green aqua cyan skyblue blue violet magenta redviolet" + +echo -e -n "\nGenerating filenames based on "$BASE"_base.png" +if [ ! -z $COMPOSITE ] ; then { + echo "," + echo -n "using "$COMPOSITE" as an overlay" +} fi + +if [ ! -z $TINT_OVERLAY ] ; then { + echo "," + echo -n "and tinting the overlay instead of the base texture" +} fi + +echo -e "...\n" + +mkdir -p generated-textures + +function generate_texture () { + name=$1 + h=$2 + s=$3 + v=$4 + if [ -z $TINT_OVERLAY ]; then { + if [ -z $COMPOSITE ]; then { + convert $BASE"_base.png" -modulate $v,$s,$h "generated-textures/"$BASE"_"$name".png" + } else { + convert $BASE"_base.png" -modulate $v,$s,$h $COMPOSITE -composite "generated-textures/"$BASE"_"$name".png" + } fi + } else { + convert $COMPOSITE -modulate $v,$s,$h MIFF:- | composite MIFF:- $BASE"_base.png" "generated-textures/"$BASE"_"$name".png" + } fi +} + +hue=0 +for color_name in $base_colors ; do + hue2=`echo "scale=10; ("$hue"*200/360)+100" |bc` + echo $color_name "("$hue" degrees)" + echo " dark" + generate_texture "dark_"$color_name $hue2 100 33 + echo " medium" + generate_texture "medium_"$color_name $hue2 100 66 + echo " full" + generate_texture $color_name $hue2 100 100 + echo " light" + generate_texture "light_"$color_name $hue2 100 150 + echo " dark, 50% saturation" + generate_texture "dark_"$color_name"_s50" $hue2 50 33 + echo " medium, 50% saturation" + generate_texture "medium_"$color_name"_s50" $hue2 50 66 + echo " full, 50% saturation" + generate_texture $color_name"_s50" $hue2 50 100 + hue=$((hue+30)) +done + +echo "greyscales" +echo " black" +generate_texture black 0 0 15 +echo " dark grey" +generate_texture darkgrey 0 0 50 +echo " medium grey" +generate_texture grey 0 0 100 +echo " light grey" +generate_texture lightgrey 0 0 150 +echo " white" +generate_texture white 0 0 190 diff --git a/mods/tulips/textures/listcolors.sh b/mods/tulips/textures/listcolors.sh new file mode 100755 index 0000000..8038c05 --- /dev/null +++ b/mods/tulips/textures/listcolors.sh @@ -0,0 +1,59 @@ +#!/bin/bash + +pushd . >/dev/null + +cd textures + +echo -e "\n\nFull-saturation colors:" +echo -e "-----------------------\n" + +for i in `ls *dark*.png|grep -v _s50|grep -v paint|grep -v black` ; do + rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","` + color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'` + printf "%-32s %-12s %s\n" "$color" "$rgb" "$i" +done |sort + +for i in `ls *medium*.png|grep -v _s50|grep -v paint|grep -v black` ; do + rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","` + color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'` + printf "%-32s %-12s %s\n" "$color" "$rgb" "$i" +done |sort + +for i in `ls *.png|grep -v medium |grep -v dark|grep -v _s50|grep -v paint|grep -v black|grep -v titanium` ; do + rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","` + color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'` + printf "%-32s %-12s %s\n" "$color" "$rgb" "$i" +done |sort + + +echo -e "\nLow-saturation colors:" +echo -e "----------------------\n" + +for i in `ls *dark*_s50.png|grep -v paint|grep -v black` ; do + rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","` + color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'` + printf "%-32s %-12s %s\n" "$color" "$rgb" "$i" +done |sort + +for i in `ls *medium*_s50.png|grep -v paint|grep -v black` ; do + rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","` + color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'` + printf "%-32s %-12s %s\n" "$color" "$rgb" "$i" +done |sort + +for i in `ls *_s50.png|grep -v dark|grep -v medium|grep -v paint|grep -v black` ; do + rgb=`convert $i -crop 1x1+8+11 -depth 8 txt: |grep "0,0: (" |cut -f 2- -d "(" |cut -f 1-3 -d ","` + color=`basename $i .png | sed 's/_/ /g; s/unifieddyes //; s/s50/50% saturation/'` + printf "%-32s %-12s %s\n" "$color" "$rgb" "$i" +done |sort + +echo -e "\nGreyscale:" +echo -e "----------\n" + +printf "%-32s %-12s %s\n" "black" " 0, 0, 0" "unifieddyes_black.png" +printf "%-32s %-12s %s\n" "dark grey" " 64, 64, 64" "unifieddyes_darkgrey_paint.png" +printf "%-32s %-12s %s\n" "medium grey" "128,128,128" "unifieddyes_grey_paint.png" +printf "%-32s %-12s %s\n" "light grey" "192,192,192" "unifieddyes_lightgrey_paint.png" +printf "%-32s %-12s %s\n" "white" "255,255,255" "unifieddyes_white_paint.png" + +popd >/dev/null diff --git a/mods/tulips/textures/overlay.png b/mods/tulips/textures/overlay.png new file mode 100644 index 0000000..c0ea034 Binary files /dev/null and b/mods/tulips/textures/overlay.png differ diff --git a/mods/tulips/textures/tulips_aqua.png b/mods/tulips/textures/tulips_aqua.png new file mode 100644 index 0000000..020e545 Binary files /dev/null and b/mods/tulips/textures/tulips_aqua.png differ diff --git a/mods/tulips/textures/tulips_base.png b/mods/tulips/textures/tulips_base.png new file mode 100644 index 0000000..123b1f0 Binary files /dev/null and b/mods/tulips/textures/tulips_base.png differ diff --git a/mods/tulips/textures/tulips_blue.png b/mods/tulips/textures/tulips_blue.png new file mode 100644 index 0000000..c14afdf Binary files /dev/null and b/mods/tulips/textures/tulips_blue.png differ diff --git a/mods/tulips/textures/tulips_cyan.png b/mods/tulips/textures/tulips_cyan.png new file mode 100644 index 0000000..95e7484 Binary files /dev/null and b/mods/tulips/textures/tulips_cyan.png differ diff --git a/mods/tulips/textures/tulips_green.png b/mods/tulips/textures/tulips_green.png new file mode 100644 index 0000000..d69e2f4 Binary files /dev/null and b/mods/tulips/textures/tulips_green.png differ diff --git a/mods/tulips/textures/tulips_lime.png b/mods/tulips/textures/tulips_lime.png new file mode 100644 index 0000000..29f490c Binary files /dev/null and b/mods/tulips/textures/tulips_lime.png differ diff --git a/mods/tulips/textures/tulips_magenta.png b/mods/tulips/textures/tulips_magenta.png new file mode 100644 index 0000000..7331009 Binary files /dev/null and b/mods/tulips/textures/tulips_magenta.png differ diff --git a/mods/tulips/textures/tulips_orange.png b/mods/tulips/textures/tulips_orange.png new file mode 100644 index 0000000..3372740 Binary files /dev/null and b/mods/tulips/textures/tulips_orange.png differ diff --git a/mods/tulips/textures/tulips_red.png b/mods/tulips/textures/tulips_red.png new file mode 100644 index 0000000..ef63951 Binary files /dev/null and b/mods/tulips/textures/tulips_red.png differ diff --git a/mods/tulips/textures/tulips_redviolet.png b/mods/tulips/textures/tulips_redviolet.png new file mode 100644 index 0000000..b4e4f9b Binary files /dev/null and b/mods/tulips/textures/tulips_redviolet.png differ diff --git a/mods/tulips/textures/tulips_seeds.png b/mods/tulips/textures/tulips_seeds.png new file mode 100644 index 0000000..97c897d Binary files /dev/null and b/mods/tulips/textures/tulips_seeds.png differ diff --git a/mods/tulips/textures/tulips_skyblue.png b/mods/tulips/textures/tulips_skyblue.png new file mode 100644 index 0000000..8589a58 Binary files /dev/null and b/mods/tulips/textures/tulips_skyblue.png differ diff --git a/mods/tulips/textures/tulips_sprout.png b/mods/tulips/textures/tulips_sprout.png new file mode 100644 index 0000000..5646d1e Binary files /dev/null and b/mods/tulips/textures/tulips_sprout.png differ diff --git a/mods/tulips/textures/tulips_violet.png b/mods/tulips/textures/tulips_violet.png new file mode 100644 index 0000000..8d9be59 Binary files /dev/null and b/mods/tulips/textures/tulips_violet.png differ diff --git a/mods/tulips/textures/tulips_yellow.png b/mods/tulips/textures/tulips_yellow.png new file mode 100644 index 0000000..6fd2be8 Binary files /dev/null and b/mods/tulips/textures/tulips_yellow.png differ diff --git a/mods/tulips/textures/tulips_yellow_s50.png b/mods/tulips/textures/tulips_yellow_s50.png new file mode 100644 index 0000000..9a47ab9 Binary files /dev/null and b/mods/tulips/textures/tulips_yellow_s50.png differ diff --git a/mods/valleys_mapgen/LICENSE b/mods/valleys_mapgen/LICENSE new file mode 100644 index 0000000..cb15575 --- /dev/null +++ b/mods/valleys_mapgen/LICENSE @@ -0,0 +1,4 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + +See http://www.gnu.org/licenses/gpl-3.0.en.html diff --git a/mods/valleys_mapgen/README.md b/mods/valleys_mapgen/README.md new file mode 100644 index 0000000..4750712 --- /dev/null +++ b/mods/valleys_mapgen/README.md @@ -0,0 +1,53 @@ +# Valleys Mapgen +Mapgen mod for Minetest 0.4.12+. Work in progress, not finished. + +![Screenshot](http://i.imgur.com/A6CBuaV.png) + +[Discussion on Minetest Forums](https://forum.minetest.net/viewtopic.php?f=9&t=11430) + +## Changelog +### 2.1 ~> Latest +* Added flowers (6 species) + +### 2.0 ~> 2.1 (Saturday July 4, 2015) +* Modified conditions for desert plants +* Added pine tree +* Generate special water in rivers +* Changed valley shape a bit (no more cliffs on the sides of the rivers) +* Changed river shape (smooth floor) + +### 1.3 ~> 2.0 (Sunday May 31, 2015) +* Added plants, optionnal, enabled by default +* Corrected math.random too large interval (2³² → 2²⁴) +* Added snow +* When a player dies, it's respawned +* Adapted to any `chunksize` (previously the mod was only working for 5) +* Added trees (3 species for now), optionnal, enabled by default +* Added logs : see vmg.conf.example +* Added temperature and humidity noises, used by trees +* Changed parameters for lava + +### 1.2 ~> 1.3 (Wednesday April 8, 2015) +* Added differents types of dirts (the aim is to make real biomes in the future) +* Added beaches +* Added setting `water_level` to set water level (default is 1) +* Fixed fatal error with number settings + +### 1.1 ~> 1.2 (Tuesday March 17, 2015) +* Added lava underground +* Settings in minetest.conf : see file vmg.conf.example +* Now the player can't spawn in rivers +* Player spawn location is randomized : you can set the maximal distance from (0;0) at which the player will appear. (If it's in a big ocean, it may be farther) +* Some minor changes about terrain : + * Bare stone is rarer + * Valleys are slightly larger + * Ores are generated properly, according to [Paramat's changes](https://github.com/minetest/minetest/commit/b2b6bbf3e80f0ab06d62c43567122871ae560534) in `minetest.generate_ores`. **I advise you to update your MT version to a recent build (03/11 or later) or the ores overlapping problem will reappear.** + +### 1.0 ~> 1.1 (Sunday March 8, 2015) +* Added caves: they are modelised by 4 3D noises. +* Corrected ores generation: There was too many ores because it was sometimes generated twice or even more. +* Activated versions manager: if you update the mod from 1.0 to this version, the new mapgen will only take effect on new worlds, worlds created with 1.0 will stay in 1.0. If you want to activate mapgen 1.1 in an old world (there could be cleavages), change the file vmg.conf which is in the world directory. +* Added… this changelog :-D + +### 1.0 (Saturday March 7, 2015) +* Created mapgen (using 7 noises at the moment). \ No newline at end of file diff --git a/mods/valleys_mapgen/depends.txt b/mods/valleys_mapgen/depends.txt new file mode 100644 index 0000000..abb01ae --- /dev/null +++ b/mods/valleys_mapgen/depends.txt @@ -0,0 +1,2 @@ +default +flowers diff --git a/mods/valleys_mapgen/init.lua b/mods/valleys_mapgen/init.lua new file mode 100644 index 0000000..f87022a --- /dev/null +++ b/mods/valleys_mapgen/init.lua @@ -0,0 +1,91 @@ +vmg = {} +vmg.version = "2.2" + +vmg.path = minetest.get_modpath("valleys_mapgen") + +vmg.loglevel = tonumber(minetest.setting_get("vmg_log_level") or 0) + +if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Loading basic functions ...") +end + +minetest.register_on_mapgen_init(function(mgparams) + minetest.set_mapgen_params({mgname="singlenode", flags="nolight"}) +end) + +if default then + if default.register_ores then + default.register_ores() + end + if default.register_blobs then + default.register_blobs() + end +end + +function pos2d(pos) + if type(pos) == "number" then + return {x = pos, y = pos} + elseif pos.z then + return {x = pos.x, y = pos.z} + else + return {x = pos.x, y = pos.y} + end +end + +function pos3d(pos, alt) + alt = alt or 0 + if type(pos) == "number" then + return {x = pos, y = pos, z = pos} + elseif pos.z then + return {x = pos.x, y = pos.z, z = pos.z} + else + return {x = pos.x, y = alt, z = pos.y} + end +end + +function minetest.add_group(node, groups) + local def = minetest.registered_items[node] + if not def then + return false + end + local def_groups = def.groups or {} + for group, value in pairs(groups) do + if value ~= 0 then + def_groups[group] = value + else + def_groups[group] = nil + end + end + minetest.override_item(node, {groups = def_groups}) + return true +end + +function displaytime(time) + return math.floor(time * 1000000 + 0.5) / 1000 .. " ms" +end + +if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Loading settings API ...") +end + +dofile(vmg.path .. "/settings.lua") + +if vmg.define("spawn", true) then + minetest.register_on_newplayer(vmg.spawnplayer) +end + +if vmg.define("respawn", true) then + minetest.register_on_respawnplayer(vmg.spawnplayer) +end + +minetest.register_on_generated(vmg.generate) + +if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Loading nodes ...") +end + +dofile(vmg.path .. "/nodes.lua") + +if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Loaded !") +end diff --git a/mods/valleys_mapgen/mapgen.lua b/mods/valleys_mapgen/mapgen.lua new file mode 100644 index 0000000..a5075af --- /dev/null +++ b/mods/valleys_mapgen/mapgen.lua @@ -0,0 +1,552 @@ +-- Mapgen 2.2 +-- Monday July 6, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4, lacunarity = 2}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6, lacunarity = 2}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.6, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8, lacunarity = 2}, + +-- Noise 7 : Dirt thickness 2D +{offset = 3, scale = 1.75, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 8 : Caves I 3D +{offset = 0, scale = 1, seed = -4640, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 9 : Caves II 3D +{offset = 0, scale = 1, seed = 8804, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 10 : Caves III 3D +{offset = 0, scale = 1, seed = -4780, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 11 : Caves IV and Lava I 3D +{offset = 0, scale = 1, seed = -9969, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 12 : Lava II (Geologic heat) 3D +{offset = 0, scale = 1, seed = 3314, spread = {x = 64, y = 64, z = 64}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 13 : Clayey dirt noise 2D +{offset = 0, scale = 1, seed = 2835, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 14 : Silty dirt noise 2D +{offset = 0, scale = 1, seed = 6674, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 15 : Sandy dirt noise 2D +{offset = 0, scale = 1, seed = 6940, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 16 : Beaches 2D +{offset = 2, scale = 8, seed = 2349, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 17 : Temperature (not in maps) 3D +{offset = 2, scale = 1, seed = -1805, spread = {x = 768, y = 256, z = 768}, octaves = 4, persist = 0.5, lacunarity = 4}, + +-- Noise 18 : Humidity 2D +{offset = 0, scale = 1, seed = -5787, spread = {x = 243, y = 243, z = 243}, octaves = 4, persist = 0.5, lacunarity = 3}, + +} + +function vmg.noisemap(i, minp, chulens) + local obj = minetest.get_perlin_map(vmg.noises[i], chulens) + if minp.z then + return obj:get3dMap_flat(minp) + else + return obj:get2dMap_flat(minp) + end +end + +for i, n in ipairs(vmg.noises) do + vmg.noises[i] = vmg.define("noise_" .. i, n) +end + +vmg.after_mapgen = {} + +function vmg.register_after_mapgen(f, ...) + table.insert(vmg.after_mapgen, {f = f, ...}) +end + +function vmg.execute_after_mapgen() + for i, params in ipairs(vmg.after_mapgen) do + params.f(unpack(params)) + end + vmg.after_mapgen = {} +end + +local river_depth = vmg.define("river_depth", 3) + 1 +local river_size = vmg.define("river_size", 5) / 100 +local caves_size = vmg.define("caves_size", 7) / 100 +local lava_depth = vmg.define("lava_depth", 2000) +local lava_max_height = vmg.define("lava_max_height", -1) +local altitude_chill = vmg.define("altitude_chill", 90) + +local average_stone_level = vmg.define("average_stone_level", 180) +local dirt_thickness = math.sqrt(average_stone_level) / (vmg.noises[7].offset + 0.5) +local average_snow_level = vmg.define("average_snow_level", 100) +local snow_threshold = vmg.noises[17].offset * 0.5 ^ (average_snow_level / altitude_chill) + +local player_max_distance = vmg.define("player_max_distance", 450) + +local clay_threshold = vmg.define("clay_threshold", 1) +local silt_threshold = vmg.define("silt_threshold", 1) +local sand_threshold = vmg.define("sand_threshold", 0.75) +local dirt_threshold = vmg.define("dirt_threshold", 0.5) + +local tree_density = vmg.define("tree_density", 5) / 100 +local trees = vmg.define("trees", true) +local plant_density = vmg.define("plant_density", 32) / 100 +local plants = vmg.define("plants", true) + +local water_level = vmg.define("water_level", 1) +local river_water = vmg.define("river_water", true) + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_stone = minetest.get_content_id("default:stone") + local c_dirt = minetest.get_content_id("default:dirt") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_snow = minetest.get_content_id("default:dirt_with_snow") + local c_dirt_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey") + local c_lawn_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_grass") + local c_snow_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_snow") + local c_dirt_silt = minetest.get_content_id("valleys_mapgen:dirt_silty") + local c_lawn_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_grass") + local c_snow_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_snow") + local c_dirt_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy") + local c_lawn_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_grass") + local c_snow_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_snow") + local c_desert_sand = minetest.get_content_id("default:desert_sand") + local c_sand = minetest.get_content_id("default:sand") + local c_gravel = minetest.get_content_id("default:gravel") + local c_silt = minetest.get_content_id("valleys_mapgen:silt") + local c_clay = minetest.get_content_id("valleys_mapgen:red_clay") + local c_water = minetest.get_content_id("default:water_source") + local c_riverwater = minetest.get_content_id("default:river_water_source") + local c_lava = minetest.get_content_id("default:lava_source") + local c_snow_layer = minetest.get_content_id("default:snow") + + local c_tree = minetest.get_content_id("default:tree") + local c_leaves = minetest.get_content_id("default:leaves") + local c_apple = minetest.get_content_id("default:apple") + local c_jungletree = minetest.get_content_id("default:jungletree") + local c_jungleleaves = minetest.get_content_id("default:jungleleaves") + local c_pinetree = minetest.get_content_id("default:pinetree") + local c_pineleaves = minetest.get_content_id("default:pine_needles") + local c_firtree = minetest.get_content_id("valleys_mapgen:fir_tree") + local c_firleaves = minetest.get_content_id("valleys_mapgen:fir_needles") + + local c_grass = { + minetest.get_content_id("default:grass_1"), + minetest.get_content_id("default:grass_2"), + minetest.get_content_id("default:grass_3"), + minetest.get_content_id("default:grass_4"), + minetest.get_content_id("default:grass_5"), + } + local c_junglegrass = minetest.get_content_id("default:junglegrass") + local c_dryshrub = minetest.get_content_id("default:dry_shrub") + local c_cactus = minetest.get_content_id("default:cactus") + local c_papyrus = minetest.get_content_id("default:papyrus") + local c_geranium = minetest.get_content_id("flowers:geranium") + local c_rose = minetest.get_content_id("flowers:rose") + local c_tulip = minetest.get_content_id("flowers:tulip") + local c_viola = minetest.get_content_id("flowers:viola") + local c_dandelion_white = minetest.get_content_id("flowers:dandelion_white") + local c_dandelion_yellow = minetest.get_content_id("flowers:dandelion_yellow") + + local c_air = minetest.get_content_id("air") + local c_ignore = minetest.get_content_id("ignore") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local ystride = a.ystride + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = vmg.noisemap(1, minp2d, chulens) + local n2 = vmg.noisemap(2, minp2d, chulens) + local n3 = vmg.noisemap(3, minp2d, chulens) + local n4 = vmg.noisemap(4, minp2d, chulens) + local n5 = vmg.noisemap(5, minp2d, chulens) + local n6 = vmg.noisemap(6, minp, chulens_sup) + local n7 = vmg.noisemap(7, minp2d, chulens) + local n8 = vmg.noisemap(8, minp, chulens) + local n9 = vmg.noisemap(9, minp, chulens) + local n10 = vmg.noisemap(10, minp, chulens) + local n11 = vmg.noisemap(11, minp, chulens) + local n12 = vmg.noisemap(12, minp, chulens) + local n13 = vmg.noisemap(13, minp2d, chulens) + local n14 = vmg.noisemap(14, minp2d, chulens) + local n15 = vmg.noisemap(15, minp2d, chulens) + local n16 = vmg.noisemap(16, minp2d, chulens) + local n18 = vmg.noisemap(18, minp2d, chulens) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d_sup = 1 -- index for noise 6 which has a special size + local i3d = 1 -- index for 3D noises + + -- Calculate increments + local i2d_incrZ = chulens.z + local i2d_decrX = chulens.x * chulens.z - 1 + local i3d_incrY = chulens.y + local i3d_sup_incrZ = 6 * chulens.y + local i3d_decrX = chulens.x * chulens.y * chulens.z - 1 + local i3d_sup_decrX = chulens.x * (chulens.y + 6) * chulens.z - 1 + + for x = minp.x, maxp.x do -- for each YZ plane + for z = minp.z, maxp.z do -- for each vertical line in this plane + local v1, v2, v3, v4, v5, v7, v13, v14, v15, v16, v18 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d], n13[i2d], n14[i2d], n15[i2d], n16[i2d], n18[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + v2 = math.abs(v2) - river_size + local river = v2 < 0 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. Try it with a geometry software ! (here x = v2 and a = v4) + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + + if river then + local depth = river_depth * math.sqrt(1 - (v2 / river_size + 1) ^ 2) -- use the curve of the function −sqrt(1-x²) which modelizes a circle. + mountain_ground = math.min(math.max(base_ground - depth, water_level - 6), mountain_ground) + slopes = 0 + end + + -- Choose biome + local dirt = c_dirt + local lawn = c_lawn + local snow = c_snow + local max = math.max(v13, v14, v15) -- the biome is the maximal of these 3 values, if bigger than 0.5. Else, make normal dirt. + if max > dirt_threshold then + if v13 == max then + if v13 > clay_threshold then + dirt = c_clay + lawn = c_clay + snow = c_clay + else + dirt = c_dirt_clay + lawn = c_lawn_clay + snow = c_snow_clay + end + elseif v14 == max then + if v14 > silt_threshold then + dirt = c_silt + lawn = c_silt + snow = c_silt + else + dirt = c_dirt_silt + lawn = c_lawn_silt + snow = c_snow_silt + end + else + if v15 > sand_threshold then + dirt = c_desert_sand + lawn = c_desert_sand + snow = c_desert_sand + else + dirt = c_dirt_sand + lawn = c_lawn_sand + snow = c_snow_sand + end + end + end + local is_beach = v15 > 0 and v16 > 0 + local beach = v15 * v16 + water_level -- the y coordinate below which dirt is replaced by beach sand + + -- raw humidity + local hraw = 2 ^ (v13 - v15 + v18 * 2) + + for y = minp.y, maxp.y do -- for each node in vertical line + local ivm = a:index(x, y, z) + local v6, v8, v9, v10, v11, v12 = n6[i3d_sup], n8[i3d], n9[i3d], n10[i3d], n11[i3d], n12[i3d] + local is_cave = v8 ^ 2 + v9 ^ 2 + v10 ^ 2 + v11 ^ 2 < caves_size + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + if not is_cave then + local thickness = v7 - math.sqrt(math.abs(y)) / dirt_thickness + local above = math.ceil(thickness + math.random()) -- The following code will look for air at this many nodes up. If any, make dirt, else, make stone. So, it's the dirt layer thickness. + + if y >= water_level and n6[i3d_sup+i3d_incrY] * slopes <= y + 1 - mountain_ground and not river then + if is_beach and y < beach then + data[ivm] = c_sand + else -- if node above is not in the ground, place lawn + + -- calculate humidity + local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) + local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) + local water = sea_water + (1 - sea_water) * river_water + local humidity = hraw + water + + local ivm2 = ivm + ystride + y = y + 1 + local pos = {x = x, y = y, z = z} + + local v17 = vmg.get_noise(pos, 17) + local temp -- calculate_temperature for node above + if y > 0 then + temp = v17 * 0.5 ^ (y / altitude_chill) + else + temp = v17 * 0.5 ^ (-y / altitude_chill) + 20 * (v12 + 1) * (1 - 2 ^ (y / lava_depth)) + end + + if temp > snow_threshold then + if above > 0 then + data[ivm] = lawn + else + data[ivm] = c_stone + end + else + if above > 0 then + data[ivm] = snow + else + data[ivm] = c_stone + end + data[ivm2] = c_snow_layer -- set node above to snow + end + + if trees and math.random() < tree_density and above > 0 then -- make a tree + + -- choose a tree from climatic and geological conditions + if v14 < 0 and temp < 1.5 and temp >= 0.90 and humidity < 1 and v15 < 0.8 and math.abs(v13) < 0.2 and math.random() < 0.3 then -- Pine Tree + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + vmg.make_pine_tree(pos, data, a, height, radius, c_pinetree, c_pineleaves, c_air, c_ignore) + elseif v15 < 0.6 and temp >= 0.85 and temp < 2.3 and humidity < 3 and v16 < 2 and v14 > -0.5 and v13 < 0.8 then -- Apple Tree + local rand = math.random() + local height = math.floor(4 + 2.5 * rand) + local radius = 3 + rand + if math.random(1, 4) == 1 then + vmg.make_apple_tree(pos, data, a, height, radius, c_tree, c_leaves, c_apple, c_air, c_ignore) + else + vmg.make_tree(pos, data, a, height, radius, c_tree, c_leaves, c_air, c_ignore) + end + elseif v15 < 0.7 and temp >= 1.9 and humidity > 2 and v16 > 2 then -- Jungle Tree + local rand = math.random() + local height = math.floor(8 + 4 * rand) + local radius = 5 + 3 * rand + vmg.make_jungle_tree(pos, data, a, height, radius, c_jungletree, c_jungleleaves, c_air, c_ignore) + elseif temp > 0.38 and temp < 1 and humidity > 0.9 and v15 > 0 and v15 < 0.55 then -- Fir Tree + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + vmg.make_fir_tree(pos, data, a, height, radius, c_firtree, c_firleaves, c_air, c_ignore) + end + elseif plants and math.random() < plant_density and above > 0 then -- make a plant + if temp > 1 and temp < 1.8 and water > 0.7 and humidity > 3 and v13 > -0.4 and math.random() < 0.04 then -- Papyrus + for i = 1, 4 do + data[ivm+i*ystride] = c_papyrus + end + elseif v15 < 0.65 and temp >= 0.65 and temp < 1.5 and humidity < 2.6 and v16 < 1.5 and v13 < 0.8 and math.random() < 0.7 then -- Grass + data[ivm2] = c_grass[math.random(1, 5)] + elseif v15 > -0.6 and temp >= 1.8 and humidity > 2.2 and v16 > 1.8 then -- Jungle Grass + data[ivm2] = c_junglegrass + elseif v15 > 0.65 and humidity < 0.5 and math.random() < 0.2 then + if v16 > 0 and temp > 1.6 and math.random() < 0.12 then -- Cactus + for i = 1, 4 do + data[ivm+i*ystride] = c_cactus + end + elseif temp > 1.2 then -- Dry Shrub + data[ivm2] = c_dryshrub + end + elseif math.random() < 0.04 and temp > 0.98 and temp < 1.8 and humidity < 1.7 and v14 >= -0.1 and v15 < 0.4 and v15 >= -0.6 and v13 < 0.82 then -- Flowers + if temp > 1.2 and math.random() < 0.3 then + data[ivm2] = c_rose + elseif thickness <= 1.3 and math.random() < 0.4 then + data[ivm2] = c_geranium + elseif v16 < 1.6 and math.random() < 0.7 then + data[ivm2] = c_viola + elseif temp > 1.3 and humidity < 1.5 and math.random() < 0.2 then + data[ivm2] = c_tulip + elseif math.random() < 0.5 then + data[ivm2] = c_dandelion_white + else + data[ivm2] = c_dandelion_yellow + end + end + end + y = y - 1 + end + elseif above <= 0 then + data[ivm] = c_stone + elseif n6[i3d_sup+above*i3d_incrY] * slopes <= y + above - mountain_ground then -- if node at "above" nodes up is not in the ground, make dirt + if is_beach and y < beach then + data[ivm] = c_sand + else + data[ivm] = dirt + end + else + data[ivm] = c_stone + end + elseif v11 + v12 > 2 ^ (y / lava_depth) and y <= lava_max_height then + data[ivm] = c_lava + end + elseif y <= water_level then -- if pos is not in the ground, and below water_level, it's an ocean + data[ivm] = c_water + elseif river and y + 1 < base_ground then + if river_water then + data[ivm] = c_riverwater + else + data[ivm] = c_water + end + end + + i3d = i3d + i3d_incrY -- increment i3d by one line + i3d_sup = i3d_sup + i3d_incrY -- idem + end + i2d = i2d + i2d_incrZ -- increment i2d by one Z + -- useless to increment i3d, because increment would be 0 ! + i3d_sup = i3d_sup + i3d_sup_incrZ -- for i3d_sup, just avoid the 6 supplemental lines + end + i2d = i2d - i2d_decrX -- decrement the Z line previously incremented and increment by one X (1) + i3d = i3d - i3d_decrX -- decrement the YZ plane previously incremented and increment by one X (1) + i3d_sup = i3d_sup - i3d_sup_decrX -- idem, including the supplemental lines + end + vmg.execute_after_mapgen() -- needed for jungletree roots + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + minetest.generate_ores(vm, minp, maxp) + vm:set_lighting({day = 0, night = 0}) + vm:calc_lighting() + vm:update_liquids() + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +dofile(vmg.path .. "/trees.lua") + +function vmg.get_humidity_raw(pos) + local v13 = vmg.get_noise(pos, 13) + local v15 = vmg.get_noise(pos, 15) + local v18 = vmg.get_noise(pos, 18) + return 2 ^ (v13 - v15 + v18 * 2) +end + +function vmg.get_humidity(pos) + local y = pos.y + local flatpos = pos2d(pos) + local hraw = vmg.get_humidity_raw(flatpos) + + local v1 = vmg.get_noise(flatpos, 1) + local v3 = vmg.get_noise(flatpos, 3) ^ 2 + local base_ground = v1 + v3 + local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) + local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) + local water = sea_water + (1 - sea_water) * river_water + return hraw + water +end + +function vmg.get_temperature(pos) + local v12 = vmg.get_noise(pos, 12) + 1 + local v17 = vmg.get_noise(pos, 17) + local y = pos.y + if y > 0 then + return v17 * 0.5 ^ (y / altitude_chill) + else + return v17 * 0.5 ^ (-y / altitude_chill) + 20 * v12 * (1 - 2 ^ (y / lava_depth)) + end +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = math.abs(vmg.get_noise(pos, 2)) - river_size + local v3 = vmg.get_noise(pos, 3) ^ 2 + local base_ground = v1 + v3 + if v2 < 0 then + return math.ceil(base_ground), true + end + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y, false + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y, false + end +end + +function vmg.spawnplayer(player) + local angle = math.random() * math.pi * 2 + local distance = math.random() * player_max_distance + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local pos = {x = -p_angle.x * distance, y = -p_angle.y * distance} + local elevation, river = vmg.get_elevation(pos) + while elevation < water_level + 2 or river do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation, river = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/nodes.lua b/mods/valleys_mapgen/nodes.lua new file mode 100644 index 0000000..8bb06a1 --- /dev/null +++ b/mods/valleys_mapgen/nodes.lua @@ -0,0 +1,192 @@ +local waterflow = vmg.define("waterflow", 3) + +minetest.override_item("default:river_water_source", {liquid_range = waterflow}) +minetest.override_item("default:river_water_flowing", {liquid_range = waterflow}) + +minetest.register_node("valleys_mapgen:silt", { + description = "Silt", + tiles = {"vmg_silt.png"}, + is_ground_content = true, + groups = {crumbly=3}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node("valleys_mapgen:red_clay", { + description = "Red Clay", + tiles = {"vmg_red_clay.png"}, + is_ground_content = true, + groups = {crumbly=3}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.override_item("default:clay", {description = "White Clay"}) + +local function register_dirts(readname) + local name = readname:lower() + local itemstr_dirt = "valleys_mapgen:dirt_" .. name + local itemstr_lawn = itemstr_dirt .. "_with_grass" + local itemstr_snow = itemstr_dirt .. "_with_snow" + local tilestr = "vmg_dirt_" .. name .. ".png" + + minetest.register_node(itemstr_dirt, { + description = readname .. " Dirt", + tiles = {tilestr}, + is_ground_content = true, + groups = {crumbly=3,soil=1}, + sounds = default.node_sound_dirt_defaults(), + }) + + minetest.register_node(itemstr_lawn, { + description = readname .. " Dirt with Grass", + tiles = {"default_grass.png", tilestr, tilestr .. "^default_grass_side.png"}, + is_ground_content = true, + groups = {crumbly=3,soil=1}, + drop = itemstr_dirt, + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_grass_footstep", gain=0.25}, + }), + }) + + minetest.register_node(itemstr_snow, { + description = readname .. " Dirt with Snow", + tiles = {"default_snow.png", tilestr, tilestr .. "^default_snow_side.png"}, + is_ground_content = true, + groups = {crumbly=3,soil=1}, + drop = itemstr_dirt, + sounds = default.node_sound_dirt_defaults({ + footstep = {name="default_snow_footstep", gain=0.25}, + }), + }) + + minetest.register_abm({ + nodenames = {itemstr_dirt}, + interval = 2, + chance = 200, + action = function(pos, node) + local above = {x=pos.x, y=pos.y+1, z=pos.z} + local name = minetest.get_node(above).name + local nodedef = minetest.registered_nodes[name] + if nodedef and (nodedef.sunlight_propagates or nodedef.paramtype == "light") + and nodedef.liquidtype == "none" + and (minetest.get_node_light(above) or 0) >= 13 then + if name == "default:snow" or name == "default:snowblock" then + minetest.set_node(pos, {name = itemstr_snow}) + else + minetest.set_node(pos, {name = itemstr_lawn}) + end + end + end + }) + + minetest.register_abm({ + nodenames = {itemstr_lawn}, + interval = 2, + chance = 20, + action = function(pos, node) + local above = {x=pos.x, y=pos.y+1, z=pos.z} + local name = minetest.get_node(above).name + local nodedef = minetest.registered_nodes[name] + if name ~= "ignore" and nodedef + and not ((nodedef.sunlight_propagates or nodedef.paramtype == "light") + and nodedef.liquidtype == "none") then + minetest.set_node(pos, {name = itemstr_dirt}) + end + end + }) +end + +register_dirts("Clayey") +register_dirts("Silty") +register_dirts("Sandy") + +----------- +-- Trees -- +----------- + +minetest.register_node("valleys_mapgen:fir_tree", { + description = "Fir Tree", + tiles = {"vmg_fir_tree_top.png", "vmg_fir_tree_top.png", "vmg_fir_tree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) + +minetest.register_node("valleys_mapgen:fir_tree", { + description = "Fir Tree", + tiles = {"vmg_fir_tree_top.png", "vmg_fir_tree_top.png", "vmg_fir_tree.png"}, + paramtype2 = "facedir", + is_ground_content = false, + groups = {tree=1,choppy=2,oddly_breakable_by_hand=1,flammable=2}, + sounds = default.node_sound_wood_defaults(), + + on_place = minetest.rotate_node +}) + +minetest.register_node("valleys_mapgen:fir_sapling", { + description = "Fir Sapling", + drawtype = "plantlike", + visual_scale = 1.0, + tiles = {"vmg_fir_sapling.png"}, + inventory_image = "vmg_fir_sapling.png", + wield_image = "vmg_fir_sapling.png", + paramtype = "light", + sunlight_propagates = true, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} + }, + groups = {snappy=2,dig_immediate=3,flammable=2,attached_node=1,sapling=1}, + sounds = default.node_sound_leaves_defaults(), +}) + +minetest.register_node("valleys_mapgen:fir_needles", { + description = "Fir Needles", + drawtype = "allfaces_optional", + waving = 1, + visual_scale = 1.3, + tiles = {"vmg_fir_leaves.png"}, + paramtype = "light", + is_ground_content = false, + groups = {snappy=3, leafdecay=7, flammable=2, leaves=1}, + drop = { + max_items = 1, + items = { + { + -- player will get sapling with 1/20 chance + items = {'valleys_mapgen:fir_sapling'}, + rarity = 20, + }, + { + -- player will get leaves only if he get no saplings, + -- this is because max_items is 1 + items = {'valleys_mapgen:fir_needles'}, + } + } + }, + sounds = default.node_sound_leaves_defaults(), + + after_place_node = default.after_place_leaves, +}) + +minetest.register_node("valleys_mapgen:fir_wood", { + description = "Fir Wood Planks", + tiles = {"vmg_fir_wood.png"}, + is_ground_content = false, + groups = {choppy=2,oddly_breakable_by_hand=2,flammable=3,wood=1}, + sounds = default.node_sound_wood_defaults(), +}) + +minetest.register_craft({ + output = "valleys_mapgen:fir_wood 5", + recipe = { + {"valleys_mapgen:fir_tree"} + } +}) + +minetest.add_group("default:leaves", {leafdecay = 5}) +minetest.add_group("default:jungleleaves", {leafdecay = 8}) +minetest.add_group("default:pine_needles", {leafdecay = 7}) diff --git a/mods/valleys_mapgen/old_mapgens/1.0.lua b/mods/valleys_mapgen/old_mapgens/1.0.lua new file mode 100644 index 0000000..872b66c --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/1.0.lua @@ -0,0 +1,195 @@ +-- Mapgen 1.0 +-- Saturday March 7, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.5, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8}, + +-- Noise 7 : Dirt thickness 2D +{offset = 1.75, scale = 3.25, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 1, persist = 1}, + +} + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_dirt = minetest.get_content_id("default:dirt") + local c_stone = minetest.get_content_id("default:stone") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_water = minetest.get_content_id("default:water_source") + local c_air = minetest.get_content_id("air") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = minetest.get_perlin_map(vmg.noises[1], chulens):get2dMap_flat(minp2d) + local n2 = minetest.get_perlin_map(vmg.noises[2], chulens):get2dMap_flat(minp2d) + local n3 = minetest.get_perlin_map(vmg.noises[3], chulens):get2dMap_flat(minp2d) + local n4 = minetest.get_perlin_map(vmg.noises[4], chulens):get2dMap_flat(minp2d) + local n5 = minetest.get_perlin_map(vmg.noises[5], chulens):get2dMap_flat(minp2d) + local n6 = minetest.get_perlin_map(vmg.noises[6], chulens_sup):get3dMap_flat(minp) + local n7 = minetest.get_perlin_map(vmg.noises[7], chulens):get2dMap_flat(minp2d) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d = 1 -- index for 3D noises + for x = minp.x, maxp.x do -- for each east-west and bottom-top plane + for z = minp.z, maxp.z do -- for each vertical row in this plane + local v1, v2, v3, v4, v5, v7 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + local river = math.abs(v2) < 0.05 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. v2 = x and v4 = a. + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + if river then + mountain_ground = math.min(math.max(base_ground - 3, -5), mountain_ground) + slopes = 0 + end + for y = minp.y, maxp.y do -- for each node in vertical row + local ivm = a:index(x, y, z) + local v6 = n6[i3d] + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + local above = math.ceil(v7 + math.random()) + if above <= 0 then + data[ivm] = c_stone + elseif y > 0 and n6[i3d+80] * slopes <= y + 1 - mountain_ground and not river then + data[ivm] = c_lawn -- if node above is not in the ground, place lawn + elseif n6[i3d+above*80] * slopes <= y + above - mountain_ground then + data[ivm] = c_dirt + else + data[ivm] = c_stone + end + elseif y <= 1 or river and y - 2 <= mountain_ground then + data[ivm] = c_water + end + + i3d = i3d + 80 -- increase i3d by one row + end + i2d = i2d + 80 -- increase i2d by one row + i3d = i3d + 480 -- avoid the 6 supplemental lines + end + i2d = i2d - 6399 -- i2d = 6401 after the first execution of this loop, it must be 2 before the second. + i3d = i3d - 550399 -- i3d = 550401 after the first execution of this loop, it must be 2 before the second. + end + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + vm:calc_lighting() + vm:update_liquids() + minetest.generate_ores(vm) -- Thank you kwolekr ! I can generate the ores in 1 line ! And so it's compatible with moreores and other mods which add ores. + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +vmg.noises_obj = {} + +for i, n in ipairs(vmg.noises) do + vmg.noises_obj[i] = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = vmg.get_noise(pos, 2) + local v3 = vmg.get_noise(pos, 3) ^ 2 + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y + end +end + +function vmg.spawnplayer(player) + local pos = {x = 0, y = 0} + local angle = math.random() * math.pi * 2 + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local elevation = vmg.get_elevation(pos) + while elevation < 2 do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/old_mapgens/1.1.lua b/mods/valleys_mapgen/old_mapgens/1.1.lua new file mode 100644 index 0000000..6d6e619 --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/1.1.lua @@ -0,0 +1,222 @@ +-- Mapgen 1.1 +-- Sunday March 8, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.5, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8}, + +-- Noise 7 : Dirt thickness 2D +{offset = 3, scale = 2, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5}, + +-- Noise 8 : Caves I +{offset = 0, scale = 1, seed = -4640, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5}, + +-- Noise 9 : Caves II +{offset = 0, scale = 1, seed = 8804, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5}, + +-- Noise 10 : Caves III +{offset = 0, scale = 1, seed = -4780, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5}, + +-- Noise 11 : Caves IV +{offset = 0, scale = 1, seed = -9969, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5}, + +} + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_dirt = minetest.get_content_id("default:dirt") + local c_stone = minetest.get_content_id("default:stone") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_water = minetest.get_content_id("default:water_source") + local c_air = minetest.get_content_id("air") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = minetest.get_perlin_map(vmg.noises[1], chulens):get2dMap_flat(minp2d) + local n2 = minetest.get_perlin_map(vmg.noises[2], chulens):get2dMap_flat(minp2d) + local n3 = minetest.get_perlin_map(vmg.noises[3], chulens):get2dMap_flat(minp2d) + local n4 = minetest.get_perlin_map(vmg.noises[4], chulens):get2dMap_flat(minp2d) + local n5 = minetest.get_perlin_map(vmg.noises[5], chulens):get2dMap_flat(minp2d) + local n6 = minetest.get_perlin_map(vmg.noises[6], chulens_sup):get3dMap_flat(minp) + local n7 = minetest.get_perlin_map(vmg.noises[7], chulens):get2dMap_flat(minp2d) + local n8 = minetest.get_perlin_map(vmg.noises[8], chulens):get3dMap_flat(minp) + local n9 = minetest.get_perlin_map(vmg.noises[9], chulens):get3dMap_flat(minp) + local n10 = minetest.get_perlin_map(vmg.noises[10], chulens):get3dMap_flat(minp) + local n11 = minetest.get_perlin_map(vmg.noises[11], chulens):get3dMap_flat(minp) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d_a = 1 -- index for noise 6 which has a special size + local i3d_b = 1 -- index for 3D noises + for x = minp.x, maxp.x do -- for each east-west and bottom-top plane + for z = minp.z, maxp.z do -- for each vertical row in this plane + local v1, v2, v3, v4, v5, v7 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + local river = math.abs(v2) < 0.05 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. v2 = x and v4 = a. + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + if river then + mountain_ground = math.min(math.max(base_ground - 3, -5), mountain_ground) + slopes = 0 + end + for y = minp.y, maxp.y do -- for each node in vertical row + local ivm = a:index(x, y, z) + local v6, v8, v9, v10, v11 = n6[i3d_a], n8[i3d_b], n9[i3d_b], n10[i3d_b], n11[i3d_b] + local is_cave = v8 ^ 2 + v9 ^ 2 + v10 ^ 2 + v11 ^ 2 < 0.07 + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + if not is_cave then + local above = math.ceil(v7 + math.random() - math.sqrt(math.abs(y)) / 3.5) + if above <= 0 then + data[ivm] = c_stone + elseif y > 0 and n6[i3d_a+80] * slopes <= y + 1 - mountain_ground and not river then + data[ivm] = c_lawn -- if node above is not in the ground, place lawn + elseif n6[i3d_a+above*80] * slopes <= y + above - mountain_ground then + data[ivm] = c_dirt + else + data[ivm] = c_stone + end + end + elseif y <= 1 or river and y - 2 <= mountain_ground then + data[ivm] = c_water + end + + i3d_a = i3d_a + 80 -- increase i3d_a by one row + i3d_b = i3d_b + 80 -- increase i3d_b by one row + end + i2d = i2d + 80 -- increase i2d by one row + i3d_a = i3d_a + 480 -- avoid the 6 supplemental lines + end + i2d = i2d - 6399 -- i2d = 6401 after the first execution of this loop, it must be 2 before the second. + i3d_a = i3d_a - 550399 -- i3d_a = 550401 after the first execution of this loop, it must be 2 before the second. + i3d_b = i3d_b - 511999 -- i3d_b = 512001 after the first execution of this loop, it must be 2 before the second. + end + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + vm:set_lighting({day = 0, night = 0}) + vm:calc_lighting() + vm:update_liquids() + vm:write_to_map() + + vm = minetest.get_voxel_manip() + vm:read_from_map(minp, maxp) + minetest.generate_ores(vm) -- Thank you kwolekr ! I can generate the ores in 1 line ! And so it's compatible with moreores and other mods which add ores. + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +vmg.noises_obj = {} + +for i, n in ipairs(vmg.noises) do + vmg.noises_obj[i] = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = vmg.get_noise(pos, 2) + local v3 = vmg.get_noise(pos, 3) ^ 2 + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y + end +end + +function vmg.spawnplayer(player) + local pos = {x = 0, y = 0} + local angle = math.random() * math.pi * 2 + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local elevation = vmg.get_elevation(pos) + while elevation < 2 do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/old_mapgens/1.2.lua b/mods/valleys_mapgen/old_mapgens/1.2.lua new file mode 100644 index 0000000..67cd89b --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/1.2.lua @@ -0,0 +1,251 @@ +-- Mapgen 1.2 +-- Tuesday March 17, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4, lacunarity = 2}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6, lacunarity = 2}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.6, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8, lacunarity = 2}, + +-- Noise 7 : Dirt thickness 2D +{offset = 3, scale = 1.75, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 8 : Caves I 3D +{offset = 0, scale = 1, seed = -4640, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 9 : Caves II 3D +{offset = 0, scale = 1, seed = 8804, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 10 : Caves III 3D +{offset = 0, scale = 1, seed = -4780, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 11 : Caves IV and Lava I 3D +{offset = 0, scale = 1, seed = -9969, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 12 : Lava II 3D +{offset = 0, scale = 1, seed = 3314, spread = {x = 64, y = 64, z = 64}, octaves = 4, persist = 0.5, lacunarity = 2}, + +} + +function vmg.noisemap(i, minp, chulens) + local obj = minetest.get_perlin_map(vmg.noises[i], chulens) + if minp.z then + return obj:get3dMap_flat(minp) + else + return obj:get2dMap_flat(minp) + end +end + +for i, n in ipairs(vmg.noises) do + vmg.noises[i] = vmg.define("noise_" .. i, n) +end + +local average_stone_level = vmg.define("average_stone_level", 180) +local dirt_thickness = math.sqrt(average_stone_level) / (vmg.noises[7].offset + 0.5) + +local river_size = vmg.define("river_size", 5) / 100 +local caves_size = vmg.define("caves_size", 7) / 100 +local lava_depth = vmg.define("lava_depth", 2000) +local surface_lava = vmg.define("surface_lava", false) + +local player_max_distance = vmg.define("player_max_distance", 450) + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_dirt = minetest.get_content_id("default:dirt") + local c_stone = minetest.get_content_id("default:stone") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_water = minetest.get_content_id("default:water_source") + local c_lava = minetest.get_content_id("default:lava_source") + local c_air = minetest.get_content_id("air") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = vmg.noisemap(1, minp2d, chulens) + local n2 = vmg.noisemap(2, minp2d, chulens) + local n3 = vmg.noisemap(3, minp2d, chulens) + local n4 = vmg.noisemap(4, minp2d, chulens) + local n5 = vmg.noisemap(5, minp2d, chulens) + local n6 = vmg.noisemap(6, minp, chulens_sup) + local n7 = vmg.noisemap(7, minp2d, chulens) + local n8 = vmg.noisemap(8, minp, chulens) + local n9 = vmg.noisemap(9, minp, chulens) + local n10 = vmg.noisemap(10, minp, chulens) + local n11 = vmg.noisemap(11, minp, chulens) + local n12 = vmg.noisemap(12, minp, chulens) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d_a = 1 -- index for noise 6 which has a special size + local i3d_b = 1 -- index for 3D noises + for x = minp.x, maxp.x do -- for each east-west and bottom-top plane + for z = minp.z, maxp.z do -- for each vertical row in this plane + local v1, v2, v3, v4, v5, v7 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + local river = math.abs(v2) < river_size + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. v2 = x and v4 = a. + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + if river then + mountain_ground = math.min(math.max(base_ground - 3, -5), mountain_ground) + slopes = 0 + end + for y = minp.y, maxp.y do -- for each node in vertical row + local ivm = a:index(x, y, z) + local v6, v8, v9, v10, v11, v12 = n6[i3d_a], n8[i3d_b], n9[i3d_b], n10[i3d_b], n11[i3d_b], n12[i3d_b] + local is_cave = v8 ^ 2 + v9 ^ 2 + v10 ^ 2 + v11 ^ 2 < caves_size + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + if not is_cave then + local above = math.ceil( + v7 + math.random() - math.sqrt(math.abs(y)) / dirt_thickness + ) + if above <= 0 then + data[ivm] = c_stone + elseif y > 0 and n6[i3d_a+80] * slopes <= y + 1 - mountain_ground and not river then + data[ivm] = c_lawn -- if node above is not in the ground, place lawn + elseif n6[i3d_a+above*80] * slopes <= y + above - mountain_ground then + data[ivm] = c_dirt + else + data[ivm] = c_stone + end + elseif v11 + v12 > 2 ^ (y / lava_depth) and (surface_lava or y < 0) then + data[ivm] = c_lava + end + elseif y <= 1 or river and y - 2 <= mountain_ground then + data[ivm] = c_water + end + + i3d_a = i3d_a + 80 -- increase i3d_a by one row + i3d_b = i3d_b + 80 -- increase i3d_b by one row + end + i2d = i2d + 80 -- increase i2d by one row + i3d_a = i3d_a + 480 -- avoid the 6 supplemental lines + end + i2d = i2d - 6399 -- i2d = 6401 after the first execution of this loop, it must be 2 before the second. + i3d_a = i3d_a - 550399 -- i3d_a = 550401 after the first execution of this loop, it must be 2 before the second. + i3d_b = i3d_b - 511999 -- i3d_b = 512001 after the first execution of this loop, it must be 2 before the second. + end + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + minetest.generate_ores(vm, minp, maxp) + vm:set_lighting({day = 0, night = 0}) + vm:calc_lighting() + vm:update_liquids() + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +vmg.noises_obj = {} + +for i, n in ipairs(vmg.noises) do + vmg.noises_obj[i] = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = vmg.get_noise(pos, 2) + local v3 = vmg.get_noise(pos, 3) ^ 2 + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y + end +end + +function vmg.spawnplayer(player) + local angle = math.random() * math.pi * 2 + local distance = math.random() * player_max_distance + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local pos = {x = -p_angle.x * distance, y = -p_angle.y * distance} + local elevation = vmg.get_elevation(pos) + while elevation < 3 or math.abs(vmg.get_noise(pos, 2)) < river_size do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/old_mapgens/1.3.lua b/mods/valleys_mapgen/old_mapgens/1.3.lua new file mode 100644 index 0000000..0df171b --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/1.3.lua @@ -0,0 +1,328 @@ +-- Mapgen 1.3 +-- Wednesday April 8, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4, lacunarity = 2}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6, lacunarity = 2}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.6, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8, lacunarity = 2}, + +-- Noise 7 : Dirt thickness 2D +{offset = 3, scale = 1.75, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 8 : Caves I 3D +{offset = 0, scale = 1, seed = -4640, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 9 : Caves II 3D +{offset = 0, scale = 1, seed = 8804, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 10 : Caves III 3D +{offset = 0, scale = 1, seed = -4780, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 11 : Caves IV and Lava I 3D +{offset = 0, scale = 1, seed = -9969, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 12 : Lava II 3D +{offset = 0, scale = 1, seed = 3314, spread = {x = 64, y = 64, z = 64}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 13 : Clayey dirt noise 2D +{offset = 0, scale = 1, seed = 2835, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 14 : Silty dirt noise 2D +{offset = 0, scale = 1, seed = 6674, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 15 : Sandy dirt noise 2D +{offset = 0, scale = 1, seed = 6940, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 16 : Beaches 2D +{offset = 2, scale = 8, seed = 2349, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +} + +function vmg.noisemap(i, minp, chulens) + local obj = minetest.get_perlin_map(vmg.noises[i], chulens) + if minp.z then + return obj:get3dMap_flat(minp) + else + return obj:get2dMap_flat(minp) + end +end + +for i, n in ipairs(vmg.noises) do + vmg.noises[i] = vmg.define("noise_" .. i, n) +end + +local average_stone_level = vmg.define("average_stone_level", 180) +local dirt_thickness = math.sqrt(average_stone_level) / (vmg.noises[7].offset + 0.5) + +local river_size = vmg.define("river_size", 5) / 100 +local caves_size = vmg.define("caves_size", 7) / 100 +local lava_depth = vmg.define("lava_depth", 2000) +local surface_lava = vmg.define("surface_lava", false) + +local player_max_distance = vmg.define("player_max_distance", 450) + +local clay_threshold = vmg.define("clay_threshold", 1) +local silt_threshold = vmg.define("silt_threshold", 1) +local sand_threshold = vmg.define("sand_threshold", 0.75) +local dirt_threshold = vmg.define("dirt_threshold", 0.5) + +local water_level = vmg.define("water_level", 1) + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_stone = minetest.get_content_id("default:stone") + local c_dirt = minetest.get_content_id("default:dirt") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_dirt_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey") + local c_lawn_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_grass") + local c_dirt_silt = minetest.get_content_id("valleys_mapgen:dirt_silty") + local c_lawn_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_grass") + local c_dirt_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy") + local c_lawn_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_grass") + local c_desert_sand = minetest.get_content_id("default:desert_sand") + local c_sand = minetest.get_content_id("default:sand") + local c_gravel = minetest.get_content_id("default:gravel") + local c_silt = minetest.get_content_id("valleys_mapgen:silt") + local c_clay = minetest.get_content_id("valleys_mapgen:red_clay") + local c_water = minetest.get_content_id("default:water_source") + local c_lava = minetest.get_content_id("default:lava_source") + local c_air = minetest.get_content_id("air") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = vmg.noisemap(1, minp2d, chulens) + local n2 = vmg.noisemap(2, minp2d, chulens) + local n3 = vmg.noisemap(3, minp2d, chulens) + local n4 = vmg.noisemap(4, minp2d, chulens) + local n5 = vmg.noisemap(5, minp2d, chulens) + local n6 = vmg.noisemap(6, minp, chulens_sup) + local n7 = vmg.noisemap(7, minp2d, chulens) + local n8 = vmg.noisemap(8, minp, chulens) + local n9 = vmg.noisemap(9, minp, chulens) + local n10 = vmg.noisemap(10, minp, chulens) + local n11 = vmg.noisemap(11, minp, chulens) + local n12 = vmg.noisemap(12, minp, chulens) + local n13 = vmg.noisemap(13, minp2d, chulens) + local n14 = vmg.noisemap(14, minp2d, chulens) + local n15 = vmg.noisemap(15, minp2d, chulens) + local n16 = vmg.noisemap(16, minp2d, chulens) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d_a = 1 -- index for noise 6 which has a special size + local i3d_b = 1 -- index for 3D noises + for x = minp.x, maxp.x do -- for each east-west and bottom-top plane + for z = minp.z, maxp.z do -- for each vertical row in this plane + local v1, v2, v3, v4, v5, v7, v13, v14, v15, v16 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d], n13[i2d], n14[i2d], n15[i2d], n16[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + local river = math.abs(v2) < river_size + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. v2 = x and v4 = a. + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + + if river then + mountain_ground = math.min(math.max(base_ground - 3, water_level - 6), mountain_ground) + slopes = 0 + end + + local dirt = c_dirt + local lawn = c_lawn + local max = math.max(v13, v14, v15) + if max > dirt_threshold then + if v13 == max then + if v13 > clay_threshold then + dirt = c_clay + lawn = c_clay + else + dirt = c_dirt_clay + lawn = c_lawn_clay + end + elseif v14 == max then + if v14 > silt_threshold then + dirt = c_silt + lawn = c_silt + else + dirt = c_dirt_silt + lawn = c_lawn_silt + end + else + if v15 > sand_threshold then + dirt = c_desert_sand + lawn = c_desert_sand + else + dirt = c_dirt_sand + lawn = c_lawn_sand + end + end + end + local is_beach = v15 > 0 and v16 > 0 + local beach = v15 * v16 + water_level + + for y = minp.y, maxp.y do -- for each node in vertical row + local ivm = a:index(x, y, z) + local v6, v8, v9, v10, v11, v12 = n6[i3d_a], n8[i3d_b], n9[i3d_b], n10[i3d_b], n11[i3d_b], n12[i3d_b] + local is_cave = v8 ^ 2 + v9 ^ 2 + v10 ^ 2 + v11 ^ 2 < caves_size + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + if not is_cave then + local above = math.ceil( + v7 + math.random() - math.sqrt(math.abs(y)) / dirt_thickness + ) + if above <= 0 then + data[ivm] = c_stone + elseif y >= water_level and n6[i3d_a+80] * slopes <= y + 1 - mountain_ground and not river then + if is_beach and y < beach then + data[ivm] = c_sand + else + data[ivm] = lawn -- if node above is not in the ground, place lawn + end + elseif n6[i3d_a+above*80] * slopes <= y + above - mountain_ground then + if is_beach and y < beach then + data[ivm] = c_sand + else + data[ivm] = dirt + end + else + data[ivm] = c_stone + end + elseif v11 + v12 > 2 ^ (y / lava_depth) and (surface_lava or y < water_level - 1) then + data[ivm] = c_lava + end + elseif y <= water_level or river and y - 2 <= mountain_ground then + data[ivm] = c_water + end + + i3d_a = i3d_a + 80 -- increase i3d_a by one row + i3d_b = i3d_b + 80 -- increase i3d_b by one row + end + i2d = i2d + 80 -- increase i2d by one row + i3d_a = i3d_a + 480 -- avoid the 6 supplemental lines + end + i2d = i2d - 6399 -- i2d = 6401 after the first execution of this loop, it must be 2 before the second. + i3d_a = i3d_a - 550399 -- i3d_a = 550401 after the first execution of this loop, it must be 2 before the second. + i3d_b = i3d_b - 511999 -- i3d_b = 512001 after the first execution of this loop, it must be 2 before the second. + end + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + minetest.generate_ores(vm, minp, maxp) + vm:set_lighting({day = 0, night = 0}) + vm:calc_lighting() + vm:update_liquids() + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +vmg.noises_obj = {} + +for i, n in ipairs(vmg.noises) do + vmg.noises_obj[i] = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = vmg.get_noise(pos, 2) + local v3 = vmg.get_noise(pos, 3) ^ 2 + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y + end +end + +function vmg.spawnplayer(player) + local angle = math.random() * math.pi * 2 + local distance = math.random() * player_max_distance + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local pos = {x = -p_angle.x * distance, y = -p_angle.y * distance} + local elevation = vmg.get_elevation(pos) + while elevation < water_level + 2 or math.abs(vmg.get_noise(pos, 2)) < river_size do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/old_mapgens/2.0-trees.lua b/mods/valleys_mapgen/old_mapgens/2.0-trees.lua new file mode 100644 index 0000000..fd0e1c3 --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/2.0-trees.lua @@ -0,0 +1,203 @@ +function default.grow_tree(pos, is_apple_tree) + local rand = math.random() + local height = math.floor(4 + 2.5 * rand) + local radius = 3 + rand + + local leaves = minetest.get_content_id("default:leaves") + local trunk = minetest.get_content_id("default:tree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 4, y = pos.y, z = pos.z - 4}, {x = pos.x + 4, y = pos.y + height + 4, z = pos.z + 4}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + if is_apple_tree then + vmg.grow_apple_tree(pos, data, area, height, radius, trunk, leaves, minetest.get_content_id("default:apple"), air, ignore) + else + vmg.grow_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + end + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function default.grow_jungle_tree(pos) + local rand = math.random() + local height = math.floor(8 + 4 * rand) + local radius = 5 + 3 * rand + + local leaves = minetest.get_content_id("default:jungleleaves") + local trunk = minetest.get_content_id("default:jungletree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 8, y = pos.y - 1, z = pos.z - 8}, {x = pos.x + 8, y = pos.y + height + 5, z = pos.z + 8}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.grow_jungle_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vmg.execute_after_mapgen() + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function default.grow_pine_tree(pos) + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + + local leaves = minetest.get_content_id("default:pine_needles") + local trunk = minetest.get_content_id("default:pinetree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 6, y = pos.y - 1, z = pos.z - 6}, {x = pos.x + 6, y = pos.y + height + 2, z = pos.z + 6}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.grow_pine_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function vmg.grow_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5} + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius, z = radius}, np) +end + +function vmg.grow_apple_tree(pos, data, area, height, radius, trunk, leaves, fruit, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating apple tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5} + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius, z = radius}, np, 0.06, fruit) +end + +local function make_jungle_root(x0, y0, z0, data, area, tree, air) + local ystride = area.ystride + local ybot = y0 - 1 + for x = x0 - 1, x0 + 1 do + for z = z0 - 1, z0 + 1 do + local iv = area:index(x, ybot, z) + for i = 0, 5 do + if data[iv] == air then + if math.random() < 0.6 then + data[iv-ystride] = tree -- make jungle tree below + if math.random() < 0.6 then + data[iv] = tree -- make jungle tree at this air node + end + end + break + end + iv = iv + ystride + end + end + end +end + +function vmg.grow_jungle_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating jungle tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + vmg.register_after_mapgen(make_jungle_root, pos.x, pos.y, pos.z, data, area, trunk, air) + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.8} + pos.y = pos.y + height + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius * 0.5, z = radius}, np) +end + +function vmg.grow_pine_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating pine tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + + -- add leaves on the top (4% 0 ; 36% 1 ; 60% 2) + local rand = math.random() + if rand < 0.96 then + data[iv] = leaves + if rand < 0.60 then + iv = iv + ystride + data[iv] = leaves + end + end + + -- make several leaves rings + local max_height = pos.y + height + local min_height = pos.y + math.floor((0.2 + 0.3 * math.random()) * height) + local radius_increment = (radius - 1.2) / (max_height - min_height) + local np = {offset = 0.8, scale = 0.4, spread = {x = 12, y = 4, z = 12}, octaves = 3, persist = 0.8} + + pos.y = max_height - 1 + while pos.y >= min_height do + local ring_radius = (max_height - pos.y) * radius_increment + 1.2 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = ring_radius, y = 2, z = ring_radius}, np) + pos.y = pos.y - math.random(2, 3) + end +end + +function vmg.make_leavesblob(pos, data, area, leaves, air, ignore, radius, np, fruit_chance, fruit) + local count = 0 + fruit_chance = fruit_chance or 0 + + np.seed = math.random(0, 16777215) + local round_radius = {x = math.ceil(radius.x), y = math.ceil(radius.y), z = math.ceil(radius.z)} + + local length = vector.multiply(round_radius, 2) + local chulens = vector.add(length, 1) + local minp = vector.subtract(pos, round_radius) + local maxp = vector.add(minp, length) + local obj = minetest.get_perlin_map(np, chulens) + local pmap = obj:get3dMap_flat(minp) + local i = 1 + for x = minp.x, maxp.x do + local xval = ((x - pos.x) / radius.x) ^ 2 + for y = minp.y, maxp.y do + local yval = ((y - pos.y) / radius.y) ^ 2 + for z = minp.z, maxp.z do + local zval = ((z - pos.z) / radius.z) ^ 2 + local dist = math.sqrt(xval + yval + zval) + local nval = pmap[i] + if nval > dist then + local iv = area:index(x, y, z) + if data[iv] == air or data[iv] == ignore then + count = count + 1 + if math.random() < fruit_chance then + data[iv] = fruit + else + data[iv] = leaves + end + end + end + i = i + 1 + end + end + end +end diff --git a/mods/valleys_mapgen/old_mapgens/2.0.lua b/mods/valleys_mapgen/old_mapgens/2.0.lua new file mode 100644 index 0000000..6779ab8 --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/2.0.lua @@ -0,0 +1,510 @@ +-- Mapgen 2.0 +-- Sunday May 31, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4, lacunarity = 2}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6, lacunarity = 2}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.6, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8, lacunarity = 2}, + +-- Noise 7 : Dirt thickness 2D +{offset = 3, scale = 1.75, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 8 : Caves I 3D +{offset = 0, scale = 1, seed = -4640, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 9 : Caves II 3D +{offset = 0, scale = 1, seed = 8804, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 10 : Caves III 3D +{offset = 0, scale = 1, seed = -4780, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 11 : Caves IV and Lava I 3D +{offset = 0, scale = 1, seed = -9969, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 12 : Lava II (Geologic heat) 3D +{offset = 0, scale = 1, seed = 3314, spread = {x = 64, y = 64, z = 64}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 13 : Clayey dirt noise 2D +{offset = 0, scale = 1, seed = 2835, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 14 : Silty dirt noise 2D +{offset = 0, scale = 1, seed = 6674, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 15 : Sandy dirt noise 2D +{offset = 0, scale = 1, seed = 6940, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 16 : Beaches 2D +{offset = 2, scale = 8, seed = 2349, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 17 : Temperature (not in maps) 3D +{offset = 2, scale = 1, seed = -1805, spread = {x = 768, y = 256, z = 768}, octaves = 4, persist = 0.5, lacunarity = 4}, + +-- Noise 18 : Humidity 2D +{offset = 0, scale = 1, seed = -5787, spread = {x = 243, y = 243, z = 243}, octaves = 4, persist = 0.5, lacunarity = 3}, + +} + +function vmg.noisemap(i, minp, chulens) + local obj = minetest.get_perlin_map(vmg.noises[i], chulens) + if minp.z then + return obj:get3dMap_flat(minp) + else + return obj:get2dMap_flat(minp) + end +end + +for i, n in ipairs(vmg.noises) do + vmg.noises[i] = vmg.define("noise_" .. i, n) +end + +vmg.after_mapgen = {} + +function vmg.register_after_mapgen(f, ...) + table.insert(vmg.after_mapgen, {f = f, ...}) +end + +function vmg.execute_after_mapgen() + for i, params in ipairs(vmg.after_mapgen) do + params.f(unpack(params)) + end + vmg.after_mapgen = {} +end + +local river_size = vmg.define("river_size", 5) / 100 +local caves_size = vmg.define("caves_size", 7) / 100 +local lava_depth = vmg.define("lava_depth", 2000) +local lava_max_height = vmg.define("lava_max_height", -1) +local altitude_chill = vmg.define("altitude_chill", 90) + +local average_stone_level = vmg.define("average_stone_level", 180) +local dirt_thickness = math.sqrt(average_stone_level) / (vmg.noises[7].offset + 0.5) +local average_snow_level = vmg.define("average_snow_level", 100) +local snow_threshold = vmg.noises[17].offset * 0.5 ^ (average_snow_level / altitude_chill) + +local player_max_distance = vmg.define("player_max_distance", 450) + +local clay_threshold = vmg.define("clay_threshold", 1) +local silt_threshold = vmg.define("silt_threshold", 1) +local sand_threshold = vmg.define("sand_threshold", 0.75) +local dirt_threshold = vmg.define("dirt_threshold", 0.5) + +local tree_density = vmg.define("tree_density", 5) / 100 +local trees = vmg.define("trees", true) +local plant_density = vmg.define("plant_density", 32) / 100 +local plants = vmg.define("plants", true) + +local water_level = vmg.define("water_level", 1) + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_stone = minetest.get_content_id("default:stone") + local c_dirt = minetest.get_content_id("default:dirt") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_snow = minetest.get_content_id("default:dirt_with_snow") + local c_dirt_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey") + local c_lawn_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_grass") + local c_snow_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_snow") + local c_dirt_silt = minetest.get_content_id("valleys_mapgen:dirt_silty") + local c_lawn_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_grass") + local c_snow_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_snow") + local c_dirt_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy") + local c_lawn_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_grass") + local c_snow_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_snow") + local c_desert_sand = minetest.get_content_id("default:desert_sand") + local c_sand = minetest.get_content_id("default:sand") + local c_gravel = minetest.get_content_id("default:gravel") + local c_silt = minetest.get_content_id("valleys_mapgen:silt") + local c_clay = minetest.get_content_id("valleys_mapgen:red_clay") + local c_water = minetest.get_content_id("default:water_source") + local c_lava = minetest.get_content_id("default:lava_source") + local c_snow_layer = minetest.get_content_id("default:snow") + + local c_tree = minetest.get_content_id("default:tree") + local c_leaves = minetest.get_content_id("default:leaves") + local c_apple = minetest.get_content_id("default:apple") + local c_jungletree = minetest.get_content_id("default:jungletree") + local c_jungleleaves = minetest.get_content_id("default:jungleleaves") + local c_pinetree = minetest.get_content_id("default:pinetree") + local c_pineleaves = minetest.get_content_id("default:pine_needles") + + local c_grass = { + minetest.get_content_id("default:grass_1"), + minetest.get_content_id("default:grass_2"), + minetest.get_content_id("default:grass_3"), + minetest.get_content_id("default:grass_4"), + minetest.get_content_id("default:grass_5"), + } + local c_junglegrass = minetest.get_content_id("default:junglegrass") + local c_dryshrub = minetest.get_content_id("default:dry_shrub") + local c_cactus = minetest.get_content_id("default:cactus") + local c_papyrus = minetest.get_content_id("default:papyrus") + + local c_air = minetest.get_content_id("air") + local c_ignore = minetest.get_content_id("ignore") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local ystride = a.ystride + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = vmg.noisemap(1, minp2d, chulens) + local n2 = vmg.noisemap(2, minp2d, chulens) + local n3 = vmg.noisemap(3, minp2d, chulens) + local n4 = vmg.noisemap(4, minp2d, chulens) + local n5 = vmg.noisemap(5, minp2d, chulens) + local n6 = vmg.noisemap(6, minp, chulens_sup) + local n7 = vmg.noisemap(7, minp2d, chulens) + local n8 = vmg.noisemap(8, minp, chulens) + local n9 = vmg.noisemap(9, minp, chulens) + local n10 = vmg.noisemap(10, minp, chulens) + local n11 = vmg.noisemap(11, minp, chulens) + local n12 = vmg.noisemap(12, minp, chulens) + local n13 = vmg.noisemap(13, minp2d, chulens) + local n14 = vmg.noisemap(14, minp2d, chulens) + local n15 = vmg.noisemap(15, minp2d, chulens) + local n16 = vmg.noisemap(16, minp2d, chulens) + local n18 = vmg.noisemap(18, minp2d, chulens) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d_sup = 1 -- index for noise 6 which has a special size + local i3d = 1 -- index for 3D noises + + -- Calculate increments + local i2d_incrZ = chulens.z + local i2d_decrX = chulens.x * chulens.z - 1 + local i3d_incrY = chulens.y + local i3d_sup_incrZ = 6 * chulens.y + local i3d_decrX = chulens.x * chulens.y * chulens.z - 1 + local i3d_sup_decrX = chulens.x * (chulens.y + 6) * chulens.z - 1 + + for x = minp.x, maxp.x do -- for each YZ plane + for z = minp.z, maxp.z do -- for each vertical line in this plane + local v1, v2, v3, v4, v5, v7, v13, v14, v15, v16, v18 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d], n13[i2d], n14[i2d], n15[i2d], n16[i2d], n18[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + local river = math.abs(v2) < river_size + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. Try it with a geometry software ! (here x = v2 and a = v4) + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + + if river then + mountain_ground = math.min(math.max(base_ground - 3, water_level - 6), mountain_ground) + slopes = 0 + end + + -- Choose biome + local dirt = c_dirt + local lawn = c_lawn + local snow = c_snow + local max = math.max(v13, v14, v15) -- the biome is the maximal of these 3 values, if bigger than 0.5. Else, make normal dirt. + if max > dirt_threshold then + if v13 == max then + if v13 > clay_threshold then + dirt = c_clay + lawn = c_clay + snow = c_clay + else + dirt = c_dirt_clay + lawn = c_lawn_clay + snow = c_snow_clay + end + elseif v14 == max then + if v14 > silt_threshold then + dirt = c_silt + lawn = c_silt + snow = c_silt + else + dirt = c_dirt_silt + lawn = c_lawn_silt + snow = c_snow_silt + end + else + if v15 > sand_threshold then + dirt = c_desert_sand + lawn = c_desert_sand + snow = c_desert_sand + else + dirt = c_dirt_sand + lawn = c_lawn_sand + snow = c_snow_sand + end + end + end + local is_beach = v15 > 0 and v16 > 0 + local beach = v15 * v16 + water_level -- the y coordinate below which dirt is replaced by beach sand + + -- raw humidity + local hraw = 2 ^ (v13 - v15 + v18 * 2) + + for y = minp.y, maxp.y do -- for each node in vertical line + local ivm = a:index(x, y, z) + local v6, v8, v9, v10, v11, v12 = n6[i3d_sup], n8[i3d], n9[i3d], n10[i3d], n11[i3d], n12[i3d] + local is_cave = v8 ^ 2 + v9 ^ 2 + v10 ^ 2 + v11 ^ 2 < caves_size + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + if not is_cave then + local above = math.ceil( + v7 + math.random() - math.sqrt(math.abs(y)) / dirt_thickness -- The following code will look for air at this many nodes up. If any, make dirt, else, make stone. So, it's the dirt layer thickness. + ) + if y >= water_level and n6[i3d_sup+i3d_incrY] * slopes <= y + 1 - mountain_ground and not river then + if is_beach and y < beach then + data[ivm] = c_sand + else -- if node above is not in the ground, place lawn + + -- calculate humidity + local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) + local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) + local water = sea_water + (1 - sea_water) * river_water + local humidity = hraw + water + + local ivm2 = ivm + ystride + y = y + 1 + local pos = {x = x, y = y, z = z} + + local v17 = vmg.get_noise(pos, 17) + local temp -- calculate_temperature for node above + if y > 0 then + temp = v17 * 0.5 ^ (y / altitude_chill) + else + temp = v17 * 0.5 ^ (-y / altitude_chill) + 20 * (v12 + 1) * (1 - 2 ^ (y / lava_depth)) + end + + if temp > snow_threshold then + if above > 0 then + data[ivm] = lawn + else + data[ivm] = c_stone + end + else + if above > 0 then + data[ivm] = snow + else + data[ivm] = c_stone + end + data[ivm2] = c_snow_layer -- set node above to snow + end + + if trees and math.random() < tree_density and above > 0 then -- make a tree + + -- choose a tree from climatic and geological conditions + if v15 < 0.6 and temp >= 0.85 and temp < 2.3 and humidity < 3 and v16 < 2 and v14 > -0.5 and v13 < 0.8 then -- Apple Tree + local rand = math.random() + local height = math.floor(4 + 2.5 * rand) + local radius = 3 + rand + if math.random(1, 4) == 1 then + vmg.grow_apple_tree(pos, data, a, height, radius, c_tree, c_leaves, c_apple, c_air, c_ignore) + else + vmg.grow_tree(pos, data, a, height, radius, c_tree, c_leaves, c_air, c_ignore) + end + elseif v15 < 0.7 and temp >= 1.9 and humidity > 2 and v16 > 2 then -- Jungle Tree + local rand = math.random() + local height = math.floor(8 + 4 * rand) + local radius = 5 + 3 * rand + vmg.grow_jungle_tree(pos, data, a, height, radius, c_jungletree, c_jungleleaves, c_air, c_ignore) + elseif temp > 0.38 and temp < 1 and humidity > 0.9 and v15 > 0 and v15 < 0.55 then -- Pine Tree (or Fir Tree) + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + vmg.grow_pine_tree(pos, data, a, height, radius, c_pinetree, c_pineleaves, c_air, c_ignore) + end + elseif plants and math.random() < plant_density and above > 0 then -- make a plant + if temp > 1 and temp < 1.8 and water > 0.7 and humidity > 3 and v13 > -0.4 and math.random() < 0.04 then -- Papyrus + for i = 1, 4 do + data[ivm+i*ystride] = c_papyrus + end + elseif v15 < 0.65 and temp >= 0.65 and temp < 1.5 and humidity < 2.6 and v16 < 1.5 and v13 < 0.8 and math.random() < 0.7 then -- Grass + data[ivm2] = c_grass[math.random(1, 5)] + elseif v15 > -0.6 and temp >= 1.8 and humidity > 2.2 and v16 > 1.8 then -- Jungle Grass + data[ivm2] = c_junglegrass + elseif v15 > 0.6 and v15 < 0.9 and humidity < 0.5 and temp > 1.8 and math.random() < 0.2 then + if v16 < 0 and math.random() < 0.12 then -- Cactus + for i = 1, 4 do + data[ivm+i*ystride] = c_cactus + end + else -- Dry Shrub + data[ivm2] = c_dryshrub + end + end + end + y = y - 1 + end + elseif above <= 0 then + data[ivm] = c_stone + elseif n6[i3d_sup+above*i3d_incrY] * slopes <= y + above - mountain_ground then -- if node at "above" nodes up is not in the ground, make dirt + if is_beach and y < beach then + data[ivm] = c_sand + else + data[ivm] = dirt + end + else + data[ivm] = c_stone + end + elseif v11 + v12 > 2 ^ (y / lava_depth) and y <= lava_max_height then + data[ivm] = c_lava + end + elseif y <= water_level or river and y - 2 <= mountain_ground then -- if pos is not in the ground, and below water_level, it's an ocean + data[ivm] = c_water + end + + i3d = i3d + i3d_incrY -- increment i3d by one line + i3d_sup = i3d_sup + i3d_incrY -- idem + end + i2d = i2d + i2d_incrZ -- increment i2d by one Z + -- useless to increment i3d, because increment would be 0 ! + i3d_sup = i3d_sup + i3d_sup_incrZ -- for i3d_sup, just avoid the 6 supplemental lines + end + i2d = i2d - i2d_decrX -- decrement the Z line previously incremented and increment by one X (1) + i3d = i3d - i3d_decrX -- decrement the YZ plane previously incremented and increment by one X (1) + i3d_sup = i3d_sup - i3d_sup_decrX -- idem, including the supplemental lines + end + vmg.execute_after_mapgen() -- needed for jungletree roots + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + minetest.generate_ores(vm, minp, maxp) + vm:set_lighting({day = 0, night = 0}) + vm:calc_lighting() + vm:update_liquids() + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +dofile(vmg.path .. "/old_mapgens/2.0-trees.lua") + +function vmg.get_humidity_raw(pos) + local v13 = vmg.get_noise(pos, 13) + local v15 = vmg.get_noise(pos, 15) + local v18 = vmg.get_noise(pos, 18) + return 2 ^ (v13 - v15 + v18 * 2) +end + +function vmg.get_humidity(pos) + local y = pos.y + local flatpos = pos2d(pos) + local hraw = vmg.get_humidity_raw(flatpos) + + local v1 = vmg.get_noise(flatpos, 1) + local v3 = vmg.get_noise(flatpos, 3) ^ 2 + local base_ground = v1 + v3 + local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) + local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) + local water = sea_water + (1 - sea_water) * river_water + return hraw + water +end + +function vmg.get_temperature(pos) + local v12 = vmg.get_noise(pos, 12) + 1 + local v17 = vmg.get_noise(pos, 17) + local y = pos.y + if y > 0 then + return v17 * 0.5 ^ (y / altitude_chill) + else + return v17 * 0.5 ^ (-y / altitude_chill) + 20 * v12 * (1 - 2 ^ (y / lava_depth)) + end +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = vmg.get_noise(pos, 2) + local v3 = vmg.get_noise(pos, 3) ^ 2 + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y + end +end + +function vmg.spawnplayer(player) + local angle = math.random() * math.pi * 2 + local distance = math.random() * player_max_distance + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local pos = {x = -p_angle.x * distance, y = -p_angle.y * distance} + local elevation = vmg.get_elevation(pos) + while elevation < water_level + 2 or math.abs(vmg.get_noise(pos, 2)) < river_size do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/old_mapgens/2.1-trees.lua b/mods/valleys_mapgen/old_mapgens/2.1-trees.lua new file mode 100644 index 0000000..3b79524 --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/2.1-trees.lua @@ -0,0 +1,287 @@ +local function can_grow(pos) -- from default mod + local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) + if not node_under then + return false + end + local name_under = node_under.name + local is_soil = minetest.get_item_group(name_under, "soil") + if is_soil == 0 then + return false + end + return true +end + +minetest.register_abm({ + nodenames = {"valleys_mapgen:fir_sapling"}, + interval = 14, + chance = 50, + action = function(pos, node) + if not can_grow(pos) then + return + end + + minetest.log("action", "A fir sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + vmg.grow_fir_tree(pos) + end +}) + +function default.grow_tree(pos, is_apple_tree) + local rand = math.random() + local height = math.floor(4 + 2.5 * rand) + local radius = 3 + rand + + local leaves = minetest.get_content_id("default:leaves") + local trunk = minetest.get_content_id("default:tree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 4, y = pos.y, z = pos.z - 4}, {x = pos.x + 4, y = pos.y + height + 4, z = pos.z + 4}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + if is_apple_tree then + vmg.make_apple_tree(pos, data, area, height, radius, trunk, leaves, minetest.get_content_id("default:apple"), air, ignore) + else + vmg.make_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + end + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function default.grow_jungle_tree(pos) + local rand = math.random() + local height = math.floor(8 + 4 * rand) + local radius = 5 + 3 * rand + + local leaves = minetest.get_content_id("default:jungleleaves") + local trunk = minetest.get_content_id("default:jungletree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 8, y = pos.y - 1, z = pos.z - 8}, {x = pos.x + 8, y = pos.y + height + 5, z = pos.z + 8}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.make_jungle_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vmg.execute_after_mapgen() + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function default.grow_pine_tree(pos) + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + + local leaves = minetest.get_content_id("default:pine_needles") + local trunk = minetest.get_content_id("default:pinetree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 6, y = pos.y - 1, z = pos.z - 6}, {x = pos.x + 6, y = pos.y + height + 2, z = pos.z + 6}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.make_pine_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function vmg.grow_fir_tree(pos) + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + + local leaves = minetest.get_content_id("valleys_mapgen:fir_needles") + local trunk = minetest.get_content_id("valleys_mapgen:fir_tree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 6, y = pos.y - 1, z = pos.z - 6}, {x = pos.x + 6, y = pos.y + height + 2, z = pos.z + 6}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.make_fir_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function vmg.make_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5} + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius, z = radius}, np) +end + +function vmg.make_apple_tree(pos, data, area, height, radius, trunk, leaves, fruit, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating apple tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5} + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius, z = radius}, np, 0.06, fruit) +end + +local function make_jungle_root(x0, y0, z0, data, area, tree, air) + local ystride = area.ystride + local ybot = y0 - 1 + for x = x0 - 1, x0 + 1 do + for z = z0 - 1, z0 + 1 do + local iv = area:index(x, ybot, z) + for i = 0, 5 do + if data[iv] == air then + if math.random() < 0.6 then + data[iv-ystride] = tree -- make jungle tree below + if math.random() < 0.6 then + data[iv] = tree -- make jungle tree at this air node + end + end + break + end + iv = iv + ystride + end + end + end +end + +function vmg.make_jungle_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating jungle tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + vmg.register_after_mapgen(make_jungle_root, pos.x, pos.y, pos.z, data, area, trunk, air) + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.8} + pos.y = pos.y + height + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius * 0.5, z = radius}, np) +end + +function vmg.make_fir_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating fir tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + + -- add leaves on the top (4% 0 ; 36% 1 ; 60% 2) + local rand = math.random() + if rand < 0.96 then + data[iv] = leaves + if rand < 0.60 then + iv = iv + ystride + data[iv] = leaves + end + end + + -- make several leaves rings + local max_height = pos.y + height + local min_height = pos.y + math.floor((0.2 + 0.3 * math.random()) * height) + local radius_increment = (radius - 1.2) / (max_height - min_height) + local np = {offset = 0.8, scale = 0.4, spread = {x = 12, y = 4, z = 12}, octaves = 3, persist = 0.8} + + pos.y = max_height - 1 + while pos.y >= min_height do + local ring_radius = (max_height - pos.y) * radius_increment + 1.2 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = ring_radius, y = 2, z = ring_radius}, np) + pos.y = pos.y - math.random(2, 3) + end +end + +function vmg.make_pine_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating pine tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + + -- add leaves on the top (4% 0 ; 36% 1 ; 60% 2) + local rand = math.random() + if rand < 0.96 then + data[iv] = leaves + if rand < 0.60 then + iv = iv + ystride + data[iv] = leaves + end + end + + local np = {offset = 0.8, scale = 0.3, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 1} + local min_height = pos.y + math.floor((0.4 + 0.2 * math.random()) * height) + local midradius = radius / 2 + + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = 1.5, z = radius}, np) + while pos.y >= min_height do + local angle, distance = math.random() * 2 * math.pi, math.random() * midradius + local cos, sin = math.cos(angle) * distance, math.sin(angle) * distance + local bpos = {x = pos.x + cos, y = pos.y, z = pos.z + sin} + vmg.make_leavesblob(bpos, data, area, leaves, air, ignore, {x = midradius, y = 1.5, z = midradius}, np) + pos.y = pos.y - math.random(1, 2) + end +end + +function vmg.make_leavesblob(pos, data, area, leaves, air, ignore, radius, np, fruit_chance, fruit) + local count = 0 + fruit_chance = fruit_chance or 0 + + np.seed = math.random(0, 16777215) + local minp = vector.subtract(pos, radius) + local maxp = vector.add(pos, radius) + local int_minp = {x = math.floor(minp.x), y = math.floor(minp.y), z = math.floor(minp.z)} + local int_maxp = {x = math.ceil(maxp.x), y = math.ceil(maxp.y), z = math.ceil(maxp.z)} + + local length = vector.subtract(int_maxp, int_minp) + local chulens = vector.add(length, 1) + local obj = minetest.get_perlin_map(np, chulens) + local pmap = obj:get3dMap_flat(minp) + local i = 1 + for x = int_minp.x, int_maxp.x do + local xval = ((x - pos.x) / radius.x) ^ 2 + for y = int_minp.y, int_maxp.y do + local yval = ((y - pos.y) / radius.y) ^ 2 + for z = int_minp.z, int_maxp.z do + local zval = ((z - pos.z) / radius.z) ^ 2 + local dist = math.sqrt(xval + yval + zval) + local nval = pmap[i] + if nval > dist then + local iv = area:index(x, y, z) + if data[iv] == air or data[iv] == ignore then + count = count + 1 + if math.random() < fruit_chance then + data[iv] = fruit + else + data[iv] = leaves + end + end + end + i = i + 1 + end + end + end +end diff --git a/mods/valleys_mapgen/old_mapgens/2.1.lua b/mods/valleys_mapgen/old_mapgens/2.1.lua new file mode 100644 index 0000000..c058e1c --- /dev/null +++ b/mods/valleys_mapgen/old_mapgens/2.1.lua @@ -0,0 +1,532 @@ +-- Mapgen 2.1 +-- Saturday July 4, 2015 + +vmg.noises = { + +-- Noise 1 : Base Ground Height 2D +{offset = -10, scale = 50, seed = 5202, spread = {x = 1024, y = 1024, z = 1024}, octaves = 6, persist = 0.4, lacunarity = 2}, + +-- Noise 2 : Valleys (River where around zero) 2D +{offset = 0, scale = 1, seed = -6050, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.6, lacunarity = 2}, + +-- Noise 3 : Valleys Depth 2D +{offset = 5, scale = 4, seed = -1914, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 4 : Valleys Profile (Higher values = Larger valleys) 2D +{offset = 0.6, scale = 0.5, seed = 777, spread = {x = 512, y = 512, z = 512}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 5 : Inter-valleys slopes 2D +{offset = 0.5, scale = 0.5, seed = 746, spread = {x = 128, y = 128, z = 128}, octaves = 1, persist = 1, lacunarity = 2}, + +-- Noise 6 : Inter-valleys filling 3D +{offset = 0, scale = 1, seed = 1993, spread = {x = 256, y = 512, z = 256}, octaves = 6, persist = 0.8, lacunarity = 2}, + +-- Noise 7 : Dirt thickness 2D +{offset = 3, scale = 1.75, seed = 1605, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 8 : Caves I 3D +{offset = 0, scale = 1, seed = -4640, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 9 : Caves II 3D +{offset = 0, scale = 1, seed = 8804, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 10 : Caves III 3D +{offset = 0, scale = 1, seed = -4780, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 11 : Caves IV and Lava I 3D +{offset = 0, scale = 1, seed = -9969, spread = {x = 32, y = 32, z = 32}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 12 : Lava II (Geologic heat) 3D +{offset = 0, scale = 1, seed = 3314, spread = {x = 64, y = 64, z = 64}, octaves = 4, persist = 0.5, lacunarity = 2}, + +-- Noise 13 : Clayey dirt noise 2D +{offset = 0, scale = 1, seed = 2835, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 14 : Silty dirt noise 2D +{offset = 0, scale = 1, seed = 6674, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 15 : Sandy dirt noise 2D +{offset = 0, scale = 1, seed = 6940, spread = {x = 256, y = 256, z = 256}, octaves = 5, persist = 0.5, lacunarity = 4}, + +-- Noise 16 : Beaches 2D +{offset = 2, scale = 8, seed = 2349, spread = {x = 256, y = 256, z = 256}, octaves = 3, persist = 0.5, lacunarity = 2}, + +-- Noise 17 : Temperature (not in maps) 3D +{offset = 2, scale = 1, seed = -1805, spread = {x = 768, y = 256, z = 768}, octaves = 4, persist = 0.5, lacunarity = 4}, + +-- Noise 18 : Humidity 2D +{offset = 0, scale = 1, seed = -5787, spread = {x = 243, y = 243, z = 243}, octaves = 4, persist = 0.5, lacunarity = 3}, + +} + +function vmg.noisemap(i, minp, chulens) + local obj = minetest.get_perlin_map(vmg.noises[i], chulens) + if minp.z then + return obj:get3dMap_flat(minp) + else + return obj:get2dMap_flat(minp) + end +end + +for i, n in ipairs(vmg.noises) do + vmg.noises[i] = vmg.define("noise_" .. i, n) +end + +vmg.after_mapgen = {} + +function vmg.register_after_mapgen(f, ...) + table.insert(vmg.after_mapgen, {f = f, ...}) +end + +function vmg.execute_after_mapgen() + for i, params in ipairs(vmg.after_mapgen) do + params.f(unpack(params)) + end + vmg.after_mapgen = {} +end + +local river_depth = vmg.define("river_depth", 3) + 1 +local river_size = vmg.define("river_size", 5) / 100 +local caves_size = vmg.define("caves_size", 7) / 100 +local lava_depth = vmg.define("lava_depth", 2000) +local lava_max_height = vmg.define("lava_max_height", -1) +local altitude_chill = vmg.define("altitude_chill", 90) + +local average_stone_level = vmg.define("average_stone_level", 180) +local dirt_thickness = math.sqrt(average_stone_level) / (vmg.noises[7].offset + 0.5) +local average_snow_level = vmg.define("average_snow_level", 100) +local snow_threshold = vmg.noises[17].offset * 0.5 ^ (average_snow_level / altitude_chill) + +local player_max_distance = vmg.define("player_max_distance", 450) + +local clay_threshold = vmg.define("clay_threshold", 1) +local silt_threshold = vmg.define("silt_threshold", 1) +local sand_threshold = vmg.define("sand_threshold", 0.75) +local dirt_threshold = vmg.define("dirt_threshold", 0.5) + +local tree_density = vmg.define("tree_density", 5) / 100 +local trees = vmg.define("trees", true) +local plant_density = vmg.define("plant_density", 32) / 100 +local plants = vmg.define("plants", true) + +local water_level = vmg.define("water_level", 1) +local river_water = vmg.define("river_water", true) + +function vmg.generate(minp, maxp, seed) + local minps, maxps = minetest.pos_to_string(minp), minetest.pos_to_string(maxp) + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Preparing to generate map from " .. minps .. " to " .. maxps .. " ...") + elseif vmg.loglevel == 1 then + print("[Valleys Mapgen] Generating map from " .. minps .. " to " .. maxps .. " ...") + end + local t0 = os.clock() + + local c_stone = minetest.get_content_id("default:stone") + local c_dirt = minetest.get_content_id("default:dirt") + local c_lawn = minetest.get_content_id("default:dirt_with_grass") + local c_snow = minetest.get_content_id("default:dirt_with_snow") + local c_dirt_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey") + local c_lawn_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_grass") + local c_snow_clay = minetest.get_content_id("valleys_mapgen:dirt_clayey_with_snow") + local c_dirt_silt = minetest.get_content_id("valleys_mapgen:dirt_silty") + local c_lawn_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_grass") + local c_snow_silt = minetest.get_content_id("valleys_mapgen:dirt_silty_with_snow") + local c_dirt_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy") + local c_lawn_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_grass") + local c_snow_sand = minetest.get_content_id("valleys_mapgen:dirt_sandy_with_snow") + local c_desert_sand = minetest.get_content_id("default:desert_sand") + local c_sand = minetest.get_content_id("default:sand") + local c_gravel = minetest.get_content_id("default:gravel") + local c_silt = minetest.get_content_id("valleys_mapgen:silt") + local c_clay = minetest.get_content_id("valleys_mapgen:red_clay") + local c_water = minetest.get_content_id("default:water_source") + local c_riverwater = minetest.get_content_id("default:river_water_source") + local c_lava = minetest.get_content_id("default:lava_source") + local c_snow_layer = minetest.get_content_id("default:snow") + + local c_tree = minetest.get_content_id("default:tree") + local c_leaves = minetest.get_content_id("default:leaves") + local c_apple = minetest.get_content_id("default:apple") + local c_jungletree = minetest.get_content_id("default:jungletree") + local c_jungleleaves = minetest.get_content_id("default:jungleleaves") + local c_pinetree = minetest.get_content_id("default:pinetree") + local c_pineleaves = minetest.get_content_id("default:pine_needles") + local c_firtree = minetest.get_content_id("valleys_mapgen:fir_tree") + local c_firleaves = minetest.get_content_id("valleys_mapgen:fir_needles") + + local c_grass = { + minetest.get_content_id("default:grass_1"), + minetest.get_content_id("default:grass_2"), + minetest.get_content_id("default:grass_3"), + minetest.get_content_id("default:grass_4"), + minetest.get_content_id("default:grass_5"), + } + local c_junglegrass = minetest.get_content_id("default:junglegrass") + local c_dryshrub = minetest.get_content_id("default:dry_shrub") + local c_cactus = minetest.get_content_id("default:cactus") + local c_papyrus = minetest.get_content_id("default:papyrus") + + local c_air = minetest.get_content_id("air") + local c_ignore = minetest.get_content_id("ignore") + + local vm, emin, emax = minetest.get_mapgen_object("voxelmanip") + local data = vm:get_data() + local a = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local ystride = a.ystride + + local chulens = vector.add(vector.subtract(maxp, minp), 1) + local chulens_sup = {x = chulens.x, y = chulens.y + 6, z = chulens.z} + local minp2d = pos2d(minp) + + local t1 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Mapgen preparation finished in " .. displaytime(t1-t0)) + print("[Valleys Mapgen] Calculating noises ...") + end + + local n1 = vmg.noisemap(1, minp2d, chulens) + local n2 = vmg.noisemap(2, minp2d, chulens) + local n3 = vmg.noisemap(3, minp2d, chulens) + local n4 = vmg.noisemap(4, minp2d, chulens) + local n5 = vmg.noisemap(5, minp2d, chulens) + local n6 = vmg.noisemap(6, minp, chulens_sup) + local n7 = vmg.noisemap(7, minp2d, chulens) + local n8 = vmg.noisemap(8, minp, chulens) + local n9 = vmg.noisemap(9, minp, chulens) + local n10 = vmg.noisemap(10, minp, chulens) + local n11 = vmg.noisemap(11, minp, chulens) + local n12 = vmg.noisemap(12, minp, chulens) + local n13 = vmg.noisemap(13, minp2d, chulens) + local n14 = vmg.noisemap(14, minp2d, chulens) + local n15 = vmg.noisemap(15, minp2d, chulens) + local n16 = vmg.noisemap(16, minp2d, chulens) + local n18 = vmg.noisemap(18, minp2d, chulens) + + local t2 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Noises calculation finished in " .. displaytime(t2-t1)) + print("[Valleys Mapgen] Collecting data ...") + end + + local i2d = 1 -- index for 2D noises + local i3d_sup = 1 -- index for noise 6 which has a special size + local i3d = 1 -- index for 3D noises + + -- Calculate increments + local i2d_incrZ = chulens.z + local i2d_decrX = chulens.x * chulens.z - 1 + local i3d_incrY = chulens.y + local i3d_sup_incrZ = 6 * chulens.y + local i3d_decrX = chulens.x * chulens.y * chulens.z - 1 + local i3d_sup_decrX = chulens.x * (chulens.y + 6) * chulens.z - 1 + + for x = minp.x, maxp.x do -- for each YZ plane + for z = minp.z, maxp.z do -- for each vertical line in this plane + local v1, v2, v3, v4, v5, v7, v13, v14, v15, v16, v18 = n1[i2d], n2[i2d], n3[i2d], n4[i2d], n5[i2d], n7[i2d], n13[i2d], n14[i2d], n15[i2d], n16[i2d], n18[i2d] -- n for noise, v for value + v3 = v3 ^ 2 -- v3 must be > 0 and by the square there are high mountains but the median valleys depth is small. + local base_ground = v1 + v3 -- v3 is here because terrain is generally higher when valleys are deep (mountains) + v2 = math.abs(v2) - river_size + local river = v2 < 0 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) -- use the curve of the function 1−exp(−(x/a)²) to modelise valleys. Making "a" varying 0 < a ≤ 1 will change the shape of the valleys. Try it with a geometry software ! (here x = v2 and a = v4) + local mountain_ground = base_ground + valleys + local slopes = v5 * valleys + + if river then + local depth = river_depth * math.sqrt(1 - (v2 / river_size + 1) ^ 2) -- use the curve of the function −sqrt(1-x²) which modelizes a circle. + mountain_ground = math.min(math.max(base_ground - depth, water_level - 6), mountain_ground) + slopes = 0 + end + + -- Choose biome + local dirt = c_dirt + local lawn = c_lawn + local snow = c_snow + local max = math.max(v13, v14, v15) -- the biome is the maximal of these 3 values, if bigger than 0.5. Else, make normal dirt. + if max > dirt_threshold then + if v13 == max then + if v13 > clay_threshold then + dirt = c_clay + lawn = c_clay + snow = c_clay + else + dirt = c_dirt_clay + lawn = c_lawn_clay + snow = c_snow_clay + end + elseif v14 == max then + if v14 > silt_threshold then + dirt = c_silt + lawn = c_silt + snow = c_silt + else + dirt = c_dirt_silt + lawn = c_lawn_silt + snow = c_snow_silt + end + else + if v15 > sand_threshold then + dirt = c_desert_sand + lawn = c_desert_sand + snow = c_desert_sand + else + dirt = c_dirt_sand + lawn = c_lawn_sand + snow = c_snow_sand + end + end + end + local is_beach = v15 > 0 and v16 > 0 + local beach = v15 * v16 + water_level -- the y coordinate below which dirt is replaced by beach sand + + -- raw humidity + local hraw = 2 ^ (v13 - v15 + v18 * 2) + + for y = minp.y, maxp.y do -- for each node in vertical line + local ivm = a:index(x, y, z) + local v6, v8, v9, v10, v11, v12 = n6[i3d_sup], n8[i3d], n9[i3d], n10[i3d], n11[i3d], n12[i3d] + local is_cave = v8 ^ 2 + v9 ^ 2 + v10 ^ 2 + v11 ^ 2 < caves_size + if v6 * slopes > y - mountain_ground then -- if pos is in the ground + if not is_cave then + local above = math.ceil( + v7 + math.random() - math.sqrt(math.abs(y)) / dirt_thickness -- The following code will look for air at this many nodes up. If any, make dirt, else, make stone. So, it's the dirt layer thickness. + ) + if y >= water_level and n6[i3d_sup+i3d_incrY] * slopes <= y + 1 - mountain_ground and not river then + if is_beach and y < beach then + data[ivm] = c_sand + else -- if node above is not in the ground, place lawn + + -- calculate humidity + local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) + local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) + local water = sea_water + (1 - sea_water) * river_water + local humidity = hraw + water + + local ivm2 = ivm + ystride + y = y + 1 + local pos = {x = x, y = y, z = z} + + local v17 = vmg.get_noise(pos, 17) + local temp -- calculate_temperature for node above + if y > 0 then + temp = v17 * 0.5 ^ (y / altitude_chill) + else + temp = v17 * 0.5 ^ (-y / altitude_chill) + 20 * (v12 + 1) * (1 - 2 ^ (y / lava_depth)) + end + + if temp > snow_threshold then + if above > 0 then + data[ivm] = lawn + else + data[ivm] = c_stone + end + else + if above > 0 then + data[ivm] = snow + else + data[ivm] = c_stone + end + data[ivm2] = c_snow_layer -- set node above to snow + end + + if trees and math.random() < tree_density and above > 0 then -- make a tree + + -- choose a tree from climatic and geological conditions + if v14 < 0 and temp < 1.5 and temp >= 0.90 and humidity < 1 and v15 < 0.8 and math.abs(v13) < 0.2 and math.random() < 0.3 then -- Pine Tree + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + vmg.make_pine_tree(pos, data, a, height, radius, c_pinetree, c_pineleaves, c_air, c_ignore) + elseif v15 < 0.6 and temp >= 0.85 and temp < 2.3 and humidity < 3 and v16 < 2 and v14 > -0.5 and v13 < 0.8 then -- Apple Tree + local rand = math.random() + local height = math.floor(4 + 2.5 * rand) + local radius = 3 + rand + if math.random(1, 4) == 1 then + vmg.make_apple_tree(pos, data, a, height, radius, c_tree, c_leaves, c_apple, c_air, c_ignore) + else + vmg.make_tree(pos, data, a, height, radius, c_tree, c_leaves, c_air, c_ignore) + end + elseif v15 < 0.7 and temp >= 1.9 and humidity > 2 and v16 > 2 then -- Jungle Tree + local rand = math.random() + local height = math.floor(8 + 4 * rand) + local radius = 5 + 3 * rand + vmg.make_jungle_tree(pos, data, a, height, radius, c_jungletree, c_jungleleaves, c_air, c_ignore) + elseif temp > 0.38 and temp < 1 and humidity > 0.9 and v15 > 0 and v15 < 0.55 then -- Fir Tree + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + vmg.make_fir_tree(pos, data, a, height, radius, c_firtree, c_firleaves, c_air, c_ignore) + end + elseif plants and math.random() < plant_density and above > 0 then -- make a plant + if temp > 1 and temp < 1.8 and water > 0.7 and humidity > 3 and v13 > -0.4 and math.random() < 0.04 then -- Papyrus + for i = 1, 4 do + data[ivm+i*ystride] = c_papyrus + end + elseif v15 < 0.65 and temp >= 0.65 and temp < 1.5 and humidity < 2.6 and v16 < 1.5 and v13 < 0.8 and math.random() < 0.7 then -- Grass + data[ivm2] = c_grass[math.random(1, 5)] + elseif v15 > -0.6 and temp >= 1.8 and humidity > 2.2 and v16 > 1.8 then -- Jungle Grass + data[ivm2] = c_junglegrass + elseif v15 > 0.65 and humidity < 0.5 and math.random() < 0.2 then + if v16 > 0 and temp > 1.6 and math.random() < 0.12 then -- Cactus + for i = 1, 4 do + data[ivm+i*ystride] = c_cactus + end + elseif temp > 1.2 then -- Dry Shrub + data[ivm2] = c_dryshrub + end + end + end + y = y - 1 + end + elseif above <= 0 then + data[ivm] = c_stone + elseif n6[i3d_sup+above*i3d_incrY] * slopes <= y + above - mountain_ground then -- if node at "above" nodes up is not in the ground, make dirt + if is_beach and y < beach then + data[ivm] = c_sand + else + data[ivm] = dirt + end + else + data[ivm] = c_stone + end + elseif v11 + v12 > 2 ^ (y / lava_depth) and y <= lava_max_height then + data[ivm] = c_lava + end + elseif y <= water_level then -- if pos is not in the ground, and below water_level, it's an ocean + data[ivm] = c_water + elseif river and y + 1 < base_ground then + if river_water then + data[ivm] = c_riverwater + else + data[ivm] = c_water + end + end + + i3d = i3d + i3d_incrY -- increment i3d by one line + i3d_sup = i3d_sup + i3d_incrY -- idem + end + i2d = i2d + i2d_incrZ -- increment i2d by one Z + -- useless to increment i3d, because increment would be 0 ! + i3d_sup = i3d_sup + i3d_sup_incrZ -- for i3d_sup, just avoid the 6 supplemental lines + end + i2d = i2d - i2d_decrX -- decrement the Z line previously incremented and increment by one X (1) + i3d = i3d - i3d_decrX -- decrement the YZ plane previously incremented and increment by one X (1) + i3d_sup = i3d_sup - i3d_sup_decrX -- idem, including the supplemental lines + end + vmg.execute_after_mapgen() -- needed for jungletree roots + + local t3 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data collecting finished in " .. displaytime(t3-t2)) + print("[Valleys Mapgen] Writing data ...") + end + + -- execute voxelmanip boring stuff to write to the map + vm:set_data(data) + minetest.generate_ores(vm, minp, maxp) + vm:set_lighting({day = 0, night = 0}) + vm:calc_lighting() + vm:update_liquids() + vm:write_to_map() + + local t4 = os.clock() + if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Data writing finished in " .. displaytime(t4-t3)) + end + if vmg.loglevel >= 1 then + print("[Valleys Mapgen] Mapgen finished in " .. displaytime(t4-t0)) + end +end + +dofile(vmg.path .. "/old_mapgens/2.1-trees.lua") + +function vmg.get_humidity_raw(pos) + local v13 = vmg.get_noise(pos, 13) + local v15 = vmg.get_noise(pos, 15) + local v18 = vmg.get_noise(pos, 18) + return 2 ^ (v13 - v15 + v18 * 2) +end + +function vmg.get_humidity(pos) + local y = pos.y + local flatpos = pos2d(pos) + local hraw = vmg.get_humidity_raw(flatpos) + + local v1 = vmg.get_noise(flatpos, 1) + local v3 = vmg.get_noise(flatpos, 3) ^ 2 + local base_ground = v1 + v3 + local sea_water = 0.5 ^ math.max((y - water_level) / 6, 0) + local river_water = 0.5 ^ math.max((y - base_ground) / 3, 0) + local water = sea_water + (1 - sea_water) * river_water + return hraw + water +end + +function vmg.get_temperature(pos) + local v12 = vmg.get_noise(pos, 12) + 1 + local v17 = vmg.get_noise(pos, 17) + local y = pos.y + if y > 0 then + return v17 * 0.5 ^ (y / altitude_chill) + else + return v17 * 0.5 ^ (-y / altitude_chill) + 20 * v12 * (1 - 2 ^ (y / lava_depth)) + end +end + +function vmg.get_noise(pos, i) + local n = vmg.noises[i] + local noise = minetest.get_perlin(n.seed, n.octaves, n.persist, 1) + if not pos.z then + return noise:get2d({x = pos.x / n.spread.x, y = pos.y / n.spread.y}) * n.scale + n.offset + else + return noise:get3d({x = pos.x / n.spread.x, y = pos.y / n.spread.y, z = pos.z / n.spread.z}) * n.scale + n.offset + end +end + +local function round(n) + return math.floor(n + 0.5) +end + +function vmg.get_elevation(pos) + local v1 = vmg.get_noise(pos, 1) + local v2 = math.abs(vmg.get_noise(pos, 2)) - river_size + local v3 = vmg.get_noise(pos, 3) ^ 2 + local base_ground = v1 + v3 + if v2 < 0 then + return math.ceil(base_ground), true + end + local v4 = vmg.get_noise(pos, 4) + local v5 = vmg.get_noise(pos, 5) + local base_ground = v1 + v3 + local valleys = v3 * (1 - math.exp(- (v2 / v4) ^ 2)) + local mountain_ground = base_ground + valleys + local pos = pos3d(pos, round(mountain_ground)) + local slopes = v5 * valleys + if vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground then + pos.y = pos.y + 1 + while vmg.get_noise(pos, 6) * slopes > pos.y - mountain_ground do + pos.y = pos.y + 1 + end + return pos.y, false + else + pos.y = pos.y - 1 + while vmg.get_noise(pos, 6) * slopes <= pos.y - mountain_ground do + pos.y = pos.y - 1 + end + return pos.y, false + end +end + +function vmg.spawnplayer(player) + local angle = math.random() * math.pi * 2 + local distance = math.random() * player_max_distance + local p_angle = {x = math.cos(angle), y = math.sin(angle)} + local pos = {x = -p_angle.x * distance, y = -p_angle.y * distance} + local elevation, river = vmg.get_elevation(pos) + while elevation < water_level + 2 or river do + pos.x = pos.x + p_angle.x + pos.y = pos.y + p_angle.y + elevation, river = vmg.get_elevation({x = round(pos.x), y = round(pos.y)}) + end + pos = {x = round(pos.x), y = round(elevation + 1), z = round(pos.y)} + player:setpos(pos) + return true +end diff --git a/mods/valleys_mapgen/settings.lua b/mods/valleys_mapgen/settings.lua new file mode 100644 index 0000000..d64f7c7 --- /dev/null +++ b/mods/valleys_mapgen/settings.lua @@ -0,0 +1,132 @@ +vmg.settings = Settings(minetest.get_worldpath() .. "/vmg.conf") + +local function define_str(flag, default, write_to_config) + local value = vmg.settings:get(flag) + if value then + return value, true + else + local on_config = minetest.setting_get("vmg_" .. flag) + if on_config then + vmg.settings:set(flag, on_config) + return on_config, false + else + if write_to_config then + minetest.setting_set("vmg_" .. flag, default) + end + vmg.settings:set(flag, default) + return default, false + end + end +end + +local function define_num(flag, default, write_to_config) + local value = vmg.settings:get(flag) + if value then + return tonumber(value), true + else + local on_config = minetest.setting_get("vmg_" .. flag) + if on_config then + vmg.settings:set(flag, on_config) + return tonumber(on_config), false + else + if write_to_config then + minetest.setting_set("vmg_" .. flag, default) + end + vmg.settings:set(flag, default) + return default, false + end + end +end + +local function define_bool(flag, default, write_to_config) + local value = vmg.settings:get_bool(flag) + if value ~= nil then + return value, true + else + local on_config = minetest.setting_getbool("vmg_" .. flag) + if on_config ~= nil then + vmg.settings:set(flag, tostring(on_config)) + return on_config, false + else + if write_to_config then + minetest.setting_setbool("vmg_" .. flag, default) + end + vmg.settings:set(flag, tostring(default)) + return default, false + end + end +end + +local function define_noise(flag, default, write_to_config) + local value = vmg.settings:get(flag) + if value then + return vmg.string_to_noise(value), true + else + local on_config = minetest.setting_get("vmg_" .. flag) + if on_config then + vmg.settings:set(flag, on_config) + return vmg.string_to_noise(on_config), false + else + local str_default = vmg.noise_to_string(default) + if write_to_config then + minetest.setting_set("vmg_" .. flag, str_default) + end + vmg.settings:set(flag, str_default) + return default, false + end + end +end + +function vmg.define(flag, default, write_to_config) + local typeval = type(default) + if typeval == "string" then + return define_str(flag, default, write_to_config) + elseif typeval == "number" then + return define_num(flag, default, write_to_config) + elseif typeval == "boolean" then + return define_bool(flag, default, write_to_config) + elseif typeval == "table" then + return define_noise(flag, default, write_to_config) + end +end + +function vmg.noise_to_string(n) + return n.offset .. + ", " .. n.scale .. + ", " .. minetest.pos_to_string(n.spread) .. + ", " .. n.seed .. + ", " .. n.octaves .. + ", " .. n.persist .. + ", " .. n.lacunarity +end + +function vmg.string_to_noise(str) + local t = {} + for line in str:gmatch("[%d%.%-e]+") do + table.insert(t, tonumber(line)) + end + return { + offset = t[1], + scale = t[2], + spread = {x=t[3], y=t[4], z=t[5]}, + seed = t[6], + octaves = t[7], + persist = t[8], + lacunarity = t[9], + } +end + +if vmg.loglevel >= 2 then + print("[Valleys Mapgen] Loading mapgen ...") +end + +-- Choose the appropriate mapgen version + +local version = vmg.define("version", vmg.version) +if version == vmg.version then + dofile(vmg.path .. "/mapgen.lua") +else + dofile(vmg.path .. "/old_mapgens/" .. version .. ".lua") +end + +vmg.settings:write() diff --git a/mods/valleys_mapgen/textures/textures modification.txt b/mods/valleys_mapgen/textures/textures modification.txt new file mode 100644 index 0000000..fadb994 --- /dev/null +++ b/mods/valleys_mapgen/textures/textures modification.txt @@ -0,0 +1,40 @@ +with GIMP : +Color ~> Hue-Saturation + +vmg_dirt_clayey.png + from default_dirt.png + Hue −6 + Brightness +5 + Saturation +40 + +vmg_dirt_sandy.png + from default_dirt.png + Hue +5 + Brightness +40 + Saturation −10 + +vmg_dirt_silty.png + from default_dirt.png + Hue +8 + Brightness −10 + Saturation −30 + +vmg_red_clay.png + from default_dirt.png + Hue −5 + Brightness +10 + Saturation +100 + +vmg_silt.png + from default_dirt.png + Hue +6 + Brightness +10 + Saturation −78 + +vmg_fir_tree.png : + from default_wood.png + Hue +6 + Brightness +50 + Saturation −24 + +And convert to indexed color. diff --git a/mods/valleys_mapgen/textures/vmg_dirt_clayey.png b/mods/valleys_mapgen/textures/vmg_dirt_clayey.png new file mode 100644 index 0000000..f1fefad Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_dirt_clayey.png differ diff --git a/mods/valleys_mapgen/textures/vmg_dirt_sandy.png b/mods/valleys_mapgen/textures/vmg_dirt_sandy.png new file mode 100644 index 0000000..01ac66d Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_dirt_sandy.png differ diff --git a/mods/valleys_mapgen/textures/vmg_dirt_silty.png b/mods/valleys_mapgen/textures/vmg_dirt_silty.png new file mode 100644 index 0000000..ddb5e5b Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_dirt_silty.png differ diff --git a/mods/valleys_mapgen/textures/vmg_fir_leaves.png b/mods/valleys_mapgen/textures/vmg_fir_leaves.png new file mode 100644 index 0000000..e1487f7 Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_fir_leaves.png differ diff --git a/mods/valleys_mapgen/textures/vmg_fir_sapling.png b/mods/valleys_mapgen/textures/vmg_fir_sapling.png new file mode 100644 index 0000000..691ed3e Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_fir_sapling.png differ diff --git a/mods/valleys_mapgen/textures/vmg_fir_tree.png b/mods/valleys_mapgen/textures/vmg_fir_tree.png new file mode 100644 index 0000000..c34932c Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_fir_tree.png differ diff --git a/mods/valleys_mapgen/textures/vmg_fir_tree_top.png b/mods/valleys_mapgen/textures/vmg_fir_tree_top.png new file mode 100644 index 0000000..d421525 Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_fir_tree_top.png differ diff --git a/mods/valleys_mapgen/textures/vmg_fir_wood.png b/mods/valleys_mapgen/textures/vmg_fir_wood.png new file mode 100644 index 0000000..49fd55b Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_fir_wood.png differ diff --git a/mods/valleys_mapgen/textures/vmg_red_clay.png b/mods/valleys_mapgen/textures/vmg_red_clay.png new file mode 100644 index 0000000..6099ef1 Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_red_clay.png differ diff --git a/mods/valleys_mapgen/textures/vmg_silt.png b/mods/valleys_mapgen/textures/vmg_silt.png new file mode 100644 index 0000000..a61a5ce Binary files /dev/null and b/mods/valleys_mapgen/textures/vmg_silt.png differ diff --git a/mods/valleys_mapgen/trees.lua b/mods/valleys_mapgen/trees.lua new file mode 100644 index 0000000..3b79524 --- /dev/null +++ b/mods/valleys_mapgen/trees.lua @@ -0,0 +1,287 @@ +local function can_grow(pos) -- from default mod + local node_under = minetest.get_node_or_nil({x = pos.x, y = pos.y - 1, z = pos.z}) + if not node_under then + return false + end + local name_under = node_under.name + local is_soil = minetest.get_item_group(name_under, "soil") + if is_soil == 0 then + return false + end + return true +end + +minetest.register_abm({ + nodenames = {"valleys_mapgen:fir_sapling"}, + interval = 14, + chance = 50, + action = function(pos, node) + if not can_grow(pos) then + return + end + + minetest.log("action", "A fir sapling grows into a tree at ".. + minetest.pos_to_string(pos)) + vmg.grow_fir_tree(pos) + end +}) + +function default.grow_tree(pos, is_apple_tree) + local rand = math.random() + local height = math.floor(4 + 2.5 * rand) + local radius = 3 + rand + + local leaves = minetest.get_content_id("default:leaves") + local trunk = minetest.get_content_id("default:tree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 4, y = pos.y, z = pos.z - 4}, {x = pos.x + 4, y = pos.y + height + 4, z = pos.z + 4}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + if is_apple_tree then + vmg.make_apple_tree(pos, data, area, height, radius, trunk, leaves, minetest.get_content_id("default:apple"), air, ignore) + else + vmg.make_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + end + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function default.grow_jungle_tree(pos) + local rand = math.random() + local height = math.floor(8 + 4 * rand) + local radius = 5 + 3 * rand + + local leaves = minetest.get_content_id("default:jungleleaves") + local trunk = minetest.get_content_id("default:jungletree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 8, y = pos.y - 1, z = pos.z - 8}, {x = pos.x + 8, y = pos.y + height + 5, z = pos.z + 8}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.make_jungle_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vmg.execute_after_mapgen() + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function default.grow_pine_tree(pos) + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + + local leaves = minetest.get_content_id("default:pine_needles") + local trunk = minetest.get_content_id("default:pinetree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 6, y = pos.y - 1, z = pos.z - 6}, {x = pos.x + 6, y = pos.y + height + 2, z = pos.z + 6}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.make_pine_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function vmg.grow_fir_tree(pos) + local rand = math.random() + local height = math.floor(9 + 6 * rand) + local radius = 4 + 2 * rand + + local leaves = minetest.get_content_id("valleys_mapgen:fir_needles") + local trunk = minetest.get_content_id("valleys_mapgen:fir_tree") + local air = minetest.get_content_id("air") + local ignore = minetest.get_content_id("ignore") + local vm = minetest.get_voxel_manip() + local emin, emax = vm:read_from_map({x = pos.x - 6, y = pos.y - 1, z = pos.z - 6}, {x = pos.x + 6, y = pos.y + height + 2, z = pos.z + 6}) + local area = VoxelArea:new({MinEdge = emin, MaxEdge = emax}) + local data = vm:get_data() + vmg.make_fir_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + vm:set_data(data) + vm:write_to_map() + vm:update_map() +end + +function vmg.make_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5} + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius, z = radius}, np) +end + +function vmg.make_apple_tree(pos, data, area, height, radius, trunk, leaves, fruit, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating apple tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.5} + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius, z = radius}, np, 0.06, fruit) +end + +local function make_jungle_root(x0, y0, z0, data, area, tree, air) + local ystride = area.ystride + local ybot = y0 - 1 + for x = x0 - 1, x0 + 1 do + for z = z0 - 1, z0 + 1 do + local iv = area:index(x, ybot, z) + for i = 0, 5 do + if data[iv] == air then + if math.random() < 0.6 then + data[iv-ystride] = tree -- make jungle tree below + if math.random() < 0.6 then + data[iv] = tree -- make jungle tree at this air node + end + end + break + end + iv = iv + ystride + end + end + end +end + +function vmg.make_jungle_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating jungle tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + vmg.register_after_mapgen(make_jungle_root, pos.x, pos.y, pos.z, data, area, trunk, air) + local np = {offset = 0.8, scale = 0.4, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 0.8} + pos.y = pos.y + height + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = radius * 0.5, z = radius}, np) +end + +function vmg.make_fir_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating fir tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + + -- add leaves on the top (4% 0 ; 36% 1 ; 60% 2) + local rand = math.random() + if rand < 0.96 then + data[iv] = leaves + if rand < 0.60 then + iv = iv + ystride + data[iv] = leaves + end + end + + -- make several leaves rings + local max_height = pos.y + height + local min_height = pos.y + math.floor((0.2 + 0.3 * math.random()) * height) + local radius_increment = (radius - 1.2) / (max_height - min_height) + local np = {offset = 0.8, scale = 0.4, spread = {x = 12, y = 4, z = 12}, octaves = 3, persist = 0.8} + + pos.y = max_height - 1 + while pos.y >= min_height do + local ring_radius = (max_height - pos.y) * radius_increment + 1.2 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = ring_radius, y = 2, z = ring_radius}, np) + pos.y = pos.y - math.random(2, 3) + end +end + +function vmg.make_pine_tree(pos, data, area, height, radius, trunk, leaves, air, ignore) + if vmg.loglevel >= 3 then + print("[Valleys Mapgen] Generating pine tree at " .. minetest.pos_to_string(pos) .. " ...") + end + local ystride = area.ystride + local iv = area:indexp(pos) + for i = 1, height do + data[iv] = trunk + iv = iv + ystride + end + + -- add leaves on the top (4% 0 ; 36% 1 ; 60% 2) + local rand = math.random() + if rand < 0.96 then + data[iv] = leaves + if rand < 0.60 then + iv = iv + ystride + data[iv] = leaves + end + end + + local np = {offset = 0.8, scale = 0.3, spread = {x = 8, y = 4, z = 8}, octaves = 3, persist = 1} + local min_height = pos.y + math.floor((0.4 + 0.2 * math.random()) * height) + local midradius = radius / 2 + + pos.y = pos.y + height - 1 + vmg.make_leavesblob(pos, data, area, leaves, air, ignore, {x = radius, y = 1.5, z = radius}, np) + while pos.y >= min_height do + local angle, distance = math.random() * 2 * math.pi, math.random() * midradius + local cos, sin = math.cos(angle) * distance, math.sin(angle) * distance + local bpos = {x = pos.x + cos, y = pos.y, z = pos.z + sin} + vmg.make_leavesblob(bpos, data, area, leaves, air, ignore, {x = midradius, y = 1.5, z = midradius}, np) + pos.y = pos.y - math.random(1, 2) + end +end + +function vmg.make_leavesblob(pos, data, area, leaves, air, ignore, radius, np, fruit_chance, fruit) + local count = 0 + fruit_chance = fruit_chance or 0 + + np.seed = math.random(0, 16777215) + local minp = vector.subtract(pos, radius) + local maxp = vector.add(pos, radius) + local int_minp = {x = math.floor(minp.x), y = math.floor(minp.y), z = math.floor(minp.z)} + local int_maxp = {x = math.ceil(maxp.x), y = math.ceil(maxp.y), z = math.ceil(maxp.z)} + + local length = vector.subtract(int_maxp, int_minp) + local chulens = vector.add(length, 1) + local obj = minetest.get_perlin_map(np, chulens) + local pmap = obj:get3dMap_flat(minp) + local i = 1 + for x = int_minp.x, int_maxp.x do + local xval = ((x - pos.x) / radius.x) ^ 2 + for y = int_minp.y, int_maxp.y do + local yval = ((y - pos.y) / radius.y) ^ 2 + for z = int_minp.z, int_maxp.z do + local zval = ((z - pos.z) / radius.z) ^ 2 + local dist = math.sqrt(xval + yval + zval) + local nval = pmap[i] + if nval > dist then + local iv = area:index(x, y, z) + if data[iv] == air or data[iv] == ignore then + count = count + 1 + if math.random() < fruit_chance then + data[iv] = fruit + else + data[iv] = leaves + end + end + end + i = i + 1 + end + end + end +end diff --git a/mods/valleys_mapgen/vmg.conf.example b/mods/valleys_mapgen/vmg.conf.example new file mode 100644 index 0000000..c783b5f --- /dev/null +++ b/mods/valleys_mapgen/vmg.conf.example @@ -0,0 +1,88 @@ +# format : FLAG = VALUE + +# Settings are presents twice : +# - In every world : +# world_directory/vmg.conf + +# - In the main directory : +# usually main_directory/minetest.conf + +# /!\ IMPORTANT : In minetest.conf, flags have to be preceded by "vmg_" like "vmg_average_stone_level". + + + +#version = 2.2 +# mapgen version used. + +#player_max_distance = 450 +# maximal distance from (0;0) at which the player will appear. (If it's in a big ocean, it may be farther) +#spawn = true +# New players are randomely spawned by the mod. Disable it to spawn the player another way. +#respawn = true +# After death, players are respawned by the mod. Disable it to respawn the player another way. + +#water_level = 1 +#river_water = true +# use river water instead of normal water in rivers. +#waterflow = 3 +# maximal length of a river water flowing. + +#average_stone_level = 180 +# height at which the half of the surface is made solely of stone. +#average_snow_level = 100 +# height at which the half of the surface is covered by snow. +#clay_threshold = 1 +# if noise 13 is above this value, make pure clay instead of clayey dirt. +#silt_threshold = 1 +# if noise 14 is above this value, make pure silt instead of silty dirt. +#sand_threshold = 0.75 +# if noise 15 is above this value, make desert sand instead of sandy dirt. +#dirt_threshold = 0.5 +# if not any of noises 13, 14 and 15 is above this value, make normal dirt. Else make special dirt. +#river_depth = 3 +#river_size = 5 +#caves_size = 7 +#lava_depth = 2000 +# to manage lava amount increasing by going deep underground : lower values = bigger increasing. +#surface_lava = false +# DEPRECATED. No longer supported since mapgen version 2.0. Use lava_max_height instead. +#lava_max_height = -1 +# Lava can't be generated above this height. Use 31000 to disable this restriction, or -31000 to fully disable lava. +#altitude_chill = 90 + +#trees = true +# If false, no trees, of course ! +#plants = true +#tree_density = 5 +# Percent of the lawn nodes that are covered by trees. +#plant_density = 32 + +# NOISES : offset, scale, (spread), seed, octaves, persist, lacunarity +# (see mapgen.lua to see what is the role of each noise) + +#noise_1 = -10, 50, (1024,1024,1024), 5202, 6, 0.4, 2 +#noise_2 = 0, 1, (256,256,256), -6050, 5, 0.6, 2 +#noise_3 = 5, 4, (512,512,512), -1914, 1, 1, 2 +#noise_4 = 0.6, 0.5, (512,512,512), 777, 1, 1, 2 +#noise_5 = 0.5, 0.5, (128,128,128), 746, 1, 1, 2 +#noise_6 = 0, 1, (256,512,256), 1993, 6, 0.8, 2 +#noise_7 = 3, 1.75, (256,256,256), 1605, 3, 0.5, 2 +#noise_8 = 0, 1, (32,32,32), -4640, 4, 0.5, 2 +#noise_9 = 0, 1, (32,32,32), 8804, 4, 0.5, 2 +#noise_10 = 0, 1, (32,32,32), -4780, 4, 0.5, 2 +#noise_11 = 0, 1, (32,32,32), -9969, 4, 0.5, 2 +#noise_12 = 0, 1, (64,64,64), 3314, 4, 0.5, 2 +#noise_13 = 0, 1, (256,256,256), 2835, 5, 0.5, 4 +#noise_14 = 0, 1, (256,256,256), 6674, 5, 0.5, 4 +#noise_15 = 0, 1, (256,256,256), 6940, 5, 0.5, 4 +#noise_16 = 2, 8, (256,256,256), 2349, 3, 0.5, 2 +#noise_17 = 0, 1, (768,256,768), -1805, 4, 0.5, 4 +#noise_18 = 0, 1, (243,243,243), -5787, 4, 0.5, 3 + +# Flags that are ONLY available in minetest.conf : + +#vmg_log_level = 0 +# 0 = Not any log from Valleys Mapgen +# 1 = Total mapgen time +# 2 = Detailed mapgen time (step by step) +# 3 = Detailed mapgen time + trees diff --git a/mods/vessels/README.txt b/mods/vessels/README.txt new file mode 100644 index 0000000..150b501 --- /dev/null +++ b/mods/vessels/README.txt @@ -0,0 +1,45 @@ +Minetest 0.4 mod: vessels +========================== + +Crafts +------- +Glass bottle (yields 10) + + G - G + G - G + - G - + +Drinking Glass (yields 14) + + G - G + G - G + G G G + +Heavy Steel Bottle (yields 5) + + S - S + S - S + - S - + +License of source code: +----------------------- +Copyright (C) 2012 Vanessa Ezekowitz +Version 2012-09-02 +Modifications by Perttu Ahola + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +http://www.gnu.org/licenses/lgpl-2.1.html + +License of media (textures and sounds) +-------------------------------------- +WTFPL + +Authors of media files +----------------------- +Unless specifically noted, +Copyright (C) 2012 Vanessa Ezekowitz + diff --git a/mods/vessels/depends.txt b/mods/vessels/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/vessels/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/vessels/init.lua b/mods/vessels/init.lua new file mode 100644 index 0000000..bed5ded --- /dev/null +++ b/mods/vessels/init.lua @@ -0,0 +1,200 @@ +-- Minetest 0.4 mod: vessels +-- See README.txt for licensing and other information. + +local vessels_shelf_formspec = + "size[8,7;]".. + default.gui_bg.. + default.gui_bg_img.. + default.gui_slots.. + "list[context;vessels;0,0.3;8,2;]".. + "list[current_player;main;0,2.85;8,1;]".. + "list[current_player;main;0,4.08;8,3;8]".. + default.get_hotbar_bg(0,2.85) + +minetest.register_node("vessels:shelf", { + description = "Vessels shelf", + tiles = {"default_wood.png", "default_wood.png", "default_wood.png^vessels_shelf.png"}, + is_ground_content = false, + groups = {choppy=3,oddly_breakable_by_hand=2,flammable=3}, + sounds = default.node_sound_wood_defaults(), + + on_construct = function(pos) + local meta = minetest.get_meta(pos) + meta:set_string("formspec", vessels_shelf_formspec) + local inv = meta:get_inventory() + inv:set_size("vessels", 8*2) + end, + can_dig = function(pos,player) + local meta = minetest.get_meta(pos); + local inv = meta:get_inventory() + return inv:is_empty("vessels") + end, + + allow_metadata_inventory_put = function(pos, listname, index, stack, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local to_stack = inv:get_stack(listname, index) + if listname == "vessels" then + if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + end, + + allow_metadata_inventory_move = function(pos, from_list, from_index, to_list, to_index, count, player) + local meta = minetest.get_meta(pos) + local inv = meta:get_inventory() + local stack = inv:get_stack(from_list, from_index) + local to_stack = inv:get_stack(to_list, to_index) + if to_list == "vessels" then + if minetest.get_item_group(stack:get_name(), "vessel") ~= 0 + and to_stack:is_empty() then + return 1 + else + return 0 + end + end + 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 vessels shelf 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 vessels shelf 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 vessels shelf at "..minetest.pos_to_string(pos)) + end, +}) + +minetest.register_craft({ + output = 'vessels:shelf', + recipe = { + {'group:wood', 'group:wood', 'group:wood'}, + {'group:vessel', 'group:vessel', 'group:vessel'}, + {'group:wood', 'group:wood', 'group:wood'}, + } +}) + +minetest.register_node("vessels:glass_bottle", { + description = "Glass Bottle (empty)", + drawtype = "plantlike", + tiles = {"vessels_glass_bottle.png"}, + inventory_image = "vessels_glass_bottle_inv.png", + wield_image = "vessels_glass_bottle.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft( { + output = "vessels:glass_bottle 10", + recipe = { + { "default:glass", "", "default:glass" }, + { "default:glass", "", "default:glass" }, + { "", "default:glass", "" } + } +}) + +minetest.register_node("vessels:drinking_glass", { + description = "Drinking Glass (empty)", + drawtype = "plantlike", + tiles = {"vessels_drinking_glass.png"}, + inventory_image = "vessels_drinking_glass_inv.png", + wield_image = "vessels_drinking_glass.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1}, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft( { + output = "vessels:drinking_glass 14", + recipe = { + { "default:glass", "", "default:glass" }, + { "default:glass", "", "default:glass" }, + { "default:glass", "default:glass", "default:glass" } + } +}) + +minetest.register_node("vessels:steel_bottle", { + description = "Heavy Steel Bottle (empty)", + drawtype = "plantlike", + tiles = {"vessels_steel_bottle.png"}, + inventory_image = "vessels_steel_bottle_inv.png", + wield_image = "vessels_steel_bottle.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.4, 0.25} + }, + groups = {vessel=1,dig_immediate=3,attached_node=1}, + sounds = default.node_sound_defaults(), +}) + +minetest.register_craft( { + output = "vessels:steel_bottle 5", + recipe = { + { "default:steel_ingot", "", "default:steel_ingot" }, + { "default:steel_ingot", "", "default:steel_ingot" }, + { "", "default:steel_ingot", "" } + } +}) + + +-- Make sure we can recycle them + +minetest.register_craftitem("vessels:glass_fragments", { + description = "Pile of Glass Fragments", + inventory_image = "vessels_glass_fragments.png", +}) + +minetest.register_craft( { + type = "shapeless", + output = "vessels:glass_fragments", + recipe = { + "vessels:glass_bottle", + "vessels:glass_bottle", + }, +}) + +minetest.register_craft( { + type = "shapeless", + output = "vessels:glass_fragments", + recipe = { + "vessels:drinking_glass", + "vessels:drinking_glass", + }, +}) + +minetest.register_craft({ + type = "cooking", + output = "default:glass", + recipe = "vessels:glass_fragments", +}) + +minetest.register_craft( { + type = "cooking", + output = "default:steel_ingot", + recipe = "vessels:steel_bottle", +}) + diff --git a/mods/vessels/textures/vessels_drinking_glass.png b/mods/vessels/textures/vessels_drinking_glass.png new file mode 100644 index 0000000..4cff308 Binary files /dev/null and b/mods/vessels/textures/vessels_drinking_glass.png differ diff --git a/mods/vessels/textures/vessels_drinking_glass_inv.png b/mods/vessels/textures/vessels_drinking_glass_inv.png new file mode 100644 index 0000000..4cff308 Binary files /dev/null and b/mods/vessels/textures/vessels_drinking_glass_inv.png differ diff --git a/mods/vessels/textures/vessels_glass_bottle.png b/mods/vessels/textures/vessels_glass_bottle.png new file mode 100644 index 0000000..e9dc683 Binary files /dev/null and b/mods/vessels/textures/vessels_glass_bottle.png differ diff --git a/mods/vessels/textures/vessels_glass_bottle_inv.png b/mods/vessels/textures/vessels_glass_bottle_inv.png new file mode 100644 index 0000000..e9dc683 Binary files /dev/null and b/mods/vessels/textures/vessels_glass_bottle_inv.png differ diff --git a/mods/vessels/textures/vessels_glass_fragments.png b/mods/vessels/textures/vessels_glass_fragments.png new file mode 100644 index 0000000..7c6c488 Binary files /dev/null and b/mods/vessels/textures/vessels_glass_fragments.png differ diff --git a/mods/vessels/textures/vessels_shelf.png b/mods/vessels/textures/vessels_shelf.png new file mode 100644 index 0000000..87c69b2 Binary files /dev/null and b/mods/vessels/textures/vessels_shelf.png differ diff --git a/mods/vessels/textures/vessels_steel_bottle.png b/mods/vessels/textures/vessels_steel_bottle.png new file mode 100644 index 0000000..834a3d5 Binary files /dev/null and b/mods/vessels/textures/vessels_steel_bottle.png differ diff --git a/mods/vessels/textures/vessels_steel_bottle_inv.png b/mods/vessels/textures/vessels_steel_bottle_inv.png new file mode 100644 index 0000000..834a3d5 Binary files /dev/null and b/mods/vessels/textures/vessels_steel_bottle_inv.png differ diff --git a/mods/wool/README.txt b/mods/wool/README.txt new file mode 100644 index 0000000..9db1332 --- /dev/null +++ b/mods/wool/README.txt @@ -0,0 +1,28 @@ +Minetest 0.4 mod: wool +====================== + +Mostly backward-compatible with jordach's 16-color wool mod. + +License of source code: +----------------------- +Copyright (C) 2012 Perttu Ahola (celeron55) + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. + +License of media (textures and sounds) +-------------------------------------- +Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) +http://creativecommons.org/licenses/by-sa/3.0/ + +Authors of media files +----------------------- +Cisoun: +- wool_black.png wool_brown.png wool_dark_green.png wool_green.png +- wool_magenta.png wool_pink.png wool_violet.png wool_yellow.png wool_blue.png +- wool_cyan.png wool_dark_grey.png wool_grey.png wool_orange.png wool_red.png +- wool_white.png + diff --git a/mods/wool/depends.txt b/mods/wool/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/mods/wool/depends.txt @@ -0,0 +1 @@ +default diff --git a/mods/wool/init.lua b/mods/wool/init.lua new file mode 100644 index 0000000..9c17b0c --- /dev/null +++ b/mods/wool/init.lua @@ -0,0 +1,50 @@ +-- minetest/wool/init.lua + +-- Backwards compatibility with jordach's 16-color wool mod +minetest.register_alias("wool:dark_blue", "wool:blue") +minetest.register_alias("wool:gold", "wool:yellow") + +local wool = {} +-- This uses a trick: you can first define the recipes using all of the base +-- colors, and then some recipes using more specific colors for a few non-base +-- colors available. When crafting, the last recipes will be checked first. +wool.dyes = { + {"white", "White", nil}, + {"grey", "Grey", "basecolor_grey"}, + {"black", "Black", "basecolor_black"}, + {"red", "Red", "basecolor_red"}, + {"yellow", "Yellow", "basecolor_yellow"}, + {"green", "Green", "basecolor_green"}, + {"cyan", "Cyan", "basecolor_cyan"}, + {"blue", "Blue", "basecolor_blue"}, + {"magenta", "Magenta", "basecolor_magenta"}, + {"orange", "Orange", "excolor_orange"}, + {"violet", "Violet", "excolor_violet"}, + {"brown", "Brown", "unicolor_dark_orange"}, + {"pink", "Pink", "unicolor_light_red"}, + {"dark_grey", "Dark Grey", "unicolor_darkgrey"}, + {"dark_green", "Dark Green", "unicolor_dark_green"}, +} + +for _, row in ipairs(wool.dyes) do + local name = row[1] + local desc = row[2] + local craft_color_group = row[3] + -- Node Definition + minetest.register_node("wool:"..name, { + description = desc.." Wool", + tiles = {"wool_"..name..".png"}, + is_ground_content = false, + groups = {snappy=2,choppy=2,oddly_breakable_by_hand=3,flammable=3,wool=1}, + sounds = default.node_sound_defaults(), + }) + if craft_color_group then + -- Crafting from dye and white wool + minetest.register_craft({ + type = "shapeless", + output = 'wool:'..name, + recipe = {'group:dye,'..craft_color_group, 'group:wool'}, + }) + end +end + diff --git a/mods/wool/textures/wool_black.png b/mods/wool/textures/wool_black.png new file mode 100644 index 0000000..a9e566b Binary files /dev/null and b/mods/wool/textures/wool_black.png differ diff --git a/mods/wool/textures/wool_blue.png b/mods/wool/textures/wool_blue.png new file mode 100644 index 0000000..035a8da Binary files /dev/null and b/mods/wool/textures/wool_blue.png differ diff --git a/mods/wool/textures/wool_brown.png b/mods/wool/textures/wool_brown.png new file mode 100644 index 0000000..2620dfd Binary files /dev/null and b/mods/wool/textures/wool_brown.png differ diff --git a/mods/wool/textures/wool_cyan.png b/mods/wool/textures/wool_cyan.png new file mode 100644 index 0000000..4e1e4a3 Binary files /dev/null and b/mods/wool/textures/wool_cyan.png differ diff --git a/mods/wool/textures/wool_dark_green.png b/mods/wool/textures/wool_dark_green.png new file mode 100644 index 0000000..92c5631 Binary files /dev/null and b/mods/wool/textures/wool_dark_green.png differ diff --git a/mods/wool/textures/wool_dark_grey.png b/mods/wool/textures/wool_dark_grey.png new file mode 100644 index 0000000..0624525 Binary files /dev/null and b/mods/wool/textures/wool_dark_grey.png differ diff --git a/mods/wool/textures/wool_green.png b/mods/wool/textures/wool_green.png new file mode 100644 index 0000000..554471a Binary files /dev/null and b/mods/wool/textures/wool_green.png differ diff --git a/mods/wool/textures/wool_grey.png b/mods/wool/textures/wool_grey.png new file mode 100644 index 0000000..ff38bf7 Binary files /dev/null and b/mods/wool/textures/wool_grey.png differ diff --git a/mods/wool/textures/wool_magenta.png b/mods/wool/textures/wool_magenta.png new file mode 100644 index 0000000..5b254e4 Binary files /dev/null and b/mods/wool/textures/wool_magenta.png differ diff --git a/mods/wool/textures/wool_orange.png b/mods/wool/textures/wool_orange.png new file mode 100644 index 0000000..64f34c0 Binary files /dev/null and b/mods/wool/textures/wool_orange.png differ diff --git a/mods/wool/textures/wool_pink.png b/mods/wool/textures/wool_pink.png new file mode 100644 index 0000000..0513540 Binary files /dev/null and b/mods/wool/textures/wool_pink.png differ diff --git a/mods/wool/textures/wool_red.png b/mods/wool/textures/wool_red.png new file mode 100644 index 0000000..de05af1 Binary files /dev/null and b/mods/wool/textures/wool_red.png differ diff --git a/mods/wool/textures/wool_violet.png b/mods/wool/textures/wool_violet.png new file mode 100644 index 0000000..a41a9f4 Binary files /dev/null and b/mods/wool/textures/wool_violet.png differ diff --git a/mods/wool/textures/wool_white.png b/mods/wool/textures/wool_white.png new file mode 100644 index 0000000..2bbb9cf Binary files /dev/null and b/mods/wool/textures/wool_white.png differ diff --git a/mods/wool/textures/wool_yellow.png b/mods/wool/textures/wool_yellow.png new file mode 100644 index 0000000..a95bb34 Binary files /dev/null and b/mods/wool/textures/wool_yellow.png differ diff --git a/mods/xpanes/README.txt b/mods/xpanes/README.txt new file mode 100644 index 0000000..233978c --- /dev/null +++ b/mods/xpanes/README.txt @@ -0,0 +1,16 @@ +Minetest 0.4.x mod: xpanes +========================== + +License: +-------- +Copyright (C) xyz +modified by BlockMen (iron bars) + +Gambit (WTFPL): + xpanes_bar.png + +This program is free software. It comes without any warranty, to +the extent permitted by applicable law. You can redistribute it +and/or modify it under the terms of the Do What The Fuck You Want +To Public License, Version 2, as published by Sam Hocevar. See +http://sam.zoy.org/wtfpl/COPYING for more details. diff --git a/mods/xpanes/depends.txt b/mods/xpanes/depends.txt new file mode 100644 index 0000000..331d858 --- /dev/null +++ b/mods/xpanes/depends.txt @@ -0,0 +1 @@ +default \ No newline at end of file diff --git a/mods/xpanes/init.lua b/mods/xpanes/init.lua new file mode 100644 index 0000000..84221d6 --- /dev/null +++ b/mods/xpanes/init.lua @@ -0,0 +1,195 @@ +xpanes = {} + +local function rshift(x, by) + return math.floor(x / 2 ^ by) +end + +local directions = { + {x = 1, y = 0, z = 0}, + {x = 0, y = 0, z = 1}, + {x = -1, y = 0, z = 0}, + {x = 0, y = 0, z = -1}, +} + +local function update_pane(pos, name) + if not minetest.get_node(pos).name:find("^xpanes:"..name) then + return + end + local sum = 0 + for i, dir in pairs(directions) do + local node = minetest.get_node({ + x = pos.x + dir.x, + y = pos.y + dir.y, + z = pos.z + dir.z + }) + local def = minetest.registered_nodes[node.name] + local pane_num = def and def.groups.pane or 0 + if pane_num > 0 or not def or (def.walkable ~= false and + def.drawtype ~= "nodebox") then + sum = sum + 2 ^ (i - 1) + end + end + if sum == 0 then + sum = 15 + end + minetest.set_node(pos, {name = "xpanes:"..name.."_"..sum}) +end + +local function update_nearby(pos, node) + node = node or minetest.get_node(pos) + local name = node.name + if not name or node.name:sub(1, 7) ~= "xpanes:" then + return + end + local underscore_pos = string.find(name, "_[^_]*$") or 0 + local len = name:len() + local num = tonumber(name:sub(underscore_pos+1, len)) + if not num or num < 1 or num > 15 then + name = name:sub(8) + else + name = name:sub(8, underscore_pos - 1) + end + for i, dir in pairs(directions) do + update_pane({ + x = pos.x + dir.x, + y = pos.y + dir.y, + z = pos.z + dir.z + }, name) + end +end + +local half_boxes = { + {0, -0.5, -1/32, 0.5, 0.5, 1/32}, + {-1/32, -0.5, 0, 1/32, 0.5, 0.5}, + {-0.5, -0.5, -1/32, 0, 0.5, 1/32}, + {-1/32, -0.5, -0.5, 1/32, 0.5, 0} +} + +local full_boxes = { + {-0.5, -0.5, -1/32, 0.5, 0.5, 1/32}, + {-1/32, -0.5, -0.5, 1/32, 0.5, 0.5} +} + +local sb_half_boxes = { + {0, -0.5, -0.06, 0.5, 0.5, 0.06}, + {-0.06, -0.5, 0, 0.06, 0.5, 0.5}, + {-0.5, -0.5, -0.06, 0, 0.5, 0.06}, + {-0.06, -0.5, -0.5, 0.06, 0.5, 0} +} + +local sb_full_boxes = { + {-0.5, -0.5, -0.06, 0.5, 0.5, 0.06}, + {-0.06, -0.5, -0.5, 0.06, 0.5, 0.5} +} + +function xpanes.register_pane(name, def) + for i = 1, 15 do + local need = {} + local cnt = 0 + for j = 1, 4 do + if rshift(i, j - 1) % 2 == 1 then + need[j] = true + cnt = cnt + 1 + end + end + local take = {} + local take2 = {} + if need[1] == true and need[3] == true then + need[1] = nil + need[3] = nil + table.insert(take, full_boxes[1]) + table.insert(take2, sb_full_boxes[1]) + end + if need[2] == true and need[4] == true then + need[2] = nil + need[4] = nil + table.insert(take, full_boxes[2]) + table.insert(take2, sb_full_boxes[2]) + end + for k in pairs(need) do + table.insert(take, half_boxes[k]) + table.insert(take2, sb_half_boxes[k]) + end + local texture = def.textures[1] + if cnt == 1 then + texture = def.textures[1].."^"..def.textures[2] + end + minetest.register_node(":xpanes:"..name.."_"..i, { + drawtype = "nodebox", + tiles = {def.textures[3], def.textures[3], texture}, + paramtype = "light", + groups = def.groups, + drop = "xpanes:"..name, + sounds = def.sounds, + node_box = { + type = "fixed", + fixed = take + }, + selection_box = { + type = "fixed", + fixed = take2 + } + }) + end + + def.on_construct = function(pos) + update_pane(pos, name) + end + + minetest.register_node(":xpanes:"..name, def) + + minetest.register_craft({ + output = "xpanes:"..name.." 16", + recipe = def.recipe + }) +end + +minetest.register_on_placenode(update_nearby) +minetest.register_on_dignode(update_nearby) + +xpanes.register_pane("pane", { + description = "Glass Pane", + tiles = {"xpanes_space.png"}, + drawtype = "airlike", + paramtype = "light", + is_ground_content = false, + sunlight_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + air_equivalent = true, + textures = {"default_glass.png","xpanes_pane_half.png","xpanes_white.png"}, + inventory_image = "default_glass.png", + wield_image = "default_glass.png", + sounds = default.node_sound_glass_defaults(), + groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1}, + recipe = { + {'default:glass', 'default:glass', 'default:glass'}, + {'default:glass', 'default:glass', 'default:glass'} + } +}) + +xpanes.register_pane("bar", { + description = "Iron bar", + tiles = {"xpanes_space.png"}, + drawtype = "airlike", + paramtype = "light", + is_ground_content = false, + sunlight_propagates = true, + walkable = false, + pointable = false, + diggable = false, + buildable_to = true, + air_equivalent = true, + textures = {"xpanes_bar.png","xpanes_bar.png","xpanes_space.png"}, + inventory_image = "xpanes_bar.png", + wield_image = "xpanes_bar.png", + groups = {snappy=2, cracky=3, oddly_breakable_by_hand=3, pane=1}, + sounds = default.node_sound_stone_defaults(), + recipe = { + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'}, + {'default:steel_ingot', 'default:steel_ingot', 'default:steel_ingot'} + } +}) + diff --git a/mods/xpanes/textures/xpanes_bar.png b/mods/xpanes/textures/xpanes_bar.png new file mode 100644 index 0000000..4d17ceb Binary files /dev/null and b/mods/xpanes/textures/xpanes_bar.png differ diff --git a/mods/xpanes/textures/xpanes_grey.png b/mods/xpanes/textures/xpanes_grey.png new file mode 100644 index 0000000..e1c6f76 Binary files /dev/null and b/mods/xpanes/textures/xpanes_grey.png differ diff --git a/mods/xpanes/textures/xpanes_pane_half.png b/mods/xpanes/textures/xpanes_pane_half.png new file mode 100644 index 0000000..4e846df Binary files /dev/null and b/mods/xpanes/textures/xpanes_pane_half.png differ diff --git a/mods/xpanes/textures/xpanes_space.png b/mods/xpanes/textures/xpanes_space.png new file mode 100644 index 0000000..016cb35 Binary files /dev/null and b/mods/xpanes/textures/xpanes_space.png differ diff --git a/mods/xpanes/textures/xpanes_white.png b/mods/xpanes/textures/xpanes_white.png new file mode 100644 index 0000000..777bd60 Binary files /dev/null and b/mods/xpanes/textures/xpanes_white.png differ