diff --git a/minetestforfun_game/mods/default/README.txt b/minetestforfun_game/mods/default/README.txt index ac0d0c73..04d34621 100755 --- a/minetestforfun_game/mods/default/README.txt +++ b/minetestforfun_game/mods/default/README.txt @@ -58,6 +58,8 @@ VanessaE (WTFPL): default_desert_sand.png default_desert_stone.png default_sand.png + default_mese_crystal.png + default_mese_crystal_fragment.png Calinou (CC BY-SA): default_brick.png @@ -99,7 +101,7 @@ Zeg9 (CC BY-SA 3.0): default_gold_block.png paramat (CC BY-SA 3.0): - wieldhand.png copied from character.png by Jordach (CC BY-SA 3.0) + wieldhand.png -- Copied from character.png by Jordach (CC BY-SA 3.0) default_pinetree.png default_pinetree_top.png default_pinewood.png @@ -114,6 +116,10 @@ paramat (CC BY-SA 3.0): default_obsidian_brick.png default_stone_brick.png default_desert_stone_brick.png + default_sandstone_block.png + default_obsidian_block.png + default_stone_block.png + default_desert_stone_block.png default_river_water.png default_river_water_source_animated.png default_river_water_flowing_animated.png @@ -122,6 +128,8 @@ paramat (CC BY-SA 3.0): default_dry_grass_*.png default_grass.png default_grass_side.png + default_snow_side.png + default_mese_block.png brunob.santos (CC BY-SA 4.0): default_desert_cobble.png @@ -184,6 +192,9 @@ Gambit (WTFPL): asl97 (WTFPL): default_ice.png +KevDoy (CC BY-SA 3.0) + heart.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/ diff --git a/minetestforfun_game/mods/default/crafting.lua b/minetestforfun_game/mods/default/crafting.lua index f2623d9c..b4fcd9a7 100755 --- a/minetestforfun_game/mods/default/crafting.lua +++ b/minetestforfun_game/mods/default/crafting.lua @@ -958,6 +958,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'default:stone_block 9', + recipe = { + {'default:stone', 'default:stone', 'default:stone'}, + {'default:stone', 'default:stone', 'default:stone'}, + {'default:stone', 'default:stone', 'default:stone'}, + } +}) + minetest.register_craft({ output = 'default:desert_stonebrick 4', recipe = { @@ -966,6 +975,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = 'default:desert_stone_block 9', + recipe = { + {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'}, + {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'}, + {'default:desert_stone', 'default:desert_stone', 'default:desert_stone'}, + } +}) + minetest.register_craft({ output = 'default:snowblock', recipe = { diff --git a/minetestforfun_game/mods/default/craftitems.lua b/minetestforfun_game/mods/default/craftitems.lua index 0ca79105..8b4d1187 100755 --- a/minetestforfun_game/mods/default/craftitems.lua +++ b/minetestforfun_game/mods/default/craftitems.lua @@ -12,24 +12,34 @@ minetest.register_craftitem("default:paper", { inventory_image = "default_paper.png", }) +local lpp = 14 -- Lines per book's page local function book_on_use(itemstack, user) local player_name = user:get_player_name() local data = minetest.deserialize(itemstack:get_metadata()) - local formspec, title, text, owner = "", "", "", player_name - local page, page_max, cpp = 1, 1, 650 + local title, text, owner = "", "", player_name + local page, page_max, lines, string = 1, 1, {}, "" if data then title = data.title text = data.text owner = data.owner + for str in (text .. "\n"):gmatch("([^\n]*)[\n]") do + lines[#lines+1] = str + end + if data.page then page = data.page page_max = data.page_max - cpp = data.chars_per_page + + for i = ((lpp * page) - lpp) + 1, lpp * page do + if not lines[i] then break end + string = string .. lines[i] .. "\n" + end end end + local formspec if owner == player_name then formspec = "size[8,8]" .. default.gui_bg .. default.gui_bg_img .. @@ -45,8 +55,8 @@ local function book_on_use(itemstack, user) "tablecolumns[color;text]" .. "tableoptions[background=#00000000;highlight=#00000000;border=false]" .. "table[0.4,0;7,0.5;title;#FFFF00," .. minetest.formspec_escape(title) .. "]" .. - "textarea[0.5,1.5;7.5,7;;" .. minetest.formspec_escape(text:sub( - (cpp * page) - cpp, cpp * page)) .. ";]" .. + "textarea[0.5,1.5;7.5,7;;" .. + minetest.formspec_escape(string ~= "" and string or text) .. ";]" .. "button[2.4,7.6;0.8,0.8;book_prev;<]" .. "label[3.2,7.7;Page " .. page .. " of " .. page_max .. "]" .. "button[4.9,7.6;0.8,0.8;book_next;>]" @@ -77,10 +87,9 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) if not data then data = {} end data.title = fields.title data.text = fields.text - data.text_len = fields.text:len() + data.text_len = #data.text data.page = 1 - data.chars_per_page = 650 - data.page_max = math.ceil(data.text_len / data.chars_per_page) + data.page_max = math.ceil((#data.text:gsub("[^\n]", "") + 1) / lpp) data.owner = player:get_player_name() local data_str = minetest.serialize(data) @@ -95,8 +104,6 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) stack:set_metadata(data_str) end - player:set_wielded_item(stack) - elseif fields.book_next or fields.book_prev then local data = minetest.deserialize(stack:get_metadata()) if not data.page then return end @@ -117,6 +124,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) stack:set_metadata(data_str) book_on_use(stack, player) end + + player:set_wielded_item(stack) end) minetest.register_craftitem("default:book", { @@ -145,7 +154,6 @@ minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv return end - local copy = ItemStack("default:book_written") local original local index for i = 1, player:get_inventory():get_size("craft") do diff --git a/minetestforfun_game/mods/default/functions.lua b/minetestforfun_game/mods/default/functions.lua index 9eb25436..9138f53d 100755 --- a/minetestforfun_game/mods/default/functions.lua +++ b/minetestforfun_game/mods/default/functions.lua @@ -49,6 +49,18 @@ function default.node_sound_sand_defaults(table) return table end +function default.node_sound_gravel_defaults(table) + table = table or {} + table.footstep = table.footstep or + {name = "default_gravel_footstep", gain = 0.5} + table.dug = table.dug or + {name = "default_gravel_footstep", gain = 1.0} + 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 @@ -99,6 +111,7 @@ default.cool_lava = function(pos, node) end minetest.register_abm({ + label = "Lava cooling", nodenames = {"default:lava_source", "default:lava_flowing"}, neighbors = {"group:water"}, interval = 1, @@ -110,6 +123,21 @@ minetest.register_abm({ }) +-- +-- optimized helper to put all items in an inventory into a drops list +-- +function default.get_inventory_drops(pos, inventory, drops) + local inv = minetest.get_meta(pos):get_inventory() + local n = #drops + for i = 1, inv:get_size(inventory) do + local stack = inv:get_stack(inventory, i) + if stack:get_count() > 0 then + drops[n+1] = stack:to_table() + n = n + 1 + end + end +end + -- -- Papyrus and cactus growing -- @@ -163,6 +191,7 @@ function default.grow_papyrus(pos, node) end minetest.register_abm({ + label = "Grow cactus", nodenames = {"default:cactus"}, neighbors = {"group:sand", "default:dirt_with_dry_grass"}, --MFF interval = 12, @@ -173,6 +202,7 @@ minetest.register_abm({ }) minetest.register_abm({ + label = "Grow papyrus", nodenames = {"default:papyrus"}, neighbors = {"default:dirt", "default:dirt_with_grass", "default:sand", "default:desert_sand"}, --MFF interval = 14, @@ -277,6 +307,7 @@ default.after_place_leaves = function(pos, placer, itemstack, pointed_thing) end minetest.register_abm({ + label = "Leaf decay", nodenames = {"group:leafdecay"}, neighbors = {"air", "group:liquid"}, -- A low interval and a high inverse chance spreads the load @@ -358,49 +389,74 @@ minetest.register_abm({ }) -minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) - if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then - return - end - minetest.remove_node(pos, newnode) - minetest.set_node(pos, oldnode) - minetest.add_item(pos, "default:torch") -end) - -- --- Grass growing on well-lit dirt +-- Convert dirt to something that fits the environment -- minetest.register_abm({ + label = "Grass spread", nodenames = {"default:dirt"}, - neighbors = {"air"}, + neighbors = { + "default:dirt_with_grass", + "default:dirt_with_dry_grass", + "default:dirt_with_snow", + "group:grass", + "group:dry_grass", + "default:snow", + }, interval = 6, chance = 67, catch_up = false, action = function(pos, node) + -- Most likely case, half the time it's too dark for this. 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 - pos.y >= 0 and - (minetest.get_node_light(above) or 0) >= 12 then - if name == "default:snow" or name == "default:snowblock" then - minetest.set_node(pos, {name = "default:dirt_with_snow"}) - else - minetest.set_node(pos, {name = "default:dirt_with_grass"}) + if (minetest.get_node_light(above) or 0) < 13 then + return + end + + -- Look for likely neighbors. + local p2 = minetest.find_node_near(pos, 1, {"default:dirt_with_grass", + "default:dirt_with_dry_grass", "default:dirt_with_snow"}) + if p2 then + -- But the node needs to be under air in this case. + local n2 = minetest.get_node(above) + if n2 and n2.name == "air" then + local n3 = minetest.get_node(p2) + minetest.set_node(pos, {name = n3.name}) + return end end + + -- Anything on top? + local n2 = minetest.get_node(above) + if not n2 then + return + end + + local name = n2.name + -- Snow check is cheapest, so comes first. + if name == "default:snow" then + minetest.set_node(pos, {name = "default:dirt_with_snow"}) + -- Most likely case first. + elseif minetest.get_item_group(name, "grass") ~= 0 then + minetest.set_node(pos, {name = "default:dirt_with_grass"}) + elseif minetest.get_item_group(name, "dry_grass") ~= 0 then + minetest.set_node(pos, {name = "default:dirt_with_dry_grass"}) + end end }) - -- -- Grass and dry grass removed in darkness -- minetest.register_abm({ - nodenames = {"default:dirt_with_grass", "default:dirt_with_dry_grass"}, + label = "Grass covered", + nodenames = { + "default:dirt_with_grass", + "default:dirt_with_dry_grass", + "default:dirt_with_snow", + }, interval = 8, chance = 50, catch_up = false, @@ -422,12 +478,59 @@ minetest.register_abm({ -- minetest.register_abm({ - nodenames = {"default:cobble"}, + label = "Moss growth", + nodenames = {"default:cobble", "stairs:slab_cobble", "stairs:stair_cobble"}, neighbors = {"group:water"}, interval = 16, chance = 200, catch_up = false, action = function(pos, node) - minetest.set_node(pos, {name = "default:mossycobble"}) + if node.name == "default:cobble" then + minetest.set_node(pos, {name = "default:mossycobble"}) + elseif node.name == "stairs:slab_cobble" then + minetest.set_node(pos, {name = "stairs:slab_mossycobble", param2 = node.param2}) + elseif node.name == "stairs:stair_cobble" then + minetest.set_node(pos, {name = "stairs:stair_mossycobble", param2 = node.param2}) + end end }) + + +-- +-- Checks if specified volume intersects a protected volume +-- + +function default.intersects_protection(minp, maxp, player_name, interval) + -- 'interval' is the largest allowed interval for the 3D lattice of checks + + -- Compute the optimal float step 'd' for each axis so that all corners and + -- borders are checked. 'd' will be smaller or equal to 'interval'. + -- Subtracting 1e-4 ensures that the max co-ordinate will be reached by the + -- for loop (which might otherwise not be the case due to rounding errors). + local d = {} + for _, c in pairs({"x", "y", "z"}) do + if maxp[c] > minp[c] then + d[c] = (maxp[c] - minp[c]) / math.ceil((maxp[c] - minp[c]) / interval) - 1e-4 + elseif maxp[c] == minp[c] then + d[c] = 1 -- Any value larger than 0 to avoid division by zero + else -- maxp[c] < minp[c], print error and treat as protection intersected + minetest.log("error", "maxp < minp in 'default.intersects_protection()'") + return true + end + end + + for zf = minp.z, maxp.z, d.z do + local z = math.floor(zf + 0.5) + for yf = minp.y, maxp.y, d.y do + local y = math.floor(yf + 0.5) + for xf = minp.x, maxp.x, d.x do + local x = math.floor(xf + 0.5) + if minetest.is_protected({x = x, y = y, z = z}, player_name) then + return true + end + end + end + end + + return false +end diff --git a/minetestforfun_game/mods/default/furnace.lua b/minetestforfun_game/mods/default/furnace.lua index 8066b3ae..741c5d86 100755 --- a/minetestforfun_game/mods/default/furnace.lua +++ b/minetestforfun_game/mods/default/furnace.lua @@ -111,7 +111,6 @@ local function furnace_node_timer(pos, elapsed) local inv = meta:get_inventory() local srclist = inv:get_list("src") local fuellist = inv:get_list("fuel") - local dstlist = inv:get_list("dst") -- -- Cooking @@ -172,7 +171,7 @@ local function furnace_node_timer(pos, elapsed) -- Update formspec, infotext and node -- local formspec = inactive_formspec - local item_state = "" + local item_state local item_percent = 0 if cookable then item_percent = math.floor(src_time / cooked.time * 100) @@ -260,6 +259,15 @@ minetest.register_node("default:furnace", { local timer = minetest.get_node_timer(pos) timer:start(1.0) end, + on_blast = function(pos) + local drops = {} + default.get_inventory_drops(pos, "src", drops) + default.get_inventory_drops(pos, "fuel", drops) + default.get_inventory_drops(pos, "dst", drops) + drops[#drops+1] = "default:furnace" + minetest.remove_node(pos) + return drops + end, allow_metadata_inventory_put = allow_metadata_inventory_put, allow_metadata_inventory_move = allow_metadata_inventory_move, diff --git a/minetestforfun_game/mods/default/init.lua b/minetestforfun_game/mods/default/init.lua index 24228214..b362fc75 100755 --- a/minetestforfun_game/mods/default/init.lua +++ b/minetestforfun_game/mods/default/init.lua @@ -1,8 +1,6 @@ -- Minetest 0.4 mod: default -- See README.txt for licensing and other information. -default = {} -- Definitions made by this mod are usable by all mods. - -- The API documentation in here was moved into game_api.txt -- Definitions made by this mod that other mods can use too @@ -38,7 +36,7 @@ default.gui_survival_form = "size[8,8.5]".. -- Load files dofile(minetest.get_modpath("default").."/functions.lua") -dofile(minetest.get_modpath("default").."/commands.lua") +dofile(minetest.get_modpath("default").."/trees.lua") dofile(minetest.get_modpath("default").."/nodes.lua") dofile(minetest.get_modpath("default").."/furnace.lua") dofile(minetest.get_modpath("default").."/tools.lua") @@ -46,103 +44,5 @@ 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") - --- Code below by Casimir. - -local function count_items() - local i = 0 - local number = 0 - for name, item in pairs(minetest.registered_items) do - if (name and name ~= "") then - number = number + 1 - end - i = i + 1 - end - minetest.log("action", "There are " .. number .. " registered nodes, items and tools.") -end - -local function player_join_sounds() - minetest.register_on_joinplayer(function() - minetest.sound_play("player_join", {gain = 0.75}) - end) -end - -local function player_leave_sounds() - minetest.register_on_leaveplayer(function() - minetest.sound_play("player_leave", {gain = 1}) - end) -end - -minetest.after(1, count_items) -minetest.after(5, player_join_sounds) -minetest.after(5, player_leave_sounds) - - -minetest.register_on_joinplayer(function(player) - player:set_physics_override({ - sneak_glitch = false, -- Climable blocks are quite fast in Carbone. - }) -end) - -minetest.register_on_respawnplayer(function(player) - player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) - local pos = player:getpos() - -- minetest.sound_play("player_join", {pos = pos, gain = 0.5}) -end) - -minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing) - if user:get_hp() >= 20 then return end - local pos = user:getpos() - minetest.sound_play("health_gain", {pos = pos, gain = 0.4}) -end) - -minetest.log("action", "") -- Empty line. -minetest.log("action", "") -- Empty line. - -if minetest.setting_getbool("creative_mode") then - minetest.log("action", "Creative mode is enabled.") - else - minetest.log("action", "Creative mode is disabled.") -end - -if minetest.setting_getbool("enable_damage") then - minetest.log("action", "Damage is enabled.") - else - minetest.log("action", "Damage is disabled.") -end - -if minetest.setting_getbool("enable_pvp") then - minetest.log("action", "PvP is enabled.") - else - minetest.log("action", "PvP is disabled.") -end - -if not minetest.is_singleplayer() and minetest.setting_getbool("server_announce") then - minetest.log("action", "") -- Empty line. - minetest.log("action", "Server name: " .. minetest.setting_get("server_name") or "(none)") - minetest.log("action", "Server description: " .. minetest.setting_get("server_description") or "(none)") - minetest.log("action", "Server URL: " .. minetest.setting_get("server_address") or "(none)") - minetest.log("action", "MOTD: " .. minetest.setting_get("motd") or "(none)") - minetest.log("action", "Maximum users: " .. minetest.setting_get("max_users") or 15) -end - -minetest.log("action", "") -- Empty line. -minetest.log("action", "") -- Empty line. - --- Reserved slot handling: - -minetest.register_on_prejoinplayer(function(name, ip) - if #minetest.get_connected_players() >= (minetest.setting_get("max_users") - 2) - and not minetest.check_player_privs(name, {server = true}) then - return "Sorry, 2 slots are reserved for administrators." - end -end) - - -if minetest.setting_getbool("log_mods") then - -- Highlight the default mod in the mod loading logs: - minetest.log("action", "Carbone: * [default] loaded.") -end diff --git a/minetestforfun_game/mods/default/mapgen.lua b/minetestforfun_game/mods/default/mapgen.lua index b5bfde21..42b3f971 100755 --- a/minetestforfun_game/mods/default/mapgen.lua +++ b/minetestforfun_game/mods/default/mapgen.lua @@ -42,14 +42,14 @@ minetest.register_alias("mapgen_stair_sandstonebrick", "stairs:stair_sandstonebr -- Register ores -- --- All mapgens except singlenode --- Blob ore first to avoid other ores inside blobs - function default.register_ores() + -- Blob ores + -- These first to avoid other ores in blobs -- Clay + -- This first to avoid clay in sand blobs - minetest.register_ore({ + minetest.register_ore({ ore_type = "blob", ore = "default:clay", wherein = {"default:sand"}, @@ -70,7 +70,7 @@ function default.register_ores() -- Sand - minetest.register_ore({ + minetest.register_ore({ ore_type = "blob", ore = "default:sand", wherein = {"default:stone", "default:sandstone", @@ -132,6 +132,8 @@ function default.register_ores() }, }) + -- Scatter ores + -- Coal minetest.register_ore({ @@ -225,6 +227,8 @@ function default.register_ores() y_max = -64, }) + -- Copper + minetest.register_ore({ ore_type = "scatter", ore = "default:stone_with_iron", @@ -260,6 +264,8 @@ function default.register_ores() y_max = -256, }) + -- Gold + minetest.register_ore({ ore_type = "scatter", ore = "default:mese", @@ -730,6 +736,8 @@ function default.register_biomes() depth_water_top = 10, --node_water = "", node_river_water = "default:ice", + node_riverbed = "default:gravel", + depth_riverbed = 2, y_min = -8, y_max = 31000, heat_point = 0, @@ -768,6 +776,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:gravel", + depth_riverbed = 2, y_min = 2, y_max = 31000, heat_point = 15, @@ -786,6 +796,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:gravel", + depth_riverbed = 2, y_min = -3, y_max = 1, heat_point = 15, @@ -804,6 +816,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:gravel", + depth_riverbed = 2, y_min = -112, y_max = -4, heat_point = 15, @@ -823,6 +837,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 2, y_max = 31000, heat_point = 15, @@ -841,6 +857,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = 1, heat_point = 15, @@ -861,6 +879,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 6, y_max = 31000, heat_point = 40, @@ -879,6 +899,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 5, y_max = 5, heat_point = 40, @@ -897,6 +919,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = 4, heat_point = 40, @@ -916,6 +940,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 6, y_max = 31000, heat_point = 40, @@ -934,6 +960,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 5, y_max = 5, heat_point = 40, @@ -952,6 +980,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = 4, heat_point = 40, @@ -971,6 +1001,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 6, y_max = 31000, heat_point = 60, @@ -989,6 +1021,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 5, y_max = 5, heat_point = 60, @@ -1007,6 +1041,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = 4, heat_point = 60, @@ -1026,6 +1062,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 1, y_max = 31000, heat_point = 60, @@ -1044,6 +1082,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -3, y_max = 0, heat_point = 60, @@ -1062,6 +1102,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = -4, heat_point = 60, @@ -1082,6 +1124,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 5, y_max = 31000, heat_point = 85, @@ -1100,6 +1144,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = 4, heat_point = 85, @@ -1119,6 +1165,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 1, y_max = 31000, heat_point = 85, @@ -1137,6 +1185,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -3, y_max = 0, heat_point = 85, @@ -1155,6 +1205,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = -4, heat_point = 85, @@ -1174,6 +1226,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = 1, y_max = 31000, heat_point = 85, @@ -1192,6 +1246,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -3, y_max = 0, heat_point = 85, @@ -1210,6 +1266,8 @@ function default.register_biomes() --depth_water_top = , --node_water = "", --node_river_water = "", + node_riverbed = "default:sand", + depth_riverbed = 2, y_min = -112, y_max = -4, heat_point = 85, diff --git a/minetestforfun_game/mods/default/nodes.lua b/minetestforfun_game/mods/default/nodes.lua index 8ece0ba4..4300f317 100755 --- a/minetestforfun_game/mods/default/nodes.lua +++ b/minetestforfun_game/mods/default/nodes.lua @@ -19,18 +19,22 @@ Stone default:stone default:cobble default:stonebrick +default:stone_block default:mossycobble default:desert_stone default:desert_cobble default:desert_stonebrick +default:desert_stone_block default:sandstone default:sandstonebrick +default:sandstone_block default:obsidian default:obsidian_cooled default:obsidianbrick +default:obsidian_block Soft / Non-Stone ---------------- @@ -247,12 +251,22 @@ minetest.register_node("default:cobble_cooled", { minetest.register_node("default:stonebrick", { description = "Stone Brick", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_stone_brick.png"}, is_ground_content = false, groups = {cracky = 2, stone = 1}, sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:stone_block", { + description = "Stone Block", + tiles = {"default_stone_block.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"}, @@ -293,12 +307,22 @@ minetest.register_node("default:desert_cobble", { minetest.register_node("default:desert_stonebrick", { description = "Desert Stone Brick", + paramtype2 = "facedir", + place_param2 = 0, 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:desert_stone_block", { + description = "Desert Stone Block", + tiles = {"default_desert_stone_block.png"}, + is_ground_content = false, + groups = {cracky = 2, stone = 1}, + sounds = default.node_sound_stone_defaults(), +}) + minetest.register_node("default:sandstone", { description = "Sandstone", @@ -309,12 +333,22 @@ minetest.register_node("default:sandstone", { minetest.register_node("default:sandstonebrick", { description = "Sandstone Brick", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_sandstone_brick.png"}, is_ground_content = false, groups = {cracky = 2}, sounds = default.node_sound_stone_defaults(), }) +minetest.register_node("default:sandstone_block", { + description = "Sandstone Block", + tiles = {"default_sandstone_block.png"}, + is_ground_content = false, + groups = {cracky = 2}, + sounds = default.node_sound_stone_defaults(), +}) + minetest.register_node("default:obsidian", { description = "Obsidian", @@ -335,12 +369,22 @@ minetest.register_node("default:obsidian_cooled", { minetest.register_node("default:obsidianbrick", { description = "Obsidian Brick", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_obsidian_brick.png"}, is_ground_content = false, sounds = default.node_sound_stone_defaults(), groups = {cracky = 1, level = 2}, }) +minetest.register_node("default:obsidian_block", { + description = "Obsidian Block", + tiles = {"default_obsidian_block.png"}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), + groups = {cracky = 1, level = 2}, +}) + -- -- Soft / Non-Stone -- @@ -442,10 +486,7 @@ 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}, - }), + sounds = default.node_sound_gravel_defaults(), drop = { max_items = 1, items = { @@ -487,6 +528,7 @@ minetest.register_node("default:snow", { paramtype = "light", buildable_to = true, floodable = true, + walkable = false, drawtype = "nodebox", node_box = { type = "fixed", @@ -546,6 +588,8 @@ minetest.register_node("default:tree", { minetest.register_node("default:wood", { description = "Wooden Planks", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_wood.png"}, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, @@ -562,6 +606,7 @@ minetest.register_node("default:sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + on_timer = default.grow_sapling, selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} @@ -569,6 +614,23 @@ minetest.register_node("default:sapling", { groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(2400,4800)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -2, y = 1, z = -2}, + {x = 2, y = 6, z = 2}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, }) minetest.register_node("default:leaves", { @@ -642,6 +704,8 @@ minetest.register_node("default:jungletree", { minetest.register_node("default:junglewood", { description = "Junglewood Planks", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_junglewood.png"}, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, @@ -680,6 +744,7 @@ minetest.register_node("default:junglesapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + on_timer = default.grow_sapling, selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} @@ -687,6 +752,23 @@ minetest.register_node("default:junglesapling", { groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(2400,4800)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:junglesapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -2, y = 1, z = -2}, + {x = 2, y = 15, z = 2}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, }) @@ -704,6 +786,8 @@ minetest.register_node("default:pine_tree", { minetest.register_node("default:pine_wood", { description = "Pine Wood Planks", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_pine_wood.png"}, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, @@ -741,6 +825,7 @@ minetest.register_node("default:pine_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + on_timer = default.grow_sapling, selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} @@ -748,6 +833,23 @@ minetest.register_node("default:pine_sapling", { groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(2400,4800)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:pine_sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -2, y = 1, z = -2}, + {x = 2, y = 12, z = 2}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, }) @@ -765,6 +867,8 @@ minetest.register_node("default:acacia_tree", { minetest.register_node("default:acacia_wood", { description = "Acacia Wood Planks", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_acacia_wood.png"}, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, @@ -802,6 +906,7 @@ minetest.register_node("default:acacia_sapling", { paramtype = "light", sunlight_propagates = true, walkable = false, + on_timer = default.grow_sapling, selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} @@ -809,6 +914,23 @@ minetest.register_node("default:acacia_sapling", { groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), + + on_construct = function(pos) + minetest.get_node_timer(pos):start(math.random(2400,4800)) + end, + + on_place = function(itemstack, placer, pointed_thing) + itemstack = default.sapling_on_place(itemstack, placer, pointed_thing, + "default:acacia_sapling", + -- minp, maxp to be checked, relative to sapling pos + -- minp_relative.y = 1 because sapling pos has been checked + {x = -4, y = 1, z = -4}, + {x = 4, y = 6, z = 4}, + -- maximum interval of interior volume check + 4) + + return itemstack + end, }) minetest.register_node("default:aspen_tree", { @@ -825,6 +947,8 @@ minetest.register_node("default:aspen_tree", { minetest.register_node("default:aspen_wood", { description = "Aspen Wood Planks", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_aspen_wood.png"}, is_ground_content = false, groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3, wood = 1}, @@ -863,11 +987,12 @@ minetest.register_node("default:aspen_sapling", { sunlight_propagates = true, walkable = false, is_ground_content = true, + on_timer = default.grow_sapling, selection_box = { type = "fixed", fixed = {-0.3, -0.5, -0.3, 0.3, 0.35, 0.3} }, - groups = {snappy = 3, flammable=2, + groups = {snappy = 2, dig_immediate = 3, flammable = 2, attached_node = 1, sapling = 1}, sounds = default.node_sound_leaves_defaults(), }) @@ -1005,7 +1130,7 @@ minetest.register_node("default:coalblock", { minetest.register_node("default:stone_with_iron", { description = "Iron Ore", tiles = {"default_stone.png^default_mineral_iron.png"}, - groups = {cracky = 3}, + groups = {cracky = 2}, drop = { items = { {items = {"default:cobble"}}, @@ -1029,7 +1154,7 @@ minetest.register_node("default:stone_with_copper", { description = "Copper Ore", tiles = {"default_stone.png^default_mineral_copper.png"}, is_ground_content = true, - groups = {cracky = 3}, + groups = {cracky = 2}, drop = { items = { {items = {"default:cobble"}}, @@ -1150,7 +1275,7 @@ minetest.register_node("default:silverblock", { minetest.register_node("default:stone_with_mese", { description = "Mese Ore", tiles = {"default_stone.png^default_mineral_mese.png"}, - groups = {cracky = 3}, + groups = {cracky = 1}, drop = { items = { {items = {"default:cobble"}}, @@ -1205,7 +1330,7 @@ minetest.register_alias("default:meze_block", "default:meze") minetest.register_node("default:stone_with_gold", { description = "Gold Ore", tiles = {"default_stone.png^default_mineral_gold.png"}, - groups = {cracky = 3}, + groups = {cracky = 2}, drop = { items = { {items = {"default:cobble"}}, @@ -1250,7 +1375,7 @@ minetest.register_node("default:mithrilblock", { minetest.register_node("default:stone_with_diamond", { description = "Diamond Ore", tiles = {"default_stone.png^default_mineral_diamond.png"}, - groups = {cracky = 3}, + groups = {cracky = 1}, drop = { items = { {items = {"default:cobble"}}, @@ -1360,7 +1485,7 @@ minetest.register_node("default:junglegrass", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1}, + groups = {snappy = 3, flammable = 2, flora = 1, attached_node = 1, grass = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -1381,7 +1506,7 @@ minetest.register_node("default:grass_1", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1}, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1, grass = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -1411,7 +1536,7 @@ for i = 2, 5 do buildable_to = true, drop = "default:grass_1", groups = {snappy = 3, flammable = 3, flora = 1, - attached_node = 1, not_in_creative_inventory = 1}, + attached_node = 1, not_in_creative_inventory = 1, grass = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -1432,7 +1557,7 @@ minetest.register_node("default:dry_grass_1", { sunlight_propagates = true, walkable = false, buildable_to = true, - groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1}, + groups = {snappy = 3, flammable = 3, flora = 1, attached_node = 1, dry_grass = 1}, sounds = default.node_sound_leaves_defaults(), selection_box = { type = "fixed", @@ -1461,7 +1586,7 @@ for i = 2, 5 do walkable = false, buildable_to = true, groups = {snappy = 3, flammable = 3, flora = 1, - attached_node = 1, not_in_creative_inventory=1}, + attached_node = 1, not_in_creative_inventory=1, dry_grass = 1}, drop = "default:dry_grass_1", sounds = default.node_sound_leaves_defaults(), selection_box = { @@ -2023,6 +2148,13 @@ minetest.register_node("default:chest", { " takes " .. stack:get_name() .. " from chest at " .. minetest.pos_to_string(pos)) end, + on_blast = function(pos) + local drops = {} + default.get_inventory_drops(pos, "main", drops) + drops[#drops+1] = "default:chest" + minetest.remove_node(pos) + return drops + end, }) minetest.register_node("default:chest_locked", { @@ -2085,7 +2217,7 @@ minetest.register_node("default:chest_locked", { " takes " .. stack:get_name() .. " from locked chest at " .. minetest.pos_to_string(pos)) end, - on_rightclick = function(pos, node, clicker) + on_rightclick = function(pos, node, clicker, itemstack, pointed_thing) local meta = minetest.get_meta(pos) if has_locked_chest_privilege(meta, clicker) then minetest.show_formspec( @@ -2094,6 +2226,7 @@ minetest.register_node("default:chest_locked", { get_locked_chest_formspec(pos) ) end + return itemstack end, on_blast = function() end, }) @@ -2113,7 +2246,9 @@ local bookshelf_formspec = minetest.register_node("default:bookshelf", { description = "Bookshelf", - tiles = {"default_wood.png", "default_wood.png", "default_bookshelf.png"}, + tiles = {"default_wood.png", "default_wood.png", "default_wood.png", + "default_wood.png", "default_bookshelf.png", "default_bookshelf.png"}, + paramtype2 = "facedir", is_ground_content = false, groups = {choppy = 3, oddly_breakable_by_hand = 2, flammable = 3}, sounds = default.node_sound_wood_defaults(), @@ -2146,6 +2281,13 @@ minetest.register_node("default:bookshelf", { minetest.log("action", player:get_player_name() .. " takes stuff from bookshelf at " .. minetest.pos_to_string(pos)) end, + on_blast = function(pos) + local drops = {} + default.get_inventory_drops(pos, "books", drops) + drops[#drops+1] = "default:bookshelf" + minetest.remove_node(pos) + return drops + end, }) local function register_sign(material, desc, def) @@ -2388,6 +2530,8 @@ minetest.register_node("default:rail", { minetest.register_node("default:brick", { description = "Brick Block", + paramtype2 = "facedir", + place_param2 = 0, tiles = {"default_brick.png"}, is_ground_content = false, groups = {cracky = 3}, diff --git a/minetestforfun_game/mods/default/textures/default_diamond_block.png b/minetestforfun_game/mods/default/textures/default_diamond_block.png old mode 100755 new mode 100644 index 7437f4df..75863646 Binary files a/minetestforfun_game/mods/default/textures/default_diamond_block.png and b/minetestforfun_game/mods/default/textures/default_diamond_block.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_acacia_wood.png b/minetestforfun_game/mods/default/textures/default_fence_acacia_wood.png index 3b973f34..d689a30b 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_acacia_wood.png and b/minetestforfun_game/mods/default/textures/default_fence_acacia_wood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_aspen_wood.png b/minetestforfun_game/mods/default/textures/default_fence_aspen_wood.png index 7fb624dc..812fc2ec 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_aspen_wood.png and b/minetestforfun_game/mods/default/textures/default_fence_aspen_wood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_brick.png b/minetestforfun_game/mods/default/textures/default_fence_brick.png index 41c72d08..f1deb371 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_brick.png and b/minetestforfun_game/mods/default/textures/default_fence_brick.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_cobble.png b/minetestforfun_game/mods/default/textures/default_fence_cobble.png index db276455..f57a2d67 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_cobble.png and b/minetestforfun_game/mods/default/textures/default_fence_cobble.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_desert_cobble.png b/minetestforfun_game/mods/default/textures/default_fence_desert_cobble.png index 7a1206eb..ed9b6876 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_desert_cobble.png and b/minetestforfun_game/mods/default/textures/default_fence_desert_cobble.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_junglewood.png b/minetestforfun_game/mods/default/textures/default_fence_junglewood.png index c390941c..4dc7a0d9 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_junglewood.png and b/minetestforfun_game/mods/default/textures/default_fence_junglewood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_pine_wood.png b/minetestforfun_game/mods/default/textures/default_fence_pine_wood.png index 74609d99..2abbb1d8 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_pine_wood.png and b/minetestforfun_game/mods/default/textures/default_fence_pine_wood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_steelblock.png b/minetestforfun_game/mods/default/textures/default_fence_steelblock.png index 6fb845f4..5706f12a 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_steelblock.png and b/minetestforfun_game/mods/default/textures/default_fence_steelblock.png differ diff --git a/minetestforfun_game/mods/default/textures/default_fence_wood.png b/minetestforfun_game/mods/default/textures/default_fence_wood.png index 1e76430d..af736826 100644 Binary files a/minetestforfun_game/mods/default/textures/default_fence_wood.png and b/minetestforfun_game/mods/default/textures/default_fence_wood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_flint.png b/minetestforfun_game/mods/default/textures/default_flint.png index 3211db15..19ba3e5c 100644 Binary files a/minetestforfun_game/mods/default/textures/default_flint.png and b/minetestforfun_game/mods/default/textures/default_flint.png differ diff --git a/minetestforfun_game/mods/default/textures/default_gold_block.png b/minetestforfun_game/mods/default/textures/default_gold_block.png old mode 100755 new mode 100644 index e262c506..cde790d6 Binary files a/minetestforfun_game/mods/default/textures/default_gold_block.png and b/minetestforfun_game/mods/default/textures/default_gold_block.png differ diff --git a/minetestforfun_game/mods/default/textures/default_grass.png b/minetestforfun_game/mods/default/textures/default_grass.png index be36f9d3..acbdcc25 100644 Binary files a/minetestforfun_game/mods/default/textures/default_grass.png and b/minetestforfun_game/mods/default/textures/default_grass.png differ diff --git a/minetestforfun_game/mods/default/textures/default_gravel.png b/minetestforfun_game/mods/default/textures/default_gravel.png old mode 100755 new mode 100644 index 752c47ca..217c68d2 Binary files a/minetestforfun_game/mods/default/textures/default_gravel.png and b/minetestforfun_game/mods/default/textures/default_gravel.png differ diff --git a/minetestforfun_game/mods/default/textures/default_jungletree.png b/minetestforfun_game/mods/default/textures/default_jungletree.png old mode 100755 new mode 100644 index bf0403e9..712e48a4 Binary files a/minetestforfun_game/mods/default/textures/default_jungletree.png and b/minetestforfun_game/mods/default/textures/default_jungletree.png differ diff --git a/minetestforfun_game/mods/default/textures/default_jungletree_top.png b/minetestforfun_game/mods/default/textures/default_jungletree_top.png old mode 100755 new mode 100644 index e3a3ccc5..204e5972 Binary files a/minetestforfun_game/mods/default/textures/default_jungletree_top.png and b/minetestforfun_game/mods/default/textures/default_jungletree_top.png differ diff --git a/minetestforfun_game/mods/default/textures/default_ladder_steel.png b/minetestforfun_game/mods/default/textures/default_ladder_steel.png index 1cc6dfde..9fa21b18 100644 Binary files a/minetestforfun_game/mods/default/textures/default_ladder_steel.png and b/minetestforfun_game/mods/default/textures/default_ladder_steel.png differ diff --git a/minetestforfun_game/mods/default/textures/default_lava.png b/minetestforfun_game/mods/default/textures/default_lava.png old mode 100755 new mode 100644 index b0d429eb..9fd26e3f Binary files a/minetestforfun_game/mods/default/textures/default_lava.png and b/minetestforfun_game/mods/default/textures/default_lava.png differ diff --git a/minetestforfun_game/mods/default/textures/default_pine_tree_top.png b/minetestforfun_game/mods/default/textures/default_pine_tree_top.png index 394cc326..2ed696af 100644 Binary files a/minetestforfun_game/mods/default/textures/default_pine_tree_top.png and b/minetestforfun_game/mods/default/textures/default_pine_tree_top.png differ diff --git a/minetestforfun_game/mods/default/textures/default_rail_crossing.png b/minetestforfun_game/mods/default/textures/default_rail_crossing.png old mode 100755 new mode 100644 index adb56560..054a6d38 Binary files a/minetestforfun_game/mods/default/textures/default_rail_crossing.png and b/minetestforfun_game/mods/default/textures/default_rail_crossing.png differ diff --git a/minetestforfun_game/mods/default/textures/default_sand_normal.png b/minetestforfun_game/mods/default/textures/default_sand_normal.png index 18145b46..6ad41d0a 100644 Binary files a/minetestforfun_game/mods/default/textures/default_sand_normal.png and b/minetestforfun_game/mods/default/textures/default_sand_normal.png differ diff --git a/minetestforfun_game/mods/default/textures/default_sandstone_brick.png b/minetestforfun_game/mods/default/textures/default_sandstone_brick.png old mode 100755 new mode 100644 index 82a1e6e8..011feac3 Binary files a/minetestforfun_game/mods/default/textures/default_sandstone_brick.png and b/minetestforfun_game/mods/default/textures/default_sandstone_brick.png differ diff --git a/minetestforfun_game/mods/default/textures/default_sign_steel.png b/minetestforfun_game/mods/default/textures/default_sign_steel.png index 5705c787..f4450f06 100644 Binary files a/minetestforfun_game/mods/default/textures/default_sign_steel.png and b/minetestforfun_game/mods/default/textures/default_sign_steel.png differ diff --git a/minetestforfun_game/mods/default/textures/default_sign_wall_steel.png b/minetestforfun_game/mods/default/textures/default_sign_wall_steel.png index d8d4a5b0..344d8dba 100644 Binary files a/minetestforfun_game/mods/default/textures/default_sign_wall_steel.png and b/minetestforfun_game/mods/default/textures/default_sign_wall_steel.png differ diff --git a/minetestforfun_game/mods/default/textures/default_sign_wall_wood.png b/minetestforfun_game/mods/default/textures/default_sign_wall_wood.png index f25a67a8..4adcbbcb 100644 Binary files a/minetestforfun_game/mods/default/textures/default_sign_wall_wood.png and b/minetestforfun_game/mods/default/textures/default_sign_wall_wood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_sign_wood.png b/minetestforfun_game/mods/default/textures/default_sign_wood.png index a25a4c34..5f892a57 100644 Binary files a/minetestforfun_game/mods/default/textures/default_sign_wood.png and b/minetestforfun_game/mods/default/textures/default_sign_wood.png differ diff --git a/minetestforfun_game/mods/default/textures/default_steel_block.png b/minetestforfun_game/mods/default/textures/default_steel_block.png old mode 100755 new mode 100644 index 0401069a..5d2c5676 Binary files a/minetestforfun_game/mods/default/textures/default_steel_block.png and b/minetestforfun_game/mods/default/textures/default_steel_block.png differ diff --git a/minetestforfun_game/mods/default/textures/default_tree.png b/minetestforfun_game/mods/default/textures/default_tree.png old mode 100755 new mode 100644 index 5fa4b65d..3f7ee15a Binary files a/minetestforfun_game/mods/default/textures/default_tree.png and b/minetestforfun_game/mods/default/textures/default_tree.png differ diff --git a/minetestforfun_game/mods/default/textures/default_tree_top.png b/minetestforfun_game/mods/default/textures/default_tree_top.png old mode 100755 new mode 100644 index e672d136..96b572ff Binary files a/minetestforfun_game/mods/default/textures/default_tree_top.png and b/minetestforfun_game/mods/default/textures/default_tree_top.png differ diff --git a/minetestforfun_game/mods/default/textures/gui_formbg.png b/minetestforfun_game/mods/default/textures/gui_formbg.png old mode 100755 new mode 100644 index d38040e3..45017413 Binary files a/minetestforfun_game/mods/default/textures/gui_formbg.png and b/minetestforfun_game/mods/default/textures/gui_formbg.png differ diff --git a/minetestforfun_game/mods/default/textures/gui_hotbar.png b/minetestforfun_game/mods/default/textures/gui_hotbar.png old mode 100755 new mode 100644 index a80ab468..f36fa17d Binary files a/minetestforfun_game/mods/default/textures/gui_hotbar.png and b/minetestforfun_game/mods/default/textures/gui_hotbar.png differ diff --git a/minetestforfun_game/mods/default/textures/xfences_space.png b/minetestforfun_game/mods/default/textures/xfences_space.png old mode 100755 new mode 100644 index 016cb352..34b25c43 Binary files a/minetestforfun_game/mods/default/textures/xfences_space.png and b/minetestforfun_game/mods/default/textures/xfences_space.png differ diff --git a/mods/_misc/carbone_init.lua b/mods/_misc/carbone_init.lua new file mode 100644 index 00000000..0b7a052c --- /dev/null +++ b/mods/_misc/carbone_init.lua @@ -0,0 +1,85 @@ +-- Code below by Casimir. + +minetest.after(1, function() + local i = 0 + local number = 0 + for name, item in pairs(minetest.registered_items) do + if (name and name ~= "") then + number = number + 1 + end + i = i + 1 + end + minetest.log("action", "There are " .. number .. " registered nodes, items and tools.") +end) + +minetest.register_on_joinplayer(function(player) + minetest.sound_play("player_join", {gain = 0.75}) + player:set_physics_override({ + sneak_glitch = false, -- Climable blocks are quite fast in Carbone. + }) +end) + +minetest.register_on_leaveplayer(function(player) + minetest.sound_play("player_leave", {gain = 1}) +end) + +minetest.register_on_respawnplayer(function(player) + player:set_eye_offset({x = 0, y = 0, z = 0}, {x = 0, y = 0, z = 0}) + local pos = player:getpos() + -- minetest.sound_play("player_join", {pos = pos, gain = 0.5}) +end) + +minetest.register_on_item_eat(function(hp_change, replace_with_item, itemstack, user, pointed_thing) + if user:get_hp() >= 20 then return end + local pos = user:getpos() + minetest.sound_play("health_gain", {pos = pos, gain = 0.4}) +end) + +minetest.log("action", "") -- Empty line. +minetest.log("action", "") -- Empty line. + +if minetest.setting_getbool("creative_mode") then + minetest.log("action", "Creative mode is enabled.") + else + minetest.log("action", "Creative mode is disabled.") +end + +if minetest.setting_getbool("enable_damage") then + minetest.log("action", "Damage is enabled.") + else + minetest.log("action", "Damage is disabled.") +end + +if minetest.setting_getbool("enable_pvp") then + minetest.log("action", "PvP is enabled.") + else + minetest.log("action", "PvP is disabled.") +end + +if not minetest.is_singleplayer() and minetest.setting_getbool("server_announce") then + minetest.log("action", "") -- Empty line. + minetest.log("action", "Server name: " .. minetest.setting_get("server_name") or "(none)") + minetest.log("action", "Server description: " .. minetest.setting_get("server_description") or "(none)") + minetest.log("action", "Server URL: " .. minetest.setting_get("server_address") or "(none)") + minetest.log("action", "MOTD: " .. minetest.setting_get("motd") or "(none)") + minetest.log("action", "Maximum users: " .. minetest.setting_get("max_users") or 15) +end + +minetest.log("action", "") -- Empty line. +minetest.log("action", "") -- Empty line. + +-- Reserved slot handling: + +minetest.register_on_prejoinplayer(function(name, ip) + local admin_slots = minetest.setting_get('admin_slots') or 2 + if #minetest.get_connected_players() >= (minetest.setting_get('max_users') - admin_slots) + and not minetest.check_player_privs(name, {server = true}) then + return "Sorry, " .. admin_slots .. " slots are reserved for administrators." + end +end) + + +if minetest.setting_getbool("log_mods") then + -- Highlight the default mod in the mod loading logs: + minetest.log("action", "Carbone: * [default] loaded.") +end diff --git a/minetestforfun_game/mods/default/commands.lua b/mods/_misc/commands.lua similarity index 99% rename from minetestforfun_game/mods/default/commands.lua rename to mods/_misc/commands.lua index af0ee256..65c88f3c 100755 --- a/minetestforfun_game/mods/default/commands.lua +++ b/mods/_misc/commands.lua @@ -2,7 +2,7 @@ minetest.register_privilege("physics", { description = "Allows player to set their gravity, jump height and movement speed"}) -- Infotool code by PilzAdam: -minetest.register_craftitem("default:infotool", { +minetest.register_craftitem(":default:infotool", { description = "Infotool", inventory_image = "default_infotool.png", wield_image = "default_infotool.png^[transformR90", diff --git a/mods/_misc/forbid_underwater_torch.lua b/mods/_misc/forbid_underwater_torch.lua new file mode 100644 index 00000000..a0b0af52 --- /dev/null +++ b/mods/_misc/forbid_underwater_torch.lua @@ -0,0 +1,8 @@ +minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing) + if newnode.name ~= "default:torch" or minetest.get_item_group(oldnode.name, "water") == 0 then + return + end + minetest.remove_node(pos, newnode) + minetest.set_node(pos, oldnode) + minetest.add_item(pos, "default:torch") +end) diff --git a/mods/_misc/init.lua b/mods/_misc/init.lua index b7630ea0..989aff9f 100755 --- a/mods/_misc/init.lua +++ b/mods/_misc/init.lua @@ -4,6 +4,11 @@ local cwd = minetest.get_modpath("_misc") +-- Code extracted from edits done in the default mod +dofile(cwd.."/carbone_init.lua") +dofile(cwd.."/commands.lua") +dofile(cwd.."/forbid_underwater_torch.lua") + -- Give initial stuff dofile(cwd.."/give_initial_stuff.lua") diff --git a/minetestforfun_game/mods/default/sounds/player_join.ogg b/mods/_misc/sounds/player_join.ogg similarity index 100% rename from minetestforfun_game/mods/default/sounds/player_join.ogg rename to mods/_misc/sounds/player_join.ogg diff --git a/minetestforfun_game/mods/default/sounds/player_leave.ogg b/mods/_misc/sounds/player_leave.ogg similarity index 100% rename from minetestforfun_game/mods/default/sounds/player_leave.ogg rename to mods/_misc/sounds/player_leave.ogg diff --git a/minetestforfun_game/mods/default/textures/default_infotool.png b/mods/_misc/textures/default_infotool.png similarity index 100% rename from minetestforfun_game/mods/default/textures/default_infotool.png rename to mods/_misc/textures/default_infotool.png